/* ════════════════════════════════════════════════════════════════
   RATCHETWORKS v3 — "Procedural / Engine Room"
   Shared design system: static index.html + WordPress blog theme
   ════════════════════════════════════════════════════════════════ */

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

:root {
  --bg: #070809;
  --bg2: #0C0E11;
  --bg3: #13161C;
  --green: #00FF88;
  --green-dim: #00CC6A;
  --green-glow: rgba(0, 255, 136, 0.35);
  --white: #F2F4F6;
  --muted: #98A2B3;
  --border: #1C212B;
  --max-w: 1280px;
  --pad-x: 48px;
  --pad-x-sm: 24px;
  --nav-h: 76px;
  --font-main: 'Archivo', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.25s var(--ease-out);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-main);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body { min-height: 100vh; overflow-x: clip; }

img { max-width: 100%; height: auto; }

::selection { background: var(--green); color: #000; }

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

/* ── Utilities ─────────────────────────────────────────────────── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 1000;
  background: var(--green);
  color: #000;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 4px;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* Film grain over everything (decorative) */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  z-index: 999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.9s steps(4) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 1%); }
  50%  { transform: translate(1%, -2%); }
  75%  { transform: translate(-1%, 2%); }
  100% { transform: translate(0, 0); }
}

/* Trailing cursor ring (pointer: fine only, enabled by JS) */
.cursor-ring {
  display: none;
  position: fixed;
  top: 0; left: 0;
  z-index: 998;
  width: 36px; height: 36px;
  margin: -18px 0 0 -18px;
  border: 1px solid var(--green-glow);
  border-radius: 50%;
  pointer-events: none;
  transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out),
              margin 0.25s var(--ease-out), border-color 0.25s var(--ease-out),
              opacity 0.25s var(--ease-out);
  opacity: 0;
}
html.has-cursor .cursor-ring { display: block; }
.cursor-ring.is-active { opacity: 1; }
.cursor-ring.is-hover {
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
  border-color: var(--green);
}

/* ── Sections ──────────────────────────────────────────────────── */

section { padding: 128px 0; position: relative; }

.section-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--green);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.section-title {
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 900;
  font-stretch: 115%;
  text-transform: uppercase;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--white);
  margin-bottom: 20px;
}

.accent-serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  text-transform: none;
  letter-spacing: 0;
  color: var(--green);
  font-size: 1.04em;
}

.section-sub {
  font-size: 17px;
  color: var(--muted);
  max-width: 540px;
  line-height: 1.7;
}

@media (max-width: 767px) {
  .container { padding: 0 var(--pad-x-sm); }
  section { padding: 80px 0; }
}

/* ── Scroll reveal (JS adds html.js + .in) ─────────────────────── */

html.js .rv {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--rv-delay, 0ms);
}
html.js .rv.in { opacity: 1; transform: none; }

/* ── Buttons ───────────────────────────────────────────────────── */

.btn-primary {
  position: relative;
  display: inline-block;
  background: var(--green);
  color: #000;
  padding: 13px 26px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  text-decoration: none;
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow var(--transition), filter var(--transition);
}
.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 0 32px var(--green-glow);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--border);
  background: transparent;
  padding: 13px 26px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); background: rgba(0, 255, 136, 0.04); }
.btn-ghost span { transition: transform var(--transition); }
.btn-ghost:hover span { transform: translateX(4px); }

[data-magnetic] { will-change: transform; }

/* ── Header / nav ──────────────────────────────────────────────── */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(7, 8, 9, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-h);
}

.nav-logo { display: inline-flex; align-items: center; text-decoration: none; }
.nav-logo-img { height: 42px; width: auto; display: block; }

.nav-links {
  display: flex;
  gap: 34px;
  list-style: none;
}
.nav-links a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
  padding: 6px 0;
  transition: color var(--transition);
}
.nav-idx {
  color: var(--green);
  font-size: 9px;
  vertical-align: super;
  margin-right: 4px;
  opacity: 0.7;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--green);
  transition: right 0.3s var(--ease-out);
}
.nav-links a:hover, .nav-links a[aria-current="true"] { color: var(--white); }
.nav-links a:hover::after, .nav-links a[aria-current="true"]::after { right: 0; }

