/* #999666 Studio — System Interface Concept */

:root {
  --bg: #000000;
  --surface: #0a0a0a;
  --surface-2: #111111;
  --text: #ffffff;
  --text-2: #8a8a8a;
  --text-3: #555555;
  --line: rgba(255, 255, 255, 0.1);
  --line-dim: rgba(255, 255, 255, 0.06);
  --warn: #bfff00;
  --err: #ff3b30;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --header-h: 64px;
  --max: 1320px;
  --pad: clamp(20px, 4vw, 48px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button, input, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
}

/* ─── BACKGROUND ─── */
#pixel-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #000;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0.12) 4px
  );
  opacity: 0.35;
}

.shell {
  position: relative;
  z-index: 2;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ─── TYPOGRAPHY ─── */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-transform: uppercase;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
}

.mono-label::before { content: '// '; color: var(--text-3); }

/* ─── GLITCH ─── */
[data-glitch] {
  position: relative;
  display: inline-block;
}

.glitch-active {
  animation: glitch-slice 0.55s steps(2) forwards;
}

.glitch-active::before,
.glitch-active::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.glitch-active::before {
  color: var(--text);
  clip-path: inset(20% 0 55% 0);
  transform: translateX(-3px);
  opacity: 0.8;
}

.glitch-active::after {
  color: var(--text-2);
  clip-path: inset(60% 0 10% 0);
  transform: translateX(3px);
  opacity: 0.6;
}

@keyframes glitch-slice {
  0%   { transform: translate(0); filter: none; }
  20%  { transform: translate(-2px, 1px); filter: contrast(2); }
  40%  { transform: translate(2px, -1px); }
  60%  { transform: translate(-1px, 0); }
  100% { transform: translate(0); filter: none; }
}

.error-flash {
  position: relative;
}

.error-flash::after {
  content: attr(data-error);
  position: absolute;
  inset: -2px -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--err);
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.25);
  opacity: 0;
  pointer-events: none;
}

.error-flash.active::after {
  animation: error-pop 0.65s steps(3) forwards;
}

@keyframes error-pop {
  0%, 100% { opacity: 0; }
  15%, 55% { opacity: 1; }
}

/* ─── HEADER ─── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid var(--line-dim);
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
}

.header__inner {
  max-width: var(--max);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.header__logo span { color: var(--text-2); }

.header__nav {
  display: none;
}

.header__nav a {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  transition: color 0.15s, top 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.header__nav a:hover {
  color: var(--text);
  top: 0;
  transform: rotate(0deg);
}

.header__burger {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid var(--line-dim);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

.mobile-menu.open { transform: translateX(0); }

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--text-2);
}

/* ─── SECTIONS ─── */
.section {
  padding: clamp(80px, 12vh, 140px) var(--pad);
}

.section__inner {
  max-width: var(--max);
  margin: 0 auto;
}

.section__head {
  margin-bottom: clamp(48px, 8vh, 80px);
}

.section__head .display {
  font-size: clamp(32px, 5vw, 56px);
  margin-top: 12px;
}

/* ─── HERO ─── */
.hero {
  min-height: 100vh;
  padding-top: calc(var(--header-h) + 22px);
  padding-bottom: 80px;
  display: flex;
  align-items: flex-start;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

/* Hero code feed — between header & status */
.hero__feed {
  position: relative;
  width: 100%;
  border: 1px solid var(--line-dim);
  background: var(--surface);
  margin-bottom: 28px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.hero__feed--error {
  border-color: rgba(255, 59, 48, 0.45);
}

.hero__feed--error .hero__feed-body {
  animation: feed-slice 0.55s steps(3);
}

@keyframes feed-slice {
  0%, 100% { transform: translate(0); filter: none; }
  25% { transform: translate(-4px, 1px); filter: contrast(1.8); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, 0); }
}

.hero__feed-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.hero__feed-state {
  color: var(--text-2);
}

.hero__feed--error .hero__feed-state {
  color: var(--err);
}

.hero__feed-body {
  margin: 0;
  padding: 22px 20px 24px;
  min-height: 156px;
  font-size: 12px;
  line-height: 1.95;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
}

.hero__feed-body .ln {
  display: block;
  min-height: 1.95em;
}

.hero__feed-body .ln-num {
  color: var(--text-3);
  margin-right: 10px;
  user-select: none;
}

.hero__feed-body .kw { color: var(--text-2); }
.hero__feed-body .val { color: var(--text); }
.hero__feed-body .cm { color: var(--text-3); }

.hero__feed-body .cursor {
  display: inline-block;
  width: 8px;
  height: 0.95em;
  background: var(--text);
  vertical-align: text-bottom;
  animation: cursor-blink 0.9s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.hero__feed-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--err);
  background: rgba(255, 59, 48, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
}

.hero__feed-error.show {
  opacity: 1;
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 1px solid var(--line-dim);
  padding: 8px 14px;
  margin-bottom: 32px;
}

.hero__status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--warn);
}

