/* ==========================================================================
   RV2 — Three brands. One standard of craft.
   A custom-coded portfolio for Rishi Vishwakarma.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --ink: #070707;
  --ink-2: #0b0b0b;
  --ink-3: #101010;
  --ink-4: #161616;
  --bone: #f2eee7;
  --bone-2: #cec8be;
  --muted: #8a847b;
  --muted-2: #5f5b55;
  --red: #e11d2e;
  --red-hi: #ff3b4a;
  --red-deep: #8e0f1a;
  --accent-rgb: 225, 29, 46;
  --on-accent: #ffffff;
  --on-accent-block: #080808;
  --on-accent-rgb: 8, 8, 8;
  --line: rgba(242, 238, 231, 0.13);
  --line-soft: rgba(242, 238, 231, 0.07);
  --surface: #0c0c0c;
  --surface-2: #0e0e0e;
  --surface-3: #111111;
  --header-bg: rgba(7, 7, 7, 0.78);
  --modal-bg: #050505;
  --card-tint: rgba(242, 238, 231, 0.025);
  --fill-soft: rgba(242, 238, 231, 0.07);
  --dot: rgba(242, 238, 231, 0.16);
  --grain-opacity: 0.05;
  --shadow-lg: rgba(0, 0, 0, 0.6);
  --scrim: rgba(0, 0, 0, 0.55);
  --r-card: 0px;
  --r-btn: 0px;
  --r-chip: 0px;
  --r-frame: 0px;
  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --pad: clamp(20px, 5vw, 80px);
  --max: 1600px;
  --header-h: 82px;
}

/* ---------- Light mode ---------- */
html[data-theme="light"] {
  --ink: #f5efe6;
  --ink-2: #efe7db;
  --ink-3: #e9dfd1;
  --ink-4: #e2d6c5;
  --bone: #241c17;
  --bone-2: #4b3f36;
  --muted: #7c6d60;
  --muted-2: #a09284;
  --line: rgba(36, 28, 23, 0.15);
  --line-soft: rgba(36, 28, 23, 0.075);
  --surface: #fffaf3;
  --surface-2: #fbf4e9;
  --surface-3: #f2e8da;
  --header-bg: rgba(245, 239, 230, 0.9);
  --modal-bg: #f5efe6;
  --card-tint: rgba(36, 28, 23, 0.025);
  --fill-soft: rgba(36, 28, 23, 0.06);
  --dot: rgba(36, 28, 23, 0.16);
  --grain-opacity: 0.028;
  --shadow-lg: rgba(68, 48, 32, 0.18);
  --scrim: rgba(36, 28, 23, 0.32);
}

/* ---------- Accent palettes ---------- */
html[data-accent="terracotta"] {
  --red: #b45432; --red-hi: #cf6a45; --red-deep: #74301b;
  --accent-rgb: 180, 84, 50;
  --on-accent: #fffaf4; --on-accent-block: #2b211b; --on-accent-rgb: 43, 33, 27;
}
html[data-accent="red"] {
  --red: #e11d2e; --red-hi: #ff3b4a; --red-deep: #8e0f1a;
  --accent-rgb: 225, 29, 46;
  --on-accent: #ffffff; --on-accent-block: #080808; --on-accent-rgb: 8, 8, 8;
}
html[data-accent="ember"] {
  --red: #e8661a; --red-hi: #ff8a3d; --red-deep: #9c3c07;
  --accent-rgb: 232, 102, 26;
  --on-accent: #ffffff; --on-accent-block: #080808; --on-accent-rgb: 8, 8, 8;
}
html[data-accent="brass"] {
  --red: #c9a227; --red-hi: #e8c45a; --red-deep: #7d6212;
  --accent-rgb: 201, 162, 39;
  --on-accent: #080808; --on-accent-block: #080808; --on-accent-rgb: 8, 8, 8;
}
html[data-accent="teal"] {
  --red: #0f8b8d; --red-hi: #25b6b8; --red-deep: #07595b;
  --accent-rgb: 15, 139, 141;
  --on-accent: #ffffff; --on-accent-block: #080808; --on-accent-rgb: 8, 8, 8;
}
html[data-accent="cobalt"] {
  --red: #2563eb; --red-hi: #5b8cff; --red-deep: #133a9e;
  --accent-rgb: 37, 99, 235;
  --on-accent: #ffffff; --on-accent-block: #ffffff; --on-accent-rgb: 255, 255, 255;
}
html[data-accent="lime"] {
  --red: #9bbf00; --red-hi: #c6ef3a; --red-deep: #5d7300;
  --accent-rgb: 155, 191, 0;
  --on-accent: #080808; --on-accent-block: #080808; --on-accent-rgb: 8, 8, 8;
}
html[data-accent="violet"] {
  --red: #7c3aed; --red-hi: #a177ff; --red-deep: #4c1d95;
  --accent-rgb: 124, 58, 237;
  --on-accent: #ffffff; --on-accent-block: #ffffff; --on-accent-rgb: 255, 255, 255;
}

/* Light-mode accent tuning for small-text contrast */
html[data-theme="light"][data-accent="terracotta"] { --red: #9c4528; --red-hi: #b85a36; --red-deep: #6d2c17; --accent-rgb: 156, 69, 40; }
html[data-theme="light"][data-accent="red"] { --red: #cf1224; --accent-rgb: 207, 18, 36; }
html[data-theme="light"][data-accent="ember"] { --red: #b94d00; --accent-rgb: 185, 77, 0; }
html[data-theme="light"][data-accent="brass"] { --red: #8a6a00; --accent-rgb: 138, 106, 0; }
html[data-theme="light"][data-accent="teal"] { --red: #087173; --accent-rgb: 8, 113, 115; }
html[data-theme="light"][data-accent="cobalt"] { --red: #1d4ed8; --accent-rgb: 29, 78, 216; }
html[data-theme="light"][data-accent="lime"] { --red: #6b8200; --accent-rgb: 107, 130, 0; }
html[data-theme="light"][data-accent="violet"] { --red: #6d28d9; --accent-rgb: 109, 40, 217; }

/* ---------- Typeface pairings ---------- */
html[data-font-display="instrument"] { --serif: "Instrument Serif", "Times New Roman", Georgia, serif; }
html[data-font-display="playfair"] { --serif: "Playfair Display", "Times New Roman", Georgia, serif; }
html[data-font-display="grotesk"] { --serif: "Space Grotesk", "Helvetica Neue", Arial, sans-serif; }
html[data-font-body="manrope"] { --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; }
html[data-font-body="inter"] { --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }

/* ---------- Corner system ---------- */
html[data-corners="sharp"] { --r-card: 0px; --r-btn: 0px; --r-chip: 0px; --r-frame: 0px; }
html[data-corners="soft"] { --r-card: 10px; --r-btn: 4px; --r-chip: 6px; --r-frame: 8px; }
html[data-corners="round"] { --r-card: 20px; --r-btn: 999px; --r-chip: 999px; --r-frame: 14px; }

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-loading,
body.menu-open,
body.modal-open { overflow: hidden; }

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
sup { font-size: 0.5em; vertical-align: super; line-height: 0; }

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

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

/* Scrollbar */
html { scrollbar-width: thin; scrollbar-color: #2c2c2c var(--ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: #2c2c2c; border: 2px solid var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ---------- Utilities ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--pad);
}

.mono {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.6;
}

.display {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.02em;
}

.display em {
  font-style: italic;
  color: var(--red);
}

.section {
  position: relative;
  padding-block: clamp(90px, 13vh, 170px);
  border-top: 1px solid var(--line-soft);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(36px, 5.5vh, 68px);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-label > span { color: var(--red); }

.section-label::after {
  content: "";
  width: clamp(40px, 8vw, 120px);
  height: 1px;
  background: var(--line);
}

.live-dot {
  position: relative;
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--red);
  vertical-align: 1px;
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--red);
  animation: livePulse 2.4s var(--ease-io) infinite;
}

@keyframes livePulse {
  0% { transform: scale(0.4); opacity: 0.9; }
  70%, 100% { transform: scale(1.7); opacity: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8em;
  padding: 1.08em 1.55em;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transition:
    background-color 0.35s var(--ease),
    color 0.35s var(--ease),
    border-color 0.35s var(--ease),
    transform 0.25s var(--ease);
}

.btn-arrow {
  display: inline-block;
  font-size: 1.05em;
  transition: transform 0.35s var(--ease);
}

.btn:hover .btn-arrow { transform: translate(2px, -2px); }

.btn-red { background: var(--red); color: var(--on-accent); }
.btn-red:hover { background: var(--bone); color: var(--ink); }

.btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--bone);
}
.btn-ghost:hover {
  border-color: var(--bone);
  background: var(--bone);
  color: var(--ink);
}

.btn-black { background: #080808; color: #f2eee7; }
.btn-black:hover { background: #f2eee7; color: #080808; }

.btn-outline-black {
  border-color: rgba(8, 8, 8, 0.45);
  background: transparent;
  color: #080808;
}
.btn-outline-black:hover { background: #080808; color: #f2eee7; }

.btn-header {
  padding: 0.85em 1.15em;
  background: var(--red);
  color: var(--on-accent);
  font-size: 0.6rem;
}
.btn-header:hover { background: var(--bone); color: var(--ink); }

/* .desk-nav a (0,1,1) outranks .btn-header (0,1,0), which stripped the CTA of
   its padding, its white text and added a stray underline. Re-assert with
   higher specificity so the button renders as designed. */
.desk-nav a.btn-header {
  padding: 0.85em 1.15em;
  color: var(--on-accent);
}
.desk-nav a.btn-header::after { content: none; }
.desk-nav a.btn-header:hover { color: var(--ink); }

/* ---------- Grain + cursor + progress ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9500;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

#cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 12000;
  pointer-events: none;
  will-change: transform;
}

.cursor-dot,
.cursor-ring {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  transform: translate(-50%, -50%);
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(var(--accent-rgb), 0.55);
  transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s, border-color 0.25s, background 0.25s;
}

#cursor.is-link .cursor-ring {
  width: 60px;
  height: 60px;
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.9);
}
#cursor.is-hidden { opacity: 0; }

/* Section 08 (.contact) is a solid red field, so the red cursor disappears on
   it. While the pointer is over that section the cursor takes the site's own
   light/dark colour instead — black in the light theme, white in the dark. */
#cursor.is-on-accent .cursor-dot { background: #fff; }
html[data-theme="light"] #cursor.is-on-accent .cursor-dot { background: #000; }
#cursor.is-on-accent .cursor-ring { border-color: rgba(255, 255, 255, 0.75); }
html[data-theme="light"] #cursor.is-on-accent .cursor-ring { border-color: rgba(0, 0, 0, 0.7); }
#cursor.is-on-accent.is-link .cursor-ring {
  background: rgba(255, 255, 255, 0.14);
  border-color: #fff;
}
html[data-theme="light"] #cursor.is-on-accent.is-link .cursor-ring {
  background: rgba(0, 0, 0, 0.1);
  border-color: #000;
}

/* ---------- Theme wave ---------- */
/* Animate the surfaces and text that actually carry the theme. A universal
   selector repainted every decorative node and dropped frames. */
html.is-theme-wiping,
html.is-theme-wiping body,
html.is-theme-wiping main,
html.is-theme-wiping section,
html.is-theme-wiping header,
html.is-theme-wiping footer,
html.is-theme-wiping .site-header,
html.is-theme-wiping .site-footer,
html.is-theme-wiping .project,
html.is-theme-wiping .work-row,
html.is-theme-wiping .card-chrome,
html.is-theme-wiping .card-foot,
html.is-theme-wiping .bcard,
html.is-theme-wiping .price-card,
html.is-theme-wiping .step,
html.is-theme-wiping .theme-card,
html.is-theme-wiping .theme-panel,
html.is-theme-wiping .menu,
html.is-theme-wiping .modal,
html.is-theme-wiping .contact-line,
html.is-theme-wiping .btn,
html.is-theme-wiping button,
html.is-theme-wiping input,
html.is-theme-wiping textarea,
html.is-theme-wiping select,
html.is-theme-wiping .hero-stage,
html.is-theme-wiping .device,
html.is-theme-wiping .device-bar,
html.is-theme-wiping .device-screen,
html.is-theme-wiping .theme-lab,
html.is-theme-wiping .theme-preview,
html.is-theme-wiping .work-index,
html.is-theme-wiping .project-visual,
html.is-theme-wiping .project-info,
html.is-theme-wiping .about-panel,
html.is-theme-wiping .contact,
html.is-theme-wiping .case-card,
html.is-theme-wiping .case-section,
html.is-theme-wiping .result,
html.is-theme-wiping .aud-panel,
html.is-theme-wiping .q,
html.is-theme-wiping .seg,
html.is-theme-wiping .first-fix,
html.is-theme-wiping .cta-band {
  transition-property: color, background-color, border-color !important;
  transition-duration: 0.8s, 1s, 0.8s !important;
  transition-timing-function: cubic-bezier(0.33, 0, 0.2, 1) !important;
  transition-delay: var(--wave-delay, 0ms) !important;
}

/* :where() keeps this below the surface rules, so a .btn link still animates
   its background and border instead of being reduced to text colour. */
html.is-theme-wiping :where(h1, h2, h3, h4, h5, h6, p, a, span, li, label, strong, em, b, i, small, blockquote, figcaption, dt, dd, td, th) {
  transition-property: color !important;
  transition-duration: 0.8s !important;
  transition-timing-function: cubic-bezier(0.33, 0, 0.2, 1) !important;
  transition-delay: var(--wave-delay, 0ms) !important;
}

/* The full-screen grain blend and a blurred fixed header are expensive while
   every surface underneath is repainting. Drop them for the 2s wave. */
html.is-theme-wiping .grain { opacity: 0 !important; }
html.is-theme-wiping .site-header.is-scrolled {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.theme-ripple {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 13000;
  pointer-events: none;
  opacity: 0;
}
.theme-ripple .ripple-line {
  fill: none;
  stroke: rgba(var(--accent-rgb), 0.5);
  stroke-width: 1;
}
.theme-ripple .ripple-glow {
  /* A wide, faint stroke reads as a soft glow without an expensive blur filter. */
  fill: none;
  stroke: rgba(var(--accent-rgb), 0.4);
  stroke-width: 48;
  opacity: 0.08;
}

@media (hover: none), (pointer: coarse) {
  #cursor { display: none; }
}

body.has-cursor,
body.has-cursor a,
body.has-cursor button,
body.has-cursor [role="button"] { cursor: none; }

body.modal-open #cursor { opacity: 0; }
body.has-cursor.modal-open,
body.has-cursor.modal-open * { cursor: auto; }
body.modal-open .modal,
body.modal-open .modal * { cursor: auto; }

#progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9100;
  width: 100%;
  height: 2px;
  background: transparent;
  pointer-events: none;
}
#progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.55);
}

/* ---------- Preloader ---------- */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: flex-end;
  background: var(--ink);
  transition: clip-path 1s var(--ease) 0.15s, visibility 1s;
  clip-path: inset(0 0 0 0);
}
#preloader.is-done {
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
}

.preloader-inner {
  width: 100%;
  padding: 0 var(--pad) clamp(26px, 5vh, 52px);
}

.preloader-brand {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 26px;
}

.pb-mark {
  font-family: var(--serif);
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 0.8;
  letter-spacing: -0.03em;
}
.pb-mark span { color: var(--red); }

.pb-sub {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.preloader-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
}

.preloader-line {
  width: 100%;
  height: 1px;
  background: var(--line);
  overflow: hidden;
}
.preloader-line i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--red);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 8000;
  width: 100%;
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: var(--header-bg);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 17px var(--pad);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
}

.brand-mark {
  font-family: var(--serif);
  font-size: 2.15rem;
  line-height: 0.8;
  letter-spacing: -0.03em;
}
.brand-mark span,
.footer-mark span,
.panel-mark span,
.pb-mark span { color: var(--red); }

.brand-sub {
  padding-left: 13px;
  border-left: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.5rem;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.desk-nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.6vw, 42px);
}

.desk-nav a {
  position: relative;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-2);
  padding: 6px 0;
  transition: color 0.3s var(--ease);
}

