/* ===========================================================
   AI EDGE CONSULTING — Design System
   Apple-inspired: clarity · deference · depth.
   Light & dark · SF Pro · one quiet blue · hairline tiles.
   =========================================================== */

:root {
  color-scheme: light;

  /* Semantic tokens — LIGHT (apple.com-faithful) */
  --bg: #ffffff;            /* page canvas */
  --bg-alt: #f5f5f7;        /* alternating sections / footer */
  --surface: #ffffff;       /* cards, panels */
  --surface-2: #f5f5f7;     /* insets: icon wells, thumbs */
  --text: #1d1d1f;          /* headlines & body */
  --text-2: #6e6e73;        /* secondary */
  --text-3: #86868b;        /* tertiary / legal */
  --border: #d2d2d7;        /* hairline */
  --border-soft: #e8e8ed;
  --accent: #0066cc;        /* button fills */
  --accent-hover: #0077ed;
  --link: #0066cc;          /* in-copy links */
  --tile-dark: #1d1d1f;     /* deliberate dark feature tile */
  --tile-dark-text: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-bg-solid: rgba(255, 255, 255, 0.96);
  --elev: 0 14px 44px rgba(0, 0, 0, 0.10);
  --elev-strong: rgba(0, 0, 0, 0.22) 0 8px 36px;

  /* Apple-Intelligence-style accent gradient */
  --ai-grad: linear-gradient(100deg, #ff7a59, #ff5db1 22%, #a45cff 46%, #4d8dff 70%, #2bd4c4);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-brand: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  --maxw: 1024px;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px; --r-xl: 28px; --r-pill: 980px;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
}

/* Dark — explicit toggle */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-alt: #0a0a0c;
  --surface: #1c1c1e;
  --surface-2: #2a2a2c;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #6e6e73;
  --border: #38383b;
  --border-soft: #2a2a2c;
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --link: #2997ff;
  --tile-dark: #1c1c1e;
  --tile-dark-text: #f5f5f7;
  --nav-bg: rgba(0, 0, 0, 0.62);
  --nav-bg-solid: rgba(0, 0, 0, 0.92);
  --elev: 0 16px 50px rgba(0, 0, 0, 0.55);
  --elev-strong: rgba(0, 0, 0, 0.6) 0 10px 44px;
}
/* Dark — system default when user hasn't chosen */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --bg-alt: #0a0a0c;
    --surface: #1c1c1e;
    --surface-2: #2a2a2c;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #6e6e73;
    --border: #38383b;
    --border-soft: #2a2a2c;
    --accent: #0a84ff;
    --accent-hover: #409cff;
    --link: #2997ff;
    --tile-dark: #1c1c1e;
    --tile-dark-text: #f5f5f7;
    --nav-bg: rgba(0, 0, 0, 0.62);
    --nav-bg-solid: rgba(0, 0, 0, 0.92);
    --elev: 0 16px 50px rgba(0, 0, 0, 0.55);
    --elev-strong: rgba(0, 0, 0, 0.6) 0 10px 44px;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.47;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
section { position: relative; padding: clamp(70px, 10vw, 120px) 0; }

.stats, #process, #ideas, #contact { background: var(--bg); }
#services, #why, #about, .footer { background: var(--bg-alt); }

/* ---------- Typography ---------- */
h1, h2, h3 { color: var(--text); font-weight: 600; letter-spacing: -0.015em; line-height: 1.08; }

.eyebrow {
  display: inline-block;
  font-size: 17px; font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--link);
  margin-bottom: 6px;
}

.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(32px, 4.4vw, 48px); margin: 6px 0 14px; }
.section-head p { color: var(--text-2); font-size: clamp(19px, 2vw, 21px); font-weight: 400; }

/* Apple-Intelligence-style gradient accent (used sparingly) */
.gradient-text {
  background: var(--ai-grad);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: aiShift 9s var(--ease) infinite;
}
@keyframes aiShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 17px; font-weight: 400;
  padding: 12px 23px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease),
    border-color .25s var(--ease), transform .12s var(--ease), box-shadow .25s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 8px 24px -8px var(--accent); }
