/* ==========================================================================
   Infernix — Pavan Ganesh Indupudi
   Premium AI research & engineering portfolio. Static, dependency-free.

   Structure: @font-face → design tokens → base → header → hero → sections →
   project showcase → achievements → stack → contact → footer → motion →
   responsive. Reveals only apply under .js (added inline in <head>), so all
   content stays visible without JavaScript. All motion is guarded by
   prefers-reduced-motion.
   ========================================================================== */

/* ------------------------------------------------------------- webfonts */

@font-face {
  font-family: "Space Grotesk";
  src: url("./assets/fonts/space-grotesk-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("./assets/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("./assets/fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

/* --------------------------------------------------------- design tokens */

:root {
  --bg: #090b0f;
  --bg-raise: #0e131c;
  --panel: #111722;
  --panel-2: #171f2b;
  --line: #1f2836;
  --line-strong: #2b3646;
  --text: #f3f4f6;
  --muted: #9aa5b5;
  --dim: #78859a;
  --accent: #ff9f2e;
  --accent-bright: #ffb55e;
  --cyan: #35d4f4;
  --font: "Inter", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --display: "Space Grotesk", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --header-h: 82px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* static grain — material depth without gradients or glow */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

a:focus-visible,
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

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

/* --------------------------------------------------------------- utility */

.section-wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.accent { color: var(--accent); }
.cyan { color: var(--cyan); }
.dim { color: var(--dim); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  background: var(--accent);
  color: #111;
  padding: 8px 12px;
  z-index: 100;
  font: 700 12px var(--mono);
}
.skip-link:focus { left: 10px; }

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  opacity: .07;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(255, 255, 255, .04) 4px);
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}

.site-header.is-stuck { border-bottom-color: var(--line); }

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.header-inner {
  width: min(1240px, calc(100% - 48px));
  height: var(--header-h);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand-logo { color: var(--text); flex: none; transition: color .2s ease; }
.brand:hover .brand-logo { color: var(--accent); }
.brand-name { font: 700 14px var(--mono); letter-spacing: .16em; }
.brand-cursor { color: var(--accent); animation: blink 1.1s steps(2, start) infinite; }

.site-nav {
  display: flex;
  gap: 34px;
  align-items: center;
  font: 500 11px var(--mono);
  letter-spacing: .12em;
  color: var(--muted);
}

.site-nav a { position: relative; padding: 6px 0; transition: color .2s ease; }

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

.site-nav a:hover { color: var(--text); }
.site-nav a:hover::after,
.site-nav a:focus-visible::after { transform: scaleX(1); }
.site-nav a[aria-current="true"] { color: var(--accent); }
.site-nav a[aria-current="true"]::after { transform: scaleX(1); }

.nav-contact {
  color: var(--text);
  border: 1px solid var(--line-strong);
  padding: 10px 13px !important;
  transition: border-color .2s ease;
}
.nav-contact::after { display: none; }
.nav-contact span { color: var(--accent); }
.nav-contact:hover { border-color: var(--accent); }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  padding: 11px 10px;
  cursor: pointer;
}
.menu-bar {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  margin: 5px 0;
  transition: transform .25s ease;
}
.menu-toggle[aria-expanded="true"] .menu-bar:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bar:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* ------------------------------------------------------------------ hero */

.hero {
  min-height: 670px;
  padding-top: 90px;
  padding-bottom: 35px;
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  position: relative;
  align-items: center;
  column-gap: 32px;
}

.hero-copy { position: relative; z-index: 2; padding-bottom: 45px; min-width: 0; }

.eyebrow,
.meta-label,
.section-index,
.project-number,
.project-status,
.stack-label,
.hero-bottom,
.art-tag,
.art-coord {
  font: 500 10px var(--mono);
  letter-spacing: .13em;
  color: var(--muted);
}

.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0; }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(53, 212, 244, .55);
}