.desk-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}

.desk-nav a:hover,
.desk-nav a.is-active { color: var(--bone); }
.desk-nav a:hover::after,
.desk-nav a.is-active::after { transform: scaleX(1); transform-origin: left; }

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.availability {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.availability i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 34px;
  height: 34px;
  margin-left: 4px;
}
.burger span {
  display: block;
  width: 26px;
  height: 1px;
  margin-left: auto;
  background: var(--bone);
  transition: transform 0.4s var(--ease), width 0.4s var(--ease);
}
.burger span:last-child { width: 18px; }
body.menu-open .burger span:first-child { transform: translateY(4px) rotate(45deg); }
body.menu-open .burger span:last-child { width: 26px; transform: translateY(-4px) rotate(-45deg); }

/* ---------- Mobile menu ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 8500;
  background: var(--ink);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.8s var(--ease);
  overflow-y: auto;
  overscroll-behavior: contain;
}
body.menu-open .menu { clip-path: inset(0 0 0 0); }

.menu-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: calc(var(--header-h) + 40px) var(--pad) 34px;
}

.menu-label { color: var(--red); margin-bottom: 20px; }

.menu nav { display: flex; flex-direction: column; }

.menu nav a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  transform: translateY(36px);
  opacity: 0;
  transition: transform 0.8s var(--ease), opacity 0.8s var(--ease), color 0.3s;
}
.menu nav a span {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: var(--red);
}
.menu nav a:hover { color: var(--red); }
body.menu-open .menu nav a { transform: none; opacity: 1; }
body.menu-open .menu nav a:nth-child(1) { transition-delay: 0.12s; }
body.menu-open .menu nav a:nth-child(2) { transition-delay: 0.18s; }
body.menu-open .menu nav a:nth-child(3) { transition-delay: 0.24s; }
body.menu-open .menu nav a:nth-child(4) { transition-delay: 0.3s; }
body.menu-open .menu nav a:nth-child(5) { transition-delay: 0.36s; }
body.menu-open .menu nav a:nth-child(6) { transition-delay: 0.42s; }

.menu-foot {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 30px;
  align-items: end;
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.menu-foot .mono { color: var(--muted); margin-bottom: 8px; }
.menu-foot a {
  display: block;
  font-size: 0.8rem;
  color: var(--bone-2);
  padding: 2px 0;
  transition: color 0.3s;
}
.menu-foot a:hover { color: var(--red); }
.menu-loc { text-align: right; color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: clamp(92px, 11vh, 120px);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -10%;
  right: -12%;
  width: 55vw;
  height: 55vw;
  max-width: 900px;
  max-height: 900px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.12), transparent 62%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.72fr);
  gap: clamp(30px, 5vw, 90px);
  align-items: end;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: var(--pad);
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  margin-bottom: clamp(20px, 3vh, 34px);
  color: var(--bone-2);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s var(--ease) 0.05s, transform 0.9s var(--ease) 0.05s;
}
body.is-loaded .hero-eyebrow { opacity: 1; transform: none; }

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.2rem, 7.6vw, 7.6rem);
  line-height: 0.86;
  letter-spacing: -0.025em;
}

.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}

.hero-title .line > span {
  display: block;
  transform: translateY(115%);
  transition: transform 1.15s var(--ease);
}

body.is-loaded .hero-title .line:nth-child(1) > span { transform: none; transition-delay: 0.1s; }
body.is-loaded .hero-title .line:nth-child(2) > span { transform: none; transition-delay: 0.18s; }
body.is-loaded .hero-title .line:nth-child(3) > span { transform: none; transition-delay: 0.26s; }

.hero-title em {
  font-style: italic;
  color: var(--red);
}

.hero-aside {
  padding-bottom: 0.5rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease) 0.42s, transform 1s var(--ease) 0.42s;
}
body.is-loaded .hero-aside { opacity: 1; transform: none; }

.hero-lede {
  max-width: 390px;
  font-size: clamp(0.9rem, 1.1vw, 1.02rem);
  line-height: 1.75;
  color: var(--bone-2);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-note {
  margin-top: 26px;
  color: var(--muted);
}
.hero-note span { color: var(--red); margin-inline: 3px; }

.hero-stage {
  position: relative;
  z-index: 1;
  height: clamp(330px, 44vh, 460px);
  margin-top: clamp(16px, 2.6vh, 36px);
  padding-bottom: 42px;
  perspective: 1600px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.1s var(--ease) 0.55s, transform 1.1s var(--ease) 0.55s;
}
body.is-loaded .hero-stage { opacity: 1; transform: none; }

.stage-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 55%;
  height: 70%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.2), transparent 68%);
  pointer-events: none;
}


.stage-floor {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.stack {
  position: absolute;
  inset: 0 0 42px 0;
  transform-style: preserve-3d;
  transition: transform 0.45s var(--ease);
}

.stack-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(280px, 31vw, 520px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.6);
  transform-origin: center center;
  transition:
    transform 0.9s var(--ease),
    opacity 0.9s var(--ease),
    border-color 0.5s var(--ease),
    filter 0.9s var(--ease);
  opacity: 0;
  pointer-events: none;
  cursor: none;
}

.stack-card[data-project-key="furniture"] { --accent: #a9663f; }
.stack-card[data-project-key="casa"] { --accent: #c9a227; }
.stack-card[data-project-key="modul"] { --accent: #d9b95c; }

.stack-card.is-left {
  opacity: 0.5;
  pointer-events: auto;
  transform: translate(calc(-50% - 48%), -50%) translateZ(-130px) rotateY(19deg) scale(0.82);
  filter: saturate(0.65) brightness(0.7);
}

.stack-card.is-right {
  opacity: 0.5;
  pointer-events: auto;
  transform: translate(calc(-50% + 48%), -50%) translateZ(-130px) rotateY(-19deg) scale(0.82);
  filter: saturate(0.65) brightness(0.7);
}

.stack-card.is-active {
  z-index: 3;
  opacity: 1;
  pointer-events: auto;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  transform: translate(-50%, -50%) translateZ(50px) scale(1);
}

.stack-card.is-active:hover { border-color: var(--accent); }

.card-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 32px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.card-chrome > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
  flex-shrink: 0;
}

.card-chrome em {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.5rem;
  font-style: normal;
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.card-live i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.card-screen {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink-3);
}
.card-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 1.2s var(--ease);
}
.stack-card.is-active:hover .card-screen img { transform: scale(1.025); }

.card-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
}

.card-num { color: var(--accent); }

.card-name h2 {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.5vw, 1.4rem);
  font-weight: 400;
  line-height: 1.1;
}
.card-name p {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-arrow {
  margin-left: auto;
  font-size: 1rem;
  color: var(--muted);
  transition: color 0.3s, transform 0.4s var(--ease);
}
.stack-card.is-active:hover .card-arrow { color: var(--accent); transform: translate(2px, -2px); }

.stack-ui {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.scroll-cue { justify-self: start; }
.stack-dots { justify-self: center; display: flex; align-items: center; gap: 20px; }

.stack-dot {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  transition: color 0.3s;
}
.stack-dot span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--muted);
  transition: width 0.4s var(--ease), background-color 0.3s;
}
.stack-dot:hover { color: var(--bone-2); }
.stack-dot.is-active { color: var(--bone); }
.stack-dot.is-active span { width: 36px; background: var(--red); }

.stack-hint { color: var(--muted); font-size: 0.55rem; justify-self: end; text-align: right; }



.scroll-cue {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-2);
  transition: color 0.3s;
}
.scroll-cue:hover { color: var(--red); }
.cue-line {
  display: block;
  width: 42px;
  height: 1px;
  background: var(--red);
  position: relative;
  overflow: hidden;
}
.cue-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bone);
  animation: cue 2.4s var(--ease-io) infinite;
  transform: translateX(-100%);
}
@keyframes cue {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

/* ---------- Velocity band ---------- */
.velocity-band {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(26px, 4vw, 44px) 0 clamp(30px, 4.6vw, 52px);
  background: var(--ink-2);
}
.velocity-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: clamp(18px, 2.6vw, 30px);
}
.velocity-head .mono {
  color: var(--muted);
  font-size: 0.55rem;
  letter-spacing: 0.18em;
}
.velocity-rule { flex: 1; height: 1px; background: var(--line); }
.velocity-row {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.velocity-track { display: flex; width: max-content; will-change: transform; }
.velocity-set {
  display: flex;
  align-items: center;
  gap: clamp(26px, 3.2vw, 48px);
  padding-right: clamp(26px, 3.2vw, 48px);
  white-space: nowrap;
}
.velocity-set span {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.3vw, 3.55rem);
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--bone);
}
.velocity-set span:nth-of-type(even) { font-style: italic; color: var(--bone-2); }
.velocity-set i {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  background: var(--red);
  transform: rotate(45deg);
}

