/* ==========================================================================
   Karti Kidambi — Portfolio v2
   Design system: dark-first, with a persisted light theme.

   Theme model
   -----------
   :root carries the DARK palette (the brand default). The light palette is
   defined once, in a custom-property block reused by two selectors:
     - [data-theme="light"]                     -> explicit user choice
     - prefers-color-scheme: light, un-overridden -> system default
   Every colour is a token. No component below hardcodes a hex value, so a
   third theme would only need one more block.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens

   Palette: three colours, used for what each is physically capable of.
     #092328  petrol black  — deepest. Body text on light; the canvas on dark.
     #0F3040  petrol navy   — mid. The brand accent on light; raised surfaces
                              on dark.
     #F9E8A2  champagne     — near-white at 0.80 luminance, so it can never be
                              text on a light ground (1.2:1 against white).
                              It earns its keep as a FILL with petrol text on
                              top, and as the accent on dark where it reaches
                              13:1. Every use below respects that.

   Light stays the default, as agreed. Dark is opt-in and is where the palette
   is most itself: petrol black canvas, navy cards, champagne accent.
   -------------------------------------------------------------------------- */

:root {
  /* Surfaces — warmed by the champagne rather than a neutral grey */
  --bg:            #FBFAF5;
  --bg-subtle:     #F3F0E4;
  --surface:       #FFFFFF;
  --surface-hover: #FAF8F0;
  --surface-sunk:  #F0EDE0;

  /* Ink */
  --text:          #092328;
  --text-muted:    #3E5C66;
  --text-faint:    #577178;   /* 4.98:1 on canvas — #5F7A82 fell to 4.38 */

  /* Lines — tinted with the ink so they never read as neutral grey */
  --border:        rgba(9, 35, 40, 0.12);
  --border-strong: rgba(9, 35, 40, 0.24);

  /* Accent — petrol navy carries CTAs, links and the brand */
  --accent:        #0F3040;
  --accent-hover:  #092328;
  --accent-ink:    #F9E8A2;          /* champagne on navy: 11.3:1 */
  --accent-soft:   rgba(15, 48, 64, 0.07);
  --accent-line:   rgba(15, 48, 64, 0.26);

  /* Highlight — champagne as a marker fill, always with petrol text over it */
  --highlight:     #F9E8A2;
  --highlight-ink: #092328;
  --highlight-soft: rgba(249, 232, 162, 0.45);

  /* Data — figures speak in the navy, distinguished from prose by weight */
  --data:          #0F3040;
  --data-soft:     rgba(15, 48, 64, 0.08);

  /* Semantic */
  --live:          #1C6B4C;
  --live-soft:     rgba(28, 107, 76, 0.12);

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(9, 35, 40, 0.06);
  --shadow-md: 0 8px 24px -10px rgba(9, 35, 40, 0.20);
  --shadow-lg: 0 24px 60px -20px rgba(9, 35, 40, 0.26);
  --glow:      0 8px 30px -12px rgba(15, 48, 64, 0.38);

  /* Type */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --shell:      1180px;
  --gutter:     clamp(1.25rem, 5vw, 3rem);
  --section-y:  clamp(5rem, 12vw, 9rem);
  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  22px;

  --ease:  cubic-bezier(0.22, 1, 0.36, 1);
  --swift: 180ms var(--ease);
  --slow:  520ms var(--ease);

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:            #092328;
  --bg-subtle:     #0C2A31;
  --surface:       #0F3040;
  --surface-hover: #143A4C;
  --surface-sunk:  #071D22;

  --text:          #F4EFDC;
  --text-muted:    #AAC0C4;
  --text-faint:    #7E979D;

  --border:        rgba(249, 232, 162, 0.14);
  --border-strong: rgba(249, 232, 162, 0.30);

  /* On petrol black the champagne becomes the accent: 13.3:1 */
  --accent:        #F9E8A2;
  --accent-hover:  #FFF4C4;
  --accent-ink:    #092328;
  --accent-soft:   rgba(249, 232, 162, 0.12);
  --accent-line:   rgba(249, 232, 162, 0.32);

  --highlight:     #F9E8A2;
  --highlight-ink: #092328;
  --highlight-soft: rgba(249, 232, 162, 0.16);

  --data:          #F9E8A2;
  --data-soft:     rgba(249, 232, 162, 0.12);

  --live:          #6FE0A5;
  --live-soft:     rgba(111, 224, 165, 0.15);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px -16px rgba(0, 0, 0, 0.7);
  --glow:      0 8px 40px -14px rgba(249, 232, 162, 0.35);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

/* Components below set display:flex/grid, which would otherwise defeat the
   UA's [hidden] rule. Filtering and every modal depend on this winning. */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;   /* 17px — measurably easier to skim than 16 */
  line-height: 1.72;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--slow), color var(--slow);
}

body.is-locked { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

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

::selection { background: var(--accent); color: var(--accent-ink); }

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

.skip-link {
  position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 200;
  padding: 0.75rem 1.5rem;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: transform var(--swift);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: ""; width: 1.75rem; height: 3px;
  border-radius: 2px;
  background: var(--highlight);
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  margin-top: 1rem;
}

.section-lede {
  max-width: 62ch;
  margin-top: 1.15rem;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.1rem);
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); position: relative; }
.section--tint { background: var(--bg-subtle); }
.section-head { margin-bottom: clamp(2.5rem, 6vw, 4rem); }

