/* Data Privacy Guide: shared look and motion for the Tailwind pages.
   Tailwind's CDN injects its utilities after this file, so rules that must win over a utility use a
   more specific selector (usually a `body` prefix) rather than relying on source order. */

:root {
  /* Colours and fonts follow the original (v2) design: Tailwind's default palette and system font.
     Page colours come from each page's own classes (hero gradients, buttons); these tokens only
     cover what this file draws itself. */
  --brand-600: #2563EB; /* Tailwind blue-600: links, buttons, focus ring */
  --brand-700: #1D4ED8; /* blue-700 */
  --accent-400: #818CF8; /* indigo-400 */
  --ink: #1F2937;       /* gray-800, the body text colour */
  --font-heading: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-body: var(--font-heading);
  /* Motion tokens. Enters use --ease-out (spring-like, no overshoot); state changes use --ease-in-out.
     Hovers ease in at --dur-hover and leave faster at --dur-exit, so the exit is the subtler half. */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --dur-press: 120ms;
  --dur-exit: 160ms;
  --dur-fast: 180ms;
  --dur-hover: 220ms;
  --dur-base: 260ms;
  --dur-enter: 450ms;
  --nav-h: 64px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }
body.font-sans { font-family: var(--font-body); color: var(--ink); -webkit-font-smoothing: antialiased; }
body h1, body h2, body h3 { font-family: var(--font-heading); }

/* Keyboard focus: a clear 3px ring on everything interactive. */
body a:focus-visible, body button:focus-visible, body input:focus-visible,
body textarea:focus-visible, body select:focus-visible, body summary:focus-visible {
  outline: 3px solid var(--brand-600);
  outline-offset: 3px;
  border-radius: 6px;
}
body a, body button { cursor: pointer; }

.skip-link {
  position: fixed; top: 10px; left: 12px; z-index: 100;
  padding: 10px 16px; border-radius: 8px;
  background: var(--brand-700); color: #fff; font-weight: 700;
  transform: translateY(-160%);
}
/* Keyboard-initiated, so it appears instantly. */
.skip-link:focus { transform: none; }

/* ------------------------------------------------------------------ nav */
body > nav.fixed {
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(15, 23, 42, .06);
  box-shadow: none;
  transition: box-shadow var(--dur-base) var(--ease-out), background-color var(--dur-base);
  z-index: 50;
}
body > nav.fixed.is-scrolled { background: rgba(255, 255, 255, .95); box-shadow: 0 6px 24px -12px rgba(15, 23, 42, .25); }

/* Brand: globe logo (images/logo-globe.png) before the wordmark. */
body > nav a.text-2xl {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700;
}
body > nav a.text-2xl::before {
  content: ""; width: 1.9rem; height: 1.9rem; flex: none;
  background: url("../images/logo-globe.png") center / contain no-repeat;
}

/* Desktop links: sliding underline, and the current page marked. */
body > nav a.text-2xl, body > nav .md\:flex > a { white-space: nowrap; }
/* Tight, even spacing so the longest nav (seven links on About/Contact) fits from 1280px. */
body > nav .md\:flex > a {
  position: relative; font-weight: 600; font-size: .95rem;
  padding-left: .6rem; padding-right: .6rem; margin-left: 0 !important;
  transition: color var(--dur-fast);
}
/* site.js adds .nav-compact when the link row doesn't fit beside the brand; the menu button takes over. */
@media (min-width: 768px) {
  body > nav.nav-compact .hidden.md\:flex { display: none !important; }
  body > nav.nav-compact .flex.items-center.md\:hidden { display: flex !important; }
  body > nav.nav-compact #mobileMenu:not(.hidden) { display: block !important; }
}
body > nav .md\:flex > a::after {
  content: ""; position: absolute; left: .6rem; right: .6rem; bottom: .2rem; height: 2px;
  background: var(--brand-600); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform var(--dur-exit) var(--ease-out);
}
body > nav .md\:flex > a:hover::after, body > nav .md\:flex > a[aria-current="page"]::after {
  transform: scaleX(1); transition-duration: var(--dur-hover);
}
body > nav a[aria-current="page"] { color: var(--brand-600); }
/* Consultation keeps v2's look: an ordinary nav link with its green "Free" tag. */