/* ---------- Intro ---------- */
.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(40px, 6vw, 110px);
  align-items: start;
}

.intro-title {
  font-size: clamp(2.9rem, 5.6vw, 5.9rem);
  max-width: 13ch;
}

.intro-side {
  max-width: 500px;
  padding-top: 0.4rem;
}
.intro-side p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--bone-2);
}
.intro-side p + p {
  margin-top: 20px;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(60px, 9vh, 120px);
  border-top: 1px solid var(--line);
}
.stat {
  padding: 26px;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; }
.stat-num {
  display: block;
  font-family: var(--serif);
  font-size: clamp(3rem, 5vw, 5.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-lbl {
  display: block;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Work head + index ---------- */
.work-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.34fr);
  gap: clamp(40px, 6vw, 110px);
  align-items: end;
}

.work-title {
  font-size: clamp(3rem, 6.6vw, 7.2rem);
  max-width: 12ch;
}

.work-aside { padding-bottom: 0.5rem; }
.work-aside p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--bone-2);
}
.work-note {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.55rem;
  line-height: 1.7;
}

.work-index {
  margin-top: clamp(55px, 8vh, 100px);
  border-top: 1px solid var(--line);
}

.work-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 220px 100px 34px;
  align-items: center;
  gap: 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.4s var(--ease), padding 0.4s var(--ease), color 0.4s var(--ease);
}

.work-row h3 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.2vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.01em;
}

.row-num { color: var(--red); transition: color 0.4s; }
.row-cat,
.row-pages {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.4s;
}
.row-arrow {
  font-size: 1.1rem;
  justify-self: end;
  color: var(--muted);
  transition: color 0.4s, transform 0.4s var(--ease);
}

.work-row:hover,
.work-row:focus-visible {
  background: var(--red);
  padding-left: 20px;
  padding-right: 20px;
  color: var(--on-accent);
  outline: none;
}
.work-row:hover .row-num,
.work-row:hover .row-cat,
.work-row:hover .row-pages,
.work-row:hover .row-arrow,
.work-row:focus-visible .row-num,
.work-row:focus-visible .row-cat,
.work-row:focus-visible .row-pages,
.work-row:focus-visible .row-arrow { color: var(--on-accent); }
.work-row:hover .row-arrow { transform: translate(3px, -3px); }

#work-peek {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 7000;
  width: 320px;
  height: 214px;
  overflow: hidden;
  border: 1px solid var(--bone);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.25s var(--ease), transform 0.35s var(--ease);
}
#work-peek.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#work-peek img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* ---------- Project ---------- */
.project {
  padding-top: clamp(90px, 12vh, 150px);
  position: relative;
}
.project + .project {
  margin-top: clamp(90px, 12vh, 150px);
  border-top: 1px solid var(--line);
}

.project-head {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) minmax(250px, 0.32fr);
  gap: clamp(26px, 4vw, 70px);
  align-items: end;
  margin-bottom: clamp(40px, 6vh, 76px);
}

.project-index {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 5.2vw, 5.6rem);
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px var(--line);
  user-select: none;
}

.project-cat {
  color: var(--red);
  margin-bottom: 12px;
}

.project-title {
  font-family: var(--serif);
  font-size: clamp(3.2rem, 6.4vw, 7.2rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.025em;
}
.project-title em { font-style: italic; color: var(--red); }

.project-tagline {
  padding-left: 22px;
  border-left: 1px solid var(--line);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--bone-2);
}

.project-body {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: clamp(40px, 5vw, 90px);
  align-items: center;
}

.project:nth-of-type(even) .project-body { grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); }
.project:nth-of-type(even) .project-visual { order: 2; }
.project:nth-of-type(even) .project-info { order: 1; }

.project-visual {
  position: relative;
  min-width: 0;
}

.visual-glow {
  position: absolute;
  inset: 8% 2%;
  z-index: 0;
  background: radial-gradient(circle at 50% 55%, var(--accent), transparent 65%);
  opacity: 0.16;
  pointer-events: none;
}

.browser {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-frame);
  overflow: hidden;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.55);
  transform-style: preserve-3d;
  transition: transform 0.45s var(--ease), border-color 0.5s var(--ease), box-shadow 0.5s var(--ease);
  will-change: transform;
}
.browser:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: 0 45px 110px rgba(0, 0, 0, 0.65), 0 0 60px -20px var(--accent);
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.browser-dots { display: flex; gap: 5px; flex-shrink: 0; }
.browser-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot);
}

.browser-url {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-live {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  flex-shrink: 0;
}
.browser-live i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: liveBlink 2.4s ease-in-out infinite;
}
@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.browser-screen {
  position: relative;
  height: clamp(300px, 52vh, 550px);
  overflow: hidden;
  background: var(--ink-3);
}
.browser-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  pointer-events: none;
}
.browser-screen img {
  width: 100%;
  height: auto;
  will-change: transform;
}

.phone {
  position: absolute;
  z-index: 2;
  left: -28px;
  bottom: -34px;
  width: clamp(120px, 13vw, 172px);
  padding: 4px;
  border-radius: 0;
  background: #101010;
  border: 1px solid var(--dot);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.65);
}
.phone-screen {
  height: auto;
  aspect-ratio: 9 / 19.5;
  overflow: hidden;
  border-radius: 0;
  background: #fff;
}
.phone-screen img { width: 100%; height: auto; will-change: transform; }

.visual-caption {
  display: block;
  margin-top: 44px;
  text-align: right;
  color: var(--muted);
  font-size: 0.5rem;
}

.project-info { min-width: 0; }

.project-desc {
  font-size: 0.94rem;
  line-height: 1.8;
  color: var(--bone-2);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
}
.tags li {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s, border-color 0.3s;
}
.tags li:hover { color: var(--bone); border-color: var(--red); }

.specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 30px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.spec { padding-right: 12px; }
.spec b {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  font-weight: 400;
  line-height: 1;
}
.spec b sup { color: var(--red); }
.spec span {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 22px;
  margin-top: 24px;
}
.swatch {
  display: flex;
  align-items: center;
  gap: 8px;
}
.swatch i {
  width: 16px;
  height: 16px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.swatch em {
  font-family: var(--mono);
  font-size: 0.5rem;
  font-style: normal;
  letter-spacing: 0.06em;
  color: var(--bone-2);
}
.swatch small {
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.pages { margin-top: 28px; }
.pages > .mono { color: var(--muted); margin-bottom: 10px; font-size: 0.55rem; }
.page-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.page-chips a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-2);
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}
.page-chips a:hover {
  color: var(--on-accent);
  background: var(--red);
  border-color: var(--red);
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 32px;
}

.case-link {
  align-self: center;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.3s;
}
.case-link:hover { color: var(--red); }

/* ---------- Capabilities ---------- */
.cap-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: clamp(40px, 6vw, 110px);
  align-items: end;
  margin-bottom: clamp(45px, 7vh, 80px);
}

.cap-title { font-size: clamp(2.8rem, 5.2vw, 5.4rem); max-width: 15ch; }
.cap-lede {
  max-width: 440px;
  padding-bottom: 0.5rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--bone-2);
}

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.bcard {
  position: relative;
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: clamp(20px, 2.4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: linear-gradient(180deg, var(--card-tint), transparent);
  overflow: hidden;
  transition: border-color 0.45s var(--ease), background-color 0.45s var(--ease);
}
.bcard-wide { grid-column: span 5; }
.bcard:nth-child(2) { grid-column: span 3; }
.bcard:nth-child(3) { grid-column: span 4; }
.bcard:nth-child(4) { grid-column: span 3; }
.bcard:nth-child(5) { grid-column: span 5; }
.bcard:nth-child(6) { grid-column: span 4; }

.bcard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), 0.13), transparent 62%);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
}
.bcard:hover { border-color: rgba(var(--accent-rgb), 0.45); }
.bcard:hover::before { opacity: 1; }