.rule {
  height: 1px; border: 0;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* --------------------------------------------------------------------------
   5. Buttons & chips
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  border-radius: 100px;
  font-size: 0.94rem; font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color var(--swift), border-color var(--swift),
              color var(--swift), transform var(--swift), box-shadow var(--swift);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: var(--glow);
}
.btn--primary:hover { background: var(--accent-hover); }

.btn--ghost {
  background: transparent; color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--surface-hover); border-color: var(--accent-line); }

.btn--sm { padding: 0.55rem 1.1rem; font-size: 0.85rem; }

.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface-sunk);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  white-space: nowrap;
}

.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px var(--live-soft);
  flex-shrink: 0;
}
.status-dot--pulse { animation: pulse 2.4s var(--ease) infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--live-soft); }
  50%      { box-shadow: 0 0 0 7px transparent; }
}

/* --------------------------------------------------------------------------
   6. Navigation
   -------------------------------------------------------------------------- */

.nav {
  position: fixed; inset: 0 0 auto 0;
  z-index: 100;
  padding-block: 1rem;
  transition: background-color var(--swift), border-color var(--swift),
              padding var(--swift), backdrop-filter var(--swift);
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  padding-block: 0.6rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom-color: var(--border);
}

.nav__inner {
  display: flex; align-items: center; gap: 1.5rem;
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 700;
  letter-spacing: -0.02em;
  margin-right: auto;
}
.nav__brand span { color: var(--accent); }

.nav__links { display: flex; align-items: center; gap: 0.4rem; }

.nav__link {
  position: relative;
  padding: 0.5rem 0.85rem;
  border-radius: 100px;
  font-size: 0.88rem; font-weight: 500;
  color: var(--text-muted);
  transition: color var(--swift), background-color var(--swift);
}
.nav__link:hover { color: var(--text); background: var(--surface-hover); }
.nav__link.is-active { color: var(--text); }
.nav__link.is-active::after {
  content: ""; position: absolute;
  left: 0.85rem; right: 0.85rem; bottom: 0.25rem; height: 2px;
  background: var(--accent); border-radius: 2px;
}

/* Flagship product capsule buttons in header navigation — highlighted with colour
   so they catch the eye immediately as live products. */
.nav__link--capsule,
.nav__link--star {
  font-weight: 600;
  font-size: 0.84rem;
  padding: 0.38rem 0.85rem 0.38rem 0.7rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 1px 3px rgba(9, 35, 40, 0.08);
  transition: transform var(--swift), box-shadow var(--swift), background-color var(--swift), border-color var(--swift), color var(--swift);
}
.nav__link--capsule:hover,
.nav__link--star:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(9, 35, 40, 0.14);
}
.nav__link--capsule.is-active::after,
.nav__link--star.is-active::after { display: none; }

.nav__star-dot {
  width: 7px; height: 7px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}

/* Switch: warm amber/gold capsule */
.nav__link--switch {
  color: #5C3E00;
  background: #FDF3C7;
  border: 1px solid #F59E0B;
}
.nav__link--switch:hover {
  background: #FDE68A;
  color: #451A03;
  border-color: #D97706;
}
.nav__link--switch .nav__star-dot {
  background: #D97706;
  animation: pulse-amber 2.2s var(--ease) infinite;
}
@keyframes pulse-amber {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.55); }
  50%      { box-shadow: 0 0 0 5px transparent; }
}

/* NutriScan: fresh vibrant mint/emerald capsule */
.nav__link--nutri {
  color: #064E3B;
  background: #D1FAE5;
  border: 1px solid #10B981;
}
.nav__link--nutri:hover {
  background: #A7F3D0;
  color: #022C22;
  border-color: #059669;
}
.nav__link--nutri .nav__star-dot {
  background: #059669;
  animation: pulse-emerald 2.2s var(--ease) infinite;
}
@keyframes pulse-emerald {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55); }
  50%      { box-shadow: 0 0 0 5px transparent; }
}

/* Dark mode overrides for vibrant high-contrast visibility */
[data-theme="dark"] .nav__link--switch {
  color: #FEF3C7;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.22);
}
[data-theme="dark"] .nav__link--switch:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: rgba(245, 158, 11, 0.8);
  color: #FFF;
}
[data-theme="dark"] .nav__link--switch .nav__star-dot {
  background: #FBBF24;
}

[data-theme="dark"] .nav__link--nutri {
  color: #D1FAE5;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.22);
}
[data-theme="dark"] .nav__link--nutri:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: rgba(16, 185, 129, 0.8);
  color: #FFF;
}
[data-theme="dark"] .nav__link--nutri .nav__star-dot {
  background: #34D399;
}

.nav__actions { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--surface);
  transition: color var(--swift), border-color var(--swift), background-color var(--swift);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); }

/* The toggle swaps which glyph is visible per theme. */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav__burger { display: none; }

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding-top: clamp(8rem, 18vw, 11rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
  overflow: hidden;
}

.hero__aura {
  position: absolute; top: -30%; left: 50%;
  width: min(1000px, 130vw); aspect-ratio: 1;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 62%);
  pointer-events: none; z-index: 0;
}