/* Mobile menu: a short enter from the top edge, where the button is; closing is instant (exits stay subtler). */
body > nav #mobileMenu:not(.hidden) { transform-origin: top center; animation: menu-in 200ms var(--ease-out) both; }
@keyframes menu-in {
  from { opacity: 0; transform: translate3d(0, -6px, 0); filter: blur(2px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* ----------------------------------------------------------------- hero */
/* The colour is each page's own gradient (blue-indigo, green-teal, purple-pink, or .gradient-bg). */
body > nav + section.text-white {
  position: relative; isolation: isolate; overflow: hidden;
}
body > nav + section.text-white::before { /* fine dot grid, faded toward the bottom */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 95%);
  mask-image: linear-gradient(to bottom, #000 20%, transparent 95%);
}
body > nav + section.text-white::after { /* soft light from the top right; static, no looping motion */
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 70vmax; height: 70vmax; right: -25vmax; top: -30vmax; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 62%);
}
body > nav + section.text-white h1 { text-wrap: balance; }
body > nav + section.text-white p:not([class*="text-gray"]) { color: rgba(255, 255, 255, .86); }

/* Hero entrance, once per page load: opacity + 8px rise + blur, so the text comes into focus.
   `both` holds the first frame during each delay, so nothing flashes before it animates. */
body > nav + section.text-white .text-center > *,
body > nav + section.text-white > .text-center > * {
  animation: rise var(--dur-enter) var(--ease-out) both;
}
body > nav + section.text-white .text-center > :nth-child(2) { animation-delay: 80ms; }
body > nav + section.text-white .text-center > :nth-child(3) { animation-delay: 160ms; }
body > nav + section.text-white .text-center > :nth-child(n+4) { animation-delay: 240ms; }
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 8px, 0); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* Home page tiles inside the hero read as glass panels. */
body #home .nav-card {
  background: rgba(255, 255, 255, .97); border: 1px solid rgba(255, 255, 255, .6);
}

/* ------------------------------------------------------ section headings */
body section h2.text-3xl.text-center::after {
  content: ""; display: block; width: 56px; height: 3px; margin: .9rem auto 0;
  border-radius: 3px; background: linear-gradient(90deg, var(--brand-600), var(--accent-400));
}

/* ----------------------------------------------------------------- tiles */
/* Layered shadows instead of solid borders: a 1px ring plus soft depth, which adapts to the white,
   white, grey and coloured backgrounds the tiles sit on. The border stays 1px wide but transparent: no layout shift. */
body [class*="-card"],
body section .grid > .rounded-lg.border,
body section .grid > .rounded-lg.shadow-md {
  position: relative; border-radius: 14px; border-color: transparent !important;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .07), 0 1px 2px -1px rgba(15, 23, 42, .08), 0 4px 12px -6px rgba(15, 23, 42, .12);
  transition: transform var(--dur-exit) var(--ease-out), box-shadow var(--dur-exit) var(--ease-out);
}
/* Hover: a 2px lift and a deeper shadow. Eases in, leaves faster. */
@media (hover: hover) {
  body [class*="-card"]:hover,
  body section .grid > .rounded-lg.border:hover,
  body section .grid > .rounded-lg.shadow-md:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, .14), 0 2px 4px -2px rgba(15, 23, 42, .1), 0 14px 28px -14px rgba(37, 99, 235, .35);
    transition-duration: 240ms;
  }
}
/* Home tiles are links: press feedback. */
body a[class*="-card"]:active { transform: scale(.985); transition-duration: var(--dur-press); }

/* Text links such as "Learn More →". */
body section a.hover\:underline { font-weight: 600; transition: color var(--dur-fast); }