.bcard-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--red);
  margin-bottom: 26px;
}
.bcard-arrow {
  font-size: 1rem;
  color: var(--muted);
  transition: color 0.3s, transform 0.4s var(--ease);
}
.bcard:hover .bcard-arrow { color: var(--red); transform: translate(2px, -2px); }

.bcard-body { position: relative; z-index: 1; }
.bcard-body h3 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 2.2vw, 2.3rem);
  font-weight: 400;
  line-height: 1;
  margin-bottom: 12px;
}
.bcard-body p {
  font-size: 0.84rem;
  line-height: 1.72;
  color: var(--muted);
  max-width: 42ch;
}

.bcard-visual {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 30px;
  min-height: 88px;
}

/* type specimen */
.type-specimen {
  display: flex;
  align-items: baseline;
  gap: clamp(8px, 1.4vw, 18px);
  flex-wrap: wrap;
}
.ts-serif {
  font-family: var(--serif);
  font-size: clamp(3.6rem, 5vw, 5.2rem);
  line-height: 0.8;
  color: var(--bone);
}
.ts-serif::first-letter { color: var(--red); }
.ts-sans {
  font-family: var(--sans);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 300;
  color: var(--muted);
}
.ts-mono {
  font-family: var(--mono);
  font-size: 1.2rem;
  color: var(--muted-2);
}
.ts-swatches { display: flex; gap: 4px; margin-left: auto; }
.ts-swatches i { width: 16px; height: 34px; display: block; }
.ts-swatches i:nth-child(1) { background: var(--red); }
.ts-swatches i:nth-child(2) { background: var(--bone); }
.ts-swatches i:nth-child(3) { background: var(--muted-2); }
.ts-swatches i:nth-child(4) { background: var(--surface-2); border: 1px solid var(--line); }

/* motion bars */
.motion-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 84px;
}
.motion-bars i {
  display: block;
  width: 7px;
  height: 100%;
  background: var(--red);
  opacity: 0.75;
  transform-origin: bottom;
  animation: barPulse 2.2s var(--ease-io) infinite;
}
.motion-bars i:nth-child(2n) { background: var(--bone); opacity: 0.35; animation-delay: 0.18s; }
.motion-bars i:nth-child(3n) { animation-delay: 0.36s; }
.motion-bars i:nth-child(4n) { animation-delay: 0.54s; }
.motion-bars i:nth-child(5n) { animation-delay: 0.72s; }
@keyframes barPulse {
  0%, 100% { transform: scaleY(0.22); }
  50% { transform: scaleY(1); }
}

/* chat */
.chat-visual { display: flex; flex-direction: column; gap: 8px; }
.chat-bubble {
  max-width: 88%;
  padding: 9px 13px;
  border: 1px solid var(--line);
  background: var(--ink-4);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--bone-2);
  border-radius: 10px 10px 10px 2px;
}
.chat-reply {
  align-self: flex-end;
  background: var(--red);
  border-color: var(--red);
  color: var(--on-accent);
  border-radius: 10px 10px 2px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.typing { display: inline-flex; gap: 3px; }
.typing b {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--on-accent);
  animation: typing 1.2s ease-in-out infinite;
}
.typing b:nth-child(2) { animation-delay: 0.15s; }
.typing b:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

/* devices */
.device-visual {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 100px;
}
.device-visual span {
  display: block;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.12), transparent);
  position: relative;
}
.device-visual span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 10px;
  height: 1px;
  transform: translateX(-50%);
  background: var(--muted-2);
}
.device-visual span:nth-child(1) { width: 54px; height: 96px; }
.device-visual span:nth-child(2) { width: 44px; height: 76px; opacity: 0.7; }
.device-visual span:nth-child(3) { width: 34px; height: 58px; opacity: 0.45; }

/* form */
.form-visual { display: flex; flex-direction: column; gap: 0; max-width: 320px; }
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.form-row i {
  font-family: var(--mono);
  font-size: 0.55rem;
  font-style: normal;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.form-row b {
  width: 34%;
  height: 6px;
  background: var(--fill-soft);
}
.form-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--r-btn);
  background: var(--red);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.form-submit em { font-style: normal; }

/* speed */
.speed-visual {
  display: flex;
  align-items: flex-end;
  gap: 20px;
}
.speed-visual b {
  font-family: var(--serif);
  font-size: clamp(3.4rem, 4.6vw, 4.8rem);
  font-weight: 400;
  line-height: 0.8;
}
.speed-visual b::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin-top: 10px;
  background: var(--red);
}
.speed-visual > span { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.speed-visual > span i {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, var(--red), transparent);
  opacity: 0.7;
}
.speed-visual > span i:nth-child(2) { width: 75%; opacity: 0.45; }
.speed-visual > span i:nth-child(3) { width: 50%; opacity: 0.25; }

.stack-strip {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  margin-top: clamp(40px, 6vh, 70px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.stack-strip > .mono { color: var(--muted); flex-shrink: 0; padding-top: 6px; }
.stack-list { display: flex; flex-wrap: wrap; gap: 7px; }
.stack-list span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-2);
  transition: color 0.3s, border-color 0.3s;
}
.stack-list span:hover { color: var(--red); border-color: var(--red); }

/* ---------- Process ---------- */
.process-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.35fr);
  gap: clamp(40px, 6vw, 110px);
  align-items: end;
  margin-bottom: clamp(45px, 7vh, 80px);
}
.process-head h2 { font-size: clamp(2.8rem, 5.2vw, 5.4rem); max-width: 14ch; }
.process-head p {
  padding-bottom: 0.5rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--bone-2);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
}

.step {
  position: relative;
  padding: 30px 26px;
  border-right: 1px solid var(--line);
}
.step:last-child { border-right: 0; }
.step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--red);
  transition: width 0.7s var(--ease);
}
.step:hover::before { width: 100%; }

.step-num { color: var(--red); }
.step h3 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 2.4vw, 2.5rem);
  font-weight: 400;
  line-height: 1;
  margin: 20px 0 12px;
}
.step p {
  max-width: 32ch;
  font-size: 0.82rem;
  line-height: 1.72;
  color: var(--muted);
}
.step-time {
  display: block;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.5rem;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  gap: clamp(40px, 6vw, 110px);
  align-items: start;
}

.about-panel {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 640px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.panel-glow {
  position: absolute;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.3), transparent 65%);
}
.panel-mark {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: clamp(6rem, 12vw, 11rem);
  line-height: 0.8;
  letter-spacing: -0.04em;
}
.panel-meta {
  position: absolute;
  left: 20px;
  bottom: 20px;
  color: var(--muted);
  font-size: 0.55rem;
  line-height: 1.8;
}
.panel-edge {
  position: absolute;
  top: 20px;
  right: 20px;
  writing-mode: vertical-rl;
  color: var(--muted);
  font-size: 0.5rem;
  letter-spacing: 0.18em;
}
.about-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-soft);
  pointer-events: none;
}

.about-copy h2 { font-size: clamp(2.6rem, 4.6vw, 4.9rem); max-width: 14ch; margin-bottom: 28px; }
.about-copy > p {
  max-width: 62ch;
  font-size: 0.94rem;
  line-height: 1.82;
  color: var(--bone-2);
}
.about-copy > p + p { margin-top: 18px; color: var(--muted); }

.skills { margin-top: 38px; }
.skill-group {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}
.skill-group > .mono { color: var(--red); padding-top: 5px; }
.skill-group > div { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-group span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone-2);
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  margin-top: 32px;
}
.about-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-2);
  transition: color 0.3s, border-color 0.3s;
}
.about-links a span { color: var(--red); transition: transform 0.3s var(--ease); }
.about-links a:hover { color: var(--red); border-color: var(--red); }
.about-links a:hover span { transform: translate(2px, -2px); }

.availability-line {
  display: flex;
  align-items: flex-start;
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.availability-line .live-dot { margin-top: 4px; flex: 0 0 6px; }

/* ---------- Contact ---------- */
.contact {
  position: relative;
  padding-block: clamp(90px, 12vh, 150px) clamp(60px, 8vh, 100px);
  background: var(--red);
  color: var(--on-accent-block);
  overflow: hidden;
}
.contact::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.18), transparent 65%);
  pointer-events: none;
}

.contact .wrap { position: relative; z-index: 1; }
.contact-label { color: rgba(var(--on-accent-rgb), 0.6); }
.contact-label > span { color: var(--on-accent-block); }
.contact-label::after { background: rgba(var(--on-accent-rgb), 0.28); }

.contact-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.2rem, 8.6vw, 9rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
  max-width: 13ch;
}
.contact-title em { font-style: italic; }

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(40px, 6vw, 110px);
  align-items: end;
  margin-top: clamp(50px, 8vh, 100px);
}

.contact-copy p {
  max-width: 44ch;
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(var(--on-accent-rgb), 0.78);
}

.contact-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }

.contact-details { border-top: 1px solid rgba(var(--on-accent-rgb), 0.28); }
.contact-line {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid rgba(var(--on-accent-rgb), 0.28);
  transition: padding 0.35s var(--ease), background-color 0.35s var(--ease);
}
.contact-line .mono { font-size: 0.5rem; color: rgba(var(--on-accent-rgb), 0.55); }
.contact-line b {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-line i {
  font-family: var(--mono);
  font-size: 0.55rem;
  font-style: normal;
  letter-spacing: 0.08em;
  color: rgba(var(--on-accent-rgb), 0.55);
}
.contact-line:hover { padding-left: 10px; background: rgba(var(--on-accent-rgb), 0.06); }
.contact-line-static:hover { padding-left: 0; background: transparent; }
.static-clock { white-space: nowrap; }

.contact-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(50px, 8vh, 100px);
  padding-top: 18px;
  border-top: 1px solid rgba(var(--on-accent-rgb), 0.28);
  font-size: 0.55rem;
  color: rgba(var(--on-accent-rgb), 0.65);
}
.contact-foot .live-dot { background: var(--on-accent-block); }
.contact-foot .live-dot::after { border-color: var(--on-accent-block); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  border-top: 1px solid var(--line);
  padding: clamp(50px, 7vh, 80px) 0 26px;
}
.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.5fr) minmax(0, 0.5fr);
  gap: 40px;
}
.footer-mark {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 3.4vw, 3.2rem);
  line-height: 0.8;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.footer-brand p { font-size: 0.78rem; line-height: 1.7; color: var(--muted); }