.hero__grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}

.hero__status {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  font-size: 0.8rem; font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.hero__title {
  font-size: clamp(2.6rem, 7.2vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}
.hero__title em {
  font-style: normal;
  color: var(--text);
  /* Marker stroke rather than coloured type: on light, champagne can only
     carry emphasis from behind. On dark it becomes the text colour instead. */
  background: linear-gradient(var(--highlight), var(--highlight)) no-repeat
              left 82% / 100% 0.30em;
  padding-inline: 0.06em;
}
[data-theme="dark"] .hero__title em {
  color: var(--accent);
  background: none;
  padding-inline: 0;
}

.hero__sub {
  max-width: 52ch;
  margin-top: 1.5rem;
  font-size: clamp(1.02rem, 2.1vw, 1.2rem);
  color: var(--text-muted);
  text-wrap: pretty;
}
.hero__sub strong { color: var(--text); font-weight: 600; }

.btn-row {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  margin-top: 2.25rem;
}

.hero__socials {
  display: flex; gap: 0.5rem;
  margin-top: 2rem;
}

/* Portrait */
.hero__portrait { position: relative; justify-self: center; width: 100%; max-width: 340px; }

.portrait-frame {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 0.75rem;
  box-shadow: var(--shadow-lg);
  transition: transform var(--slow), border-color var(--swift);
}
.hero__portrait:hover .portrait-frame {
  transform: translateY(-6px);
  border-color: var(--accent-line);
}
.portrait-frame img {
  width: 100%; aspect-ratio: 1 / 1;
  object-fit: cover; object-position: center top;
  border-radius: calc(var(--radius-lg) - 8px);
  background: var(--bg-subtle);
}
.portrait-frame__meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0.5rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Proof strip */
.proof {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.proof__cell {
  padding: 1.5rem 1.25rem;
  background: var(--bg);
  transition: background-color var(--swift);
}
.proof__cell:hover { background: var(--surface); }
.proof__num {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  background: linear-gradient(var(--highlight), var(--highlight)) no-repeat
              left 90% / 100% 0.34em;
  padding-inline: 0.1em;
}
[data-theme="dark"] .proof__num {
  color: var(--accent);
  background: none;
  padding-inline: 0;
}
.proof__num sup { font-size: 0.5em; color: var(--text-muted); top: -0.7em; }
.proof__label {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   7b. Flagship — Switch
   -------------------------------------------------------------------------- */

.flagship { position: relative; overflow: hidden; }
.flagship::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 70% at 15% 40%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.flagship > * { position: relative; }

.flagship__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.flagship__tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
}

.flagship__title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: -0.04em;
  margin-top: 1.25rem;
}
.flagship__tagline {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-weight: 600; letter-spacing: -0.02em;
  color: var(--accent);
  margin-top: 0.5rem;
}

.flagship__lede {
  max-width: 54ch; margin-top: 1.35rem;
  font-size: clamp(1.02rem, 2.1vw, 1.15rem);
  color: var(--text-muted);
  text-wrap: pretty;
}
.flagship__lede strong { color: var(--text); font-weight: 600; }

.flagship__stats {
  display: grid; grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 2.25rem;
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.flagship__stat-val {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700; letter-spacing: -0.03em; line-height: 1;
  color: var(--text);
  /* Champagne sits behind the figure like a marker stroke, which is the one
     way it can carry weight on a light ground. */
  background: linear-gradient(var(--highlight), var(--highlight)) no-repeat
              left 88% / 100% 0.42em;
  padding-inline: 0.12em;
}
[data-theme="dark"] .flagship__stat-val {
  color: var(--accent);
  background: none;
  padding-inline: 0;
}
.flagship__stat-key {
  margin-top: 0.4rem;
  font-size: 0.78rem; color: var(--text-muted);
  max-width: 16ch; line-height: 1.4;
}

/* Phone -------------------------------------------------------------------- */
.phone {
  justify-self: center;
  width: min(300px, 100%);
  border-radius: 34px;
  padding: 10px;
  box-shadow: var(--shadow-lg);
}
.phone__screen {
  border-radius: 26px;
  background: var(--bg-subtle);
  overflow: hidden;
  border: 1px solid var(--border);
}
.phone__bar {
  display: flex; align-items: center; justify-content: center;
  padding: 0.7rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.phone__notch {
  width: 46px; height: 5px; border-radius: 4px;
  background: var(--border-strong);
}
.phone__head { padding: 1rem 1rem 0.65rem; }
.phone__item {
  font-family: var(--font-display);
  font-size: 0.98rem; font-weight: 600; letter-spacing: -0.01em;
}
.phone__sub {
  font-size: 0.72rem; color: var(--text-faint); margin-top: 0.15rem;
}
.phone__rows { padding: 0.35rem 0.7rem 0.7rem; display: grid; gap: 0.3rem; }

.prow {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
}
.prow__store { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.prow__name {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; font-weight: 500;
}
.prow__eta { display: block; font-size: 0.68rem; color: var(--text-faint); }
.prow__price {
  font-family: var(--font-display);
  font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text-muted);
}
.prow--best {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.prow--best .prow__price { color: var(--accent); font-size: 1.08rem; }
.prow--best .prow__name { color: var(--text); font-weight: 600; }
.prow__flag {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.55rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent);
  padding: 0.1rem 0.35rem; border-radius: 4px;
}
.phone__foot {
  padding: 0.7rem 1rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.7rem; color: var(--text-faint);
  line-height: 1.45;
}
/* Second product section. The phone moves to the left so two consecutive
   product blocks alternate instead of repeating, and a hairline separates
   them because both sit on the plain canvas. */
.flagship + .flagship { border-top: 1px solid var(--border); }
.flagship--reverse .flagship__grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}
.flagship--reverse .flagship__visual { order: -1; }
.flagship--reverse::before {
  background: radial-gradient(ellipse 60% 70% at 85% 40%, var(--accent-soft), transparent 70%);
}

.flagship__tag--alt {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

/* A real product screenshot inside the phone frame, rather than a drawn
   mockup. Cropped above the app's install banner. */
.phone__shot {
  display: block;
  width: 100%;
  height: auto;
}

.flagship__caption {
  margin-top: 0.9rem;
  font-size: 0.72rem; color: var(--text-faint);
  text-align: center;
}

/* Flagship Multi-Stakeholder & Feature Enhancements */
.flagship__eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.flagship__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
}

.flagship__badge--highlight {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Custom Interactive Cursor & Special Element */
@media (hover: hover) and (pointer: fine) {
  body.has-custom-cursor,
  body.has-custom-cursor a,
  body.has-custom-cursor button,
  body.has-custom-cursor input,
  body.has-custom-cursor select,
  body.has-custom-cursor textarea,
  body.has-custom-cursor [role="button"],
  body.has-custom-cursor label {
    cursor: none !important;
  }

  .cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.25s ease, transform 0.15s ease, background-color 0.2s ease;
    will-change: transform, left, top;
  }

  .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--accent);
    background: transparent;
    border-radius: 50%;
    pointer-events: none;
    z-index: 999998;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease, width 0.25s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, border-color 0.25s ease;
    will-change: transform, left, top, width, height;
  }

  [data-theme="dark"] .cursor-dot {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(249, 232, 162, 0.5);
  }

  [data-theme="dark"] .cursor-ring {
    border-color: var(--accent);
    box-shadow: 0 0 14px rgba(249, 232, 162, 0.18);
  }

  .cursor-dot.is-visible,
  .cursor-ring.is-visible {
    opacity: 1;
  }

  /* Hovering over clickable items */
  .cursor-ring.is-hovering {
    width: 48px;
    height: 48px;
    background: var(--accent-soft);
    border-color: var(--accent);
  }

  .cursor-dot.is-hovering {
    transform: translate(-50%, -50%) scale(0.6);
  }

  /* Active / Click effect */
  .cursor-ring.is-clicking {
    width: 24px;
    height: 24px;
    background: var(--accent-line);
    transform: translate(-50%, -50%) scale(0.9);
  }
}

/* Touch devices: hide custom cursor completely */
@media (pointer: coarse), (hover: none) {
  .cursor-dot,
  .cursor-ring {
    display: none !important;
  }
}

.flagship__stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.25rem;
}