.hero__title {
  font-size: clamp(42px, 8vw, 96px);
  margin-bottom: 28px;
}

.hero__title .line { display: block; }
.hero__title .dim { color: var(--text-3); }

.hero__desc {
  font-family: var(--font-display);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 400;
  color: var(--text-2);
  max-width: 480px;
  line-height: 1.5;
  margin-bottom: 40px;
  text-transform: none;
  letter-spacing: -0.01em;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section__head--work {
  display: flex;
  align-items: flex-end;
  gap: clamp(20px, 4vw, 48px);
}

.section__head-text {
  flex: 1;
  min-width: 0;
}

.work__skull {
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  font-size: 6px;
  line-height: 1.1;
  letter-spacing: 0.03em;
  color: var(--text-3);
  white-space: pre;
  overflow: hidden;
  position: relative;
  align-self: flex-end;
  margin-bottom: 4px;
}

.work__skull.drawing { color: var(--text-2); }

.work__skull.done { color: var(--text-2); opacity: 0.85; }

.work__skull--glitch {
  animation: skull-glitch-box 0.5s steps(4);
}

@keyframes skull-glitch-box {
  0%, 100% { transform: translate(0); filter: none; }
  25% { transform: translate(-3px, 1px); filter: contrast(1.6); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, 2px); }
}

.work__skull--breathe {
  animation: skull-breathe 3s ease-in-out infinite;
}

@keyframes skull-breathe {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}

.work__skull .sk-char {
  display: inline-block;
  min-width: 0.5em;
  text-align: center;
  transition: color 0.12s, opacity 0.12s;
}

.work__skull .sk-char--outline { color: var(--text-3); }
.work__skull .sk-char--bone { color: var(--text-2); }
.work__skull .sk-char--fill { color: var(--text); }
.work__skull .sk-char--shade { color: #555; }
.work__skull .sk-char--eye { color: var(--warn); }
.work__skull .sk-char--mouth { color: var(--text-2); }
.work__skull .sk-char--scan { color: var(--text) !important; text-shadow: 0 0 8px rgba(255,255,255,0.4); }
.work__skull .sk-char--dim { opacity: 0.15; }
.work__skull .sk-char--err { color: var(--err); }

@media (min-width: 768px) {
  .work__skull { font-size: 7px; }
}

@media (min-width: 1024px) {
  .work__skull { font-size: 8px; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid var(--line);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn--fill {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn--fill:hover {
  background: transparent;
  color: var(--text);
}

.btn--line {
  color: var(--text-2);
  border-color: var(--line-dim);
}

.btn--line:hover {
  color: var(--text);
  border-color: var(--line);
}

.hero__figure {
  position: relative;
  z-index: 4;
  margin: 0;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--surface);
  isolation: isolate;
}

.hero__figure img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 30%;
  filter: grayscale(100%) contrast(1.12) brightness(0.92);
}

.hero__figure::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.75) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero__figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
  pointer-events: none;
  z-index: 2;
}

.hero__figure-cap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  border-top: 1px solid var(--line-dim);
  background: rgba(0, 0, 0, 0.45);
}

/* ─── MANIFESTO ─── */
.manifesto {
  border-top: 1px solid var(--line-dim);
  border-bottom: 1px solid var(--line-dim);
  background: var(--surface);
}

.manifesto__block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.manifesto__log {
  border: 1px solid var(--line-dim);
  padding: 28px;
  font-size: 11px;
  line-height: 2;
  color: var(--text-2);
}

.manifesto__log .commit { color: var(--warn); }
.manifesto__log .hash { color: var(--text-3); }
.manifesto__log .msg { color: var(--text); }

