/* ==========================================================================
   Afaque Jaya — Project Showcase
   A dark companion to the paper-toned portfolio: same type families and
   signal-orange accent, near-black stage, restrained surfaces.
   No framework. Tokens first, then base, layout, components, pages.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Surfaces */
  --bg: #0b0c0e;
  --bg-2: #111316;
  --surface: #15171b;
  --surface-2: #1b1e23;
  --surface-3: #23272d;
  --line: rgba(243, 239, 231, 0.08);
  --line-2: rgba(243, 239, 231, 0.14);
  --line-3: rgba(243, 239, 231, 0.24);

  /* Text */
  --text: #f3efe7;
  --text-2: #cfc9bf;
  --muted: #9a958c;
  --faint: #6e6a63;

  /* Brand */
  --accent: #ff5b24;
  --accent-2: #ff8a5c;
  --accent-soft: rgba(255, 91, 36, 0.12);

  /* Category hues — muted so the grid never turns into a rainbow */
  --c-mobile: #6b9cf5;
  --c-web: #4fc1b0;
  --c-saas: #e2a54a;
  --c-ai: #b493f0;
  --c-agents: #ff7a4a;
  --c-backend: #8fb36b;
  --c-experiments: #c9a7a0;

  /* Status */
  --s-live: #5fd18b;
  --s-shipped: #9fb1c8;
  --s-dev: #e2a54a;
  --s-proto: #b493f0;
  --s-learning: #c9a7a0;

  /* Type */
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Geist", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  /* Layout */
  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1240px;
  --section-y: clamp(72px, 10vw, 136px);
  --radius: 20px;
  --radius-sm: 12px;
  --nav-h: 64px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.45s;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
::selection { background: var(--accent); color: #fff; }

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

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

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.25s var(--ease);
}
.skip-link:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.serif { font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }

/* Ambient backdrop: one soft light + a faint grid, fixed so it costs nothing on scroll */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vw 40vw at 85% -10%, rgba(255, 91, 36, 0.09), transparent 70%),
    radial-gradient(50vw 40vw at -10% 30%, rgba(107, 156, 245, 0.06), transparent 70%),
    var(--bg);
}
.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 65%);
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 65%);
  opacity: 0.55;
}