.store-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
}

.store-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.flagship__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   8. Work
   -------------------------------------------------------------------------- */

.work__filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.filter {
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  font-size: 0.84rem; font-weight: 500;
  color: var(--text-muted);
  transition: all var(--swift);
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.is-active {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent);
}

.work__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.25rem;
}

.project {
  position: relative;
  display: flex; flex-direction: column;
  padding: 1.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--swift), transform var(--swift), box-shadow var(--swift);
}
.project::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--slow);
}
.project:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.project:hover::before { transform: scaleX(1); }

.project__top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.1rem;
}
.project__badge {
  font-family: var(--font-mono);
  font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  padding: 0.25rem 0.55rem;
  background: var(--accent-soft);
  border-radius: 5px;
}
.project__idx {
  font-family: var(--font-mono);
  font-size: 0.72rem; color: var(--text-faint);
}

.project__name {
  font-size: 1.22rem; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.25;
}
.project.is-featured .project__name { font-size: 1.35rem; }
.project.is-featured .project__badge { background: var(--accent); color: var(--accent-ink); }
.project__badge { background: var(--highlight-soft); color: var(--accent); }

.project__outcome {
  margin-top: 0.7rem;
  font-size: 0.93rem;
  color: var(--text-muted);
  text-wrap: pretty;
}

.project__metrics {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}
.metric__val {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700; letter-spacing: -0.03em;
  color: var(--data);
  line-height: 1.1;
}
.metric__key {
  font-size: 0.73rem; color: var(--text-faint);
  margin-top: 0.15rem;
}

.project__stack {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-top: 1.25rem;
}

.project__foot {
  display: flex; align-items: center; gap: 1.1rem;
  margin-top: auto; padding-top: 1.4rem;
}
.project__link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.84rem; font-weight: 500;
  color: var(--text-muted);
  transition: color var(--swift);
}
.project__link:hover { color: var(--accent); }
.project__more {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.1rem;
  font-size: 0.84rem; font-weight: 600; color: var(--accent);
  cursor: pointer;
}
.project__more:hover { color: var(--accent-hover); }
.project__more svg { transition: transform var(--swift); }
.project:hover .project__more svg { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   9. Stack
   -------------------------------------------------------------------------- */

.stack__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}
.stack-card {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--swift), transform var(--swift);
}
.stack-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }

