/* ==========================================================================
   MtswGenix — shared stylesheet
   Change the brand colors in the :root blocks below; everything else follows.
   ========================================================================== */

/* ---------- 1. Theme tokens ----------
   Palette: white + graphite, with the teal from the logo as the accent.
   The logo keeps its own navy (--brand) in light mode. */
:root {
  --brand-navy: #262866;   /* logo only */
  --brand-teal: #1FB6A5;

  /* Light theme (default) — tuned for clear contrast */
  --bg: #EEF2F3;             /* page: light grey so white cards stand out */
  --surface: #FFFFFF;        /* cards */
  --surface-2: #E4EAEC;
  --band: #E2E9EB;           /* alternating sections */
  --text: #0F1316;
  --muted: #3F484D;
  --border: #C9D1D4;
  --brand: #262866;          /* logo "Gen" / "MTSW" color */
  --accent: #14A595;         /* buttons, rules, icons */
  --accent-text: #06695E;    /* teal used as text */
  --accent-soft: rgba(20, 165, 149, 0.16);
  --on-accent: #0E1513;      /* text on teal fills */
  --graphite: #1E2427;       /* folder, initials avatar */
  --danger: #B42318;
  --danger-soft: #FCE4E1;
  --success: #06695E;
  --success-soft: #DDF3EF;
  --shadow: 0 1px 2px rgba(16, 20, 22, 0.08), 0 10px 28px rgba(16, 20, 22, 0.10);
  --header-bg: #FFFFFF;

  /* Dark blocks (CTA band, footer) */
  --deep: #14181B;
  --deep-2: #101315;

  /* Type & layout */
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --container: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --section: clamp(4rem, 9vw, 7rem);
  --header-h: 72px;

  color-scheme: light;
}

/* Dark theme (when the visitor picks it with the toggle) */
:root[data-theme="dark"] {
  --bg: #0F1214;
  --surface: #171B1E;
  --surface-2: #1F2427;
  --band: #131719;
  --text: #ECEFEF;
  --muted: #A2ABAE;
  --border: #2A3135;
  --brand: #ECEFEF;
  --accent: #2CC9B6;
  --accent-text: #55DCCB;
  --accent-soft: rgba(44, 201, 182, 0.14);
  --on-accent: #0E1513;
  --graphite: #3A444A;
  --danger: #FF8A80;
  --danger-soft: rgba(255, 138, 128, 0.12);
  --success: #55DCCB;
  --success-soft: rgba(85, 220, 203, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  --header-bg: rgba(15, 18, 20, 0.88);
  --deep: #0B0D0F;
  --deep-2: #090B0C;
  color-scheme: dark;
}

/* Dark blocks (CTA band, footer — and the hero in dark mode) */
.on-dark {
  --surface: #1A1F22;
  --surface-2: #22282B;
  --text: #EEF1F1;
  --muted: #AEB6B8;
  --border: #2D3437;
  --brand: #FFFFFF;
  --accent: #2CC9B6;
  --accent-text: #5CE0CF;
  --accent-soft: rgba(44, 201, 182, 0.16);
  --on-accent: #0E1513;
  background: var(--deep);
  color: var(--text);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.6em; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: clamp(2.25rem, 5.4vw, 3.75rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
strong { font-weight: 700; }
::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 200;
  background: var(--accent); color: var(--on-accent); padding: 0.75rem 1rem;
  border-radius: var(--radius-sm); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; }

/* ---------- 3. Buttons, chips, links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  min-height: 48px; padding: 0.7rem 1.35rem;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2;
  border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.btn-ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); }
.btn-sm { min-height: 40px; padding: 0.45rem 1rem; font-size: 0.95rem; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.text-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 700; color: var(--accent-text); text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; }
.chip {
  display: inline-block; padding: .35rem .8rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--text);
  font-size: .9rem; font-weight: 600;
}

.icon { width: 24px; height: 24px; flex: none; }
.icon-box {
  display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent-text);
}

/* ---------- 4. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; text-decoration: none; flex: none; }
.logo { height: 46px; width: auto; overflow: visible; }
.logo text { font-family: var(--font); }
.logo-mtsw { fill: var(--brand); font-size: 11px; font-weight: 700; }
.logo-gen { fill: var(--brand); font-size: 29px; font-weight: 800; letter-spacing: -0.5px; }
.logo-ix, .logo-line { fill: var(--accent); }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: .25rem; list-style: none; }
.site-nav ul a {
  display: block; padding: .5rem .8rem; border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .98rem;
}
.site-nav ul a:hover { background: var(--surface-2); }
.site-nav ul a[aria-current="page"] { color: var(--accent-text); }
.site-nav .nav-cta-mobile { display: none; }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.nav-toggle { display: none; }

/* Theme toggle icon: show the icon of the theme you'd switch TO */
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

@media (max-width: 960px) {
  .nav-toggle { display: grid; }
  .header-actions { margin-left: auto; }
  .header-cta { display: none; }
  .site-nav { margin-left: auto; }
  .js .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 1rem var(--gutter) 1.5rem;
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
    display: none;
  }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; gap: 0; }
  .js .site-nav ul a { padding: .9rem .25rem; border-bottom: 1px solid var(--border); border-radius: 0; font-size: 1.05rem; }
  .js .site-nav ul a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); padding-left: .9rem; }
  .js .site-nav .nav-cta-mobile { display: flex; margin-top: 1.25rem; width: 100%; }
  html:not(.js) .site-nav ul { flex-wrap: wrap; }
  html:not(.js) .header-inner { height: auto; flex-wrap: wrap; padding-block: .75rem; }
}

/* ---------- 5. Sections & headings ---------- */
.section { padding-block: var(--section); }
.section-alt { background: var(--band, var(--surface-2)); }
.section + .section-alt, .section-alt + .section { /* keep consistent spacing */ }