/* --------------------------------------------------------------- buttons */
/* Buttons: colour and a 1px lift on hover, a quick scale on press for tactile feedback. */
body a.bg-blue-600, body button.bg-blue-600, body a.bg-green-600 {
  transition: background-color var(--dur-exit) var(--ease-in-out), transform var(--dur-exit) var(--ease-out), box-shadow var(--dur-exit) var(--ease-out);
}
body a.bg-blue-600:hover, body button.bg-blue-600:hover, body a.bg-green-600:hover {
  transform: translateY(-1px); box-shadow: 0 10px 20px -12px rgba(37, 99, 235, .8); transition-duration: var(--dur-fast);
}
body a.bg-blue-600:active, body button.bg-blue-600:active, body a.bg-green-600:active {
  transform: scale(.97); transition-duration: var(--dur-press);
}
/* The main call to action on a page keeps its own colours (as in v2) and gets the shared motion. */
body .btn-cta {
  transition: background-color var(--dur-exit) var(--ease-in-out), transform var(--dur-exit) var(--ease-out), box-shadow var(--dur-exit) var(--ease-out);
}
body .btn-cta:hover { transform: translateY(-1px); transition-duration: var(--dur-fast); }
body .btn-cta:active { transform: scale(.97); transition-duration: var(--dur-press); }

/* About page photo: the page's own 5% zoom on hover is toned down to 2%. */
body .profile-image { transition: transform var(--dur-base) var(--ease-out); }
body .profile-image:hover { transform: scale(1.02); }

/* Scope evaluators: quiet hover transitions on options and buttons, press feedback, and an
   in-out curve for the flowchart's state changes (it previously used the default ease). */
body .tool .opt, body .tool .btn, body .tool .chipbtn {
  transition: border-color var(--dur-exit) var(--ease-in-out), background-color var(--dur-exit) var(--ease-in-out),
              color var(--dur-exit) var(--ease-in-out), transform var(--dur-exit) var(--ease-out);
}
body .tool .opt:hover, body .tool .btn:hover, body .tool .chipbtn:hover { transition-duration: var(--dur-fast); }
body .tool .opt:active, body .tool .btn:active, body .tool .chipbtn:active { transform: scale(.98); transition-duration: var(--dur-press); }
body .tool .node rect, body .tool .edge path { transition-timing-function: var(--ease-in-out); }

/* The purple .gradient-bg / .gradient-text on About, Consultation and Contact are defined in those
   pages' own <style> blocks, as in v2. */
body .form-input:focus { border-color: var(--brand-600); box-shadow: 0 0 0 3px rgba(37, 99, 235, .18); }

/* The footer is the pages' own bg-gray-800 with white text, as in v2. */

/* ---------------------------------------------------------- scroll reveal
   site.js adds .reveal only when motion is allowed, so without JavaScript nothing is hidden. */
/* !important: tile rules are more specific and would otherwise replace this transition. */
/* Same enter recipe as the hero, once per element: opacity + 10px rise + blur, 60ms stagger. */
body .reveal {
  opacity: 0; transform: translate3d(0, 10px, 0) !important; filter: blur(4px);
  transition: opacity var(--dur-enter) var(--ease-out), transform var(--dur-enter) var(--ease-out),
              filter var(--dur-enter) var(--ease-out) !important;
  transition-delay: var(--reveal-delay, 0ms) !important;
}
body .reveal.is-visible { opacity: 1; transform: none !important; filter: none; }
/* site.js removes both classes when the fade ends, handing tiles back to their hover transitions. */

/* Reduced motion: every animation and transition resolves instantly to its final state, and nothing
   moves on hover or press. Colour and shadow changes still show, without motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important;
    transition-duration: .01ms !important; transition-delay: 0ms !important;
  }
  body .reveal { opacity: 1; transform: none !important; filter: none; }
  body [class*="-card"]:hover, body section .grid > .rounded-lg.border:hover, body section .grid > .rounded-lg.shadow-md:hover,
  body a[class*="-card"]:active, body .btn-cta:hover, body .btn-cta:active,
  body a.bg-blue-600:hover, body button.bg-blue-600:hover, body a.bg-green-600:hover,
  body a.bg-blue-600:active, body button.bg-blue-600:active, body a.bg-green-600:active,
  body > nav .md\:flex > a[href="consultation.html"]:hover, body > nav .md\:flex > a[href="consultation.html"]:active,
  body .profile-image:hover, body .tool .opt:active, body .tool .btn:active, body .tool .chipbtn:active { transform: none !important; }
}