.nav-right { display: flex; align-items: center; gap: 16px; }
.nav-cta { padding: 10px 20px; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-dropdown {
  display: none;
  flex-direction: column;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 8px 0;
}
.nav-dropdown ul { list-style: none; }
.nav-dropdown a {
  display: block;
  padding: 15px var(--pad-x-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition), padding-left var(--transition);
}
.nav-dropdown li:last-child a { border-bottom: none; }
.nav-dropdown a:hover { color: var(--green); padding-left: calc(var(--pad-x-sm) + 6px); }
.nav-dropdown.open { display: flex; }

.nav-progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: transparent;
}
.nav-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  box-shadow: 0 0 12px var(--green-glow);
}

@media (max-width: 920px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-cta { display: none; }
}

/* ── Hero ──────────────────────────────────────────────────────── */

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 48px) 0 64px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 70% 20%, rgba(0, 255, 136, 0.05), transparent 60%),
    var(--bg);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 8, 9, 0.55) 0%, transparent 30%, transparent 62%, var(--bg) 100%);
}

.hero-content { position: relative; z-index: 2; }

.hero-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 36px;
}

.available-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(0, 255, 136, 0.07);
  border: 1px solid rgba(0, 255, 136, 0.3);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.badge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.hero-tag::before {
  content: '';
  width: 36px; height: 1px;
  background: var(--green);
}

.hero-headline {
  font-size: clamp(58px, 11.5vw, 168px);
  font-weight: 900;
  font-stretch: 122%;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.015em;
  color: var(--white);
  margin-bottom: 44px;
}
.hh-line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hh-word { display: inline-block; }
.hh-serif {
  display: inline-block;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.92em;
  color: var(--green);
  text-shadow: 0 0 60px var(--green-glow);
}

.hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
  margin-bottom: 72px;
}

.hero-sub {
  font-size: 18px;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-stats {
  display: flex;
  gap: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column-reverse; }
.stat-num {
  font-size: 40px;
  font-weight: 900;
  font-stretch: 115%;
  color: var(--white);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-suffix { color: var(--green); }
.stat-num--mono {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--green);
  padding-top: 10px;
}
.stat-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 8px;
  font-family: var(--font-mono);
}
.stat--wide { margin-left: auto; }

.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: var(--pad-x);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}
.hero-scroll:hover { color: var(--green); }
.hero-scroll-line {
  width: 1px;
  height: 36px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}
.hero-scroll-line::after {
  content: '';
  position: absolute;
  top: -100%; left: 0;
  width: 100%; height: 100%;
  background: var(--green);
  animation: scrollDrip 2.2s var(--ease-out) infinite;
}
@keyframes scrollDrip {
  0% { top: -100%; }
  60%, 100% { top: 100%; }
}

/* Load-in sequence (one-shot, CSS only) */
.ld { animation: ldRise 0.9s var(--ease-out) both; }
.ld-1 { animation-delay: 0.05s; }
.ld-2 { animation-delay: 0.15s; }
.ld-3 { animation-delay: 0.25s; }
.ld-4 { animation-delay: 0.35s; }
.ld-5 { animation-delay: 0.55s; }
.ld-6 { animation-delay: 0.7s; }
@keyframes ldRise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
.hh-line.ld { animation: none; opacity: 1; transform: none; }
.hh-line .hh-word, .hh-line .hh-serif {
  animation: hhUp 1s var(--ease-out) both;
}
.ld-2 .hh-word { animation-delay: 0.12s; }
.ld-3 .hh-word { animation-delay: 0.22s; }
.ld-4 .hh-serif { animation-delay: 0.34s; }
@keyframes hhUp {
  from { transform: translateY(112%); }
  to   { transform: none; }
}