/* --------------------------------------------------------------------------
   Shared atoms: eyebrow, buttons, chips, status, category label
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .num { color: var(--accent); }
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--line-3);
}

.section { padding-block: var(--section-y); }
.section-head { display: grid; gap: 16px; max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.split { max-width: none; grid-template-columns: minmax(0, 1fr); align-items: end; }
@media (min-width: 900px) {
  .section-head.split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 48px; }
}
.section-title {
  font-family: var(--f-display);
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.section-lead { color: var(--text-2); font-size: clamp(1rem, 1.3vw, 1.1rem); max-width: 560px; }

.btn {
  --b-bg: var(--text);
  --b-fg: var(--bg);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--b-bg);
  color: var(--b-fg);
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), color 0.3s, border-color 0.3s;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: translateY(101%);
  transition: transform 0.4s var(--ease);
}
.btn .arrow { transition: transform 0.3s var(--ease); }
.btn.ghost { --b-bg: transparent; --b-fg: var(--text); border-color: var(--line-3); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(255, 91, 36, 0.6); color: #fff; border-color: transparent; }
  .btn:hover::before { transform: none; }
  .btn:hover .arrow { transform: translateX(3px); }
  .btn:hover .arrow.up { transform: translate(2px, -2px); }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(243, 239, 231, 0.03);
  color: var(--text-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.chip.more { color: var(--muted); border-style: dashed; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.status {
  --s: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--s);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--s);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--s) 22%, transparent);
}
.status[data-status="live"] { --s: var(--s-live); }
.status[data-status="shipped"] { --s: var(--s-shipped); }
.status[data-status="in-development"] { --s: var(--s-dev); }
.status[data-status="prototype"] { --s: var(--s-proto); }
.status[data-status="learning"] { --s: var(--s-learning); }

.cat-label {
  --c: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: color-mix(in srgb, var(--c) 80%, var(--text));
}
.cat-label i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--c);
  transform: rotate(45deg);
}

[data-cat="mobile"] { --c: var(--c-mobile); }
[data-cat="web"] { --c: var(--c-web); }
[data-cat="saas"] { --c: var(--c-saas); }
[data-cat="ai"] { --c: var(--c-ai); }
[data-cat="agents"] { --c: var(--c-agents); }
[data-cat="backend"] { --c: var(--c-backend); }
[data-cat="experiments"] { --c: var(--c-experiments); }

.vis-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.vis-note svg { width: 15px; height: 15px; flex: none; }

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.nav.is-stuck {
  background: rgba(11, 12, 14, 0.78);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
}
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; flex: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.brand-name { font-family: var(--f-display); font-weight: 600; font-size: 15px; letter-spacing: -0.02em; line-height: 1.1; }
.brand-name small { display: block; font-family: var(--f-body); font-weight: 400; font-size: 11.5px; color: var(--muted); letter-spacing: 0; }

.nav-links { display: none; margin-left: auto; align-items: center; gap: 2px; }
.nav-links a {
  position: relative;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--text); background: rgba(243, 239, 231, 0.05); }
.nav-links a[aria-current="true"] { color: var(--text); background: rgba(243, 239, 231, 0.08); }
.nav-cta { display: none; }
@media (min-width: 1080px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
}

.menu-btn {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
}
.menu-btn .bars, .menu-btn .bars::before, .menu-btn .bars::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.menu-btn .bars { position: relative; }
.menu-btn .bars::before, .menu-btn .bars::after { content: ""; position: absolute; left: 0; }
.menu-btn .bars::before { top: -6px; }
.menu-btn .bars::after { top: 6px; }
.menu-btn[aria-expanded="true"] .bars { background: transparent; }
.menu-btn[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }
@media (min-width: 1080px) { .menu-btn { display: none; } }

.menu {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 49;
  padding: 20px var(--gutter) 32px;
  background: rgba(11, 12, 14, 0.97);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.3s var(--ease);
}
.menu.is-open { opacity: 1; transform: none; }
.menu[hidden] { display: none; }
.menu ol { display: grid; gap: 2px; counter-reset: m; }
.menu li a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 6vw, 2rem);
  letter-spacing: -0.03em;
}
.menu li a::before {
  counter-increment: m;
  content: counter(m, decimal-leading-zero);
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--accent);
}
.menu-foot { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
body.menu-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding-top: clamp(40px, 8vw, 96px); padding-bottom: clamp(48px, 7vw, 88px); }
.hero-grid { display: grid; gap: clamp(32px, 5vw, 64px); align-items: center; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); } }

.hero-who { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; color: var(--text-2); font-size: 14px; }
.hero-who .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px var(--line-2); }
.hero-who b { color: var(--text); font-weight: 600; }
.hero-who .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }

.hero h1 {
  margin-top: 22px;
  font-family: var(--f-display);
  font-size: clamp(2.6rem, 7.2vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  text-wrap: balance;
}
.hero h1 .serif { color: var(--accent-2); }
.hero-lead { margin-top: 22px; max-width: 600px; font-size: clamp(1.02rem, 1.5vw, 1.2rem); color: var(--text-2); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

.hero-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(36px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}
@media (min-width: 720px) { .hero-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hero-facts li { padding: 18px 20px; background: var(--bg-2); }
.hero-facts b { display: block; font-family: var(--f-display); font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.04em; line-height: 1; }
.hero-facts b em { font-style: normal; color: var(--accent); }
.hero-facts span { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.hero-facts-src { margin-top: 10px; font-size: 12px; color: var(--faint); }

/* Hero visual: an orbit of product categories around one engineer */
.orbit {
  position: relative;
  aspect-ratio: 1;
  width: min(100%, 480px);
  margin-inline: auto;
}
.orbit svg { width: 100%; height: 100%; overflow: visible; }
.orbit .ring { fill: none; stroke: var(--line-2); stroke-width: 1; }
.orbit .ring.dash { stroke-dasharray: 2 6; }
.orbit .link { fill: none; stroke: var(--line-3); stroke-width: 1; }
.orbit .pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 10 400;
  animation: pulse-run 5.5s linear infinite;
  opacity: 0.85;
}
@keyframes pulse-run { from { stroke-dashoffset: 410; } to { stroke-dashoffset: 0; } }
.orbit .core-ring { fill: rgba(255, 91, 36, 0.06); stroke: rgba(255, 91, 36, 0.4); }
.orbit .spin { transform-origin: 240px 240px; animation: spin 80s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.orbit-core {
  position: absolute;
  left: 50%; top: 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2a2d33, #121418);
  box-shadow: 0 0 0 1px var(--line-2), 0 30px 60px -20px rgba(255, 91, 36, 0.45);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  letter-spacing: -0.04em;
}
.orbit-node {
  --c: var(--muted);
  position: absolute;
  translate: -50% -50%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
  background: rgba(21, 23, 27, 0.9);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 10px 30px -18px #000;
  transition: border-color 0.3s, transform 0.3s var(--ease), background 0.3s;
}
.orbit-node i { width: 7px; height: 7px; border-radius: 2px; background: var(--c); transform: rotate(45deg); }
.orbit-node b { font-family: var(--f-mono); font-weight: 500; font-size: 11px; color: var(--muted); }
a.orbit-node:hover { border-color: var(--c); background: var(--surface-2); transform: translateY(-2px); }

/* --------------------------------------------------------------------------
   Featured case studies (editorial)
   -------------------------------------------------------------------------- */
.featured-list { display: grid; gap: clamp(20px, 3vw, 32px); }
.feature {
  --c: var(--accent);
  position: relative;
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  overflow: hidden;
}
@media (min-width: 980px) {
  .feature { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 520px; }
  .feature:nth-child(even) .feature-media { order: 2; }
}
.feature-media {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: clamp(20px, 3vw, 40px);
  background:
    radial-gradient(80% 70% at 50% 60%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%),
    var(--bg-2);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
@media (min-width: 980px) {
  .feature-media { border-bottom: 0; border-right: 1px solid var(--line); }
  .feature:nth-child(even) .feature-media { border-right: 0; border-left: 1px solid var(--line); }
}
.feature-body { padding: clamp(24px, 3.4vw, 48px); display: flex; flex-direction: column; gap: 18px; }
.feature-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.feature h3 { font-family: var(--f-display); font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -0.04em; line-height: 1.04; }
.feature h3 small { display: block; margin-top: 8px; font-family: var(--f-body); font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.feature-cols { display: grid; gap: 16px; }
@media (min-width: 640px) { .feature-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.feature-cols h4, .mini-h {
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.feature-cols p { color: var(--text-2); font-size: 14.5px; }
.feature-points { display: grid; gap: 8px; }
.feature-points li { position: relative; padding-left: 18px; font-size: 14.5px; color: var(--text-2); }
.feature-points li::before { content: ""; position: absolute; left: 2px; top: 0.65em; width: 6px; height: 6px; border-radius: 2px; background: var(--c); transform: rotate(45deg); }
.feature-points b { color: var(--text); font-weight: 600; }
.outcomes { display: flex; flex-wrap: wrap; gap: 10px; }
.outcome {
  flex: 1 1 120px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(243, 239, 231, 0.02);
}
.outcome b { display: block; font-family: var(--f-display); font-size: 1.5rem; letter-spacing: -0.04em; line-height: 1; }
.outcome span { display: block; margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.feature-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 6px; }

/* --------------------------------------------------------------------------
   Media: screenshots, device frames, browser frames, generated illustration
   -------------------------------------------------------------------------- */
.device {
  position: relative;
  width: min(220px, 46%);
  padding: 7px;
  border-radius: 30px;
  background: #050506;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 40px 70px -30px rgba(0, 0, 0, 0.9);
}
.device img { width: 100%; border-radius: 23px; background: var(--surface-2); }
.devices { display: flex; align-items: center; justify-content: center; gap: 0; width: 100%; }
.devices .device:nth-child(2) { margin-left: -16%; transform: translateY(8%) scale(0.86); z-index: -1; opacity: 0.92; }
.devices .device:nth-child(3) { margin-left: -16%; transform: translateY(-6%) scale(0.86); z-index: -2; opacity: 0.85; }
.devices { isolation: isolate; }

.browser-frame {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  overflow: hidden;
  box-shadow: 0 40px 70px -40px rgba(0, 0, 0, 0.9);
}
.browser-frame .bar { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.browser-frame .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); }
.browser-frame .bar span { margin-left: 6px; font-family: var(--f-mono); font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser-frame img { width: 100%; }

.logo-plate {
  display: grid;
  place-items: center;
  gap: 18px;
  text-align: center;
}
.logo-plate img { max-width: min(260px, 70%); border-radius: 18px; }
.logo-plate img.square { width: 120px; border-radius: 28px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9); }

/* Generated illustration — used when a project has no public screenshots.
   It is deliberately abstract so it can't be mistaken for a product UI. */
.illus {
  --c: var(--accent);
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(70% 60% at 50% 55%, color-mix(in srgb, var(--c) 16%, transparent), transparent 75%),
    var(--bg-2);
}
.illus svg.pattern { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--c); opacity: 0.5; }
.illus .glyph {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, var(--surface)), var(--surface));
  color: color-mix(in srgb, var(--c) 75%, #fff);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.9);
}
.illus .glyph svg { width: 34px; height: 34px; }
.illus .illus-tag {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   Discovery dashboard: toolbar, chips, grid, empty state
   -------------------------------------------------------------------------- */
.explore-shell {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: rgba(17, 19, 22, 0.7);
  padding: clamp(14px, 2vw, 22px);
}
.toolbar { display: grid; gap: 12px; }
@media (min-width: 860px) { .toolbar { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; } }

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search svg { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%;
  min-height: 50px;
  padding: 0 44px 0 46px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--muted);
}
.search .clear:hover { color: var(--text); background: var(--surface-2); }
.search .clear[hidden] { display: none; }
.search kbd {
  position: absolute;
  right: 12px;
  padding: 2px 7px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--faint);
}
@media (hover: none) { .search kbd { display: none; } }

.select {
  position: relative;
  display: flex;
  align-items: center;
}
.select select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 50px;
  width: 100%;
  padding: 0 40px 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  font-size: 14px;
  cursor: pointer;
}
.select select:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 0 0 4px var(--accent-soft); }
.select::after {
  content: "";
  position: absolute;
  right: 16px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  pointer-events: none;
}
.select option { background: var(--surface); color: var(--text); }
.toolbar-selects { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (min-width: 860px) { .toolbar-selects { display: contents; } .select { min-width: 180px; } }

.cat-chips {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent);
  mask-image: linear-gradient(90deg, #000 92%, transparent);
  padding-bottom: 2px;
}
.cat-chips::-webkit-scrollbar { display: none; }
@media (min-width: 1100px) { .cat-chips { flex-wrap: wrap; -webkit-mask-image: none; mask-image: none; } }
.cat-chip {
  --c: var(--text);
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: 14px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.cat-chip i { width: 7px; height: 7px; border-radius: 2px; background: var(--c); transform: rotate(45deg); opacity: 0.8; }
.cat-chip[data-cat="all"] i { display: none; }
.cat-chip .n { font-family: var(--f-mono); font-size: 11.5px; color: var(--faint); }
.cat-chip:hover { color: var(--text); border-color: var(--line-3); }
.cat-chip[aria-pressed="true"] {
  color: var(--text);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 12%, transparent);
}
.cat-chip[aria-pressed="true"] .n { color: var(--text-2); }
.cat-chip[data-cat="all"][aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.cat-chip[data-cat="all"][aria-pressed="true"] .n { color: var(--surface-3); }

.results-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: clamp(20px, 3vw, 28px) 2px 16px;
}
.results-count { font-size: 14px; color: var(--muted); }
.results-count b { color: var(--text); font-weight: 600; }
.reset-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--accent-2);
  border-radius: 6px;
}
.reset-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.reset-link[hidden] { display: none; }