.btn-ghost { background: transparent; border-color: var(--link); color: var(--link); }
.btn-ghost:hover { background: color-mix(in srgb, var(--link) 8%, transparent); }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .2s, background .2s, transform .3s var(--ease);
}
.theme-toggle:hover { border-color: var(--text-2); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* ---------- Primary nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .5s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--border-soft); }
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; max-width: var(--maxw); margin: 0 auto; padding: 0 22px;
  transition: height .35s var(--ease);
}
.nav.scrolled .nav-inner { height: 48px; }
.nav .brand .logo, .nav .brand-text { transition: transform .35s var(--ease); }
.nav.scrolled .brand .logo { transform: scale(0.9); }
.nav.scrolled .brand-text { transform: scale(0.96); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: var(--text);
  display: grid; place-items: center;
  font-family: var(--font-brand);
  font-weight: 700; font-size: 15px; line-height: 1;
  letter-spacing: -0.03em; color: var(--bg);
}
.brand-text { display: flex; align-items: baseline; gap: 9px; }
.brand-text b {
  font-family: var(--font-brand);
  font-size: 18px; font-weight: 700; line-height: 1;
  letter-spacing: -0.03em; color: var(--text);
}
.brand-sub {
  font-family: var(--font-brand);
  font-size: 11px; line-height: 1; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-3);
  margin-right: -0.18em;
}
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  font-size: 14px; font-weight: 400; color: var(--text);
  position: relative; padding: 4px 0;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1.5px; border-radius: 2px; background: var(--link);
  transition: right .32s var(--ease);
}
.nav-links a:hover { color: var(--link); text-decoration: none; }
.nav-links a:hover::after { right: 0; }
.nav-cta { display: flex; align-items: center; gap: 14px; }
.nav-cta .btn { padding: 7px 16px; font-size: 14px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); cursor: pointer; padding: 6px; }
.nav-toggle svg { width: 24px; height: 24px; }

/* ---------- Sticky section sub-nav ---------- */
.subnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-soft);
  transform: translateY(-105%);
  transition: transform .45s var(--ease);
}
.subnav.show { transform: translateY(0); }
.subnav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 50px; max-width: var(--maxw); margin: 0 auto; padding: 0 22px;
}
.subnav-title { font-family: var(--font-brand); font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.03em; }
.subnav-links { display: flex; align-items: center; gap: 28px; }
.subnav-links a { font-size: 13px; color: var(--text-2); position: relative; padding: 4px 0; }
.subnav-links a:hover { color: var(--text); text-decoration: none; }
.subnav-links a.active { color: var(--text); }
.subnav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--link);
}
.subnav .btn { padding: 6px 15px; font-size: 13px; }