.stack-card__head {
  display: flex; align-items: center; gap: 0.7rem;
  margin-bottom: 0.4rem;
}
.stack-card__head h3 { font-size: 1.02rem; letter-spacing: -0.01em; }
.stack-card__icon { color: var(--accent); display: grid; place-items: center; }

.stack-card__note {
  font-size: 0.83rem; color: var(--text-faint);
  margin-bottom: 1.15rem;
}
.stack-card__items { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* --------------------------------------------------------------------------
   10. THOR
   -------------------------------------------------------------------------- */

.thor__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

.thor__points { margin-top: 2rem; display: grid; gap: 1.15rem; }
.thor__point { display: flex; gap: 0.9rem; }
.thor__point-icon {
  flex-shrink: 0; margin-top: 0.15rem;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
}
.thor__point h4 { font-size: 0.95rem; margin-bottom: 0.15rem; }
.thor__point p { font-size: 0.87rem; color: var(--text-muted); }

.terminal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunk);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.terminal__bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.terminal__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.terminal__title {
  margin-left: auto; margin-right: auto;
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-faint);
}
.terminal__body {
  padding: 1.25rem;
  min-height: 300px;
  font-family: var(--font-mono);
  font-size: 0.79rem;
  line-height: 1.85;
}
.term-line { word-break: break-word; }
.term-line.is-cmd    { color: var(--text); }
.term-line.is-cmd::before  { content: "$ "; color: var(--accent); }
.term-line.is-out    { color: var(--text-muted); padding-left: 1rem; }
.term-line.is-ok     { color: var(--live); padding-left: 1rem; }
.term-line.is-sys    { color: var(--text-faint); font-style: italic; }
.term-caret {
  display: inline-block; width: 8px; height: 1em;
  background: var(--accent); vertical-align: text-bottom;
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* --------------------------------------------------------------------------
   11. Credentials — education + certifications
   -------------------------------------------------------------------------- */

.creds__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: start;
}

.creds__subhead {
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1.5rem;
}

.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before {
  content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 1px; background: var(--border);
}
.timeline__item { position: relative; padding-bottom: 2rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute;
  left: calc(-1.6rem + 1px); top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border-strong);
}
.timeline__item.is-current::before {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline__when {
  font-family: var(--font-mono); font-size: 0.74rem;
  color: var(--accent); letter-spacing: 0.04em;
}
.timeline__what { font-size: 1rem; font-weight: 600; margin-top: 0.3rem; }
.timeline__where { font-size: 0.87rem; color: var(--text-muted); margin-top: 0.15rem; }
.timeline__note {
  display: inline-block; margin-top: 0.55rem;
  font-family: var(--font-mono); font-size: 0.74rem;
  color: var(--text); padding: 0.2rem 0.55rem;
  background: var(--accent-soft); border-radius: 5px;
}

.cert-list { display: grid; gap: 0.6rem; }
.cert {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color var(--swift), transform var(--swift), background-color var(--swift);
}
.cert:hover {
  border-color: var(--accent-line);
  background: var(--surface-hover);
  transform: translateX(4px);
}
.cert__icon {
  flex-shrink: 0; width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
}
.cert__body { min-width: 0; flex: 1; }
.cert__name { font-size: 0.92rem; font-weight: 600; letter-spacing: -0.01em; }
.cert__issuer { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.1rem; }
.cert__go { flex-shrink: 0; color: var(--text-faint); transition: color var(--swift), transform var(--swift); }
.cert:hover .cert__go { color: var(--accent); transform: translateX(2px); }

/* --------------------------------------------------------------------------
   12. Contact
   -------------------------------------------------------------------------- */

.contact { text-align: center; }
.contact__title {
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: -0.04em;
}
.contact__lede {
  max-width: 50ch; margin: 1.35rem auto 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
}
.contact__cta {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  justify-content: center;
  margin-top: 2.5rem;
}
.contact__direct {
  display: flex; flex-wrap: wrap; gap: 2.5rem;
  justify-content: center;
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.contact__field { text-align: left; }
.contact__key {
  font-family: var(--font-mono); font-size: 0.7rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint);
}
.contact__val {
  display: block; margin-top: 0.3rem;
  font-size: 0.95rem; font-weight: 500;
  transition: color var(--swift);
}
a.contact__val:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--border);
  padding-block: 2.5rem;
  background: var(--bg-subtle);
}
.footer__inner {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 1rem 2rem;
}
.footer__copy { font-size: 0.83rem; color: var(--text-faint); margin-right: auto; }
.footer__links { display: flex; gap: 1.25rem; }
.footer__links a { font-size: 0.83rem; color: var(--text-muted); transition: color var(--swift); }
.footer__links a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   14. Modal (project detail + resume)
   -------------------------------------------------------------------------- */

.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: var(--gutter);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden;
  transition: opacity var(--swift), visibility var(--swift);
}
.modal.is-open { opacity: 1; visibility: visible; }