.footer-nav,
.footer-social { display: flex; flex-direction: column; gap: 9px; }
.footer-nav a,
.footer-social a {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bone-2);
  width: fit-content;
  transition: color 0.3s, transform 0.3s var(--ease);
}
.footer-nav a:hover,
.footer-social a:hover { color: var(--red); transform: translateX(3px); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(40px, 6vh, 70px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.5rem;
}
.to-top {
  color: var(--bone-2);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.3s;
}
.to-top:hover { color: var(--red); }

/* ---------- Preview modal ---------- */
.modal {
  position: fixed;
  overflow: hidden;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  background: var(--modal-bg);
  opacity: 0;
  visibility: hidden;
  transform: scale(1.01);
  transition: opacity 0.45s var(--ease), visibility 0.45s, transform 0.45s var(--ease);
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.modal-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 11px clamp(12px, 2vw, 24px);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex-shrink: 0;
}

.modal-id {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}
.modal-id .mono { color: var(--red); font-size: 0.55rem; flex-shrink: 0; }
.modal-id h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-tabs {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.modal-tabs::-webkit-scrollbar { display: none; }
.modal-tabs button {
  flex-shrink: 0;
  padding: 9px 11px;
  border-bottom: 1px solid transparent;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.3s, border-color 0.3s;
}
.modal-tabs button:hover { color: var(--bone); }
.modal-tabs button.is-active { color: var(--bone); border-bottom-color: var(--red); }

.modal-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.device-switch {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
}
.device-switch button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  color: var(--muted);
  transition: background-color 0.3s, color 0.3s;
}
.device-switch button + button { border-left: 1px solid var(--line); }
.device-switch button:hover { color: var(--bone); }
.device-switch button.is-active { background: var(--red); color: var(--on-accent); }

.modal-external,
.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  font-size: 0.85rem;
  color: var(--bone-2);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.modal-external:hover,
.modal-close:hover { background: var(--red); border-color: var(--red); color: var(--on-accent); }

.modal-stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2.4vh, 26px);
  background:
    radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb), 0.09), transparent 60%),
    var(--modal-bg);
  overflow: hidden;
}

.device-fit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.device {
  position: relative;
  flex-shrink: 0;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  width: 1400px;
  height: 900px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-frame);
  box-shadow: 0 40px 100px var(--shadow-lg);
  overflow: hidden;
  transform-origin: center center;
  transition: transform 0.45s var(--ease), border-radius 0.45s var(--ease);
}
.device[data-device="tablet"] {
  width: 820px;
  height: 920px;
  border-radius: 10px;
}
.device[data-device="mobile"] {
  width: 390px;
  height: 800px;
  border-radius: 4px;
}
.device-base {
  display: none;
  flex-shrink: 0;
  height: 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-2), var(--ink-2));
}
.device-base::after {
  content: "";
  display: block;
  width: 13%;
  height: 3px;
  margin: 0 auto;
  border-radius: 0 0 4px 4px;
  background: var(--line);
}
.device[data-device="desktop"] .device-base { display: block; }

.device-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 34px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex-shrink: 0;
}
.device[data-device="mobile"] .device-chrome { display: none; }

.device-url {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.5rem;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #fff;
}
.device-screen iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}
.device[data-device="mobile"] .device-screen { border-radius: 1px; }

.frame-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--surface-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.frame-loader.is-loading { opacity: 1; pointer-events: auto; }
.frame-loader span {
  width: 30px;
  height: 30px;
  border: 2px solid var(--line);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.frame-loader em { font-style: normal; color: var(--muted); font-size: 0.55rem; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal-hint {
  flex-shrink: 0;
  padding: 9px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.52rem;
}

/* ---------- Reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* Same delay API as the demo sites: data-delay="1|2|3". */
.js .reveal[data-delay="1"] { --d: 0.08s; }
.js .reveal[data-delay="2"] { --d: 0.16s; }
.js .reveal[data-delay="3"] { --d: 0.24s; }

/* Work rows animate in on scroll without losing their hover transitions. */
.js .work-row.reveal {
  transition:
    opacity 1s var(--ease),
    transform 1s var(--ease),
    background-color 0.4s var(--ease),
    padding 0.4s var(--ease),
    color 0.4s var(--ease);
}

.stats .stat:nth-child(2) { --d: 0.08s; }
.stats .stat:nth-child(3) { --d: 0.16s; }
.stats .stat:nth-child(4) { --d: 0.24s; }

.bento .bcard:nth-child(2) { --d: 0.07s; }
.bento .bcard:nth-child(3) { --d: 0.14s; }
.bento .bcard:nth-child(4) { --d: 0.07s; }
.bento .bcard:nth-child(5) { --d: 0.14s; }
.bento .bcard:nth-child(6) { --d: 0.21s; }

.case-grid .case-card:nth-child(2) { --d: 0.07s; }
.case-grid .case-card:nth-child(3) { --d: 0.14s; }
.case-grid .case-card:nth-child(4) { --d: 0.21s; }

.process-grid .step:nth-child(2) { --d: 0.08s; }
.process-grid .step:nth-child(3) { --d: 0.16s; }
.process-grid .step:nth-child(4) { --d: 0.24s; }


/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 13000;
  padding: 10px 16px;
  background: var(--red);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: none; }


/* ==========================================================================
   Theme system + new sections
   ========================================================================== */

/* ---------- Button style modes ---------- */
html[data-buttons="outline"] .btn-red,
html[data-buttons="outline"] .btn-header {
  background: transparent;
  color: var(--red);
  border-color: var(--red);
}
html[data-buttons="outline"] .btn-red:hover,
html[data-buttons="outline"] .btn-header:hover {
  background: var(--red);
  color: var(--on-accent);
  border-color: var(--red);
}
html[data-buttons="underline"] .btn-red,
html[data-buttons="underline"] .btn-header {
  background: transparent;
  color: var(--bone);
  border-color: transparent;
  border-bottom-color: var(--red);
  padding-inline: 0;
}
html[data-buttons="underline"] .btn-red:hover,
html[data-buttons="underline"] .btn-header:hover {
  background: transparent;
  color: var(--red);
  border-color: transparent;
  border-bottom-color: var(--red);
}

html[data-buttons="outline"] .contact .btn-black {
  background: transparent;
  color: var(--on-accent-block);
  border-color: var(--on-accent-block);
}
html[data-buttons="outline"] .contact .btn-black:hover {
  background: var(--on-accent-block);
  color: var(--red);
}
html[data-buttons="underline"] .contact .btn-black {
  background: transparent;
  color: var(--on-accent-block);
  border-color: transparent;
  border-bottom-color: var(--on-accent-block);
  padding-inline: 0;
}
html[data-buttons="underline"] .contact .btn-black:hover {
  background: transparent;
  color: var(--on-accent-block);
  border-color: transparent;
  border-bottom-color: var(--on-accent-block);
}
.contact .btn-outline-black {
  border-color: color-mix(in srgb, var(--on-accent-block) 45%, transparent);
  color: var(--on-accent-block);
}
.contact .btn-outline-black:hover {
  background: var(--on-accent-block);
  color: var(--red);
}

/* ---------- Motion levels ---------- */
html[data-motion="off"] *,
html[data-motion="off"] *::before,
html[data-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
}
html[data-motion="off"] { scroll-behavior: auto; }
html[data-motion="off"] #preloader { display: none; }
html[data-motion="off"] .reveal,
html[data-motion="off"] .hero-eyebrow,
html[data-motion="off"] .hero-aside,
html[data-motion="off"] .hero-stage,
html[data-motion="off"] .hero-title .line > span {
  opacity: 1 !important;
  transform: none !important;
}
html[data-motion="off"] .velocity-track { transform: none !important; }
html[data-motion="off"] #cursor { display: none; }
html[data-motion="off"] body.has-cursor,
html[data-motion="off"] body.has-cursor a,
html[data-motion="off"] body.has-cursor button,
html[data-motion="off"] body.has-cursor [role="button"] { cursor: auto; }
html[data-motion="subtle"] .velocity-track { will-change: auto; }
html[data-motion="subtle"] .motion-bars i { animation-duration: 4.5s; }
html[data-motion="subtle"] .live-dot::after { animation-duration: 4.5s; }
html[data-motion="subtle"] .typing b { animation-duration: 2.4s; }
html[data-motion="subtle"] .stack-card { transition-duration: 0.45s; }

/* ---------- Header theme toggle ---------- */
.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  color: var(--bone-2);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.theme-toggle:hover { color: var(--red); border-color: var(--red); }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Project laptop frame ---------- */
.browser-frame {
  position: relative;
  z-index: 1;
  transform-style: preserve-3d;
  will-change: transform;
}
.browser-frame .browser { z-index: 1; }
.browser-base {
  position: relative;
  z-index: 0;
  display: block;
  width: 92%;
  height: 12px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--r-frame) var(--r-frame);
  background: linear-gradient(180deg, var(--surface-2), var(--ink-2));
  box-shadow: 0 18px 35px var(--shadow-lg);
}
.browser-base::after {
  content: "";
  display: block;
  width: 14%;
  height: 3px;
  margin: 0 auto;
  border-radius: 0 0 4px 4px;
  background: var(--line);
}

/* ---------- Theme lab ---------- */
.themes-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.4fr);
  gap: clamp(40px, 6vw, 110px);
  align-items: end;
  margin-bottom: clamp(45px, 7vh, 80px);
}
.themes-head h2 { font-size: clamp(2.8rem, 5.2vw, 5.4rem); max-width: 14ch; }
.themes-aside { padding-bottom: 0.5rem; }
.themes-aside p {
  max-width: 440px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--bone-2);
}
.themes-aside .btn { margin-top: 24px; }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.theme-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  text-align: left;
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.theme-card:hover,
.theme-card:focus-visible {
  transform: translateY(-5px);
  border-color: var(--red);
  box-shadow: 0 24px 50px -24px rgba(var(--accent-rgb), 0.55);
  outline: none;
}
.theme-card:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.theme-card.is-current { border-color: var(--red); }
.theme-card.is-current .theme-apply { color: var(--red); }