/* Signature device: the teal rule from the logo sits above section headings */
.rule-head { max-width: 720px; margin-bottom: clamp(2rem, 4vw, 3rem); }
.rule-head::before {
  content: ""; display: block; width: 56px; height: 4px; border-radius: 2px;
  background: var(--accent); margin-bottom: 1.25rem;
}
.rule-head p { color: var(--muted); font-size: 1.125rem; margin: 0; }
.rule-head.center { margin-inline: auto; text-align: center; }
.rule-head.center::before { margin-inline: auto; }

.lead { font-size: clamp(1.1rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }

/* ---------- 6. Home hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(4rem, 9vw, 7rem); }
.hero-inner { position: relative; z-index: 1; display: grid; gap: clamp(2.5rem, 5vw, 4rem); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 980px) { .hero-inner { grid-template-columns: 1.05fr 1fr; } }
.hero-tagline { display: flex; flex-direction: column; gap: .9rem; color: var(--accent-text); font-weight: 600; font-size: .98rem; margin-bottom: 1.5rem; }
.hero-tagline::before { content: ""; width: 72px; height: 4px; border-radius: 2px; background: var(--accent); }
.hero h1 { max-width: 17ch; margin-bottom: .45em; }
.hero .lead { margin-bottom: 2rem; }

/* Hero visual: a messy spreadsheet settles into an organised dashboard */
.hero-visual { position: relative; min-height: 420px; max-width: 560px; width: 100%; justify-self: center; }
.sheet, .dash { position: absolute; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.sheet { top: 0; left: 0; width: 78%; background: #F4F5F9; color: #3B4065; box-shadow: 0 20px 40px rgba(0,0,0,.35); }
.win-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; font-size: .75rem; font-weight: 600; }
.win-bar i { width: 9px; height: 9px; border-radius: 50%; background: #C9CCDD; }
.win-bar b { margin-left: 8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet .win-bar { background: #E3E5EF; }
.sheet-grid { display: grid; grid-template-columns: repeat(5, 1fr); }
.sheet-grid span { height: 26px; border-right: 1px solid #DDE0EA; border-bottom: 1px solid #DDE0EA; position: relative; }
.sheet-grid span::after { content: ""; position: absolute; left: 8px; top: 11px; height: 4px; border-radius: 2px; background: #B9BDD2; width: var(--w, 55%); }
.sheet-grid span.hl { background: #FFF3C4; }
.sheet-grid span.err { background: #FDE2E0; }
.sheet-grid span.err::after { background: #E2726A; }
.sheet-grid span.blank::after { display: none; }

.dash { right: 0; bottom: 0; width: 70%; background: var(--surface); color: var(--text); box-shadow: 0 24px 48px rgba(0,0,0,.45); }
.dash .win-bar { background: var(--surface-2); color: var(--muted); }
.dash .win-bar i:first-child { background: var(--accent); }
.dash-body { padding: 14px; display: grid; gap: 12px; }
.dash-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dash-tile { background: var(--surface-2); border-radius: 10px; padding: 10px; font-size: .72rem; color: var(--muted); font-weight: 600; }
.dash-tile s { display: block; text-decoration: none; height: 8px; border-radius: 4px; margin-top: 8px; background: var(--accent); width: var(--w, 70%); }
.dash-chart { display: flex; align-items: flex-end; gap: 8px; height: 92px; padding: 10px; background: var(--surface-2); border-radius: 10px; }
.dash-chart i { flex: 1; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--accent) 70%, transparent); height: var(--h, 50%); }
.dash-chart i:nth-child(odd) { background: var(--accent); }
.dash-rows { display: grid; gap: 6px; }
.dash-rows i { display: flex; justify-content: space-between; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); }
.dash-rows i::before { content: ""; width: 45%; height: 4px; border-radius: 2px; background: var(--border); }
.dash-rows i::after { content: ""; width: 34px; height: 10px; border-radius: 5px; background: var(--accent-soft); border: 1px solid var(--accent); }
.dash-rows i.done::after { background: var(--accent); }

/* One orchestrated load moment (skipped for reduced motion) */
@media (prefers-reduced-motion: no-preference) {
  .sheet-grid span.mess { animation: settle 1s cubic-bezier(.2,.8,.2,1) .35s both; }
  .sheet-grid span.mess:nth-child(3n) { --dx: 14px; --dy: -10px; --r: 6deg; }
  .sheet-grid span.mess:nth-child(3n+1) { --dx: -12px; --dy: 12px; --r: -5deg; }
  .sheet-grid span.mess:nth-child(3n+2) { --dx: 8px; --dy: 16px; --r: 4deg; }
  .sheet { animation: dim .6s ease 1.35s both; }
  .dash { animation: rise .8s cubic-bezier(.2,.8,.2,1) 1.25s both; }
  .dash-chart i { animation: grow .7s cubic-bezier(.2,.8,.2,1) 1.7s both; transform-origin: bottom; }
}
@keyframes settle { from { transform: translate(var(--dx,0), var(--dy,0)) rotate(var(--r,0)); } to { transform: none; } }
@keyframes dim { to { opacity: .55; filter: saturate(.6); } }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

@media (max-width: 520px) {
  .hero-visual { min-height: 400px; }
  .sheet { width: 92%; }
  .dash { width: 84%; }
}

/* ---------- 7. Page hero (inner pages) ---------- */
.page-hero { padding-block: clamp(3rem, 7vw, 5rem); }
.page-hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); max-width: 20ch; }
.page-hero .lead { margin: 0; }
.page-hero .rule-head { margin-bottom: 0; max-width: 780px; }
.anchor-nav { margin-top: 2rem; }
.anchor-nav a { text-decoration: none; }
.anchor-nav .chip { background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: .5rem .95rem; }
.anchor-nav a:hover .chip { border-color: var(--accent); }

/* ---------- 9. Cards (services etc.) ---------- */
.card-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .card-grid.four { grid-template-columns: repeat(4, 1fr); } }
.card {
  display: flex; flex-direction: column; gap: .9rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  transition: border-color .2s, transform .2s;
}
.card:hover { border-color: var(--accent); }
.card h3 { margin: .25rem 0 0; }
.card p { margin: 0; color: var(--muted); }
.card .text-link { margin-top: auto; padding-top: .5rem; }

/* ---------- 10. Featured project ---------- */
.feature { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (min-width: 900px) { .feature { grid-template-columns: 1fr 1.1fr; } }
.feature .chips { margin: 1.25rem 0 1.75rem; }

.shot {
  display: grid; place-items: center; text-align: center; margin: 0;
  aspect-ratio: 16 / 10; border-radius: var(--radius-lg);
  border: 2px dashed var(--border); background: var(--surface);
  color: var(--muted); font-weight: 600; padding: 1rem;
}
.shot small { display: block; font-weight: 500; font-size: .85rem; margin-top: .35rem; }
.shot img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.shot.has-img { border: 1px solid var(--border); padding: 0; }

/* ---------- 11. Audience strip ---------- */
.audience { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--border); }
@media (min-width: 640px) { .audience { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .audience { grid-template-columns: repeat(4, 1fr); } }
.audience li { list-style: none; padding: 1.75rem 1.5rem 1.75rem 0; border-bottom: 1px solid var(--border); }
@media (min-width: 1040px) {
  .audience li { border-bottom: 0; padding-right: 1.75rem; }
  .audience li + li { border-left: 1px solid var(--border); padding-left: 1.75rem; }
}
.audience .icon { color: var(--accent-text); width: 32px; height: 32px; margin-bottom: 1rem; }
.audience h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.audience p { margin: 0; color: var(--muted); font-size: 1rem; }

/* ---------- 12. Process (a real sequence, so it's numbered) ---------- */
.process { list-style: none; counter-reset: step; display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .process { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .process { grid-template-columns: repeat(6, 1fr); gap: 0; } }
.process li { counter-increment: step; position: relative; padding-right: 1rem; }
.process li::before {
  content: counter(step); display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); color: var(--text);
  font-weight: 800; margin-bottom: 1rem; position: relative; z-index: 1;
}
@media (min-width: 1040px) {
  .process li::after { content: ""; position: absolute; top: 21px; left: 44px; right: 0; height: 2px; background: var(--border); }
  .process li:last-child::after { display: none; }
}
.process h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.process p { margin: 0; color: var(--muted); font-size: .98rem; }

/* ---------- 13. CTA band ---------- */
.cta-band { padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.cta-inner { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .cta-inner { grid-template-columns: 1.4fr auto; } }
.cta-inner h2 { margin-bottom: .4em; }
.cta-inner p { color: var(--muted); margin: 0; max-width: 56ch; }

/* ---------- 14. Services page ---------- */
.service { display: grid; gap: clamp(2rem, 5vw, 4rem); padding-block: var(--section); border-top: 1px solid var(--border); }
.service:first-of-type { border-top: 0; }
@media (min-width: 960px) { .service { grid-template-columns: .9fr 1.1fr; } .service-intro { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; } }
.service-intro .icon-box { margin-bottom: 1.25rem; width: 56px; height: 56px; }
.service-intro h2 { margin-bottom: .5em; }
.service-problem { border-left: 4px solid var(--danger); padding: .25rem 0 .25rem 1.1rem; color: var(--muted); }
.service-problem strong { display: block; color: var(--text); margin-bottom: .25rem; }
.service-detail h3 { margin-top: 0; }
.service-detail > p { color: var(--muted); }
.feature-list { list-style: none; display: grid; gap: .75rem; margin: 1.25rem 0 2rem; }
@media (min-width: 640px) { .feature-list.two { grid-template-columns: repeat(2, 1fr); } }
.feature-list li { display: flex; gap: .75rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; }
.feature-list li .icon { color: var(--accent-text); width: 20px; height: 20px; margin-top: .2rem; }
.feature-list li span { display: block; }
.feature-list li small { display: block; color: var(--muted); font-size: .92rem; margin-top: .15rem; }

/* ---------- 15. Solutions page ---------- */
.industry { display: grid; gap: 2rem; padding-block: var(--section); border-top: 1px solid var(--border); }
.industry:first-of-type { border-top: 0; }
.industry-head { display: flex; gap: 1.25rem; align-items: flex-start; }
.industry-head .icon-box { width: 56px; height: 56px; flex: none; }
.industry-head p { color: var(--muted); margin: 0; max-width: 62ch; }
.compare { display: grid; gap: 1.25rem; }
@media (min-width: 800px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare > div { border-radius: var(--radius-lg); padding: 1.75rem; border: 1px solid var(--border); background: var(--surface); }
.compare h3 { font-size: 1.05rem; margin-bottom: 1rem; display: flex; gap: .6rem; align-items: center; }
.compare ul { list-style: none; display: grid; gap: .65rem; }
.compare li { display: flex; gap: .65rem; align-items: flex-start; }
.compare li .icon { width: 20px; height: 20px; margin-top: .2rem; }
.compare .before li .icon { color: var(--danger); }
.compare .after { border-color: var(--accent); }
.compare .after li .icon { color: var(--accent-text); }

/* ---------- 16. Projects page ---------- */
.case-index { list-style: none; display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .case-index { grid-template-columns: repeat(2, 1fr); } }
.case-index a, .case-index .placeholder-card { display: block; height: 100%; padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); }
.case-index a:hover { border-color: var(--accent); }
.case-index small { color: var(--accent-text); font-weight: 700; }
.case-index strong { display: block; font-size: 1.2rem; margin: .25rem 0; }
.case-index span { color: var(--muted); }
.placeholder-card { border-style: dashed !important; background: transparent !important; }

.case { padding-block: var(--section); border-top: 1px solid var(--border); }
.case-head { display: grid; gap: 2rem; margin-bottom: 2.5rem; }
@media (min-width: 900px) { .case-head { grid-template-columns: 1.4fr 1fr; align-items: end; } }
.case-type { color: var(--accent-text); font-weight: 700; margin-bottom: .5rem; }
.case-meta { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1.25rem; margin: 0; padding: 1.25rem 1.5rem; border-radius: var(--radius); background: var(--surface-2); }
.case-meta dt { color: var(--muted); font-weight: 600; }
.case-meta dd { margin: 0; font-weight: 600; }
.gallery { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
@media (min-width: 720px) { .gallery { grid-template-columns: 2fr 1fr; } .gallery .shot:first-child { grid-row: span 2; aspect-ratio: auto; min-height: 340px; } }
.case-body { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
@media (min-width: 960px) { .case-body { grid-template-columns: 1fr 2fr; } }
.case-body h3 { font-size: 1.4rem; }
.case-section + .case-section { margin-top: 2.5rem; }
.placeholder-note { padding: 1.25rem 1.5rem; border-radius: var(--radius); border: 2px dashed var(--border); color: var(--muted); font-weight: 600; }

/* ---------- 17. About page ---------- */
.split { display: grid; gap: clamp(2rem, 5vw, 4rem); }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; align-items: start; } }
.mission { font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 700; line-height: 1.4; letter-spacing: -0.01em; border-left: 4px solid var(--accent); padding-left: 1.25rem; margin: 0; }
.values { list-style: none; display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .values { grid-template-columns: repeat(2, 1fr); } }
.values li { padding-top: 1.25rem; border-top: 2px solid var(--accent); }
.values h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.values p { margin: 0; color: var(--muted); }
.tech-groups { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .tech-groups { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .tech-groups { grid-template-columns: repeat(4, 1fr); } }
.tech-group { padding: 1.5rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.tech-group h3 { font-size: 1rem; color: var(--muted); font-weight: 700; margin-bottom: 1rem; }
.tech-group.expanding { border-style: dashed; background: transparent; }
.tech-group.expanding .chip { background: transparent; border: 1px solid var(--border); }
.founder { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 720px) { .founder { grid-template-columns: 240px 1fr; } }
.founder-photo { aspect-ratio: 1; border-radius: var(--radius-lg); background: var(--surface-2); border: 2px dashed var(--border); display: grid; place-items: center; color: var(--muted); text-align: center; font-weight: 600; font-size: .9rem; overflow: hidden; }
.founder-photo svg { width: 72px; height: 72px; margin: 0 auto .5rem; opacity: .6; }
.founder-photo img { width: 100%; height: 100%; object-fit: cover; }
.founder h3 { font-size: 1.5rem; margin-bottom: .2rem; }

/* ---------- 18. Contact page & form ---------- */
.contact-layout { display: grid; gap: clamp(2rem, 5vw, 3.5rem); }
@media (min-width: 960px) { .contact-layout { grid-template-columns: 1.5fr 1fr; align-items: start; } }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: var(--shadow); }
.form-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.field label { display: block; font-weight: 700; margin-bottom: .4rem; font-size: .98rem; }
.field .opt { font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px;
  padding: .75rem .9rem; min-height: 48px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field-error { display: block; color: var(--danger); font-size: .9rem; font-weight: 600; margin-top: .35rem; min-height: 0; }
.field-hint { display: block; color: var(--muted); font-size: .9rem; margin-top: .35rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile-wrap { min-height: 65px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.form-actions p { margin: 0; color: var(--muted); font-size: .92rem; }
.form-status { display: none; margin-top: 1.25rem; padding: 1rem 1.15rem; border-radius: 10px; font-weight: 600; }
.form-status.is-success { display: block; background: var(--success-soft); color: var(--success); border: 1px solid currentColor; }
.form-status.is-error { display: block; background: var(--danger-soft); color: var(--danger); border: 1px solid currentColor; }

.contact-aside { display: grid; gap: 1.25rem; }
.aside-block { padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); }
.aside-block h2 { font-size: 1.15rem; margin-bottom: .75rem; }
.contact-lines { list-style: none; display: grid; gap: .9rem; }
.contact-lines li { display: flex; gap: .75rem; align-items: flex-start; }
.contact-lines .icon { color: var(--accent-text); width: 22px; height: 22px; margin-top: .15rem; }
.contact-lines small { display: block; color: var(--muted); font-size: .88rem; }
.steps-mini { list-style: none; counter-reset: s; display: grid; gap: .9rem; }
.steps-mini li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: .75rem; color: var(--muted); }
.steps-mini li::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; }
.steps-mini strong { color: var(--text); display: block; }
.btn-whatsapp { background: #25D366; color: #08240F; width: 100%; }
.btn-whatsapp:hover { background: #3BE07A; }

/* ---------- 19. Legal & 404 ---------- */
.prose { max-width: 72ch; }
.prose h2 { font-size: 1.5rem; margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.25rem; margin-bottom: 1em; }
.prose li { margin-bottom: .4em; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.notfound { min-height: 60vh; display: grid; align-items: center; }
.notfound .code { font-size: clamp(5rem, 16vw, 9rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--accent-text); margin-bottom: 1rem; }

/* ---------- 20. Footer ---------- */
.site-footer { padding-top: clamp(3.5rem, 7vw, 5rem); background: var(--deep-2); }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1fr; padding-bottom: 3rem; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1.2fr 1.3fr; } }
.footer-brand p { color: var(--muted); max-width: 34ch; margin: 1rem 0 1.25rem; }
.site-footer h2 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--text); }
.footer-links { list-style: none; display: grid; gap: .55rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent-text); text-decoration: underline; }
.footer-links li { color: var(--muted); }
.footer-contact li { display: flex; gap: .6rem; align-items: flex-start; }
.footer-contact .icon { width: 18px; height: 18px; margin-top: .3rem; color: var(--accent-text); }
.socials { display: flex; gap: .5rem; list-style: none; }
.socials a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); color: var(--text); }
.socials a:hover { border-color: var(--accent); color: var(--accent-text); }
.socials svg { width: 18px; height: 18px; }
.footer-bottom { border-top: 1px solid var(--border); padding-block: 1.5rem; display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between; color: var(--muted); font-size: .92rem; }
.footer-bottom ul { display: flex; gap: 1.25rem; list-style: none; }
.footer-bottom a { color: var(--muted); }

/* ---------- 21. Scroll reveal (subtle, opt-in via .reveal) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- 22. Print ---------- */
@media print {
  .site-header, .site-footer, .cta-band, .btn { display: none !important; }
  body { background: #fff; color: #000; }
}
.cta-inner .rule-head { margin-bottom: 0; }
.case-body > .case-section { margin-top: 0; }
.section-tight { padding-bottom: 0; }

/* ---------- 23. Content managed from the admin panel ---------- */
.socials:empty { display: none; }
.gallery-1 { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .gallery-2 { grid-template-columns: 1fr 1fr; }
  .gallery-n > :first-child { grid-row: span 2; }
  .gallery-n > :first-child img { aspect-ratio: auto; height: 100%; }
}
.gallery-item { margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.gallery-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-2); }
.gallery-item figcaption { color: var(--muted); font-size: .92rem; }
.testimonial { margin: 0; padding: 1.5rem 1.75rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); }
.testimonial p { font-size: 1.125rem; font-weight: 500; margin-bottom: .75rem; }
.testimonial footer strong { display: block; }
.testimonial footer span { color: var(--muted); font-size: .95rem; }
.founder-photo.has-img { border: 0; }
.founder-photo.initials { border: 0; background: var(--graphite); color: #fff; font-size: 4rem; font-weight: 800; letter-spacing: -0.03em; }
.founder-photo.initials::after { content: ""; display: block; }

/* ==========================================================================
   24. v2 — design refinements & motion system
   Performance rules: only transform/opacity are animated; ambient loops pause
   off-screen (.loop-paused) and are switched off on low-end devices (.lite)
   and for visitors who prefer reduced motion.
   ========================================================================== */
:root { --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1); }

/* ---- Dark zones: static glows (painted once, never animated) ---- */
.on-dark {
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(44, 201, 182, .14), transparent 62%),
    radial-gradient(700px 460px at -12% 112%, rgba(44, 201, 182, .06), transparent 62%),
    var(--deep);
}
.hero, .page-hero, .cta-band { position: relative; overflow: hidden; isolation: isolate; }
.bg-grid {
  position: absolute; inset: -64px; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 48px 32px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 25%, transparent 75%);
}
.loop-paused, .loop-paused * { animation-play-state: paused !important; }