.eyebrow-line { width: 38px; height: 1px; background: var(--line-strong); }

.hero-identity {
  margin: 30px 0 0;
  font: 700 12px var(--mono);
  letter-spacing: .22em;
  color: var(--text);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: 1.05;
  letter-spacing: -.04em;
  font-weight: 700;
  margin: 20px 0 24px;
}

.outline-text { color: transparent; -webkit-text-stroke: 1px #5d6a7c; }

.hero-intro { max-width: 530px; font-size: 16px; line-height: 1.85; color: var(--muted); margin: 0; }
.hero-intro strong { color: var(--text); font-weight: 600; }

.hero-actions,
.contact-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

.button {
  min-height: 46px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font: 500 11px var(--mono);
  letter-spacing: .04em;
  border: 1px solid var(--line-strong);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); border-color: var(--accent); }
.button span { font-size: 16px; }
.button-primary { color: #14100b; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.button-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.button-ghost { background: var(--bg-raise); color: var(--text); }

.hero-meta { display: flex; gap: 42px; margin-top: 50px; }
.hero-meta div { display: grid; gap: 5px; min-width: 0; }
.meta-label { color: var(--dim); font-size: 9px; }
.hero-meta div > span:last-child { font-size: 12px; color: var(--muted); }

/* hero centerpiece — system schematic with draw-in orbits */

.hero-art {
  height: 420px;
  position: relative;
  display: grid;
  place-items: center;
  margin-left: -20px;
  overflow: hidden;
}

.art-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(154, 165, 181, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(154, 165, 181, .055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%);
}

.hero-orbits {
  position: absolute;
  width: min(100%, 430px);
  height: auto;
  overflow: visible;
}

.hero-orbits ellipse { fill: none; stroke-width: 1; }
.hero-orbits .o1 { stroke: rgba(255, 159, 46, .4); transform: rotate(-24deg); transform-origin: 200px 200px; }
.hero-orbits .o2 { stroke: rgba(53, 212, 244, .32); transform: rotate(52deg); transform-origin: 200px 200px; }

.core {
  width: 200px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, var(--panel-2), var(--bg) 70%);
  border: 1px solid var(--line-strong);
  transform: rotate(-8deg);
  position: relative;
}
.core::before,
.core::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent);
  border-style: solid;
}
.core::before { top: -5px; left: -5px; border-width: 1px 0 0 1px; }
.core::after { bottom: -5px; right: -5px; border-width: 0 1px 1px 0; }

.core-symbol { font: 700 86px/.9 var(--mono); letter-spacing: -.12em; padding-right: 10px; color: var(--text); }
.core-symbol span { color: var(--accent); }
.core-label { font: 500 9px var(--mono); letter-spacing: .25em; margin-top: 18px; color: var(--muted); }
.core-label span { color: var(--accent); margin-left: 6px; }

.art-tag {
  position: absolute;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 9px;
}
.tag-top { top: 47px; right: 0; color: var(--cyan); }
.tag-bottom { bottom: 55px; left: 0; color: var(--accent); }
.art-coord { position: absolute; right: 5px; bottom: 0; font-size: 9px; line-height: 1.8; color: var(--dim); }
.art-cross { position: absolute; color: var(--accent); font: 18px var(--mono); }
.cross-one { left: 15%; top: 22%; }
.cross-two { right: 18%; bottom: 20%; color: var(--cyan); }

.hero-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 9px;
  color: var(--dim);
}
.scroll-line { width: 68px; height: 1px; background: var(--line-strong); }
.hero-bottom span:last-child { margin-left: auto; }

/* -------------------------------------------------------------- sections */

.section-block { padding-top: 112px; }

.section-heading { display: flex; align-items: center; gap: 17px; margin-bottom: 36px; }
.section-index { color: var(--accent); }

.section-heading h2 {
  font-family: var(--display);
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -.03em;
  line-height: 1.2;
  font-weight: 700;
}