.theme-preview {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 4 / 3;
  padding: 12px;
  overflow: hidden;
  background: var(--p-bg);
  color: var(--p-fg);
  font-family: var(--p-sans);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.theme-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 10%, var(--p-accent), transparent 55%);
  opacity: 0.08;
  pointer-events: none;
}
.theme-preview[data-preview="noir"] {
  --p-bg: #070707; --p-fg: #f2eee7; --p-muted: #8a847b; --p-accent: #e11d2e;
  --p-line: rgba(242, 238, 231, 0.13); --p-font: "Instrument Serif", Georgia, serif;
  --p-sans: "Manrope", sans-serif; --p-radius: 0px; --p-btn-bg: #e11d2e; --p-btn-fg: #fff;
}
.theme-preview[data-preview="maison"] {
  --p-bg: #f5efe6; --p-fg: #241c17; --p-muted: #7c6d60; --p-accent: #9c4528;
  --p-line: rgba(36, 28, 23, 0.15); --p-font: "Playfair Display", Georgia, serif;
  --p-sans: "Manrope", sans-serif; --p-radius: 10px; --p-btn-bg: #9c4528; --p-btn-fg: #fffaf4;
}
.theme-preview[data-preview="ivory"] {
  --p-bg: #f3efe8; --p-fg: #0b0b0b; --p-muted: #6e6960; --p-accent: #cf1224;
  --p-line: rgba(10, 10, 10, 0.16); --p-font: "Instrument Serif", Georgia, serif;
  --p-sans: "Manrope", sans-serif; --p-radius: 10px; --p-btn-bg: #cf1224; --p-btn-fg: #fff;
}
.theme-preview[data-preview="brass"] {
  --p-bg: #0d0b07; --p-fg: #f4ead2; --p-muted: #a79a7e; --p-accent: #c9a227;
  --p-line: rgba(244, 234, 210, 0.14); --p-font: "Playfair Display", Georgia, serif;
  --p-sans: "Manrope", sans-serif; --p-radius: 8px; --p-btn-bg: #c9a227; --p-btn-fg: #080808;
}
.theme-preview[data-preview="atelier"] {
  --p-bg: #eef2ee; --p-fg: #10201d; --p-muted: #5f6f6a; --p-accent: #0f8b8d;
  --p-line: rgba(16, 32, 29, 0.16); --p-font: "Playfair Display", Georgia, serif;
  --p-sans: "Inter", sans-serif; --p-radius: 20px; --p-btn-bg: #0f8b8d; --p-btn-fg: #fff;
}
.tp-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--p-line);
}
.tp-bar i { width: 4px; height: 4px; border-radius: 50%; background: var(--p-line); }
.tp-bar i:first-child { background: var(--p-accent); }
.tp-bar em {
  margin-left: auto;
  font-family: var(--p-font);
  font-style: normal;
  font-size: 0.82rem;
  line-height: 1;
  color: var(--p-fg);
}
.tp-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 14px;
}
.tp-eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.36rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--p-muted);
}
.tp-title {
  margin: 7px 0;
  font-family: var(--p-font);
  font-size: clamp(1.25rem, 1.7vw, 1.8rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.tp-title em { font-style: italic; color: var(--p-accent); }
.tp-text { font-size: 0.56rem; line-height: 1.5; color: var(--p-muted); }
.tp-btn {
  margin-top: 10px;
  padding: 6px 9px;
  border-radius: var(--p-radius);
  background: var(--p-btn-bg);
  color: var(--p-btn-fg);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.38rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 0.35s var(--ease);
}
.theme-card:hover .tp-btn { transform: translateY(-2px); }
.tp-chips { display: flex; gap: 4px; width: 100%; margin-top: 12px; }
.tp-chips i { flex: 1; height: 3px; background: var(--p-line); }
.tp-chips i:first-child { background: var(--p-accent); }

.theme-card-foot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.theme-card-foot .mono:nth-child(2) { color: var(--muted); font-size: 0.5rem; }
.theme-apply { color: var(--red); white-space: nowrap; }
.theme-hint { margin-top: 18px; color: var(--muted); }
.theme-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.theme-notes .mono { font-size: 0.5rem; }

/* ---------- Pricing ---------- */
.pricing-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.4fr);
  gap: clamp(40px, 6vw, 110px);
  align-items: end;
  margin-bottom: clamp(45px, 7vh, 80px);
}
.pricing-head h2 { font-size: clamp(2.8rem, 5.2vw, 5.4rem); max-width: 14ch; }
.pricing-aside { padding-bottom: 0.5rem; }
.pricing-aside p {
  max-width: 450px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--bone-2);
}
.pricing-note { margin-top: 18px; color: var(--muted); font-size: 0.5rem; line-height: 1.7; }

.launch-note {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--bone);
  font-size: 0.72rem;
  line-height: 1.65;
}
.launch-note strong { color: var(--red); font-weight: 600; }
.launch-inline { color: var(--red); }
.contact-price .launch-inline { color: var(--on-accent); opacity: 0.9; }
.price-launch {
  margin-top: 8px;
  color: var(--red);
  font-size: 0.52rem;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.currency-picker {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 20px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}
.currency-label { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.currency-label .mono:first-child { color: var(--bone); font-size: 0.55rem; letter-spacing: 0.14em; }
.currency-label #currency-note { color: var(--muted); font-size: 0.46rem; letter-spacing: 0.08em; line-height: 1.45; }
.currency-select {
  width: 100%;
  max-width: none;
  padding: 8px 30px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background-color: var(--ink-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237c6d60' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  color: var(--bone);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  appearance: none;
}
.currency-select:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.money { white-space: nowrap; }
.contact-fx { margin-top: 7px; color: var(--muted); font-size: 0.48rem; letter-spacing: 0.08em; line-height: 1.5; }

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(22px, 2.6vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.price-card:hover { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
.price-card.is-featured {
  border-color: var(--red);
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.09), transparent 42%),
    var(--surface);
}
.price-flag {
  position: absolute;
  top: -1px;
  right: 20px;
  transform: translateY(-50%);
  padding: 5px 9px;
  border-radius: var(--r-chip);
  background: var(--red);
  color: var(--on-accent);
  font-size: 0.5rem;
  white-space: nowrap;
}
.price-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.price-top .mono:first-child { color: var(--red); }
.price-badge { color: var(--muted); font-size: 0.5rem; }
.price-amount {
  margin: 22px 0 14px;
  font-family: var(--serif);
  font-size: clamp(3rem, 4.8vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
}
.price-amount span { margin-right: 4px; font-size: 0.45em; color: var(--muted); }
.price-desc { min-height: 4.8em; font-size: 0.82rem; line-height: 1.7; color: var(--muted); }
.price-list { margin: 22px 0 26px; border-top: 1px solid var(--line); }
.price-list li {
  display: flex;
  gap: 9px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--bone-2);
}
.price-list li::before {
  content: "✓";
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--red);
}
.price-cta { width: 100%; margin-top: auto; }

.price-band {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 30px;
  align-items: center;
  margin-top: 12px;
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--ink-2);
}
.price-band-copy > .mono { color: var(--red); margin-bottom: 8px; }
.price-band h3 {
  margin: 8px 0 10px;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  font-weight: 400;
  line-height: 1;
}
.price-band h3 em { font-style: italic; color: var(--red); }
.price-band p { max-width: 62ch; font-size: 0.82rem; line-height: 1.7; color: var(--muted); }
.price-band-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.price-band-meta .mono { color: var(--muted); font-size: 0.5rem; }

.price-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 12px;
  margin-top: 12px;
}
.addons,
.price-terms {
  min-width: 0;
  padding: clamp(20px, 2.4vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}
.price-subhead { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); margin-bottom: 16px; }
.addon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.addon { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.addon span { display: block; font-size: 0.8rem; font-weight: 600; line-height: 1.35; }
.addon b { display: block; margin: 4px 0; font-family: var(--mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.06em; color: var(--red); }
.addon p { font-size: 0.72rem; line-height: 1.6; color: var(--muted); }
.price-terms { display: flex; flex-direction: column; }
.price-term { padding: 14px 0; border-top: 1px solid var(--line-soft); }
.price-term:first-child { padding-top: 0; border-top: 0; }
.price-term .mono { margin-bottom: 6px; color: var(--red); }
.price-term p:last-child { font-size: 0.76rem; line-height: 1.65; color: var(--muted); }
.price-term b { color: var(--bone); }

.compare {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}
.compare-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.compare-head .mono { font-size: 0.5rem; }
.compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr) minmax(0, 0.6fr) minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.78rem;
  color: var(--bone-2);
}
.compare-row span:first-child { font-weight: 600; color: var(--bone); }
.compare-row span:not(:first-child) {
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.04em;
  line-height: 1.5;
  color: var(--muted);
}
.compare-row.is-us { background: rgba(var(--accent-rgb), 0.06); }
.compare-row.is-us span:first-child { color: var(--red); }
.compare-row.is-us span:not(:first-child) { color: var(--bone-2); }
.compare-row-head { background: var(--ink-2); }
.compare-row-head span { font-family: var(--mono); font-size: 0.52rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.compare-row-head span:first-child { color: var(--muted); font-weight: 400; }
.compare-note { max-width: 86ch; padding: 16px 20px 20px; font-size: 0.76rem; line-height: 1.7; color: var(--muted); }

.pricing-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  margin-top: 12px;
  padding: clamp(24px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--ink-2);
}
.pricing-cta .mono { margin-bottom: 8px; color: var(--red); }
.pricing-cta h3 {
  max-width: 26ch;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  font-weight: 400;
  line-height: 1.05;
}
.pricing-cta-actions { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }

.contact-price {
  margin-top: 18px;
  color: rgba(var(--on-accent-rgb), 0.7);
  font-size: 0.55rem;
}
.contact-price::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  margin-right: 8px;
  background: currentColor;
  vertical-align: middle;
}

/* ---------- Theme studio panel ---------- */
body.theme-open { overflow: hidden; }
body.theme-open #cursor { opacity: 0; }
body.has-cursor.theme-open,
body.has-cursor.theme-open * { cursor: auto; }
body.theme-open .theme-fab,
body.modal-open .theme-fab,
body.menu-open .theme-fab { opacity: 0; pointer-events: none; }

.theme-scrim {
  position: fixed;
  inset: 0;
  z-index: 8550;
  background: var(--scrim);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
body.theme-open .theme-scrim { opacity: 1; visibility: visible; }

.theme-panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 8600;
  display: flex;
  flex-direction: column;
  width: min(400px, 100vw);
  height: 100%;
  border-right: 1px solid var(--line);
  background: var(--ink-2);
  box-shadow: 30px 0 80px rgba(0, 0, 0, 0.35);
  transform: translateX(-101%);
  visibility: hidden;
  transition: transform 0.55s var(--ease), visibility 0s 0.55s;
}
body.theme-open .theme-panel {
  transform: none;
  visibility: visible;
  transition: transform 0.55s var(--ease), visibility 0s 0s;
}

.theme-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-shrink: 0;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line);
}
.theme-panel-head .mono { color: var(--red); margin-bottom: 8px; }
.theme-panel-head h3 { font-family: var(--serif); font-size: 2.5rem; font-weight: 400; line-height: 0.9; }
.theme-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  color: var(--bone-2);
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}
.theme-close:hover { color: var(--on-accent); background: var(--red); border-color: var(--red); }

.theme-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 24px 40px;
}
.theme-live > .mono { margin-bottom: 10px; color: var(--muted); }
.theme-live-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
}
.theme-live-card > .mono { color: var(--red); font-size: 0.5rem; }
.theme-live-card strong {
  display: block;
  margin: 10px 0;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.theme-live-card strong em { font-style: italic; color: var(--red); }
.theme-live-card p { font-size: 0.74rem; line-height: 1.6; color: var(--muted); }
.theme-live-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.theme-live-row .btn { padding: 0.72em 0.9em; font-size: 0.52rem; }
.theme-live-chips { display: flex; gap: 5px; margin-top: 14px; }
.theme-live-chips i { width: 22px; height: 4px; background: var(--line); }
.theme-live-chips i:first-child { background: var(--red); }

.theme-control { margin-top: 20px; }
.theme-control > .mono { margin-bottom: 8px; color: var(--muted); }
.seg {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
}
.seg button {
  flex: 1;
  padding: 9px 6px;
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s, background-color 0.3s;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--bone); }
.seg button.is-active { background: var(--red); color: var(--on-accent); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--sw);
  outline: 1px solid var(--line);
  outline-offset: 1px;
  transition: transform 0.25s var(--ease), border-color 0.25s, outline-color 0.25s;
}
.swatches button:hover { transform: scale(1.08); }
.swatches button.is-active { border-color: var(--bone); outline-color: var(--bone); transform: scale(1.1); }
.theme-value { margin-top: 8px; color: var(--muted); font-size: 0.5rem; }