.cat-desc { margin: 0 2px; font-size: 14px; color: var(--text-2); max-width: 760px; }
.cat-desc:empty { display: none; }

.grid {
  display: grid;
  gap: clamp(14px, 1.8vw, 22px);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Project card */
.card {
  --c: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card.is-entering { animation: card-in 0.5s var(--ease) both; animation-delay: var(--i, 0ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } }
@media (hover: hover) {
  .card:hover { border-color: color-mix(in srgb, var(--c) 40%, var(--line-2)); transform: translateY(-4px); box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.9); }
  .card:hover .thumb img, .card:hover .thumb .device { transform: scale(1.035); }
  .card:hover .card-go .arrow { transform: translate(2px, -2px); }
}
.card:focus-within { border-color: color-mix(in srgb, var(--c) 50%, var(--line-2)); }

.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.thumb > img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.thumb .illus { position: absolute; inset: 0; }
.thumb.is-phone {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  padding-top: 22px;
  background:
    radial-gradient(70% 80% at 50% 100%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%),
    var(--bg-2);
}
.thumb.is-phone .device {
  width: 34%;
  padding: 5px;
  border-radius: 20px 20px 0 0;
  margin-bottom: -40%;
  transition: transform 0.6s var(--ease);
}
.thumb.is-phone .device img { border-radius: 15px 15px 0 0; }
.thumb.is-phone .device + .device { margin-bottom: -50%; opacity: 0.8; }
.thumb.is-web { padding: 18px 18px 0; display: flex; align-items: flex-end;
  background: radial-gradient(70% 80% at 50% 100%, color-mix(in srgb, var(--c) 22%, transparent), transparent 70%), var(--bg-2); }
.thumb.is-web .browser-frame { border-radius: 10px 10px 0 0; border-bottom: 0; transition: transform 0.6s var(--ease); transform-origin: bottom center; }
.thumb.is-web .browser-frame .bar { height: 22px; }
.thumb.is-web .browser-frame .bar i { width: 7px; height: 7px; }
.card:hover .thumb.is-web .browser-frame { transform: translateY(-4px); }
.thumb.is-logo { display: grid; place-items: center;
  background: radial-gradient(70% 70% at 50% 50%, color-mix(in srgb, var(--c) 18%, transparent), transparent 75%), var(--bg-2); }
.thumb.is-logo img { width: auto; height: auto; max-width: 52%; max-height: 46%; object-fit: contain; border-radius: 14px; }
.thumb.is-logo img.square { max-height: 52%; border-radius: 22px; box-shadow: 0 20px 40px -20px #000; }

.thumb-badges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.thumb-badges .pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(11, 12, 14, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-2);
}
.thumb-badges .pill.star { color: var(--accent-2); font-size: 12px; gap: 6px; }

.card-body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 18px 20px 20px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.card h3 { font-family: var(--f-display); font-size: 1.32rem; letter-spacing: -0.03em; line-height: 1.15; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card is the hit area */
.card h3 a:focus-visible { outline: none; }
.card h3 a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.card .value { font-size: 14.5px; color: var(--text); line-height: 1.45; }
.card .ps { font-size: 13.5px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .chips { margin-top: auto; padding-top: 4px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.card-go { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text); }
.card-go .arrow { transition: transform 0.3s var(--ease); color: var(--accent-2); }
.card-ext { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line-2); }
.card-ext:hover { color: var(--text); border-color: var(--line-3); }

.empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: clamp(40px, 6vw, 72px) 20px;
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}
.empty[hidden] { display: none; }
.empty .empty-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); color: var(--muted); }
.empty .empty-ico svg { width: 26px; height: 26px; }
.empty h3 { font-family: var(--f-display); font-size: 1.4rem; letter-spacing: -0.03em; }
.empty p { color: var(--muted); max-width: 420px; }

