/* ---------- Tokens ---------- */
:root {
  --bg: #0d0b14;
  --bg-elev: #15121f;
  --line: #2a2438;
  --text: #e8e6e1;
  --muted: #9aa0ab;
  --accent: #b84dff;       /* neon purple */
  --accent-ink: #ffffff;
  --glow: rgba(184, 77, 255, 0.20);
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[data-theme="light"] {
  --bg: #faf8fd;
  --bg-elev: #ffffff;
  --line: #e6e0f0;
  --text: #1a1622;
  --muted: #645d70;
  --accent: #5b0fb3;       /* deep purple */
  --accent-ink: #ffffff;
  --glow: rgba(124, 34, 214, 0.14);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  transition: background .6s var(--ease), color .6s var(--ease);
}
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: inherit; }
img { max-width: 100%; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow {
  display: inline-block;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
}
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .85em 1.4em; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink);
  font: 600 .95rem var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--glow); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-small { padding: .55em 1.1em; font-size: .88rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .55em; font: 600 1.25rem var(--serif); text-decoration: none; }
.brand-mark {
  width: 36px; height: 18px; display: block;
  filter: drop-shadow(0 0 6px rgba(184, 77, 255, .65));
  transition: filter .4s;
}
[data-theme="light"] .brand-mark { filter: drop-shadow(0 0 3px rgba(91, 15, 179, .35)); }
.brand:hover .brand-mark { filter: drop-shadow(0 0 10px rgba(184, 77, 255, .9)); }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a:not(.btn) { text-decoration: none; color: var(--muted); font-size: .95rem; transition: color .2s; }
.nav a:not(.btn):hover, .nav a.active { color: var(--text); }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: transform .3s; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 1rem;
    padding: 20px 16px 28px; background: var(--bg); border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .25s, transform .25s;
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
}

/* ---------- Views ---------- */
main { outline: none; min-height: 70vh; }
.view { animation: fadeUp .5s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
section { padding: clamp(56px, 9vw, 112px) 0; }
section + section { border-top: 1px solid var(--line); }
.section-head { max-width: 680px; margin-bottom: 48px; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 620px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(72px, 12vw, 140px); }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(circle, var(--glow) 0%, transparent 65%);
  pointer-events: none; transition: opacity .8s;
}
.hero h1 .lit { color: var(--accent); font-style: italic; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; align-items: center; }

/* Light switch */
.switch {
  display: inline-flex; align-items: center; gap: 12px;
  background: none; border: 0; color: var(--muted); font: 500 .9rem var(--sans); cursor: pointer; padding: 0;
}
.switch-track {
  width: 52px; height: 30px; border-radius: 999px; position: relative;
  background: var(--bg-elev); border: 1px solid var(--line); transition: background .3s;
}
.switch-thumb {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--muted); transition: transform .35s var(--ease), background .35s, box-shadow .35s;
}
[data-theme="light"] .switch-thumb { transform: translateX(22px); background: var(--accent); box-shadow: 0 0 14px var(--accent); }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; transition: border-color .25s, transform .25s var(--ease);
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-2px); }
.card p:last-child { margin-bottom: 0; }
.icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--glow); color: var(--accent); margin-bottom: 18px; font-size: 1.2rem;
}
.card ul { padding-left: 1.1em; margin: 0; color: var(--muted); }
.card li { margin-bottom: .35em; }