.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.preset-buttons button {
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bone-2);
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}
.preset-buttons button:hover { color: var(--red); border-color: var(--red); }
.preset-buttons button.is-active { background: var(--red); color: var(--on-accent); border-color: var(--red); }

.theme-reset {
  width: 100%;
  margin-top: 22px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  color: var(--bone-2);
  font-size: 0.52rem;
  transition: color 0.3s, border-color 0.3s;
}
.theme-reset:hover { color: var(--red); border-color: var(--red); }
.theme-save { margin-top: 12px; text-align: center; color: var(--muted); font-size: 0.44rem; }

.theme-fab {
  position: fixed;
  left: 14px;
  right: auto;
  bottom: 18px;
  z-index: 7700;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--bone);
  border-radius: 999px;
  background: var(--bone);
  color: var(--ink);
  box-shadow: 0 18px 40px var(--shadow-lg);
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 0.35s var(--ease), background-color 0.35s, color 0.35s, border-color 0.35s, opacity 0.35s;
}
.theme-fab svg { color: var(--red); transition: color 0.35s; }
.theme-fab span {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  background: var(--surface);
  color: var(--bone);
  box-shadow: 0 10px 24px var(--shadow-lg);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.theme-fab:hover span,
.theme-fab:focus-visible span { opacity: 1; transform: none; }
.theme-fab:hover {
  transform: translateY(-2px);
  background: var(--red);
  border-color: var(--red);
  color: var(--on-accent);
}
.theme-fab:hover svg { color: var(--on-accent); }

.theme-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 9000;
  max-width: calc(100vw - 40px);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-chip);
  background: var(--bone);
  color: var(--ink);
  box-shadow: 0 18px 40px var(--shadow-lg);
  font-family: var(--mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.theme-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  .header-inner { gap: 18px; }
  .availability { display: none; }
  .project-head { grid-template-columns: 70px minmax(0, 1fr) minmax(230px, 0.34fr); }
  .work-row { grid-template-columns: 54px minmax(0, 1fr) 180px 90px 30px; }
}

@media (max-width: 1024px) {
  .desk-nav { gap: 20px; }
  .hero-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }
  .project-body { gap: 38px; }
  .bcard { min-height: 280px; }
  .footer-top { grid-template-columns: 1.2fr 0.6fr 0.6fr; }
}

@media (max-width: 900px) {
  :root { --header-h: 72px; }

  .desk-nav { display: none; }
  .burger { display: flex; }
  .header-right { gap: 10px; }
  .btn-header { display: none; }

  .hero {
    padding-top: 104px;
    min-height: 0;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    align-items: start;
  }
  .hero-title { font-size: clamp(3.4rem, 12vw, 6.6rem); }
  .hero-aside { max-width: 560px; }
  .hero-lede { max-width: 520px; }

  .hero-stage {
    height: auto;
    margin-top: 34px;
    padding-bottom: 0;
    perspective: none;
  }
  .stage-glow { width: 90%; height: 80%; }
  .stage-floor { display: none; }
  .stack {
    position: relative;
    inset: auto;
    height: auto;
    display: flex;
    justify-content: center;
    transform: none !important;
    perspective: none;
  }
  .stack-card {
    position: relative;
    top: auto;
    left: auto;
    display: none;
    width: min(88vw, 540px);
    transform: none !important;
    opacity: 0;
    filter: none !important;
    cursor: pointer;
  }
  .stack-card.is-active {
    display: block;
    opacity: 1;
    z-index: 2;
  }
  .stack-ui {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 18px;
    padding-inline: var(--pad);
  }
  .stack-hint { display: none; }

  .intro-grid { grid-template-columns: 1fr; gap: 34px; }
  .intro-title { max-width: 16ch; }
  .intro-side { max-width: 640px; }

  .work-head { grid-template-columns: 1fr; gap: 30px; }
  .work-title { max-width: 15ch; }
  .work-aside { max-width: 560px; }
  .work-row { grid-template-columns: 48px minmax(0, 1fr) 30px; }
  .row-cat, .row-pages { display: none; }
  #work-peek { display: none; }

  .project-head {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 18px;
  }
  .project-tagline {
    grid-column: 2;
    padding-left: 18px;
    margin-top: 6px;
    max-width: 520px;
  }
  .project-body,
  .project:nth-of-type(even) .project-body {
    grid-template-columns: 1fr;
    gap: 55px;
  }
  .project:nth-of-type(even) .project-visual,
  .project:nth-of-type(even) .project-info { order: initial; }
  .project-visual { max-width: 760px; }
  .project-info { max-width: 640px; }
  .visual-caption { text-align: left; margin-top: 46px; }

  .cap-head { grid-template-columns: 1fr; gap: 26px; }
  .cap-title { max-width: 17ch; }
  .cap-lede { max-width: 620px; }

  .bcard, .bcard-wide,
  .bcard:nth-child(2), .bcard:nth-child(3),
  .bcard:nth-child(4), .bcard:nth-child(5),
  .bcard:nth-child(6) { grid-column: span 6; }
  .bcard { min-height: 270px; }

  .process-head { grid-template-columns: 1fr; gap: 26px; }
  .process-head h2 { max-width: 16ch; }
  .process-head p { max-width: 560px; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .step:nth-child(2) { border-right: 0; }
  .step:nth-child(3), .step:nth-child(4) { border-top: 1px solid var(--line); }

  .about-grid { grid-template-columns: 1fr; gap: 44px; }
  .about-panel { max-width: 430px; aspect-ratio: 4 / 4.6; }
  .about-copy { max-width: 700px; }

  .contact-grid { grid-template-columns: 1fr; gap: 42px; align-items: start; }
  .contact-copy p { max-width: 52ch; }
  .contact-details { max-width: 680px; }

  .footer-top { grid-template-columns: 1fr 1fr; gap: 34px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-wrap: wrap; }
}

@media (max-width: 768px) {
  .modal-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    padding: 8px 10px;
  }
  .modal-id { grid-column: 1; grid-row: 1; min-width: 0; }
  .modal-id h3 { font-size: 1.15rem; }
  .modal-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    order: initial;
    flex-basis: auto;
    border-top: 1px solid var(--line);
    padding-top: 3px;
  }
  .device-switch { display: flex; }
  .device-switch button { width: 30px; height: 28px; }
  .modal-tools { grid-column: 2; grid-row: 1; margin-left: auto; gap: 5px; }
  .modal-external, .modal-close { width: 30px; height: 28px; }
  .modal-stage { padding: 8px; }
  .device[data-device="mobile"] .device-chrome { display: none; }
  .modal-hint { display: none; }

  .bcard, .bcard-wide,
  .bcard:nth-child(2), .bcard:nth-child(3),
  .bcard:nth-child(4), .bcard:nth-child(5),
  .bcard:nth-child(6) { grid-column: span 12; min-height: 250px; }
  .bcard-visual { min-height: 76px; }

  .stack-strip { flex-direction: column; gap: 14px; }
  .stack-strip > .mono { padding-top: 0; }

  .contact-line { grid-template-columns: 66px minmax(0, 1fr) auto; gap: 10px; }
  .contact-line b { font-size: 0.82rem; }
  .contact-foot { flex-direction: column; gap: 8px; }
}

@media (max-width: 560px) {
  .section { padding-block: 72px; }
  .section-label { margin-bottom: 32px; }

  .brand-sub { display: none; }
  .brand-mark { font-size: 1.95rem; }

  .hero { padding-top: 92px; }
  .hero-title { font-size: clamp(3rem, 14.5vw, 4.8rem); }
  .hero-lede { font-size: 0.95rem; }
  .hero-ctas { gap: 8px; }
  .hero-ctas .btn { padding: 1em 1.15em; font-size: 0.6rem; }
  .hero-note { font-size: 0.5rem; }

  .stack-card { width: 88vw; }
  .card-chrome { height: 28px; }
  .card-foot { padding: 11px 13px; gap: 10px; }
  .card-name h2 { font-size: 1.15rem; }
  .card-name p { font-size: 0.42rem; }
  .stack-dots { gap: 13px; }
  .stack-dot { font-size: 0.52rem; }
  .stack-dot span { width: 12px; }
  .stack-dot.is-active span { width: 24px; }

  .velocity-set { gap: 20px; padding-right: 20px; }

  .intro-title { font-size: clamp(2.5rem, 11vw, 3.6rem); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 20px 18px; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3), .stat:nth-child(4) { border-top: 1px solid var(--line); }
  .stat-num { font-size: 3rem; }

  .work-title { font-size: clamp(2.6rem, 12vw, 4rem); }
  .work-row { padding: 18px 0; gap: 10px; grid-template-columns: 38px minmax(0, 1fr) 24px; }
  .work-row h3 { font-size: 1.9rem; }
  .work-row:hover, .work-row:focus-visible { padding-left: 12px; padding-right: 12px; }

  .project-head { grid-template-columns: 1fr; gap: 12px; }
  .project-index { display: none; }
  .project-tagline { grid-column: 1; padding-left: 16px; }
  .project-title { font-size: clamp(3.2rem, 15vw, 4.6rem); }
  .project-cat { font-size: 0.5rem; line-height: 1.7; }
  .browser-screen { height: clamp(250px, 44vh, 380px); }
  .phone { width: 112px; left: -12px; bottom: -22px; border-radius: 0; padding: 3px; }
  .phone-screen { border-radius: 0; }
  .visual-caption { font-size: 0.5rem; margin-top: 38px; }
  .project-actions .btn { width: 100%; }
  .specs { gap: 8px; }
  .palette { gap: 10px 16px; }
  .swatch small { display: none; }

  .cap-title { font-size: clamp(2.8rem, 12vw, 4rem); }
  .bcard-body h3 { font-size: 2.1rem; }
  .type-specimen { gap: 10px; }
  .ts-serif { font-size: 4rem; }
  .ts-swatches { width: 100%; margin-left: 0; margin-top: 8px; }
  .ts-swatches i { height: 14px; flex: 1; }

  .process-grid { grid-template-columns: 1fr; }
  .step { border-right: 0; border-top: 1px solid var(--line); padding: 24px 30px; }
  .step:first-child { border-top: 0; }
  .step p { max-width: 40ch; }

  .about-panel { max-width: 100%; aspect-ratio: 4 / 4.4; }
  .about-copy h2 { font-size: clamp(2.3rem, 10vw, 3.2rem); }
  .skill-group { grid-template-columns: 1fr; gap: 8px; }

  .contact { padding-block: 76px 54px; }
  .contact-title { font-size: clamp(2.5rem, 11.5vw, 3.8rem); max-width: 12ch; }
  .contact-copy p { font-size: 1rem; }
  .contact-actions .btn { width: 100%; }
  .contact-line { grid-template-columns: 58px minmax(0, 1fr); }
  .contact-line i { display: none; }
  .contact-line b { font-size: 0.78rem; }

  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 10px; }
}