/* ---- Paper (the site's motif) ---- */
.paper, .float-paper {
  display: block;
  background-color: #fff;
  background-image: repeating-linear-gradient(180deg, transparent 0 8px, #D6DAEA 8px 9px);
  background-size: 68% calc(100% - 22px);
  background-position: 50% 14px;
  background-repeat: no-repeat;
  border: 1px solid rgba(16, 20, 22, .14);
  border-radius: 5px;
  box-shadow: 0 8px 18px rgba(10, 12, 14, .22);
}
.paper.xls, .float-paper.sheet-paper {
  background-color: #F3FBFA;
  background-image: linear-gradient(#BFE6E0 1px, transparent 1px), linear-gradient(90deg, #BFE6E0 1px, transparent 1px);
  background-size: 11px 9px;
  background-position: 0 0;
  background-repeat: repeat;
}
.paper b {
  position: absolute; left: 4px; right: 4px; bottom: 4px;
  padding: 1px 3px; border-radius: 3px; background: #fff;
  color: #0A7A6D; font-size: 8px; font-weight: 800; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Floating papers around the hero / page heroes */
.float-paper { position: absolute; width: 46px; height: 58px; z-index: 2; pointer-events: none; transform: rotate(var(--r, -10deg)); }
.hero-visual .fp1 { top: -4%; left: -6%; --r: -14deg; }
.hero-visual .fp2 { bottom: 10%; left: -10%; --r: 12deg; width: 40px; height: 50px; }
.hero-visual .fp3 { top: 2%; right: 2%; --r: 8deg; }
.page-hero .float-paper { opacity: .9; }
.page-hero .fp1 { right: 9%; top: 24%; --r: -12deg; }
.page-hero .fp2 { right: 19%; bottom: 16%; --r: 10deg; width: 38px; height: 48px; }
@media (max-width: 900px) { .page-hero .float-paper { display: none; } }

/* ---- Header: scroll progress + nav underline ---- */
.site-header { position: sticky; }
.scroll-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform-origin: left; transform: scaleX(var(--p, 0)); pointer-events: none; }
@media (min-width: 961px) {
  .site-nav ul a { position: relative; }
  .site-nav ul a::after {
    content: ""; position: absolute; left: .8rem; right: .8rem; bottom: 3px; height: 2px; border-radius: 1px;
    background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease-out);
  }
  .site-nav ul a:hover { background: transparent; }
  .site-nav ul a:hover::after, .site-nav ul a[aria-current="page"]::after { transform: scaleX(1); }
}

/* ---- Buttons: lift + shine sweep ---- */
.btn { position: relative; overflow: hidden; isolation: isolate; transition: transform .25s var(--ease-out), background-color .2s, border-color .2s, color .2s, box-shadow .25s; }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease-out);
}
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); }
  .btn-primary:hover { box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
  .btn-primary:hover::after { transform: translateX(120%); }
}
.btn:active { transform: translateY(0) scale(.97); }
.btn.is-loading { color: transparent !important; }
.btn.is-loading::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; border: 2.5px solid var(--on-accent); border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Animated underline for text links */
.text-link { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .35s var(--ease-out); padding-bottom: 2px; }
.text-link:hover { text-decoration: none; background-size: 100% 2px; }
.text-link svg { width: 18px; height: 18px; transition: transform .3s var(--ease-out); }
.text-link:hover svg { transform: translateX(4px); }