/* ---------- Hero ---------- */
.hero { padding: 140px 0 60px; text-align: center; background: var(--bg); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -25% -12% auto -12%; height: 90%;
  z-index: 0; pointer-events: none; filter: blur(46px); opacity: .9;
  background:
    radial-gradient(38% 50% at 24% 28%, rgba(255, 93, 177, .16), transparent 70%),
    radial-gradient(44% 56% at 79% 24%, rgba(77, 141, 255, .15), transparent 70%),
    radial-gradient(40% 46% at 56% 66%, rgba(43, 212, 196, .12), transparent 70%);
  animation: auroraDrift 20s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); }
  50%  { transform: translate3d(3%, 2%, 0) scale(1.09); }
  100% { transform: translate3d(-1%, 1%, 0) scale(1.04); }
}
.hero-inner { max-width: 820px; margin: 0 auto; position: relative; z-index: 1; }
.hero .eyebrow { font-size: clamp(19px, 2.4vw, 24px); }
.hero h1 {
  font-size: clamp(34px, 4.8vw, 58px); font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.08; margin: 8px 0 16px;
}
.hero p.lead {
  font-size: clamp(19px, 2.4vw, 26px); font-weight: 400;
  color: var(--text-2); max-width: 660px; margin: 0 auto 32px;
  letter-spacing: -0.01em;
}
.hero-actions { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: 24px; font-size: 15px; color: var(--text-3); }
.hero-strip { margin-top: 38px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero-strip span {
  font-size: 13px; color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  padding: 7px 15px; border-radius: var(--r-pill);
  transition: border-color .25s var(--ease), color .25s var(--ease);
}
.hero-strip span:hover { color: var(--text); border-color: var(--border); }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat {
  background: var(--surface-2); border-radius: var(--r-lg);
  padding: 40px 26px; text-align: center;
  transition: transform .4s var(--ease);
}
.stat:hover { transform: translateY(-3px); }
.stat .num {
  font-size: clamp(34px, 4.2vw, 52px); font-weight: 600;
  letter-spacing: -0.02em; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat .label { color: var(--text-2); font-size: 16px; margin-top: 6px; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 36px 34px;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s;
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%),
    color-mix(in srgb, var(--link) 14%, transparent), transparent 60%);
  opacity: 0; transition: opacity .4s var(--ease); pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card > * { position: relative; z-index: 1; }
.card:hover { transform: translateY(-6px); box-shadow: var(--elev); border-color: var(--border-soft); }
.card .icon {
  width: 52px; height: 52px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--surface-2); margin-bottom: 20px; font-size: 25px;
  transition: transform .45s var(--ease);
}
.card:hover .icon { transform: scale(1.08); }
.card h3 { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.card p { color: var(--text-2); font-size: 17px; }
.card .tag { margin-top: 16px; font-size: 14px; color: var(--text-3); }

/* ---------- Process ---------- */
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { padding: 32px 28px; border-radius: var(--r-lg); background: var(--surface-2); transition: transform .4s var(--ease); }
.step:hover { transform: translateY(-4px); }
.step .step-no { font-size: 15px; font-weight: 600; color: var(--link); }
.step h3 { font-size: 22px; font-weight: 600; margin: 12px 0 8px; }
.step p { color: var(--text-2); font-size: 16px; }

/* ---------- Split / Why / About ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; max-width: var(--maxw); }
.split .eyebrow { font-size: 21px; }
.split h2 { font-size: clamp(32px, 4.2vw, 48px); margin-bottom: 16px; }
.split p.sub { color: var(--text-2); font-size: 19px; margin-bottom: 28px; }
.feature-list { display: grid; gap: 14px; }
.feature {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 20px 22px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .35s var(--ease), border-color .35s;
}
.feature:hover { transform: translateX(4px); border-color: var(--border-soft); }
.feature .check {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center;
  font-size: 14px; color: #fff;
}
.feature b { display: block; font-size: 17px; font-weight: 600; color: var(--text); }
.feature span { color: var(--text-2); font-size: 16px; }

.panel { border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); padding: 40px; }
#why .panel {
  background: var(--tile-dark); border-color: var(--tile-dark);
  position: relative; overflow: hidden;
}
#why .panel::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 0% 0%, rgba(120,120,255,.16), transparent 55%);
  pointer-events: none;
}
#why .panel > * { position: relative; }
#why .panel .quote, #why .panel .who b { color: var(--tile-dark-text); }
#why .panel .who span { color: color-mix(in srgb, var(--tile-dark-text) 55%, transparent); }
.panel .quote { font-size: 24px; line-height: 1.4; font-weight: 600; letter-spacing: -0.015em; color: var(--text); }
.panel .who { margin-top: 26px; display: flex; align-items: center; gap: 14px; }
.panel .who .av { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 600; color: #fff; }
.panel .who b { display: block; font-size: 16px; font-weight: 600; }
.panel .who span { display: block; font-size: 14px; color: var(--text-3); margin-top: 2px; }
#about .panel { background: var(--surface); border-color: var(--border); }
#about .panel .contact-item b { color: var(--text); }

/* ---------- Portfolio ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.work-card {
  border: 1px solid var(--border); border-radius: var(--r-xl);
  overflow: hidden; background: var(--surface);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .45s;
}
.work-card:hover { transform: translateY(-6px); box-shadow: var(--elev); border-color: var(--border-soft); text-decoration: none; }
.work-thumb {
  aspect-ratio: 16 / 10; display: grid; place-items: center;
  font-size: 64px; position: relative; overflow: hidden;
  background: var(--surface-2);
  filter: saturate(1.05);
}
.work-thumb > * { position: relative; z-index: 1; transition: transform .55s var(--ease); }
.work-card:hover .work-thumb > * { transform: scale(1.08); }
.work-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(140% 120% at 50% 0%, rgba(255,255,255,.35), transparent 60%);
  mix-blend-mode: soft-light;
}
.work-card:nth-of-type(4n+1) .work-thumb { background: linear-gradient(140deg, #ffd5c2, #ff9a8b 45%, #ff6f91); }
.work-card:nth-of-type(4n+2) .work-thumb { background: linear-gradient(140deg, #c2e9fb, #81a4fd 50%, #6a5cff); }
.work-card:nth-of-type(4n+3) .work-thumb { background: linear-gradient(140deg, #d4fc79, #34d3a6 50%, #2bb7c4); }
.work-card:nth-of-type(4n+4) .work-thumb { background: linear-gradient(140deg, #fbc7ff, #b18cff 50%, #6d83ff); }
.work-body { padding: 30px 32px 34px; }
.work-body .kind { font-size: 15px; color: var(--link); font-weight: 600; }
.work-body h3 { font-size: 24px; font-weight: 600; margin: 8px 0 10px; color: var(--text); }
.work-body p { color: var(--text-2); font-size: 17px; }
.work-link { margin-top: 20px; display: inline-flex; align-items: center; gap: 6px; font-size: 17px; color: var(--link); }
.work-link .dom { color: var(--text-3); }
.work-link .arrow { transition: transform .2s var(--ease); }
.work-card:hover .work-link .arrow { transform: translateX(3px); }

.subdomain-note {
  margin-top: 44px; display: flex; gap: 16px; align-items: flex-start;
  padding: 24px 28px; border-radius: var(--r-lg);
  background: var(--surface-2); color: var(--text-2); font-size: 16px;
}
.subdomain-note code {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  background: var(--surface); border: 1px solid var(--border);
  padding: 1px 7px; border-radius: 5px; color: var(--text); font-size: 14px;
}

/* ---------- CTA ---------- */
.cta-wrap {
  border-radius: var(--r-xl); padding: clamp(56px, 8vw, 100px) 32px;
  text-align: center; position: relative; overflow: hidden;
  background: var(--tile-dark);
}
.cta-wrap::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(90% 120% at 50% 0%, rgba(120,140,255,.22), transparent 60%);
}
.cta-wrap > * { position: relative; }
.cta-wrap h2 { font-size: clamp(34px, 5vw, 56px); margin-bottom: 14px; color: var(--tile-dark-text); }
.cta-wrap p { color: color-mix(in srgb, var(--tile-dark-text) 66%, transparent); font-size: clamp(19px, 2vw, 21px); max-width: 540px; margin: 0 auto 30px; }
.cta-actions { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; align-items: center; }
.cta-wrap .btn-ghost { border-color: color-mix(in srgb, var(--tile-dark-text) 45%, transparent); color: var(--tile-dark-text); }
.cta-wrap .btn-ghost:hover { background: color-mix(in srgb, var(--tile-dark-text) 10%, transparent); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; max-width: var(--maxw); }
.contact-info .eyebrow { font-size: 21px; }
.contact-info h2 { font-size: clamp(32px, 4.2vw, 48px); margin-bottom: 14px; }
.contact-info > p { color: var(--text-2); font-size: 19px; margin-bottom: 32px; }
.contact-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.contact-item .ci { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 18px; }
.contact-item b { display: block; font-size: 16px; font-weight: 600; color: var(--text); }
.contact-item span { color: var(--text-2); font-size: 16px; }