/* ---------- Loop (approach) ---------- */
.loop { display: grid; gap: 0; counter-reset: step; }
.loop-step {
  display: grid; grid-template-columns: 72px 1fr; gap: 20px; padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.loop-step:last-child { border-bottom: 0; }
.loop-num {
  font: 600 2rem var(--serif); color: var(--accent); line-height: 1;
}
.loop-step h3 { margin-bottom: .3em; }
.loop-step p { color: var(--muted); margin: 0; max-width: 640px; }
.loop-back { margin-top: 24px; color: var(--muted); font-style: italic; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.stat { border-left: 2px solid var(--accent); padding: 4px 0 4px 18px; }
.stat-value { font: 600 2.4rem var(--serif); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .92rem; }
.placeholder-note {
  display: inline-block; margin-top: 24px; font-size: .82rem; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 8px; padding: 6px 10px;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.5);
  padding: clamp(32px, 6vw, 64px); text-align: center; position: relative; overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; left: 50%; top: -60%; width: 600px; height: 600px; transform: translateX(-50%);
  background: radial-gradient(circle, var(--glow), transparent 60%); pointer-events: none;
}
.cta-band > * { position: relative; }
.cta-band .lead { margin-inline: auto; }

/* ---------- Form ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; }
.field label { font-size: .88rem; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: 400 1rem var(--sans); transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { min-height: 130px; resize: vertical; }
.form-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-success { padding: 18px; border-radius: 10px; background: var(--glow); border: 1px solid var(--accent); }

/* ---------- FAQ ---------- */
details { border-bottom: 1px solid var(--line); padding: 18px 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; transition: transform .25s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); margin: 12px 0 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0; }
.footer-inner { display: grid; gap: 24px; grid-template-columns: 1fr auto; align-items: start; }
.footer-inner > p { grid-column: 1 / -1; margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-nav a { text-decoration: none; color: var(--muted); font-size: .95rem; }
.footer-nav a:hover { color: var(--text); }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Hero infinity (brand motif) ---------- */
.hero > .wrap { position: relative; z-index: 1; }
.hero-infinity {
  position: absolute; right: -6%; top: 50%; transform: translateY(-50%);
  width: min(760px, 90vw); height: auto; color: var(--accent); opacity: .55;
  filter: drop-shadow(0 0 12px var(--accent));
  pointer-events: none;
}
.hero-infinity path {
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: draw 2.4s var(--ease) .2s forwards, pulse 6s ease-in-out 2.6s infinite;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 50% { opacity: .55; } }
[data-theme="light"] .hero-infinity { opacity: .35; filter: none; }
@media (max-width: 760px) { .hero-infinity { opacity: .25; right: -30%; } }
@media (prefers-reduced-motion: reduce) { .hero-infinity path { stroke-dashoffset: 0; } }

/* ---------- Forms: honeypot ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn:disabled { opacity: .6; cursor: progress; transform: none; box-shadow: none; }

/* ---------- Client portal ---------- */
:root {
  /* Status palette: reserved for project health, always shown with icon + label */
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
  --meter-track: color-mix(in srgb, var(--accent) 18%, var(--bg-elev));
}
.portal { padding-top: clamp(48px, 7vw, 88px); }
.portal .section-head { margin-bottom: 24px; }
.portal-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.portal-head p { margin: 0; }
.portal-signin { display: grid; justify-items: start; gap: 8px; }
.portal-projects { display: grid; gap: 24px; }
.skeleton { height: 280px; background: linear-gradient(90deg, var(--bg-elev), var(--line), var(--bg-elev)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.project { padding: clamp(22px, 4vw, 36px); }
.project:hover { transform: none; }
.project-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.project-head h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line);
  font-size: .82rem; font-weight: 500; color: var(--text);
}
.pill-icon {
  width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  font-size: .68rem; font-weight: 700; color: #fff;
}
.pill-good .pill-icon { background: var(--status-good); }
.pill-warning .pill-icon { background: var(--status-warning); color: #1a1406; }
.pill-critical .pill-icon { background: var(--status-critical); }
.pill-good { border-color: color-mix(in srgb, var(--status-good) 45%, var(--line)); }
.pill-warning { border-color: color-mix(in srgb, var(--status-warning) 55%, var(--line)); }
.pill-critical { border-color: color-mix(in srgb, var(--status-critical) 45%, var(--line)); }

.progress-block { display: flex; align-items: center; gap: 24px; margin: 24px 0; }
.hero-figure { font: 600 clamp(3rem, 8vw, 4rem)/1 var(--sans); letter-spacing: -0.03em; }
.hero-figure span { font-size: .45em; color: var(--muted); margin-left: 2px; }
.progress-side { flex: 1; display: grid; gap: 8px; }

.meter { height: 8px; border-radius: 4px; background: var(--meter-track); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .8s var(--ease); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.tile-value { font: 600 1.6rem/1.1 var(--sans); }
.tile-label { color: var(--muted); font-size: .85rem; }

.block-title { font: 600 1rem var(--sans); margin: 28px 0 12px; }
.milestones, .highlights { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ms-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: .95rem; }
.ms-row .small { font-variant-numeric: tabular-nums; white-space: nowrap; }
.update {
  white-space: pre-line; color: var(--muted); font-size: .95rem;
  border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; max-height: 14em; overflow: auto;
}
.highlights { gap: 8px; }
.highlights li { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: baseline; font-size: .95rem; }
.hl-mark { color: var(--muted); text-align: center; }
.highlights .is-done .hl-mark { color: var(--accent); }

@media (max-width: 520px) {
  .progress-block { flex-direction: column; align-items: stretch; gap: 12px; }
  .tiles { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .tile { padding: 10px 12px; }
  .highlights li { grid-template-columns: 20px 1fr; }
  .highlights li > .small { grid-column: 2; }
}

/* SVG icons inside .icon tiles */
.icon-svg { width: 24px; height: 24px; transition: transform .5s var(--ease); }
.card:hover .icon-firework { transform: scale(1.15) rotate(22.5deg); }
.icon-bulb { transition: filter .4s var(--ease), transform .4s var(--ease); }
.card:hover .icon-bulb { transform: translateY(-1px); filter: drop-shadow(0 0 6px var(--accent)); }