/* ---- Cursor spotlight on cards (.glow) ---- */
.glow { position: relative; }
.glow::before {
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft), transparent 65%);
  opacity: 0; transition: opacity .35s;
}
.glow:hover::before { opacity: 1; }
.glow > * { position: relative; z-index: 1; }

/* ---- Hero ---- */
.hero { padding-bottom: 0; }
.hero-inner { padding-bottom: clamp(3rem, 7vw, 5rem); }
.hero-title .w { display: inline-block; }
.hero-visual { transform: perspective(1100px) rotateX(var(--ty, 0deg)) rotateY(var(--tx, 0deg)); transition: transform .5s var(--ease-out); }
.tech-strip { border-top: 1px solid var(--border); padding-block: 1.1rem; }
.marquee { display: flex; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; flex: none; gap: 2.75rem; padding-right: 2.75rem; list-style: none; }
.marquee-track li { display: flex; align-items: center; gap: 2.75rem; white-space: nowrap; color: var(--muted); font-weight: 700; }
.marquee-track li::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---- Problems: papers scatter on hover ---- */
.problems { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 820px) { .problems { grid-template-columns: repeat(2, 1fr); } }
.problem {
  overflow: hidden; display: grid; gap: 1rem 1.5rem; grid-template-columns: 1fr;
  padding: clamp(1.5rem, 3vw, 2rem); border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .4s var(--ease-out), border-color .3s, box-shadow .4s;
}
@media (min-width: 520px) { .problem { grid-template-columns: 160px 1fr; align-items: center; } }
.problem h3 { margin: 0 0 .4rem; }
.problem p { margin: 0; color: var(--muted); }
.problem-art { height: 130px; }
.problem-fix { display: flex; gap: .5rem; align-items: flex-start; margin-top: 1rem !important; color: var(--text) !important; font-weight: 600; font-size: .96rem; }
.problem-fix .icon { width: 20px; height: 20px; margin-top: .15rem; color: var(--accent-text); }
.problem-art .paper {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 66px; margin: -33px 0 0 -26px;
  transform: translate3d(calc(var(--i) * 5px - 8px), calc(var(--i) * -3px), 0) rotate(var(--r0));
  transition: transform .65s var(--ease-spring), opacity .5s ease;
  transition-delay: calc(var(--i) * 40ms);
}
.problem:hover .paper, .problem:focus-within .paper, .problem.is-scattered .paper {
  transform: translate3d(var(--x), var(--y), 0) rotate(var(--r));
}
/* Lost records: papers fly out of the folder and vanish */
.problem-lost .paper { transform: translate3d(calc(var(--i) * 6px - 10px), -18px, 0) rotate(var(--r0)); }
.problem-lost:hover .paper, .problem-lost:focus-within .paper, .problem-lost.is-scattered .paper {
  transform: translate3d(var(--x), var(--y), 0) rotate(var(--r)) scale(.7); opacity: 0;
  transition-duration: .9s, .8s;
}
.folder { position: absolute; left: 50%; bottom: 8px; z-index: 3; width: 92px; height: 58px; margin-left: -46px; border-radius: 4px 8px 8px 8px; background: var(--graphite); box-shadow: 0 10px 20px rgba(10, 12, 14, .3); transition: transform .5s var(--ease-spring); }
.folder::before { content: ""; position: absolute; left: 0; top: -9px; width: 38px; height: 12px; border-radius: 5px 5px 0 0; background: var(--graphite); }
.folder::after { content: ""; position: absolute; left: 10px; right: 10px; top: 14px; height: 3px; border-radius: 2px; background: var(--accent); }
.problem-lost:hover .folder, .problem-lost.is-scattered .folder { transform: rotate(-6deg) translateY(4px); }
/* Slow reporting: the clock spins while papers pile up */
.clock { position: absolute; right: 4px; top: 2px; z-index: 3; width: 50px; height: 50px; border-radius: 50%; border: 3px solid var(--accent); background: var(--surface); box-shadow: 0 6px 14px rgba(10, 12, 14, .2); }
.clock::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: var(--text); }
.clock i { position: absolute; left: 50%; top: 50%; width: 3px; height: 17px; margin: -17px 0 0 -1.5px; border-radius: 2px; background: var(--text); transform-origin: 50% 100%; transition: transform 1.8s var(--ease-out); }
.problem-slow:hover .clock i, .problem-slow.is-scattered .clock i { transform: rotate(720deg); }
@media (hover: hover) {
  .problem:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 22px 44px -22px rgba(10, 12, 14, .55); }
  .problem-fix { opacity: 0; transform: translateY(10px); transition: opacity .4s ease .1s, transform .4s var(--ease-out) .1s; }
  .problem:hover .problem-fix, .problem:focus-within .problem-fix { opacity: 1; transform: none; }
}