@media (max-width: 767px) {
  /* no terrain on mobile: hero shrinks to its content, top-aligned */
  .hero { min-height: 0; justify-content: flex-start; padding: calc(var(--nav-h) + 24px) 0 48px; }
  .hero-canvas, .hero-vignette { display: none; }
  .hero-eyebrow { margin-bottom: 28px; }
  .hero-headline { margin-bottom: 32px; }
  .hero-row { margin-bottom: 40px; gap: 32px; }
  .hero-stats { gap: 28px; padding-top: 28px; }
  .stat--wide { display: none; }
  .hero-scroll { display: none; }
}

/* ── Marquee ───────────────────────────────────────────────────── */

.marquee {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  overflow: hidden;
  padding: 18px 0;
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track,
.marquee:focus-within .marquee-track { animation-play-state: paused; }
.marquee-row {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.marquee-row i {
  font-style: normal;
  color: var(--green);
  font-size: 11px;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── About ─────────────────────────────────────────────────────── */

#about { background: var(--bg); }

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 96px;
  align-items: start;
}

.about-body {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.85;
  margin: 28px 0 32px;
  max-width: 560px;
}

.about-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}
.pill {
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.pill:hover { border-color: var(--muted); color: var(--white); }
.pill--hot { border-color: rgba(0, 255, 136, 0.45); color: var(--green); background: rgba(0, 255, 136, 0.05); }

.about-right { display: flex; flex-direction: column; gap: 28px; }

.portrait-frame {
  position: relative;
  padding: 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  transform-style: preserve-3d;
}
.portrait-frame img {
  display: block;
  width: 100%;
}
.pf-corner {
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid var(--green);
  z-index: 2;
}
.pf-tl { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.pf-tr { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.pf-bl { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.pf-br { bottom: -2px; right: -2px; border-left: none; border-top: none; }
.collab-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px;
}
.collab-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--green);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.collab-list { list-style: none; }
.collab-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left var(--transition);
}
.collab-item:hover { padding-left: 8px; }
.collab-item:last-child { border-bottom: none; }
.collab-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  min-width: 24px;
}
.collab-name { font-size: 16px; font-weight: 600; color: var(--white); flex: 1; }
.collab-type { font-size: 11px; color: var(--muted); font-family: var(--font-mono); letter-spacing: 0.08em; }
.collab-nda-text { font-size: 14px; color: var(--muted); }

@media (max-width: 1023px) {
  .about-grid { grid-template-columns: 1fr; gap: 56px; }
  .portrait-frame { max-width: 420px; }
}

/* ── Services ──────────────────────────────────────────────────── */

#services { background: var(--bg2); }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 64px;
}

.service-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 40px 34px;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  transition: left 0.7s var(--ease-out);
}
.service-card:hover::before { left: 100%; }
.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 255, 136, 0.35);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.8);
}
.service-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  letter-spacing: 0.2em;
  margin-bottom: 24px;
}
.service-name {
  font-size: 22px;
  font-weight: 800;
  font-stretch: 110%;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--white);
  margin-bottom: 14px;
  line-height: 1.2;
}
.service-desc {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 24px;
}
.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}
.stag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 3px;
}

@media (max-width: 1023px) {
  .services-grid { grid-template-columns: 1fr; max-width: 560px; }
}

/* ── Work: featured case list ──────────────────────────────────── */

#work { background: var(--bg); }

