:root {
  --ink: #171713;
  --paper: #f1ecdf;
  --paper-bright: #faf7ef;
  --signal: #df3f25;
  --signal-dark: #a62616;
  --chartreuse: #d7f54a;
  --line: #b8b09f;
  --muted: #676258;
  --terminal: #141713;
  --terminal-line: #343a31;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", sans-serif;
}
button, textarea { font: inherit; }
button { color: inherit; }
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9; opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
}
.masthead {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  min-height: 76px; padding: 0 4vw; border-bottom: 1px solid var(--ink);
  font-size: 12px; text-transform: uppercase; letter-spacing: .12em;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; }
.brand-glyph { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--paper); letter-spacing: -.08em; }
.mast-meta { font-family: "DM Mono", monospace; }
.signal { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #279c4c; box-shadow: 0 0 0 4px rgba(39,156,76,.12); }
.source-link { justify-self: end; color: inherit; font-weight: 800; text-underline-offset: 4px; }

.hero { position: relative; min-height: 720px; padding: 8.5vw 4vw 4vw; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; width: 42vw; height: 42vw; right: -8vw; top: 2vw;
  border: 1px solid var(--ink); border-radius: 50%;
}
.hero::after {
  content: ""; position: absolute; width: 18vw; height: 18vw; right: 4vw; top: 14vw;
  background: var(--signal); border-radius: 50%; mix-blend-mode: multiply;
}
.eyebrow, .pane-label, .section-number { font: 500 11px "DM Mono", monospace; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { position: relative; z-index: 1; margin: 22px 0 30px; max-width: 1040px; font: 600 clamp(60px, 8vw, 130px)/.84 "Newsreader", serif; letter-spacing: -.055em; }
.hero h1 em { color: var(--signal); font-weight: 500; }
.hero-copy { position: relative; z-index: 1; max-width: 650px; margin-left: 22vw; font-size: clamp(18px, 2vw, 27px); line-height: 1.38; }
.hero-cta { display: inline-flex; gap: 80px; align-items: center; margin: 45px 0 80px 22vw; padding: 15px 0; border-bottom: 2px solid var(--ink); color: inherit; text-decoration: none; font-weight: 800; }
.hero-proof { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 700px; margin-left: auto; border-top: 1px solid var(--ink); }
.hero-proof div { padding: 20px 10px 0; border-right: 1px solid var(--line); }
.hero-proof strong { display: block; font: 600 34px "Newsreader", serif; }
.hero-proof span { color: var(--muted); font: 500 11px "DM Mono", monospace; text-transform: uppercase; }

.compiler { padding: 4vw; background: var(--ink); color: var(--paper-bright); }
.compiler-head, .pane-head, .output-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.compiler-head { margin-bottom: 32px; }
.compiler-head > div:first-child { display: flex; align-items: baseline; gap: 22px; }
.compiler h2, .method h2 { margin: 0; font: 500 clamp(40px, 5vw, 72px)/1 "Newsreader", serif; letter-spacing: -.04em; }
.run-state { display: flex; align-items: center; gap: 9px; font: 500 11px "DM Mono", monospace; text-transform: uppercase; }
.run-state span { width: 8px; height: 8px; border-radius: 50%; background: #aaa; }
.run-state[data-state="complete"] span { background: var(--chartreuse); box-shadow: 0 0 0 5px rgba(215,245,74,.12); }
.run-state[data-state="error"] span { background: #ff6048; }
.workspace { display: grid; grid-template-columns: minmax(360px,.9fr) minmax(500px,1.35fr); min-height: 690px; border: 1px solid #5e6359; }
.input-pane, .output-pane { min-width: 0; }
.input-pane { padding: 26px; border-right: 1px solid #5e6359; }
.pane-head { min-height: 54px; }
.pane-head h3 { margin: 5px 0 0; font-size: 22px; letter-spacing: -.03em; }
.pane-label { color: #9ca294; }
.input-actions { display: flex; gap: 14px; }
.text-button, .download-button, #copyButton { border: 0; background: none; color: inherit; cursor: pointer; font: 500 11px "DM Mono", monospace; text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; }
#fileInput { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-button { cursor: pointer; }
textarea {
  width: 100%; height: 390px; margin-top: 22px; padding: 20px; resize: vertical;
  border: 1px solid var(--terminal-line); outline: 0; background: #0d100c; color: #dce5d3;
  font: 400 12px/1.65 "DM Mono", monospace; caret-color: var(--chartreuse);
}
textarea:focus { border-color: var(--chartreuse); box-shadow: 0 0 0 1px var(--chartreuse); }
.input-foot { display: flex; justify-content: space-between; margin: 9px 0 20px; color: #858b7d; font: 400 10px "DM Mono", monospace; }
.approval-row { padding: 15px 0 20px; border-top: 1px solid var(--terminal-line); }
.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch-track { flex: 0 0 auto; width: 42px; height: 23px; padding: 3px; border: 1px solid #697063; border-radius: 30px; transition: .2s; }
.switch-track span { display: block; width: 15px; height: 15px; border-radius: 50%; background: #697063; transition: .2s; }
.switch input:checked + .switch-track { border-color: var(--chartreuse); }
.switch input:checked + .switch-track span { transform: translateX(19px); background: var(--chartreuse); }
.switch strong, .switch small { display: block; }
.switch strong { font-size: 12px; }
.switch small { margin-top: 3px; color: #858b7d; font-size: 10px; }
.compile-button { display: flex; justify-content: space-between; width: 100%; padding: 18px 20px; border: 0; background: var(--chartreuse); color: var(--ink); cursor: pointer; font-weight: 800; text-align: left; transition: transform .15s, background .15s; }
.compile-button:hover { transform: translateY(-2px); background: #e5ff68; }
.compile-button b { font: 500 11px "DM Mono", monospace; }
.error-box { margin-top: 14px; padding: 13px; border-left: 3px solid #ff6048; background: rgba(255,96,72,.1); color: #ff9b8b; font: 400 11px/1.5 "DM Mono", monospace; }

.output-pane { position: relative; background: #1b1e19; }
.output-empty { display: grid; place-content: center; height: 100%; min-height: 640px; padding: 30px; text-align: center; color: #8a9082; }
.output-empty p { margin: 28px 0 8px; color: var(--paper-bright); font: 500 28px "Newsreader", serif; }
.output-empty small { max-width: 370px; line-height: 1.5; }
.empty-mark { display: flex; justify-content: center; align-items: end; gap: 8px; height: 60px; }
.empty-mark span { display: block; width: 18px; background: #3a4036; animation: idle 1.8s ease-in-out infinite; }
.empty-mark span:nth-child(1) { height: 25px; }
.empty-mark span:nth-child(2) { height: 58px; animation-delay: .18s; }
.empty-mark span:nth-child(3) { height: 39px; animation-delay: .36s; }
@keyframes idle { 50% { background: #5b6551; transform: translateY(-4px); } }
.output-ready { padding: 26px; }
.download-button { padding: 11px 14px; border: 1px solid var(--chartreuse); color: var(--chartreuse); text-decoration: none; }
.download-button:hover { background: var(--chartreuse); color: var(--ink); }
.metric-strip { display: grid; grid-template-columns: repeat(4,1fr); margin: 24px 0; border: 1px solid var(--terminal-line); }
.metric-strip div { padding: 15px; border-right: 1px solid var(--terminal-line); }
.metric-strip div:last-child { border: 0; }
.metric-strip strong { display: block; color: var(--chartreuse); font: 500 20px "DM Mono", monospace; }
.metric-strip span { color: #8a9082; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.artifact-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 9px; }
.artifact-tabs button { flex: 0 0 auto; padding: 9px 11px; border: 1px solid var(--terminal-line); background: transparent; color: #9ca294; cursor: pointer; font: 500 10px "DM Mono", monospace; }
.artifact-tabs button.active { border-color: var(--chartreuse); background: var(--chartreuse); color: var(--ink); }
.artifact-stage { border: 1px solid var(--terminal-line); background: #0d100c; }
.artifact-meta { display: flex; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--terminal-line); color: #92998b; font: 500 10px "DM Mono", monospace; }
.artifact-meta #copyButton { color: var(--chartreuse); }
pre { height: 390px; margin: 0; padding: 20px; overflow: auto; color: #dce5d3; white-space: pre-wrap; font: 400 11px/1.62 "DM Mono", monospace; }

.method { display: grid; grid-template-columns: .8fr 1.2fr; gap: 7vw; padding: 9vw 4vw; }
.method-intro .section-number { display: block; margin-bottom: 30px; }
.method-grid { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--ink); }
.method-grid article { padding: 24px 20px 0 0; border-right: 1px solid var(--line); }
.method-grid article + article { padding-left: 20px; }
.method-grid article:last-child { border-right: 0; }
.method-grid article > span { color: var(--signal); font: 500 11px "DM Mono", monospace; }
.method-grid h3 { margin: 50px 0 15px; font: 600 25px/1.05 "Newsreader", serif; }
.method-grid p { color: var(--muted); font-size: 13px; line-height: 1.65; }
footer { display: flex; justify-content: space-between; gap: 25px; padding: 28px 4vw; border-top: 1px solid var(--ink); font: 500 10px "DM Mono", monospace; text-transform: uppercase; }
footer a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .input-pane { border-right: 0; border-bottom: 1px solid #5e6359; }
  .hero { min-height: 640px; }
  .hero-copy, .hero-cta { margin-left: 10vw; }
  .method { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .masthead { grid-template-columns: 1fr auto; padding: 0 20px; }
  .mast-meta { display: none; }
  .hero { min-height: 660px; padding: 100px 20px 30px; }
  .hero::before { width: 80vw; height: 80vw; right: -35vw; top: 34vw; }
  .hero::after { width: 32vw; height: 32vw; right: -2vw; top: 58vw; }
  .hero h1 { font-size: clamp(51px,17vw,80px); }
  .hero-copy, .hero-cta { margin-left: 0; }
  .hero-copy { max-width: 88%; font-size: 18px; }
  .hero-cta { margin-top: 32px; margin-bottom: 65px; }
  .hero-proof { grid-template-columns: repeat(2,1fr); margin-left: 0; }
  .compiler { padding: 55px 16px; }
  .compiler-head { align-items: flex-start; }
  .compiler-head > div:first-child { display: block; }
  .compiler-head .section-number { display: block; margin-bottom: 12px; }
  .workspace { display: block; }
  .input-pane, .output-ready { padding: 18px; }
  textarea { height: 340px; }
  .pane-head { align-items: flex-start; }
  .input-actions { flex-direction: column; gap: 8px; text-align: right; }
  .metric-strip { grid-template-columns: repeat(2,1fr); }
  .metric-strip div:nth-child(2) { border-right: 0; }
  .metric-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--terminal-line); }
  .method { padding: 80px 20px; }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid article, .method-grid article + article { padding: 22px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .method-grid h3 { margin-top: 30px; }
  footer { flex-direction: column; padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