.modal__panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(86vh, 900px);
  display: flex; flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.985);
  transition: transform var(--slow);
  overflow: hidden;
}
.modal.is-open .modal__panel { transform: none; }
.modal__panel--wide { width: min(1000px, 100%); height: min(88vh, 1000px); }

.modal__head {
  padding: 1.75rem 1.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal__title { font-size: clamp(1.35rem, 3vw, 1.85rem); margin-top: 0.75rem; }
.modal__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }

.modal__close {
  position: absolute; top: 1rem; right: 1rem; z-index: 2;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  transition: color var(--swift), border-color var(--swift);
}
.modal__close:hover { color: var(--text); border-color: var(--border-strong); }

.modal__body { padding: 1.75rem; overflow-y: auto; overscroll-behavior: contain; }
.modal__block + .modal__block { margin-top: 1.75rem; }
.modal__block h4 {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.modal__block p { color: var(--text-muted); font-size: 0.94rem; text-wrap: pretty; }
.modal__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.modal__frame { flex: 1; border: 0; width: 100%; background: var(--surface-sunk); }

/* --------------------------------------------------------------------------
   15. Chat widget
   -------------------------------------------------------------------------- */

.chat-fab {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 150;
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: var(--shadow-md), var(--glow);
  transition: transform var(--swift);
}
.chat-fab:hover { transform: scale(1.07); }
.chat-fab .icon-close { display: none; }
.chat-fab.is-open .icon-chat { display: none; }
.chat-fab.is-open .icon-close { display: block; }

.chat {
  position: fixed; right: 1.5rem; bottom: 5.5rem; z-index: 150;
  width: min(390px, calc(100vw - 3rem));
  height: min(560px, calc(100vh - 8rem));
  display: flex; flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity var(--swift), visibility var(--swift), transform var(--swift);
  overflow: hidden;
}
.chat.is-open { opacity: 1; visibility: visible; transform: none; }

.chat__head {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  flex-shrink: 0;
}
.chat__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.chat__name { font-size: 0.9rem; font-weight: 600; font-family: var(--font-display); }
.chat__state {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; color: var(--text-muted);
}

.chat__log {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 1.1rem;
  display: flex; flex-direction: column; gap: 0.8rem;
}
.msg {
  max-width: 88%;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius);
  font-size: 0.88rem; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word;
}
.msg--bot {
  align-self: flex-start;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg--me {
  align-self: flex-end;
  background: var(--accent); color: var(--accent-ink);
  border-bottom-right-radius: 4px;
}
.msg--err { border-color: var(--accent-line); color: var(--text-muted); }

.typing { display: flex; gap: 4px; padding: 0.85rem 0.95rem; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-faint);
  animation: bounce 1.3s var(--ease) infinite;
}
.typing span:nth-child(2) { animation-delay: 0.16s; }
.typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

.chat__chips {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  padding: 0 1.1rem 0.8rem;
  flex-shrink: 0;
}
.chat__chip {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.76rem; color: var(--text-muted);
  transition: all var(--swift);
}
.chat__chip:hover { color: var(--accent); border-color: var(--accent-line); }

.chat__form {
  display: flex; gap: 0.5rem;
  padding: 0.8rem 1.1rem 1.1rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.chat__input {
  flex: 1; min-width: 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-subtle);
  font-size: 0.86rem;
  transition: border-color var(--swift);
}
.chat__input:focus { outline: none; border-color: var(--accent-line); }
.chat__input::placeholder { color: var(--text-faint); }
.chat__send {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  transition: transform var(--swift), opacity var(--swift);
}
.chat__send:hover { transform: scale(1.07); }
.chat__send:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Notice removed */

/* --------------------------------------------------------------------------
   16b. Motion accents
   -------------------------------------------------------------------------- */

/* Scroll progress — a hairline, so it informs without competing. */
.progress {
  position: fixed; inset: 0 auto auto 0;
  height: 2px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--highlight));
  z-index: 300;
  will-change: transform;
}

/* Cursor glow. Sits behind everything and only ever tints the background,
   which keeps it invisible on touch devices where there is no cursor. */
.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 520px; height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 65%);
  pointer-events: none; z-index: 0;
  opacity: 0;
  transition: opacity 600ms var(--ease);
  will-change: transform;
}
.cursor-glow.is-on { opacity: 1; }

/* Animated gradient border for the flagship.
   Two backgrounds rather than a pseudo element: the first fills the padding
   box with the card colour, the second paints the conic gradient into the
   border box only. A negative-z pseudo element was tried first and vanished —
   .phone creates no stacking context, so the pseudo element slid behind the
   card's own opaque background instead of ringing it. */
.phone {
  position: relative;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--angle, 0deg),
      var(--border) 0deg,
      var(--accent) 85deg,
      var(--highlight) 160deg,
      var(--border) 250deg,
      var(--border) 360deg) border-box;
  animation: spin-border 8s linear infinite;
}
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes spin-border { to { --angle: 360deg; } }