.case-list {
  list-style: none;
  margin-top: 64px;
  border-top: 1px solid var(--border);
}
.case {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.case-idx {
  font-size: clamp(64px, 8vw, 112px);
  font-weight: 900;
  font-stretch: 122%;
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1px rgba(152, 162, 179, 0.45);
  transition: -webkit-text-stroke-color 0.4s ease, color 0.4s ease, text-shadow 0.4s ease;
  font-variant-numeric: tabular-nums;
}
.case:hover .case-idx {
  -webkit-text-stroke-color: var(--green);
  color: rgba(0, 255, 136, 0.08);
  text-shadow: 0 0 40px var(--green-glow);
}
.case-body { max-width: 760px; }
.case-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 14px;
}
.case-client {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.case-tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 3px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.case-period {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.case-title {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 800;
  font-stretch: 112%;
  text-transform: uppercase;
  line-height: 1.12;
  color: var(--white);
  margin-bottom: 12px;
  transition: color var(--transition);
}
.case:hover .case-title { color: var(--green); }
.case-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.75;
}

@media (max-width: 767px) {
  .case { grid-template-columns: 1fr; gap: 12px; padding: 36px 0; }
  .case-idx { font-size: 48px; }
}

/* ── Work: card grid + NDA ─────────────────────────────────────── */

.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 56px;
}
.work-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 32px;
  transition: border-color var(--transition), box-shadow var(--transition);
  transform-style: preserve-3d;
}
.work-card:hover {
  border-color: rgba(0, 255, 136, 0.4);
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.85);
}
.work-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.work-client {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.work-tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 3px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.work-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
  line-height: 1.3;
}
.work-desc { font-size: 14px; color: var(--muted); line-height: 1.7; }

.nda-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.nda-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 28px 32px;
  transition: border-color var(--transition);
}
.nda-card:hover { border-color: rgba(0, 255, 136, 0.35); }
.nda-card--full { grid-column: 1 / -1; }
.nda-icon { font-size: 22px; color: var(--green); opacity: 0.5; line-height: 1.4; flex-shrink: 0; }
.nda-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--green);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.nda-desc { font-size: 14px; color: var(--muted); line-height: 1.7; }

@media (max-width: 767px) {
  .work-grid, .nda-grid { grid-template-columns: 1fr; }
}

/* ── Writing (shared with blog theme) ──────────────────────────── */

#writing { background: var(--bg2); }

.writing-list {
  margin-top: 56px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
}
.writing-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 30px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  position: relative;
  transition: background var(--transition);
}
.writing-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--green);
  transform: scaleY(0);
  transition: transform 0.3s var(--ease-out);
}
.writing-item:hover::before { transform: scaleY(1); }
.writing-item:last-child { border-bottom: none; }
.writing-item:hover { background: var(--bg3); }
.writing-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}
.writing-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.writing-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--green);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.writing-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
}
.writing-arrow {
  font-size: 18px;
  color: var(--muted);
  transition: color var(--transition), transform var(--transition);
}
.writing-item:hover .writing-arrow { color: var(--green); transform: translateX(5px); }
.writing-more { margin-top: 28px; }

@media (max-width: 767px) {
  .writing-item { flex-wrap: wrap; gap: 8px; padding: 18px 20px; }
  .writing-meta { min-width: auto; flex-direction: row; gap: 12px; width: 100%; }
}

/* ── Testimonials ──────────────────────────────────────────────── */

#testimonials { background: var(--bg); }

.testi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 56px;
}
.testi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 40px;
  position: relative;
  overflow: hidden;
}
.testi-card::before {
  content: '"';
  position: absolute;
  top: -10px; right: 18px;
  font-size: 140px;
  font-family: var(--font-serif);
  font-style: italic;
  color: rgba(0, 255, 136, 0.07);
  line-height: 1;
  pointer-events: none;
}
.testi-text p {
  font-size: 15.5px;
  color: var(--white);
  line-height: 1.8;
  font-family: var(--font-serif);
  font-style: italic;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}