.heading-rule {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, var(--line-strong), transparent);
  margin-left: 8px;
}

.big-copy {
  font-family: var(--display);
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.3;
  letter-spacing: -.03em;
  font-weight: 700;
  margin: 0;
}

.section-description {
  max-width: 600px;
  color: var(--muted);
  font-size: 14px;
  margin: -15px 0 34px;
}

/* datasheet rows (about spec + skills) */

.spec { border-top: 1px solid var(--line); margin-top: 28px; }
.spec-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.spec-key { font: 500 10px var(--mono); letter-spacing: .14em; color: var(--dim); }
.spec-val { font-size: 13.5px; color: var(--text); }

/* about */

.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 60px; min-width: 0; }
.about-body { color: var(--muted); font-size: 14.5px; min-width: 0; }
.about-body p { margin: 0 0 18px; }

.terminal-note {
  margin-top: 26px;
  padding: 15px;
  border: 1px solid var(--line);
  background: var(--bg-raise);
  font: 400 11px/1.8 var(--mono);
  overflow-wrap: anywhere;
}
.terminal-prompt { color: var(--cyan); }
.typing-cursor { color: var(--accent); animation: blink .9s steps(2, start) infinite; }
.terminal-response { color: var(--muted); }

/* ----------------------------------------------------- project showcase */

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 4px 0;
}

.flow-step {
  position: relative;
  flex: 1 1 110px;
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid var(--line);
  background: var(--bg-raise);
  font: 500 9.5px/1.5 var(--mono);
  letter-spacing: .08em;
  text-align: center;
  color: var(--muted);
  text-transform: uppercase;
}
.flow-step b { display: block; color: var(--text); font-weight: 700; letter-spacing: .1em; }
.flow-step + .flow-step { margin-left: 22px; }
.flow-step + .flow-step::before {
  content: "→";
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  font-size: 13px;
}
.flow-step.is-key { border-color: rgba(53, 212, 244, .5); }
.flow-step.is-key b { color: var(--cyan); }
.flow-step.is-warm { border-color: rgba(255, 159, 46, .45); }
.flow-step.is-warm b { color: var(--accent); }

.evidence-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 4px; }
.evidence-chips span {
  font: 500 10px var(--mono);
  letter-spacing: .04em;
  color: var(--cyan);
  border: 1px solid rgba(53, 212, 244, .35);
  background: rgba(53, 212, 244, .05);
  padding: 5px 8px;
}

.tag-list { display: flex; gap: 7px; flex-wrap: wrap; margin: 16px 0 20px; }
.tag-list span {
  border: 1px solid var(--line);
  color: var(--muted);
  font: 400 10px var(--mono);
  padding: 6px 8px;
}

.shot {
  border: 1px solid var(--line);
  background: var(--bg-raise);
  padding: 6px;
  overflow: hidden;
}
.shot img { width: 100%; height: auto; }
.shot figcaption {
  font: 400 9px var(--mono);
  letter-spacing: .1em;
  color: var(--dim);
  padding: 8px 4px 2px;
  text-transform: uppercase;
}

.project-link {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
  font: 500 10.5px var(--mono);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 4px;
  align-self: flex-start;
  transition: border-color .2s ease;
}
.project-link span { color: var(--accent); }
.project-link:hover { border-color: var(--accent); }

.project-footnote { color: var(--dim); font-size: 11px; margin-top: 22px; }

/* featured project — PRIVYSE */

.project-featured {
  position: relative;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, var(--panel), var(--bg-raise));
  padding: 34px;
  margin-bottom: 16px;
  overflow: hidden;
}

.project-featured::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 18px;
  height: 18px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  pointer-events: none;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 36px;
  align-items: start;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.project-number { color: var(--dim); font-size: 9px; }
.project-status { color: var(--cyan); font-size: 9px; }

.project-kicker { font: 500 10px var(--mono); letter-spacing: .14em; color: var(--accent); margin: 14px 0 4px; text-transform: uppercase; }