/* ---------- New sections: responsive ---------- */
@media (max-width: 1180px) {
  .theme-card-foot .mono:nth-child(2) { font-size: 0.42rem; }
}

@media (max-width: 1024px) {
  .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-preview { aspect-ratio: 16 / 10; }
}

@media (max-width: 900px) {
  .themes-head,
  .pricing-head { grid-template-columns: 1fr; gap: 26px; }
  .themes-head h2,
  .pricing-head h2 { max-width: 17ch; }
  .themes-aside,
  .pricing-aside { max-width: 620px; padding-bottom: 0; }
  .price-grid { grid-template-columns: 1fr; }
  .price-band { grid-template-columns: 1fr; gap: 22px; }
  .price-lower { grid-template-columns: 1fr; }
  .pricing-cta { flex-direction: column; align-items: flex-start; }
  .pricing-cta h3 { max-width: 32ch; }
  .compare-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr) minmax(0, 0.6fr) minmax(0, 1fr); }
  .stack-ui { grid-template-columns: 1fr auto; }
}

@media (max-width: 768px) {
  .theme-panel { width: 100%; border-right: 0; }
  .theme-panel-head { padding: 20px 18px 16px; }
  .theme-panel-body { padding: 18px 18px 34px; }
  .theme-fab { display: none; }
  .theme-fab span { display: none; }
  .theme-toast { bottom: 74px; }
  .theme-toggle { width: 32px; height: 32px; }
  .addon-grid { grid-template-columns: 1fr; }
  .compare-head { display: none; }
  .compare-row { grid-template-columns: 1fr 1fr; gap: 8px 18px; }
  .compare-row span:first-child {
    grid-column: 1 / -1;
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.1;
  }
  .compare-row span[data-label]::before {
    content: attr(data-label) " · ";
    font-family: var(--mono);
    font-size: 0.44rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .compare-row span:nth-child(4) { grid-column: 1 / -1; }
  .compare-row.is-us span:first-child { color: var(--red); }
  .compare-note { padding-top: 16px; }
  .pricing-cta-actions { width: 100%; }
  .pricing-cta-actions .btn { flex: 1; }
}

@media (max-width: 560px) {
  .theme-grid { grid-template-columns: 1fr; }
  .theme-preview { aspect-ratio: 16 / 10; }
  .theme-card-foot .mono:nth-child(2) { display: none; }
  .theme-notes { gap: 8px 16px; }
  .price-card { padding: 20px; }
  .price-amount { font-size: 3.4rem; }
  .price-desc { min-height: 0; }
  .price-list { margin: 18px 0 22px; }
  .price-band { padding: 20px; }
  .price-band h3 { font-size: 1.8rem; }
  .addons, .price-terms { padding: 20px; }
  .compare-row { padding: 12px 14px; }
  .compare-row span:first-child { font-size: 1.15rem; }
  .pricing-cta { padding: 22px; }
  .pricing-cta h3 { font-size: 1.6rem; }
  .pricing-cta-actions { flex-direction: column; }
  .pricing-cta-actions .btn { width: 100%; }
  .contact-price { font-size: 0.52rem; }
  .phone { left: auto; right: -10px; bottom: -18px; width: 108px; }
  .visual-caption { margin-top: 28px; }
  .browser-base { height: 10px; }
}

/* Short laptop screens: keep the hero card stack inside the fold */
@media (min-width: 901px) and (max-height: 820px) {
  .hero { padding-top: 86px; }
  .hero-title { font-size: clamp(3.5rem, 7vw, 6rem); }
  .hero-eyebrow { margin-bottom: 16px; }
  .hero-stage { height: clamp(330px, 48vh, 400px); margin-top: 12px; }
  .stack-card { width: clamp(280px, 29vw, 440px); }
  .hero-lede { font-size: 1rem; line-height: 1.65; }
  .hero-ctas { margin-top: 20px; }
  .hero-note { margin-top: 16px; }
  .stack-hint { display: none; }
  .stack-ui { grid-template-columns: 1fr auto; }
}

/* Short, narrower laptops: use more of the stage width */
@media (min-width: 901px) and (max-width: 1150px) and (max-height: 820px) {
  .stack-card { width: clamp(280px, 34vw, 400px); }
}

/* ---------- 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;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .hero-title .line > span { transform: none; }
  .hero-eyebrow, .hero-aside, .hero-stage { opacity: 1; transform: none; }
  .velocity-track { transform: none !important; }
  #preloader { display: none; }
  .cursor-ring { transition: none; }
}

/* ---------- WhatsApp float (shared by the portfolio and case studies) ---------- */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #25D366;
  color: #fff;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(37, 211, 102, 0.35);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s;
}
.whatsapp-float.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.whatsapp-float:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(37, 211, 102, 0.45);
}
.whatsapp-float:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
@media (max-width: 600px) {
  .whatsapp-float {
    left: 16px;
    right: 16px;
    bottom: 16px;
    justify-content: center;
    padding: 14px 20px;
    font-size: 0.9rem;
    border-radius: 12px;
  }
}

/* ============================================================
   PHONE READABILITY + TAP TARGETS  (max-width: 560px)
   ------------------------------------------------------------
   The 560px block further up deliberately SHRINKS copy:
   .card-name p -> 0.42rem (6.7px), .hero-note/.project-cat/
   .visual-caption -> 0.5rem (8px), and .mono is 0.62rem (9.9px)
   everywhere. On a handset that is unreadable. This raises
   everything a reader must read to a ~11px floor and gives
   controls a >= 40px tap height.

   Decorative miniatures (fake browser chrome, device frame,
   theme-preview mockups) read as scaled-down screenshots, so
   they keep their miniature type.
   ============================================================ */
@media (max-width: 560px) {

  /* ---- readability floor ---- */
  .mono { font-size: 11px; }
  /* .velocity-head .mono sets 0.55rem (8.8px) and outranks the .mono floor
     above, which left "Selected disciplines" and "Concept work · 2026" as the
     only two labels a reader must see below 11px. */
  .velocity-head .mono { font-size: 11px; }

  .hero-eyebrow,
  .hero-note,
  .project-cat,
  .visual-caption,
  .card-name p,
  .section-label,
  .stat-lbl,
  .step-num,
  .step-time,
  .price-badge,
  .price-flag,
  .price-launch,
  .menu-label,
  .menu-loc,
  .theme-hint,
  .row-num { font-size: 11px; }

  /* ---- buttons: readable label + ~41px tall tap target ---- */
  .btn {
    font-size: 11.5px;
    padding: 1.2em 1.45em;
  }
  .hero-ctas .btn { font-size: 11.5px; padding: 1.2em 1.4em; }

  /* ---- homepage content runs the first pass missed ---- */
  .skill-group span,
  .tags li,
  .stack-list span,
  .spec span,
  .compare-row span:not(:first-child),
  .compare-row-head span,
  .theme-notes .mono,
  .pages > .mono,
  .about-links a,
  .footer-nav a,
  .footer-social a,
  .contact-line .mono,
  .contact-line i,
  .card-chrome em,
  .card-live,
  .swatch em,
  .swatch small,
  .marquee span,
  .currency-label .mono:first-child,
  #currency-note.mono,
  #modal-index,
  .pb-sub,
  .price-band-meta .mono,
  .theme-live-card > .mono,
  .theme-live-row .btn,
  .form-row i,
  .form-submit,
  .skip-link,
  .scroll-cue,
  .addon b,
  .to-top,
  .page-chips button,
  .menu nav a span { font-size: 11px; }

  /* audit tool: the Yes/No/Not sure segments are the main control */
  .seg span { padding: 14px 10px; white-space: nowrap; }

  /* ---- icon controls: 40px minimum ---- */
  .theme-toggle,
  .burger { width: 40px; height: 40px; }

  /* ---- theme panel + footer controls: thumb-sized ---- */
  .page-chips button,
  .seg button,
  .preset-buttons button { min-height: 40px; padding-block: 10px; font-size: 11px; }
  .swatches button { position: relative; }
  .swatches button::after { content: ""; position: absolute; inset: -6px; }
  .theme-close,
  .modal-close { width: 40px; height: 40px; }
  .to-top { display: inline-flex; align-items: center; min-height: 40px; }

  /* ---- indicators that collapsed under the button reset ---- */
  .stack-dot { padding: 12px 6px; font-size: 11px; }
  [data-slide] { min-width: 40px; min-height: 40px; }

  /* ---- device-frame chrome stays miniature ---- */
  .panel-meta,
  .panel-edge { font-size: 8px; }
}

/* ---------- Phones: no live preview modal, redirects only ---------- */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .preview-trigger { display: none !important; }
  .modal { display: none !important; }

  /* Header tap targets. The controls default to 34px and SHRINK to 32px
     below 768px, while the 40px floor only reaches them below 560px — so
     from 561px to 900px every header control sat under the minimum, on the
     homepage as much as on any secondary page. Being last in the file, this
     rule also overrides the 768px shrink above. */
  .theme-toggle,
  .burger { width: 40px; height: 40px; }

  /* The brand link is only as tall as its own text (~25px), so it falls
     short of 40px everywhere. A transparent overlay widens the hit area
     without padding, leaving the header at exactly the height it has now. */
  .brand { position: relative; }
  .brand::after {
    content: "";
    position: absolute;
    top: -8px;
    bottom: -8px;
    left: 0;
    right: 0;
  }
}

/* ============================================================
   ULTRA-NARROW (<=360px): horizontal overflow
   ------------------------------------------------------------
   Below ~360px three elements pin themselves to a size the viewport
   cannot hold and drag document.scrollWidth past the viewport:
   the price band's min-content, the audit form's inline-flex
   segmented control, and the case-study grid's 280px track floor.
   Each is released here. Measured overflow before this block:
   home +25px, audit +56px, case study +40px, all at 280px.
   ============================================================ */
@media (max-width: 360px) {
  /* The band is a single 1fr track at this width, and 1fr resolves its
     minimum to min-content — the non-wrapping "Enquire about white-label"
     button — measuring 264px inside a 200px content box. */
  .price-band { grid-template-columns: minmax(0, 1fr); }
  .price-band-copy,
  .price-band-meta { min-width: 0; }
  .price-band-meta .btn { white-space: normal; max-width: 100%; text-align: left; }

  /* The 3-up spec row floors its third track at the label's min-content
     ("PRICING TIERS" letter-spaced = 91px in an 80px share), pushing the
     document 5px wide. Release the floor and let the label wrap. */
  .specs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spec { min-width: 0; }

  /* "…(Living/Bedroom/Kitchen)…" is a single unbreakable token, so this
     card's paragraph paints 73px past its 211px box. */
  .case-card p { overflow-wrap: break-word; }
}