.testi-author { display: flex; align-items: center; gap: 14px; }
.testi-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid rgba(0, 255, 136, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  flex-shrink: 0;
}
.testi-name { display: block; font-size: 14px; font-weight: 600; color: var(--white); }
.testi-role { display: block; font-size: 11px; color: var(--muted); font-family: var(--font-mono); margin-top: 2px; }
.testi-note {
  margin-top: 24px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

@media (max-width: 767px) {
  .testi-grid { grid-template-columns: 1fr; }
}

/* ── Contact ───────────────────────────────────────────────────── */

#contact {
  background:
    radial-gradient(ellipse 70% 60% at 50% 110%, rgba(0, 255, 136, 0.07), transparent 65%),
    var(--bg2);
  border-top: 1px solid var(--border);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 80px;
  align-items: start;
  margin-top: 24px;
}
.contact-headline {
  font-size: clamp(40px, 6.5vw, 84px);
  font-weight: 900;
  font-stretch: 120%;
  text-transform: uppercase;
  line-height: 0.98;
  color: var(--white);
  margin-bottom: 24px;
}
.contact-sub {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.75;
  max-width: 460px;
}

.contact-links { display: flex; flex-direction: column; gap: 12px; }
.contact-link, .contact-copy {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 20px 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--white);
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font-main);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
}
.contact-link:hover, .contact-copy:hover {
  border-color: rgba(0, 255, 136, 0.5);
  background: rgba(0, 255, 136, 0.03);
}
.contact-copy.copied { border-color: var(--green); }
.contact-copy.copied .contact-link-icon { color: var(--white); }
.contact-link-icon {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  min-width: 48px;
  letter-spacing: 0.14em;
}
.contact-link-text { display: block; }
.contact-link-label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

@media (max-width: 1023px) {
  .contact-grid { grid-template-columns: 1fr; gap: 48px; }
}

/* ── Footer ────────────────────────────────────────────────────── */

.site-footer, footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-logo, .footer-copy {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

@media (max-width: 767px) {
  .footer-inner { flex-direction: column; text-align: center; }
}

/* ── Mobile rhythm: consistent spacing between heading and content ─ */

@media (max-width: 767px) {
  .services-grid, .case-list, .work-grid, .writing-list, .testi-grid { margin-top: 40px; }
  .about-grid { gap: 44px; }
  .case { padding: 32px 0; }
  /* faster, subtler reveals — fast flick-scrolling never lands on empty space */
  html.js .rv { transform: translateY(14px); transition-duration: 0.45s; }
}

/* ── Reduced motion: kill everything ───────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .grain { animation: none; }
  /* hero-canvas stays visible: hero-gl.js renders a motionless single frame */
  .cursor-ring { display: none !important; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; }
  .marquee-row[aria-hidden] { display: none; }
  .marquee-row { white-space: normal; flex-wrap: wrap; gap: 14px; }
  html.js .rv { opacity: 1; transform: none; transition: none; }
  .ld, .hh-line .hh-word, .hh-line .hh-serif { animation: none; opacity: 1; transform: none; }
  .hero-scroll-line::after { animation: none; }
  .badge-dot { animation: none; }
}

/* ── Web archive page ──────────────────────────────────────────── */

.archive-main { padding: calc(var(--nav-h) + 88px) 0 128px; }
.archive-back {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  margin-bottom: 40px;
}
.archive-back a { color: var(--muted); text-decoration: none; transition: color var(--transition); }
.archive-back a:hover, .archive-back a:focus-visible { color: var(--green); }
.archive-intro { max-width: 640px; margin-top: 24px; font-size: 16px; color: var(--muted); line-height: 1.8; }
.archive-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 64px; }
.archive-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  transform-style: preserve-3d;
}
.archive-card:hover {
  border-color: rgba(0, 255, 136, 0.4);
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.85);
}
.archive-shot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border-bottom: 1px solid var(--border);
}
.archive-shot--missing {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
}
.archive-body { padding: 28px 32px 32px; }
.archive-year {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.2em;
  white-space: nowrap;
}
.archive-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.work-more { margin-top: 56px; }
.footer-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-link:hover, .footer-link:focus-visible { color: var(--green); }

@media (max-width: 767px) {
  .archive-main { padding: calc(var(--nav-h) + 56px) 0 80px; }
  .archive-grid { grid-template-columns: 1fr; margin-top: 40px; }
  .archive-body { padding: 24px; }
}