.manifesto__statement {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.5vw, 36px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  text-transform: none;
}

/* ─── SERVICES ─── */
.services__stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.service-layer {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 36px 0;
  border-bottom: 1px solid var(--line-dim);
  transition: padding-left 0.3s ease;
}

.service-layer:first-child { border-top: 1px solid var(--line-dim); }

.service-layer:hover {
  padding-left: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,0.02), transparent);
}

.service-layer__num {
  font-size: 11px;
  color: var(--text-3);
  padding-top: 4px;
}

.service-layer__num::before { content: '['; }
.service-layer__num::after { content: ']'; }

.service-layer__title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.service-layer__text {
  font-size: 12px;
  color: var(--text-2);
  max-width: 520px;
  line-height: 1.7;
}

.service-layer__cmd {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-3);
  border: 1px solid var(--line-dim);
  padding: 6px 12px;
  align-self: center;
  white-space: nowrap;
}

.service-layer__cmd::before { content: '`'; color: var(--text-3); }
.service-layer__cmd::after { content: '`'; color: var(--text-3); }

/* ─── WORK ─── */
.work__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.work-card {
  border: 1px solid var(--line-dim);
  background: var(--surface);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}

.work-card--wide .work-card__preview { min-height: 280px; }
.work-card--tall .work-card__preview { min-height: 360px; }

.work-card__preview {
  position: relative;
  overflow: hidden;
  min-height: 240px;
}

.work-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%) contrast(1.15);
}

.work-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}

.work-card__code {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  border: 1px solid var(--line-dim);
  padding: 6px 10px;
  background: rgba(0,0,0,0.6);
}

.work-card__body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.work-card__index {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.15em;
}

.work-card__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.work-card__desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 480px;
}

.work-card--offset {
  margin-top: 0;
}

/* ─── PROCESS ─── */
.process__pipeline {
  position: relative;
  padding: 40px 0;
}

.process__line {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-dim);
  display: none;
}

.process__steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.process__step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 20px;
  position: relative;
}

.process__marker {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg);
}

.process__step h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.process__meta {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.process__step p {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 400px;
}

.process__snake {
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  margin-top: clamp(32px, 6vh, 56px);
  height: clamp(72px, 14vw, 96px);
  background: transparent;
  overflow: hidden;
  pointer-events: none;
}

.process__snake canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ─── CONTACT ─── */
.contact {
  min-height: 80vh;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
}

.contact__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  width: 100%;
}

.contact__title {
  font-size: clamp(40px, 7vw, 80px);
  margin-bottom: 20px;
}

.contact__title .warn { color: var(--warn); }

.contact__sub {
  font-size: 12px;
  color: var(--text-2);
  max-width: 400px;
  line-height: 1.7;
  margin-bottom: 32px;
}

.contact__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact__link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line-dim);
  font-size: 12px;
  transition: border-color 0.15s;
}

.contact__link:hover { border-color: var(--line); }

.contact__link .lbl {
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  min-width: 64px;
}

.terminal-form {
  border: 1px solid var(--line);
  background: var(--surface);
}

.terminal-form__bar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-dim);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.1em;
}

.terminal-form__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field__label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}

.field__label::before { content: '> '; color: var(--text-2); }

.field__input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-dim);
  background: var(--bg);
  font-size: 12px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.field__input:focus { border-color: var(--line); }

.field__input::placeholder { color: var(--text-3); }

textarea.field__input {
  min-height: 100px;
  resize: vertical;
}

.form-ok {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 48px 24px;
  font-size: 12px;
}

.form-ok.show { display: flex; }
.form-ok .ok { color: var(--warn); }

/* ─── FOOTER ─── */
.footer {
  padding: 24px var(--pad);
  border-top: 1px solid var(--line-dim);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.1em;
}

.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