/* Counting numbers reserve their final width so the layout cannot jitter. */
.proof__num { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   17. Scroll reveal
   -------------------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   18. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__portrait { order: -1; max-width: 200px; justify-self: center; margin-bottom: 1.5rem; }
  .thor__grid, .creds__grid, .flagship__grid,
  .flagship--reverse .flagship__grid { grid-template-columns: 1fr; }
  .flagship--reverse .flagship__grid > * { order: initial; }
  .proof { grid-template-columns: repeat(2, 1fr); }
  .stack__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  :root {
    --gutter: 1.15rem;
    --section-y: clamp(3rem, 7vw, 4.25rem);
  }

  /* Section Typography Mobile */
  .section-head {
    margin-bottom: 2rem;
  }
  .section-title {
    font-size: clamp(1.85rem, 6.5vw, 2.35rem);
    letter-spacing: -0.03em;
    line-height: 1.2;
  }
  .section-lede {
    font-size: 0.94rem;
    line-height: 1.55;
    margin-top: 0.75rem;
  }

  /* Navigation Bar */
  .nav {
    padding-block: 0.65rem;
  }
  .nav__inner {
    padding-inline: var(--gutter);
  }
  .nav__burger {
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    z-index: 105;
  }
  .nav__actions {
    gap: 0.45rem;
    z-index: 105;
  }
  .nav__cta-label {
    display: inline-block;
    font-size: 0.82rem;
  }
  #resumeOpen {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    min-height: 38px;
    gap: 0.4rem;
  }

  /* Mobile Drawer Menu */
  .nav__links {
    position: fixed;
    top: 0; left: 0; right: 0;
    max-height: 100vh;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 4.75rem 1.25rem 2rem;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    transform: translateY(-110%);
    visibility: hidden;
    pointer-events: none;
    transition: transform var(--slow), visibility var(--slow);
    z-index: 95;
    overflow-y: auto;
  }
  .nav__links.is-open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }
  .nav__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    min-height: 44px;
    font-size: 1.05rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    color: var(--text);
  }
  .nav__link:hover,
  .nav__link:active {
    background: var(--surface);
  }
  .nav__link--capsule {
    justify-content: flex-start;
    margin-top: 0.25rem;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }
  .nav__link.is-active::after { display: none; }

  /* Hero Section Mobile Polish */
  .hero {
    padding-top: clamp(5.75rem, 14vw, 7.25rem);
    padding-bottom: 2.25rem;
  }
  .hero__portrait {
    order: -1;
    max-width: 190px;
    justify-self: center;
    margin: 0 auto 1.5rem;
  }
  .portrait-frame {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 0.65rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
  }
  .portrait-frame img {
    border-radius: calc(var(--radius-lg) - 6px);
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center top;
    display: block;
    background: var(--bg-subtle);
  }
  .portrait-frame__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.35rem 0.15rem;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--text-faint);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .hero__title {
    font-size: clamp(2rem, 7.2vw, 2.7rem);
    letter-spacing: -0.03em;
    line-height: 1.16;
    text-align: center;
  }
  .hero__status {
    text-align: center;
    justify-content: center;
    margin-inline: auto;
    font-size: 0.78rem;
    padding: 0.3rem 0.85rem;
  }
  .hero__sub {
    font-size: 0.95rem;
    line-height: 1.55;
    text-align: center;
    margin-top: 1rem;
    margin-inline: auto;
    max-width: 44ch;
  }
  .hero .btn-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-top: 1.5rem;
  }
  .hero .btn-row .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 0.95rem;
  }
  .hero__socials {
    justify-content: center;
    margin-top: 1.25rem;
    gap: 0.75rem;
  }
  .hero__socials .icon-btn {
    width: 44px; height: 44px;
  }

  /* Proof Strip Mobile */
  .proof {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 2.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
  }
  .proof__cell {
    padding: 1.15rem 1rem;
  }
  .proof__num {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  .proof__label {
    font-size: 0.75rem;
    line-height: 1.35;
    margin-top: 0.35rem;
  }

  /* Flagship Products (Switch & NutriScan) Mobile */
  .flagship {
    padding-block: var(--section-y);
  }
  .flagship__grid {
    gap: 2.25rem;
  }
  .flagship__title {
    font-size: clamp(2rem, 6.5vw, 2.5rem);
    letter-spacing: -0.03em;
  }
  .flagship__tagline {
    font-size: 1.05rem;
  }
  .flagship__lede {
    font-size: 0.94rem;
    line-height: 1.55;
    margin-top: 1rem;
  }
  .flagship__stores {
    gap: 0.35rem;
    margin-top: 1rem;
  }
  .store-chip {
    font-size: 0.76rem;
    padding: 0.25rem 0.65rem;
  }
  .flagship__stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
  }
  .flagship__stat-val {
    font-size: 1.35rem;
  }
  .flagship__stat-key {
    font-size: 0.7rem;
    line-height: 1.3;
    margin-top: 0.25rem;
  }
  .flagship__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-top: 1.5rem;
    width: 100%;
  }
  .flagship__actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 0.92rem;
  }
  .phone {
    width: min(320px, 100%);
    margin: 0 auto;
    padding: 8px;
    border-radius: 28px;
    box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border);
  }
  .phone__head {
    padding: 0.85rem 0.85rem 0.5rem;
  }
  .phone__rows {
    padding: 0.25rem 0.6rem 0.6rem;
  }
  .prow {
    padding: 0.55rem 0.65rem;
  }
  .prow__name {
    font-size: 0.8rem;
  }
  .prow__price {
    font-size: 0.92rem;
  }

  /* Work Grid & Filters Mobile */
  .work__filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    padding-bottom: 0.5rem;
    padding-inline: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .work__filters::-webkit-scrollbar {
    display: none;
  }
  .filter {
    flex-shrink: 0;
    padding: 0.45rem 0.95rem;
    font-size: 0.82rem;
    min-height: 38px;
    white-space: nowrap;
  }
  .work__grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .project {
    padding: 1.25rem;
    border-radius: var(--radius);
  }
  .project__name {
    font-size: 1.15rem;
  }
  .project__outcome {
    font-size: 0.88rem;
    line-height: 1.45;
  }
  .project__metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.95rem;
  }
  .metric__val {
    font-size: 1.05rem;
  }
  .metric__key {
    font-size: 0.7rem;
  }
  .project__stack {
    margin-top: 1rem;
    gap: 0.35rem;
  }
  .project__stack .chip {
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
  }
  .project__foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
  }
  .project__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 500;
    min-height: 38px;
    padding: 0.45rem 0.85rem;
    border-radius: 100px;
    background: var(--surface-hover);
    color: var(--text);
    border: 1px solid var(--border);
  }
  .project__more {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--accent);
    min-height: 38px;
    padding: 0.45rem 0.65rem;
  }

  /* Technical Stack Mobile */
  .stack__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .stack-card {
    padding: 1.25rem;
    border-radius: var(--radius);
  }
  .stack-card__head h3 {
    font-size: 1.1rem;
  }
  .stack-card__note {
    font-size: 0.82rem;
    margin-top: 0.25rem;
    margin-bottom: 0.85rem;
  }
  .stack-card__items {
    gap: 0.4rem;
  }
  .stack-card__items .chip {
    font-size: 0.76rem;
    padding: 0.3rem 0.65rem;
  }

  /* THOR & Terminal Mobile */
  .thor__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .thor__points {
    margin-top: 1.5rem;
    gap: 1rem;
  }
  .thor__point p {
    font-size: 0.85rem;
    line-height: 1.45;
  }
  .thor .btn-row {
    margin-top: 1.5rem;
  }
  .thor .btn-row .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }
  .terminal {
    border-radius: var(--radius);
    margin-top: 0.5rem;
  }
  .terminal__bar {
    padding: 0.65rem 0.85rem;
  }
  .terminal__title {
    font-size: 0.72rem;
  }
  .terminal__body {
    padding: 0.85rem;
    font-size: 0.76rem;
    line-height: 1.55;
    min-height: 240px;
  }

  /* Credentials Mobile */
  .creds__grid {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }
  .creds__subhead {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
  }
  .cert {
    padding: 0.9rem 1rem;
    gap: 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
  }
  .cert__icon {
    width: 32px; height: 32px;
    border-radius: 8px;
  }
  .cert__name {
    font-size: 0.9rem;
    font-weight: 600;
  }
  .cert__issuer {
    font-size: 0.75rem;
    line-height: 1.35;
    margin-top: 0.15rem;
  }

  /* Contact & Direct Info Mobile */
  .contact__cta {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
    margin-top: 1.75rem;
  }
  .contact__cta .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 0.95rem;
  }
  .contact__direct {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: left;
  }
  .contact__field {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.65rem;
  }
  .contact__key {
    font-size: 0.72rem;
  }
  .contact__val {
    text-align: right;
    font-size: 0.9rem;
  }

  /* Footer Mobile */
  .footer__inner {
    flex-direction: column-reverse;
    gap: 1.25rem;
    text-align: center;
  }
  .footer__links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
  }

  /* Modals Mobile */
  .modal {
    padding: 0.75rem;
  }
  .modal__panel {
    max-height: 92vh;
    border-radius: var(--radius);
  }
  .modal__head {
    padding: 1.25rem 1.25rem 1rem;
  }
  .modal__title {
    font-size: 1.35rem;
  }
  .modal__body {
    padding: 1.25rem;
  }
  .modal__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .modal__actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  /* Chat Widget Mobile */
  .chat {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 4.75rem;
    width: auto;
    max-width: none;
    height: min(490px, calc(100vh - 6.5rem));
    border-radius: var(--radius);
  }
  .chat-fab {
    right: 1rem;
    bottom: 1rem;
    width: 50px;
    height: 50px;
  }
  .chat__input {
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: 2.15rem;
  }
  .flagship__stats {
    grid-template-columns: 1fr;
    gap: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
  }
  .flagship__stats > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }
  .flagship__stat-val {
    font-size: 1.25rem;
  }
  .flagship__stat-key {
    font-size: 0.74rem;
    text-align: right;
    margin-top: 0;
    max-width: 65%;
  }
}

/* --------------------------------------------------------------------------
   19. Motion & print
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .phone { animation: none; }
  .cursor-glow { display: none; }
}

@media print {
  .nav, .chat, .chat-fab, .hero__aura, .work__filters,
  .project__more, .modal { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding-block: 1.5rem; break-inside: avoid; }
  .project { break-inside: avoid; border-color: #ccc; }
  a::after { content: " (" attr(href) ")"; font-size: 0.75em; color: #555; }
}