/* --------------------------------------------------------------------------
   Architecture diagram (pure HTML/CSS flow)
   -------------------------------------------------------------------------- */
.arch {
  --c: var(--accent);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(60% 80% at 50% 0%, color-mix(in srgb, var(--c) 8%, transparent), transparent 70%),
    var(--bg-2);
  padding: clamp(16px, 2.4vw, 28px);
}
.arch-flow { position: relative; display: grid; gap: 10px; counter-reset: step; }
@media (min-width: 860px) {
  .arch-flow { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 14px; }
}
.arch-node {
  position: relative;
  padding: 14px 14px 14px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
}
.arch-node::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--c);
}
.arch-node b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.arch-node span { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.arch-node.is-hot { border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
/* connectors */
.arch-node:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 1px;
  height: 10px;
  background: var(--line-3);
}
@media (min-width: 860px) {
  .arch-node:not(:last-child)::after { left: auto; right: -15px; top: 50%; bottom: auto; width: 14px; height: 1px; }
}
.arch-guard {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.arch-guard span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--text-2);
}
.arch-guard span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--s-live); }
.arch-caption { margin-top: 12px; font-size: 12.5px; color: var(--faint); }

/* --------------------------------------------------------------------------
   About & contact
   -------------------------------------------------------------------------- */