.project-card h3,
.project-featured h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 6px 0 2px;
}
.project-featured h3 { font-size: clamp(28px, 3.4vw, 40px); }

.project-tagline { color: var(--accent); font: 500 11px var(--mono); letter-spacing: .06em; margin: 4px 0 14px !important; }

.project-copy { color: var(--muted); font-size: 14px; line-height: 1.8; }
.project-copy strong { color: var(--text); font-weight: 600; }

.project-built {
  font-size: 13.5px;
  color: var(--muted);
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  margin: 16px 0;
}
.project-built b { color: var(--text); font-weight: 600; }

/* standard project cards */

.project-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
}

.project-card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 26px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  transition: transform .25s ease, border-color .25s ease;
}
.project-card:hover,
.project-card:focus-within { transform: translateY(-3px); border-color: var(--line-strong); }

.project-card .project-ghost {
  position: absolute;
  top: -26px;
  right: -6px;
  font-family: var(--display);
  font-size: 110px;
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(154, 165, 181, .12);
  pointer-events: none;
  user-select: none;
}

.project-card h3 { font-size: 24px; margin-top: 10px; }
.project-card .flow { margin-top: 16px; }
.project-card .project-link { margin-top: auto; padding-top: 18px; }

.project-card.span-all { grid-column: 1 / -1; }

/* Viora horizontal variant */
.project-card.horizontal { display: grid; grid-template-columns: 1fr .9fr; gap: 30px; align-items: center; }
.project-card.horizontal .project-media { order: 2; }
.project-card.horizontal .project-main { order: 1; display: flex; flex-direction: column; height: 100%; }

/* ---------------------------------------------------------- achievements */

.badges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: var(--bg-raise);
}
.badge {
  padding: 22px 20px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.badge:last-child { border-right: 0; }
.badge-label { font: 500 9px var(--mono); letter-spacing: .16em; color: var(--cyan); text-transform: uppercase; }
.badge-title { font-family: var(--display); font-weight: 700; font-size: 17px; margin-top: 8px; letter-spacing: -.01em; }
.badge-meta { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ---------------------------------------------------------------- stack */

.stack-groups { border-top: 1px solid var(--line); }
.stack-row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 20px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.stack-label { color: var(--accent); font-size: 10px; padding-top: 0; }
.stack-items { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--text); }
.stack-items span { position: relative; }
.stack-items span + span::before {
  content: "·";
  position: absolute;
  left: -11px;
  color: var(--dim);
}

/* ------------------------------------------------- contact + marquee */

.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-raise);
  padding: 13px 0;
  white-space: nowrap;
}
.marquee-track {
  display: inline-flex;
  gap: 44px;
  min-width: max-content;
  animation: marquee 38s linear infinite;
  font: 700 13px var(--mono);
  letter-spacing: .28em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 159, 46, .55);
}
.marquee-track span.solid { color: var(--accent); -webkit-text-stroke: 0; }
.marquee:hover .marquee-track { animation-play-state: paused; }

.contact-section {
  margin-top: 120px;
  background: linear-gradient(120deg, rgba(255, 159, 46, .05), transparent 55%);
}
.contact-inner { padding-top: 75px; padding-bottom: 85px; }
.contact-inner h2 {
  font-family: var(--display);
  font-size: clamp(36px, 5.6vw, 64px);
  line-height: 1.08;
  letter-spacing: -.04em;
  font-weight: 700;
  margin: 20px 0;
}
.contact-inner > p { max-width: 500px; color: var(--muted); font-size: 14.5px; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--dim);
  font: 400 10px var(--mono);
  flex-wrap: wrap;
}
.footer-brand .brand-logo { width: 28px; height: 28px; }
.footer-brand .brand-name { font-size: 11px; }
.footer-system { letter-spacing: .12em; color: var(--dim); }
.footer-note { letter-spacing: .08em; }