/* ---- Cards ---- */
.card { transition: transform .4s var(--ease-out), border-color .3s, box-shadow .4s; }
.icon-box { transition: transform .45s var(--ease-spring), background-color .3s, color .3s; }
@media (hover: hover) {
  .card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px -22px rgba(10, 12, 14, .55); }
  .card:hover .icon-box { transform: rotate(-8deg) scale(1.1); background: var(--accent); color: var(--on-accent); }
}

/* ---- Audience, process, features, chips, values ---- */
.audience .icon { transition: transform .45s var(--ease-spring); }
@media (hover: hover) { .audience li:hover .icon { transform: translateY(-4px) scale(1.15) rotate(-6deg); } }
.process li::before { transition: transform .4s var(--ease-spring), background-color .3s, color .3s; }
@media (hover: hover) { .process li:hover::before { transform: scale(1.12); background: var(--accent); color: var(--on-accent); } }
.feature-list li { transition: transform .3s var(--ease-out), border-color .3s; }
.feature-list li .icon { transition: transform .4s var(--ease-spring); }
@media (hover: hover) {
  .feature-list li:hover { transform: translateX(4px); border-color: var(--accent); }
  .feature-list li:hover .icon { transform: scale(1.25); }
}
.chip { transition: transform .3s var(--ease-spring), background-color .2s; }
@media (hover: hover) { .chip:hover { transform: translateY(-2px) scale(1.05); } }
.values li { transition: transform .35s var(--ease-out); }
@media (hover: hover) { .values li:hover { transform: translateY(-4px); } }
.compare > div, .case-index a, .tech-group, .aside-block, .stat { transition: transform .4s var(--ease-out), border-color .3s; }
@media (hover: hover) {
  .compare > div:hover, .case-index a:hover, .tech-group:hover { transform: translateY(-4px); }
  .compare .before li:hover .icon { transform: rotate(90deg); }
}
.compare .before li .icon { transition: transform .35s var(--ease-out); }
.gallery-item img, .shot img { transition: transform .6s var(--ease-out); }
@media (hover: hover) { .gallery-item:hover img { transform: scale(1.03); } }
.socials a { transition: transform .3s var(--ease-spring), background-color .2s, color .2s, border-color .2s; }
@media (hover: hover) { .socials a:hover { transform: translateY(-3px); background: var(--accent); color: var(--on-accent); border-color: var(--accent); } }
.founder-photo { transition: transform .5s var(--ease-out); }
@media (hover: hover) { .founder:hover .founder-photo { transform: rotate(-2deg) scale(1.02); } }