/* ─── REVEAL ─── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ─── DESKTOP ─── */
@media (min-width: 768px) {
  .header__inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(24px, 5vw, 64px);
  }

  .header__nav {
    display: grid;
    grid-template-columns: 1.1fr 1.35fr 0.95fr 1.2fr;
    align-items: center;
    height: 100%;
    padding-left: clamp(16px, 6vw, 96px);
    padding-right: clamp(4px, 1.5vw, 16px);
  }

  .header__nav a {
    position: relative;
    justify-self: start;
  }

  .header__nav a:nth-child(1) {
    top: -5px;
    transform: rotate(-1.4deg);
    letter-spacing: 0.16em;
  }

  .header__nav a:nth-child(2) {
    top: 4px;
    transform: rotate(0.9deg);
    justify-self: center;
    letter-spacing: 0.11em;
  }

  .header__nav a:nth-child(3) {
    top: -2px;
    transform: rotate(-0.5deg);
    justify-self: end;
    font-size: 10px;
    letter-spacing: 0.18em;
  }

  .header__nav a:nth-child(4) {
    top: 6px;
    transform: rotate(1.2deg);
    justify-self: end;
    letter-spacing: 0.12em;
  }

  .header__burger { display: none; }

  .hero__grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 64px;
    align-items: start;
  }

  .hero__figure {
    align-self: center;
  }

  .hero__feed-body {
    min-height: 172px;
    font-size: 13px;
    padding: 24px 22px 28px;
  }

  .manifesto__block {
    grid-template-columns: 1fr 1.2fr;
    align-items: center;
  }

  .work__grid {
    grid-template-columns: 1.2fr 0.8fr;
    grid-template-rows: auto auto;
    gap: 20px;
  }

  .work-card--wide { grid-column: 1 / -1; }
  .work-card--tall { grid-row: span 1; }
  .work-card--offset { margin-top: 48px; }

  .work-card--wide {
    grid-template-columns: 1.4fr 1fr;
  }

  .work-card--wide .work-card__preview { min-height: 320px; }
  .work-card--wide .work-card__body {
    justify-content: center;
    padding: 40px;
  }

  .process__line { display: block; }

  .process__steps {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
  }

  .process__step {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .process__marker { margin-bottom: 20px; }

  .contact__grid {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
  }
}

@media (min-width: 1024px) {
  .service-layer {
    grid-template-columns: 100px 1fr 120px;
    padding: 44px 0;
  }
}