.next-steps { display: grid; gap: 12px; margin: 8px 0 30px; }
.next-steps li {
  padding: 16px 18px; border: 1px solid var(--border);
  border-radius: var(--r-md); background: var(--surface);
}
.next-steps li b { display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.next-steps li span { display: block; font-size: 14px; color: var(--text-2); margin-top: 3px; }

/* ---------- Legal / text pages ---------- */
.legal { max-width: 740px; margin: 0 auto; padding: 130px 22px 90px; }
.legal h1 { font-size: clamp(32px, 5vw, 46px); margin-bottom: 8px; }
.legal .updated { color: var(--text-3); font-size: 14px; margin-bottom: 36px; }
.legal h2 { font-size: 22px; margin: 34px 0 10px; }
.legal p, .legal li { color: var(--text-2); font-size: 16px; line-height: 1.6; }
.legal p { margin-bottom: 14px; }
.legal ul { margin: 0 0 14px 20px; list-style: disc; }
.legal li { margin-bottom: 6px; }
.legal .notice {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px 18px; font-size: 14px;
  color: var(--text-2); margin-bottom: 30px;
}

form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; color: var(--text-2); }
.field input, .field textarea, .field select {
  font-family: inherit; font-size: 17px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 13px 15px;
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 13px; color: var(--text-3); }
.form-status { font-size: 15px; min-height: 20px; }
.form-status.ok { color: #1d7a33; }
.form-status.err { color: #e0484d; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 40px; }
.footer .container { max-width: var(--maxw); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand p { color: var(--text-2); font-size: 14px; margin-top: 14px; max-width: 320px; line-height: 1.5; }
.footer h4 { font-size: 12px; color: var(--text-3); margin-bottom: 14px; font-weight: 600; }
.footer ul li { margin-bottom: 10px; }
.footer ul li a { color: var(--text-2); font-size: 14px; }
.footer ul li a:hover { color: var(--link); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 22px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px;
  color: var(--text-3); font-size: 12px;
}
.footer-bottom .socials { display: flex; gap: 10px; }
.footer-bottom .socials a {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; color: var(--text-2);
  transition: border-color .2s, color .2s, transform .3s var(--ease);
}
.footer-bottom .socials a:hover { border-color: var(--link); color: var(--link); text-decoration: none; transform: translateY(-2px); }

/* ---------- Page header (portfolio) ---------- */
.page-hero { padding: 140px 0 30px; text-align: center; background: var(--bg); }
.page-hero .eyebrow { font-size: clamp(19px, 2.4vw, 24px); }
.page-hero h1 { font-size: clamp(44px, 6.4vw, 72px); font-weight: 600; letter-spacing: -0.022em; margin: 8px 0 16px; }
.page-hero p { color: var(--text-2); font-size: clamp(19px, 2vw, 21px); max-width: 600px; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--link); font-size: 16px; margin-top: 12px; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .07s; }
.reveal[data-delay="2"] { transition-delay: .14s; }
.reveal[data-delay="3"] { transition-delay: .21s; }
.reveal[data-delay="4"] { transition-delay: .28s; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  /* Minimal closed bar: brand + menu button only */
  .nav-links, .subnav-links { display: none; }
  .nav-cta .btn, .nav-cta .theme-toggle { display: none; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; margin-right: -8px;
    color: var(--text); background: none; border: 0;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle svg { width: 24px; height: 24px; overflow: visible; }
  .nav-toggle svg line {
    transition: transform .35s var(--ease), opacity .2s var(--ease);
    transform-origin: 50% 50%;
  }
  .nav.open .nav-toggle svg line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav.open .nav-toggle svg line:nth-child(2) { opacity: 0; }
  .nav.open .nav-toggle svg line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  /* Full opaque sheet */
  .nav.open {
    position: fixed; inset: 0; height: 100dvh;
    background: var(--bg);
    border-bottom: 0;
    overflow-y: auto;
    transition: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    animation: sheetIn .3s var(--ease);
  }
  @keyframes sheetIn { from { opacity: 0; } to { opacity: 1; } }
  .nav.open .nav-inner {
    flex-direction: column; align-items: stretch;
    height: auto; min-height: 100dvh;
    padding: 0 26px 36px;
  }
  .nav.open .brand { order: 0; height: 64px; align-self: flex-start; }
  .nav.open .nav-cta {
    order: 3; display: flex; flex-direction: column; align-items: stretch;
    gap: 14px; margin-top: auto; padding-top: 28px;
  }
  .nav.open .nav-toggle {
    position: absolute; top: 11px; right: 18px; order: 0;
  }
  .nav.open .nav-cta .btn {
    display: inline-flex; justify-content: center;
    width: 100%; padding: 15px 24px; font-size: 17px;
  }
  .nav.open .nav-cta .theme-toggle {
    display: inline-flex; width: 100%; height: 52px;
    border: 1px solid var(--border); border-radius: var(--r-pill);
    gap: 10px; padding: 0 24px; color: var(--text);
  }
  .nav.open .nav-cta .theme-toggle::after {
    content: "Toggle appearance"; font-size: 16px; font-weight: 500; color: var(--text);
  }
  .nav.open .nav-cta { gap: 12px; }

  .nav.open .nav-links {
    order: 2; display: flex; flex-direction: column;
    align-items: stretch; gap: 0;
    position: static; inset: auto; background: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    border: 0; padding: 0; margin-top: 10px;
  }
  .nav.open .nav-links li {
    border-top: 1px solid var(--border-soft);
    opacity: 0; transform: translateY(10px);
    transition: opacity .45s var(--ease), transform .45s var(--ease);
  }
  .nav.open .nav-links li:last-child { border-bottom: 1px solid var(--border-soft); }
  .nav.open .nav-links li { animation: itemIn .5s var(--ease) forwards; }
  .nav.open .nav-links li:nth-child(1) { animation-delay: .06s; }
  .nav.open .nav-links li:nth-child(2) { animation-delay: .12s; }
  .nav.open .nav-links li:nth-child(3) { animation-delay: .18s; }
  .nav.open .nav-links li:nth-child(4) { animation-delay: .24s; }
  .nav.open .nav-links li:nth-child(5) { animation-delay: .30s; }
  @keyframes itemIn { to { opacity: 1; transform: none; } }
  .nav.open .nav-links a {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; font-size: 22px; font-weight: 500; letter-spacing: -0.02em;
    color: var(--text); padding: 21px 4px;
  }
  .nav.open .nav-links a:hover { color: var(--text); }
  .nav.open .nav-links a::after {
    content: ""; position: static; flex: none;
    left: auto; right: auto; bottom: auto;
    width: 8px; height: 8px;
    background: transparent; border-radius: 0;
    border: 0;
    border-right: 2px solid var(--text-3);
    border-bottom: 2px solid var(--text-3);
    transform: rotate(-45deg);
    transition: border-color .2s var(--ease);
  }
  .nav.open .nav-links a:hover::after { border-color: var(--link); }

  .grid-3, .process-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .split, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .work-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 620px) {
  .grid-3, .grid-2, .process-grid, .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  section { padding: 60px 0; }
  .hero { padding-top: 110px; }
  .hero-actions, .cta-actions { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===========================================================
   BACK OFFICE / ADMIN
   =========================================================== */
.admin-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg-alt); }
.admin-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 40px 36px; }
.admin-card h1 { font-size: 26px; text-align: center; margin: 16px 0 22px; }
.admin-card form { display: grid; gap: 16px; }

.admin-shell { max-width: 1024px; margin: 0 auto; padding: 28px 22px 80px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 20px; margin-bottom: 26px; border-bottom: 1px solid var(--border); }
.admin-top-actions { display: flex; gap: 12px; }
.admin-top-actions .btn { padding: 8px 18px; font-size: 14px; }
.admin-top-actions form { display: inline; }

.admin-flash { padding: 14px 18px; border-radius: var(--r-md); margin-bottom: 24px; font-size: 15px; border: 1px solid var(--border); }
.admin-flash.ok { background: color-mix(in srgb, #1d7a33 12%, var(--surface)); border-color: color-mix(in srgb, #1d7a33 40%, var(--border)); color: #1d7a33; }
.admin-flash.err { background: color-mix(in srgb, #e0484d 12%, var(--surface)); border-color: color-mix(in srgb, #e0484d 40%, var(--border)); color: #e0484d; }

.admin-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.admin-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 30px 32px; }
.admin-block h2 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.admin-hint { color: var(--text-3); font-size: 14px; margin-bottom: 18px; }
.admin-hint code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; color: var(--text); font-size: 13px; }
.admin-block form { display: grid; gap: 15px; margin-top: 14px; }
.admin-block .btn { justify-self: start; }

.admin-list { display: grid; gap: 10px; margin-top: 6px; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.admin-row-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.admin-emoji { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 19px; background: var(--surface-2); }
.admin-row-main b { display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.admin-row-main span { display: block; font-size: 13px; color: var(--text-3); }
.admin-row-main span a { color: var(--link); }
.admin-row-actions { display: flex; align-items: center; gap: 7px; flex: none; }
.admin-row-actions form { display: inline; margin: 0; }
.admin-row-actions button, .edit-toggle {
  font-family: inherit; font-size: 13px; cursor: pointer;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 7px 13px; transition: border-color .2s, color .2s;
}
.admin-row-actions button:hover:not(:disabled), .edit-toggle:hover { color: var(--link); border-color: var(--link); }
.admin-row-actions button:disabled { opacity: .35; cursor: not-allowed; }
.admin-row-actions .danger:hover { color: #e0484d; border-color: #e0484d; }

.admin-block .admin-edit { display: none; gap: 14px; padding: 22px; margin-top: -2px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--r-md) var(--r-md); background: var(--surface-2); }
.admin-block .admin-edit.open { display: grid; }
.admin-add { margin-top: 18px; }
.admin-add summary { cursor: pointer; font-size: 15px; font-weight: 600; color: var(--link); padding: 10px 0; }
.admin-add form { display: grid; gap: 14px; padding-top: 12px; }

/* ---------- Hero 3D layer ---------- */
.hero-3d { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-3d canvas { width: 100%; height: 100%; display: block; }
.work-card { transform-style: preserve-3d; }

/* Mobile: globe becomes its own block between the copy and the next section.
   Only takes space once the scene actually boots (.is-live) -- no dead gap
   for reduced-motion / no-WebGL / no-JS visitors. */
@media (max-width: 980px) {
  .hero { display: flex; flex-direction: column; }
  .hero-inner { order: 1; }
  .hero-3d { display: none; }
  .hero-3d.is-live {
    display: block; order: 2;
    position: static; inset: auto;
    height: clamp(250px, 72vw, 380px);
    margin-top: 4px;
  }
}

/* ===========================================================
   Award polish: split hero, a11y, selection
   =========================================================== */
::selection { background: color-mix(in srgb, var(--link) 24%, transparent); }

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

.skip-link {
  position: fixed; top: -56px; left: 16px; z-index: 300;
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* Split hero composition: copy left, globe right */
@media (min-width: 1081px) {
  .hero { text-align: left; }
  .hero-inner { max-width: var(--maxw); display: grid; grid-template-columns: minmax(0, 600px) 1fr; }
  .hero-inner > * { grid-column: 1; justify-self: start; }
  .hero p.lead { margin-left: 0; margin-right: 0; }
  .hero-actions { justify-content: flex-start; }
}

/* ---------- AI tools marquee ---------- */
.tools-strip { margin-top: 64px; text-align: center; }
.tools-label {
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 22px;
}
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: marqueeScroll 30s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  flex: none;
  font-family: var(--font-brand);
  font-size: 15px; font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 11px 22px; margin-right: 14px;
  border-radius: var(--r-pill);
}
@keyframes marqueeScroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .marquee { -webkit-mask-image: none; mask-image: none; }
  .marquee-track { flex-wrap: wrap; justify-content: center; white-space: normal; }
  .marquee-track span:nth-child(n+9) { display: none; } /* hide the duplicate copy */
}