/* ---------------------------------------------------------------- motion */

@keyframes blink { to { visibility: hidden; } }

@keyframes marquee { to { transform: translateX(-50%); } }

@keyframes draw-orbit {
  to { stroke-dashoffset: 0; }
}

.hero-orbits ellipse {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: draw-orbit 1.7s cubic-bezier(.4, 0, .2, 1) forwards;
}
.hero-orbits .o2 { animation-delay: .35s; }

.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity .7s ease var(--reveal-delay, 0ms),
    transform .7s cubic-bezier(.2, .7, .2, 1) var(--reveal-delay, 0ms);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .hero-orbits ellipse { stroke-dashoffset: 0; }
  .marquee-track { animation: none; }
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 70px; min-height: auto; }
  .hero-copy { padding-bottom: 10px; }
  .hero-art { height: 360px; margin: 5px auto 45px; width: min(100%, 470px); margin-left: auto; }
  .about-grid { grid-template-columns: 1fr; gap: 34px; }
  .featured-grid { grid-template-columns: 1fr; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card.horizontal { grid-template-columns: 1fr; }
  .project-card.horizontal .project-media { order: 1; }
  .project-card.horizontal .project-main { order: 2; }
  .badges { grid-template-columns: repeat(2, 1fr); }
  .badge:nth-child(2n) { border-right: 0; }
  .badge:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .section-block { padding-top: 85px; }
  .flow-step + .flow-step { margin-left: 0; margin-top: 22px; }
  .flow-step + .flow-step::before {
    content: "↓";
    left: 50%;
    top: -19px;
    transform: translateX(-50%);
  }
  .flow { flex-direction: column; }
  .stack-row { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 560px) {
  :root { --header-h: 70px; }
  .section-wrap,
  .header-inner { width: calc(100% - 34px); }

  .menu-toggle { display: block; }

  .js .site-nav {
    display: none;
    position: absolute;
    top: calc(var(--header-h) - 1px);
    left: -1px;
    right: -1px;
    padding: 18px;
    background: var(--bg-raise);
    border: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, .5);
  }
  .js .site-nav.open { display: flex; }
  .site-nav a { padding: 13px 5px; border-bottom: 1px solid rgba(154, 165, 181, .1); }
  .site-nav a::after { display: none; }
  .site-nav .nav-contact { border: 0; padding: 13px 5px !important; }

  html:not(.js) .site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 10px;
  }
  html:not(.js) .menu-toggle { display: none; }

  .hero { padding-top: 58px; }
  .eyebrow { flex-wrap: wrap; font-size: 9px; }
  .hero-identity { font-size: 10px; margin-top: 24px; letter-spacing: .16em; }
  .hero h1 { font-size: clamp(36px, 11vw, 54px); }
  .hero-intro { font-size: 14px; }
  .hero-meta { gap: 25px; margin-top: 36px; flex-wrap: wrap; }
  .hero-art { height: 300px; }
  .core { width: 145px; height: 145px; }
  .core-symbol { font-size: 60px; }
  .core-label { font-size: 7px; }
  .art-tag, .art-coord { font-size: 8px; }

  .section-heading { gap: 10px; }
  .section-heading h2 { font-size: 25px; }
  .heading-rule { margin-left: 0; }

  .project-featured { padding: 22px; }
  .project-card { padding: 22px; }
  .project-card .project-ghost { font-size: 80px; }
  .badges { grid-template-columns: 1fr; }
  .badge { border-right: 0; border-bottom: 1px solid var(--line); }
  .badge:last-child { border-bottom: 0; }
  .spec-row { grid-template-columns: 110px 1fr; }

  .contact-section { margin-top: 85px; }
  .contact-inner { padding-top: 60px; padding-bottom: 65px; }

  .site-footer { padding-top: 24px; padding-bottom: 24px; justify-content: flex-start; }
  .footer-note, .footer-system { width: 100%; }
}