/* ─── MOBILE (≤767px) ─── */
@media (max-width: 767px) {
  :root {
    --header-h: calc(56px + env(safe-area-inset-top, 0px));
    --pad: 16px;
  }

  body.menu-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
    touch-action: none;
  }

  a,
  button,
  .btn,
  .header__burger,
  .contact__link,
  .mobile-menu a {
    touch-action: manipulation;
  }

  .section {
    padding: 56px var(--pad);
  }

  .section__head {
    margin-bottom: 36px;
  }

  .section__head .display {
    font-size: clamp(28px, 8vw, 40px);
    word-break: break-word;
  }

  /* Header */
  .header {
    padding-top: env(safe-area-inset-top, 0px);
    height: var(--header-h);
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .header__inner {
    height: calc(var(--header-h) - env(safe-area-inset-top, 0px));
    padding-left: max(var(--pad), env(safe-area-inset-left));
    padding-right: max(var(--pad), env(safe-area-inset-right));
  }

  .header__logo {
    font-size: 11px;
    max-width: calc(100% - 52px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header__burger {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  .mobile-menu {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-menu a {
    padding: 14px 28px;
    min-height: 48px;
    display: flex;
    align-items: center;
    font-size: clamp(22px, 6vw, 28px);
  }

  /* Hero */
  .hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 12px);
    padding-bottom: 48px;
  }

  .hero__grid {
    gap: 28px;
  }

  .hero__feed {
    margin-bottom: 18px;
  }

  .hero__feed-bar {
    padding: 10px 12px;
    font-size: 8px;
    gap: 8px;
  }

  #hero-feed-file {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 58%;
    flex-shrink: 1;
  }

  .hero__feed-body {
    min-height: 112px;
    padding: 14px 12px 16px;
    font-size: 10px;
    line-height: 1.7;
  }

  .hero__feed-body .ln {
    min-height: 1.7em;
    word-break: break-all;
  }

  .hero__status {
    font-size: 8px;
    letter-spacing: 0.1em;
    padding: 8px 12px;
    margin-bottom: 20px;
    max-width: 100%;
    line-height: 1.4;
  }

  .hero__title {
    font-size: clamp(30px, 9.5vw, 42px);
    margin-bottom: 18px;
    word-break: break-word;
  }

  .hero__desc {
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.45;
  }

  .hero__cta {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .hero__cta .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 10px;
  }

  .hero__figure img {
    aspect-ratio: 4 / 5;
  }

  .hero__figure-cap {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 14px;
    font-size: 8px;
  }

  /* Manifesto */
  .manifesto__block {
    gap: 28px;
  }

  .manifesto__log {
    padding: 18px;
    font-size: 10px;
    line-height: 1.85;
    overflow-x: auto;
  }

  .manifesto__statement {
    font-size: clamp(18px, 5.2vw, 24px);
  }

  /* Services */
  .service-layer {
    grid-template-columns: 40px 1fr;
    gap: 14px;
    padding: 26px 0;
  }

  .service-layer:hover {
    padding-left: 0;
  }

  .service-layer__cmd {
    grid-column: 2;
    justify-self: start;
    margin-top: 8px;
  }

  .service-layer__title {
    font-size: clamp(18px, 5vw, 22px);
  }

  .service-layer__text {
    font-size: 11px;
  }

  /* Work */
  .section__head--work {
    gap: 10px;
    align-items: flex-end;
    flex-wrap: nowrap;
  }

  .work__skull {
    font-size: 3.6px;
    max-width: 36vw;
    overflow: hidden;
    flex-shrink: 1;
  }

  .work__skull .sk-char {
    min-width: 0.42em;
  }

  .work__grid {
    gap: 16px;
  }

  .work-card__preview,
  .work-card--wide .work-card__preview,
  .work-card--tall .work-card__preview {
    min-height: 200px;
  }

  .work-card__body {
    padding: 18px;
  }

  .work-card__title {
    font-size: clamp(18px, 5vw, 24px);
  }

  .work-card__code {
    font-size: 7px;
    max-width: calc(100% - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 5px 8px;
  }

  /* Process */
  .process__pipeline {
    padding: 20px 0;
  }

  .process__steps {
    gap: 24px;
  }

  .process__step {
    grid-template-columns: 40px 1fr;
    gap: 14px;
  }

  .process__marker {
    width: 40px;
    height: 40px;
    font-size: 9px;
  }

  .process__step p {
    font-size: 11px;
    max-width: none;
  }

  .process__snake {
    width: 100%;
    left: 0;
    margin-left: 0;
    margin-top: 28px;
    height: 56px;
  }

  .process__pipeline {
    overflow: hidden;
  }

  /* Contact */
  .contact {
    min-height: auto;
    align-items: flex-start;
  }

  .contact__sub {
    font-size: 14px;
    line-height: 1.5;
  }

  .contact__link span:last-child {
    word-break: break-all;
  }

  .contact__title {
    font-size: clamp(30px, 9vw, 48px);
    word-break: break-word;
  }

  .contact__grid {
    gap: 36px;
  }

  .contact__link {
    min-height: 48px;
    padding: 12px 14px;
  }

  .field__input {
    font-size: 16px;
    padding: 14px 16px;
    min-height: 48px;
  }

  textarea.field__input {
    min-height: 120px;
  }

  .terminal-form__body {
    padding: 16px;
    gap: 16px;
  }

  .terminal-form__bar {
    font-size: 8px;
    padding: 10px 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Footer */
  .footer {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Background lighter on mobile */
  .scanlines {
    opacity: 0.15;
  }

  #pixel-canvas {
    image-rendering: pixelated;
  }

  .btn:active,
  .header__burger:active,
  .contact__link:active,
  .mobile-menu a:active {
    opacity: 0.72;
  }

  .hero__figure img,
  .work-card__preview img {
    content-visibility: auto;
    contain-intrinsic-size: 320px 400px;
  }
}

/* ─── SMALL PHONES (≤390px) ─── */
@media (max-width: 390px) {
  :root {
    --pad: 14px;
  }

  .hero__title {
    font-size: clamp(28px, 8.5vw, 36px);
  }

  .section__head--work {
    align-items: flex-start;
    gap: 8px;
  }

  .work__skull {
    font-size: 3.2px;
    max-width: 34vw;
  }

  .mono-label {
    font-size: 9px;
    letter-spacing: 0.12em;
  }
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scanlines { display: none; }
  .glitch-active, .error-flash.active::after { animation: none !important; }
  .hero__feed--error .hero__feed-body { animation: none; }
  .hero__feed-body .cursor { animation: none; }
  .work__skull--glitch,
  .work__skull--breathe { animation: none; }
}