.about-grid { display: grid; gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (min-width: 900px) { .about-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); } }
.about-card {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.about-card img { width: 84px; height: 84px; border-radius: 20px; object-fit: cover; }
.about-card b { display: block; font-family: var(--f-display); font-size: 1.3rem; letter-spacing: -0.03em; }
.about-card span { display: block; font-size: 13.5px; color: var(--muted); }
.about-copy { display: grid; gap: 16px; color: var(--text-2); font-size: 1.04rem; }
.about-copy .lead { font-family: var(--f-display); font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.2; letter-spacing: -0.03em; color: var(--text); }
.timeline-mini { display: grid; gap: 0; margin-top: 22px; border-top: 1px solid var(--line); }
.timeline-mini li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline-mini time { font-family: var(--f-mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.timeline-mini b { color: var(--text); font-weight: 600; }
.timeline-mini span { color: var(--muted); }

.contact-card {
  position: relative;
  display: grid;
  gap: 24px;
  padding: clamp(28px, 5vw, 64px);
  border: 1px solid var(--line-2);
  border-radius: calc(var(--radius) + 10px);
  background:
    radial-gradient(70% 120% at 100% 0%, rgba(255, 91, 36, 0.16), transparent 60%),
    var(--surface);
  overflow: hidden;
}
@media (min-width: 900px) { .contact-card { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); align-items: end; } }
.contact-card h2 { font-family: var(--f-display); font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -0.045em; line-height: 1.02; }
.contact-card p { margin-top: 14px; color: var(--text-2); max-width: 520px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.profile-links { display: grid; gap: 8px; }
.profile-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(11, 12, 14, 0.4);
  transition: border-color 0.2s, background 0.2s;
}
.profile-links a:hover { border-color: var(--line-3); background: rgba(11, 12, 14, 0.7); }
.profile-links small { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.profile-links span { font-size: 15px; }
.profile-links svg { width: 18px; height: 18px; color: var(--muted); flex: none; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-block: 28px 40px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.footer a:hover { color: var(--text); }
.footer nav { display: flex; flex-wrap: wrap; gap: 18px; }

/* --------------------------------------------------------------------------
   Project detail page
   -------------------------------------------------------------------------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs span[aria-hidden] { color: var(--faint); }

.d-hero { padding-top: clamp(28px, 5vw, 56px); padding-bottom: clamp(28px, 4vw, 48px); }
.d-head { display: grid; gap: 18px; margin-top: 22px; }
@media (min-width: 980px) { .d-head { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); align-items: end; gap: 48px; } }
.d-title-row { display: flex; align-items: center; gap: 18px; }
.d-icon { width: 72px; height: 72px; border-radius: 20px; flex: none; box-shadow: 0 0 0 1px var(--line-2), 0 20px 40px -20px #000; }
.d-head h1 { font-family: var(--f-display); font-size: clamp(2.3rem, 6vw, 4.4rem); letter-spacing: -0.05em; line-height: 1; }
.d-tagline { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-2); max-width: 680px; }
.d-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.d-links { display: flex; flex-wrap: wrap; gap: 10px; }
.d-links-col { display: grid; gap: 12px; justify-items: start; }
@media (min-width: 980px) { .d-links-col { justify-items: end; } .d-links { justify-content: flex-end; } }

.d-media {
  --c: var(--accent);
  margin-top: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(70% 90% at 50% 100%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%),
    var(--bg-2);
  padding: clamp(20px, 4vw, 48px);
  overflow: hidden;
}
.d-media .devices .device { width: min(240px, 30%); }
.d-media .browser-frame { max-width: 980px; margin-inline: auto; }
.d-media .illus { min-height: 260px; border-radius: var(--radius); }
.d-media-caption { margin-top: 16px; text-align: center; font-size: 13px; color: var(--muted); }

.gallery {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.gallery figure { margin: 0; flex: none; scroll-snap-align: start; }
.gallery .g-phone { width: clamp(170px, 22vw, 230px); }
.gallery .g-web { width: min(640px, 82vw); }
.gallery img { width: 100%; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface-2); }
.gallery figcaption { margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.gallery-wrap { position: relative; }
.gallery-btns { display: flex; gap: 8px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  color: var(--text-2);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-3); }
.icon-btn svg { width: 18px; height: 18px; }

.d-layout { display: grid; gap: clamp(32px, 5vw, 64px); padding-bottom: var(--section-y); }
@media (min-width: 1040px) { .d-layout { grid-template-columns: 220px minmax(0, 1fr); } }
.toc { display: none; }
@media (min-width: 1040px) {
  .toc { display: block; position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; }
}
.toc p { margin-bottom: 10px; }
.toc ol { display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 1px solid transparent; font-size: 13.5px; color: var(--muted); transition: color 0.2s, border-color 0.2s; }
.toc a:hover { color: var(--text); }
.toc a[aria-current="true"] { color: var(--text); border-left-color: var(--accent); }

.d-sections { display: grid; gap: clamp(36px, 5vw, 56px); min-width: 0; }
.d-sec { display: grid; gap: 16px; scroll-margin-top: calc(var(--nav-h) + 20px); }
.d-sec > h2 { font-family: var(--f-display); font-size: clamp(1.45rem, 2.6vw, 1.9rem); letter-spacing: -0.035em; line-height: 1.15; display: flex; align-items: baseline; gap: 14px; }
.d-sec > h2 .n { font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--accent); letter-spacing: 0.04em; }
.d-sec .prose { display: grid; gap: 12px; color: var(--text-2); max-width: 760px; font-size: 1.02rem; }
.d-sec .prose strong { color: var(--text); font-weight: 600; }

.ps-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .ps-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ps-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.ps-card p { color: var(--text-2); font-size: 15px; }
.ps-card.is-solution { border-color: color-mix(in srgb, var(--c, var(--accent)) 30%, var(--line)); }

.feat-grid { display: grid; gap: 12px; }
@media (min-width: 760px) { .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feat {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.feat b { display: block; font-size: 15px; font-weight: 600; }
.feat span { display: block; margin-top: 4px; font-size: 14px; color: var(--muted); }
.feat .tagline { display: inline-flex; margin-top: 10px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--s-dev); }

.role-list { display: grid; gap: 10px; max-width: 760px; }
.role-list li { position: relative; padding-left: 22px; color: var(--text-2); }
.role-list li::before { content: ""; position: absolute; left: 0; top: 0.7em; width: 10px; height: 1px; background: var(--accent); }

.stack-groups { display: grid; gap: 12px; }
@media (min-width: 760px) { .stack-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stack-group { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.stack-group .chips { margin-top: 10px; }

.challenge { display: grid; gap: 6px; padding: 18px 20px; border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: 4px 14px 14px 4px; background: var(--surface); }
.challenge b { font-weight: 600; }
.challenge p { color: var(--text-2); font-size: 15px; }
.challenge p.how { color: var(--muted); font-size: 14px; }

.tradeoff { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tradeoff b { font-weight: 600; }
.tradeoff p { color: var(--text-2); font-size: 14.5px; }
.tradeoff .cost { color: var(--muted); font-size: 13.5px; }
.tradeoff .cost::before { content: "Trade-off · "; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--s-dev); }

.impact-list { display: grid; gap: 10px; }
@media (min-width: 640px) { .impact-list { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.impact-src { font-size: 12.5px; color: var(--faint); }

.callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(243, 239, 231, 0.03);
  color: var(--text-2);
  font-size: 14.5px;
}
.callout svg { width: 20px; height: 20px; flex: none; color: var(--muted); margin-top: 2px; }
.callout.is-warn svg { color: var(--s-dev); }

.link-list { display: grid; gap: 10px; }
@media (min-width: 640px) { .link-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
.link-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s, transform 0.3s var(--ease);
}
.link-tile:hover { border-color: var(--line-3); background: var(--surface-2); transform: translateY(-2px); }
.link-tile .li { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); flex: none; }
.link-tile .li svg { width: 20px; height: 20px; }
.link-tile small { display: block; font-size: 12px; color: var(--muted); }
.link-tile b { display: block; font-size: 14.5px; font-weight: 500; }
.link-tile .arrow { margin-left: auto; color: var(--muted); }

.d-nav { display: grid; gap: 12px; padding-block: 28px; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .d-nav { grid-template-columns: 1fr 1fr; } }
.d-nav a { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; transition: border-color 0.2s, background 0.2s; }
.d-nav a:hover { border-color: var(--line-3); background: var(--surface); }
.d-nav a.next { text-align: right; }
.d-nav small { font-family: var(--f-mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.d-nav b { font-family: var(--f-display); font-size: 1.15rem; letter-spacing: -0.02em; }

.not-found { display: grid; justify-items: start; gap: 18px; padding-block: clamp(80px, 14vw, 160px); }
.not-found h1 { font-family: var(--f-display); font-size: clamp(2.2rem, 6vw, 4rem); letter-spacing: -0.05em; line-height: 1; }
.not-found p { color: var(--text-2); max-width: 520px; }

/* Loading state (only visible if scripts are slow) */
.loading { display: grid; place-items: center; min-height: 40vh; color: var(--muted); font-size: 14px; }
.loading::before { content: ""; width: 28px; height: 28px; margin-bottom: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }

/* Scroll reveal */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

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

/* noscript */
.noscript { padding: 24px; margin: 24px var(--gutter); border: 1px solid var(--line-2); border-radius: 14px; color: var(--text-2); }

/* Detail page: quick facts + agent profile */
.facts-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); }
.facts-dl div { padding: 12px 14px; background: var(--surface); }
.facts-dl dt { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.facts-dl dd { margin-top: 4px; font-size: 14px; color: var(--text); }
.agent-grid .agent-tools { grid-column: 1 / -1; }
.agent-grid .agent-tools .chips { margin-top: 10px; }
.agent-grid .agent-tools .chip { font-family: var(--f-mono); font-size: 12px; }
.d-media .logo-plate img.square { width: 140px; }
.feat-grid > .tradeoff { list-style: none; }

/* Category hues last, so they win over each component's default --c */
[data-cat="mobile"] { --c: var(--c-mobile); }
[data-cat="web"] { --c: var(--c-web); }
[data-cat="saas"] { --c: var(--c-saas); }
[data-cat="ai"] { --c: var(--c-ai); }
[data-cat="agents"] { --c: var(--c-agents); }
[data-cat="backend"] { --c: var(--c-backend); }
[data-cat="experiments"] { --c: var(--c-experiments); }

/* Thumbnail framing: show the top of every screen, crop the bottom */
.thumb.is-web .browser-frame { height: 100%; display: flex; flex-direction: column; }
.thumb.is-web .browser-frame .bar { flex: none; }
.thumb.is-web .browser-frame img { flex: 1; min-height: 0; width: 100%; object-fit: cover; object-position: top left; }
.thumb.is-phone { align-items: flex-start; padding-top: 7%; gap: 14px; }
.thumb.is-phone .device,
.thumb.is-phone .device + .device { width: 30%; margin-bottom: 0; opacity: 1; }
.thumb.is-phone .device + .device { margin-top: 9%; opacity: 0.85; }
@media (hover: hover) {
  .card:hover .thumb.is-phone .device { transform: translateY(-6px); }
}

/* Grids that hold a horizontal gallery must not grow to its content width */
.d-sections, .d-sec { grid-template-columns: minmax(0, 1fr); min-width: 0; }
.chip { max-width: 100%; }
.agent-tools .chip, .stack-group .chip { white-space: normal; line-height: 1.35; padding-block: 4px; }
.feat, .stack-group { min-width: 0; }

/* Full-bleed artwork / real captures in 16:10 */
.thumb.is-art > img { width: 100%; height: 100%; object-fit: cover; }
.concept-pill {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(11, 12, 14, 0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-2);
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-2);
  pointer-events: none;
}
.concept-pill::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--c, var(--accent)); transform: rotate(45deg); }
.art-frame { position: relative; margin: 0; width: 100%; max-width: 1040px; margin-inline: auto; border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2), 0 40px 80px -40px #000; }
.art-frame img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.art-frame .concept-pill { left: 16px; bottom: 16px; font-size: 11.5px; min-height: 28px; padding: 0 12px; }
.feature-media .art-frame { border-radius: 14px; }
.d-media:has(.art-frame) { padding: clamp(12px, 3vw, 36px); }
/* Keep the pill clear of the label baked into the artwork (bottom-left) */
.concept-pill { left: auto; right: 12px; }
.feature-media .art-frame .concept-pill { left: auto; right: 14px; }
.d-media .art-frame .concept-pill { display: none; } /* large frame: baked label + caption are readable */

/* Decisions: the why and the benefit under each one */
.tradeoff .why, .tradeoff .benefit { color: var(--text-2); font-size: 14px; }
.tradeoff .why strong, .tradeoff .benefit strong {
  margin-right: 4px;
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