/* ---- Forms ---- */
.field label { transition: color .2s; }
.field:focus-within label { color: var(--accent-text); }
.form-status.is-success, .form-status.is-error { animation: fade-up .45s var(--ease-out); }

/* ---- 404 ---- */
.notfound { position: relative; overflow: hidden; }
.notfound .container { position: relative; z-index: 1; }
.nf-papers { position: absolute; inset: 0; pointer-events: none; }
.paper.drift { position: absolute; width: 58px; height: 74px; opacity: .85; transform: rotate(var(--r0)); }

/* ---- Motion (only when the visitor hasn't asked for reduced motion) ---- */
@media (prefers-reduced-motion: no-preference) {
  /* Load: headline words rise, then the rest of the hero copy */
  .hero-title .w { animation: word-rise .8s var(--ease-out) both; animation-delay: calc(.1s + var(--i) * 70ms); }
  .hero-tagline { animation: fade-up .7s var(--ease-out) both; }
  .hero .lead { animation: fade-up .8s var(--ease-out) .65s both; }
  .hero .btn-row { animation: fade-up .8s var(--ease-out) .8s both; }
  .tech-strip { animation: fade-up .8s var(--ease-out) 1s both; }
  .page-hero h1 { animation: fade-up .7s var(--ease-out) both; }
  .page-hero .lead { animation: fade-up .7s var(--ease-out) .12s both; }
  .page-hero .anchor-nav { animation: fade-up .7s var(--ease-out) .24s both; }

  /* Scroll reveals (JS adds .reveal / staggers with --i) */
  .js .reveal { opacity: 0; transform: translate3d(0, 26px, 0); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
  .js .rule-head::before { transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease-out) .15s; }
  .js .rule-head.center::before { transform-origin: center; }
  .js .rule-head.in::before { transform: scaleX(1); }

  /* Process timeline draws itself */
  .js .process li::after { transform: scaleX(0); transform-origin: left; transition: transform .7s var(--ease-out); transition-delay: calc(var(--i, 0) * 140ms + .35s); }
  .js .process li.in::after { transform: scaleX(1); }
  .js .process li.in::before { animation: pop .55s var(--ease-spring) both; animation-delay: calc(var(--i, 0) * 140ms); }

  /* Solutions: check marks tick in */
  .js .compare .after li .icon path { stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset .45s ease; }
  .js .compare .after.in li .icon path { stroke-dashoffset: 0; }
  .compare .after li:nth-child(1) path { transition-delay: .35s; }
  .compare .after li:nth-child(2) path { transition-delay: .5s; }
  .compare .after li:nth-child(3) path { transition-delay: .65s; }
  .compare .after li:nth-child(4) path { transition-delay: .8s; }
  .compare .after li:nth-child(5) path { transition-delay: .95s; }
  .compare .after li:nth-child(6) path { transition-delay: 1.1s; }

  /* Ambient loops — disabled in .lite mode */
  html:not(.lite) .bg-grid { animation: grid-drift 26s linear infinite; }
  html:not(.lite) .float-paper { animation: float 9s ease-in-out infinite; }
  html:not(.lite) .fp2 { animation-duration: 11s; animation-delay: -3s; }
  html:not(.lite) .fp3 { animation-duration: 10s; animation-delay: -6s; }
  html:not(.lite) .marquee-track { animation: marquee 32s linear infinite; }
  html:not(.lite) .marquee:hover .marquee-track { animation-play-state: paused; }
  html:not(.lite) .dash { animation: rise .8s var(--ease-out) 1.25s both, bob 7s ease-in-out 2.4s infinite; }
  html:not(.lite) .paper.drift { animation: drift 11s ease-in-out infinite; animation-delay: calc(var(--i) * -1.8s); }
}
@keyframes word-rise { from { opacity: 0; transform: translateY(.55em); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes grid-drift { to { transform: translate3d(48px, 32px, 0); } }
@keyframes float { 0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--r, -10deg)); } 50% { transform: translate3d(0, -16px, 0) rotate(calc(var(--r, -10deg) + 7deg)); } }
@keyframes marquee { to { transform: translateX(-100%); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes drift { 0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--r0)); } 50% { transform: translate3d(var(--dx), var(--dy), 0) rotate(calc(var(--r0) * -1)); } }

/* ---- Lite mode for low-end devices: keep hover effects, drop the expensive extras ---- */
.lite .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
.lite .glow::before { display: none; }
.lite .marquee { -webkit-mask-image: none; mask-image: none; }
.lite .marquee-track[aria-hidden="true"] { display: none; }
.lite .marquee-track { flex: 1; flex-wrap: wrap; justify-content: center; gap: .75rem 2rem; padding: 0; }
.lite .marquee-track li { gap: 2rem; }
.lite .hero-visual { transform: none; }
.lite .paper, .lite .float-paper, .lite .sheet, .lite .dash { box-shadow: none; }
.problem .problem-art { position: relative; z-index: 1; }
.problem .problem-copy { position: relative; z-index: 2; }
@media (max-width: 519px) { .problem-art { height: 120px; } }
.page-hero > .container { position: relative; z-index: 1; }
.page-hero .float-paper { z-index: 0; }
.page-hero .fp2 { right: 5%; bottom: auto; top: 58%; }

/* ==========================================================================
   25. Light mode: the hero and page headers follow the light theme
   ========================================================================== */
:root[data-theme="light"] .hero.on-dark,
:root[data-theme="light"] .page-hero.on-dark {
  --surface: #FFFFFF;
  --surface-2: #E4EAEC;
  --text: #0F1316;
  --muted: #3F484D;
  --border: #C9D1D4;
  --brand: #262866;
  --accent: #14A595;
  --accent-text: #06695E;
  --accent-soft: rgba(20, 165, 149, 0.16);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(23, 174, 158, .13), transparent 62%),
    radial-gradient(700px 460px at -12% 112%, rgba(23, 174, 158, .06), transparent 62%),
    #FFFFFF;
  border-bottom: 1px solid var(--border);
}
:root[data-theme="light"] .hero .bg-grid,
:root[data-theme="light"] .page-hero .bg-grid {
  background-image: linear-gradient(rgba(16, 20, 22, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(16, 20, 22, .05) 1px, transparent 1px);
}
:root[data-theme="light"] .hero .sheet { box-shadow: 0 18px 40px -14px rgba(16, 20, 22, .28); }
:root[data-theme="light"] .hero .dash { box-shadow: 0 24px 48px -16px rgba(16, 20, 22, .3); border-color: var(--border); }
:root[data-theme="light"] .hero .tech-strip { background: rgba(255, 255, 255, .6); }
:root[data-theme="light"] .float-paper { box-shadow: 0 8px 18px rgba(16, 20, 22, .14); }

/* ==========================================================================
   26. Light mode: clear edges and depth
   ========================================================================== */
:root[data-theme="light"] .site-header { border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 rgba(16, 20, 22, .03); }
:root[data-theme="light"] .site-nav ul a { color: #2A3236; }
:root[data-theme="light"] .site-nav ul a[aria-current="page"] { color: var(--accent-text); }

/* Cards, panels and boxes get a visible edge + soft shadow */
:root[data-theme="light"] :is(.card, .problem, .compare > div, .feature-list li, .case-index a,
  .tech-group, .aside-block, .form-card, .case-meta, .shot, .service-problem) {
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(16, 20, 22, .06), 0 6px 18px rgba(16, 20, 22, .06);
}
:root[data-theme="light"] .problems { gap: 1.25rem; }
:root[data-theme="light"] .problem { background: #FFFFFF; }
:root[data-theme="light"] .shot { background: #FFFFFF; border-color: #AFB9BD; }
:root[data-theme="light"] .compare .after { border-color: var(--accent); background: #F4FBFA; }

/* Section bands read as separate blocks */
:root[data-theme="light"] .section-alt { border-block: 1px solid var(--border); }

/* Icons, chips, numbers: stronger teal */
:root[data-theme="light"] .icon-box { background: rgba(20, 165, 149, .14); color: var(--accent-text); }
:root[data-theme="light"] .chip { background: rgba(20, 165, 149, .14); color: #0B3B36; }
:root[data-theme="light"] .anchor-nav .chip { background: #FFFFFF; border-color: var(--border); color: var(--text); }
:root[data-theme="light"] .process li::before { background: #FFFFFF; border-color: var(--accent); color: var(--text); }
:root[data-theme="light"] .process li::after { background: #B9C3C7; }
:root[data-theme="light"] .audience li, :root[data-theme="light"] .audience { border-color: var(--border); }
:root[data-theme="light"] .rule-head::before { background: var(--accent); }

/* Buttons */
:root[data-theme="light"] .btn-ghost { border-color: #9EAAAF; color: var(--text); background: #FFFFFF; }
:root[data-theme="light"] .btn-ghost:hover { border-color: var(--text); }
:root[data-theme="light"] .cta-band .btn-ghost, :root[data-theme="light"] .site-footer .btn-ghost { background: transparent; color: var(--text); border-color: rgba(255, 255, 255, .35); }

/* Form fields */
:root[data-theme="light"] .field input, :root[data-theme="light"] .field select, :root[data-theme="light"] .field textarea { background: #FFFFFF; border-color: #B5C0C4; }

/* Hero: crisper illustration and grid */
:root[data-theme="light"] .hero .sheet { border-color: #C9D1D4; }
@media (prefers-reduced-motion: no-preference) {
  :root[data-theme="light"] .sheet { animation-name: dim-light; }
}
@keyframes dim-light { to { opacity: .9; } }
:root[data-theme="light"] .hero .bg-grid,
:root[data-theme="light"] .page-hero .bg-grid {
  background-image: linear-gradient(rgba(16, 20, 22, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(16, 20, 22, .07) 1px, transparent 1px);
}
:root[data-theme="light"] .hero .tech-strip { background: #FFFFFF; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
:root[data-theme="light"] .marquee-track li { color: #2A3236; }
:root[data-theme="light"] .paper, :root[data-theme="light"] .float-paper { border-color: rgba(16, 20, 22, .22); }

/* Main buttons in light mode: deeper teal + white text (5:1 contrast) */
:root[data-theme="light"] .btn-primary { background: #0B7D71; color: #FFFFFF; }
:root[data-theme="light"] .btn-primary:hover { background: #08665C; }
:root[data-theme="light"] .btn-primary.is-loading::before { border-color: #FFFFFF; border-right-color: transparent; }
/* …except on the dark quote band, where bright teal reads best */
:root[data-theme="light"] .cta-band .btn-primary { background: var(--accent); color: var(--on-accent); }
:root[data-theme="light"] .cta-band .btn-primary:hover { background: #3CD6C3; }
