@layer reset, base, components, utilities;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body, h1, h2, h3, p, ul, ol, figure { margin: 0; }
  img, svg { display: block; max-width: 100%; }
  button, input { font: inherit; }
}

@layer base {
  :root {
    color-scheme: dark;
    --ink: #f2f5e9;
    --muted: #a9b2a6;
    --surface: #111713;
    --surface-2: #182019;
    --surface-3: #202a22;
    --line: #354138;
    --acid: #b7ff3c;
    --amber: #ffb000;
    --blue: #72d9ff;
    --rose: #ff7f88;
    --bg: #090d0a;
    --max: 1180px;
    --radius: 16px;
  }
  body {
    min-width: 320px;
    background:
      linear-gradient(rgba(183,255,60,.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(183,255,60,.025) 1px, transparent 1px),
      radial-gradient(circle at 80% -10%, rgba(183,255,60,.08), transparent 35%),
      var(--bg);
    background-size: 48px 48px, 48px 48px, auto, auto;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.68;
    text-rendering: optimizeLegibility;
  }
  a { color: var(--acid); text-underline-offset: .2em; }
  a:hover { color: #d2ff86; }
  h1, h2, h3 { font-family: "Arial Narrow", "Roboto Condensed", Impact, ui-sans-serif, sans-serif; font-stretch: condensed; line-height: 1.04; letter-spacing: -.02em; }
  h1 { font-size: clamp(3rem, 8vw, 7rem); max-width: 12ch; text-transform: uppercase; }
  h2 { font-size: clamp(2rem, 4.2vw, 3.6rem); max-width: 19ch; margin-bottom: 1.2rem; }
  h3 { font-size: 1.25rem; }
  p + p { margin-top: 1rem; }
  code, kbd { font-family: "SFMono-Regular", Consolas, monospace; }
  code { color: var(--acid); }
  kbd { display: inline-block; padding: .14rem .42rem; border: 1px solid #647166; border-bottom-width: 3px; border-radius: 5px; background: #283129; color: #fff; font-size: .86rem; }
  :focus-visible { outline: 3px solid var(--acid); outline-offset: 4px; }
  ::selection { background: var(--acid); color: #101510; }
}

@layer components {
  .skip-link { position: fixed; z-index: 99; top: .5rem; left: .5rem; transform: translateY(-180%); background: var(--acid); color: #081008; padding: .6rem 1rem; font-weight: 800; }
  .skip-link:focus { transform: none; }
  .site-header { position: sticky; z-index: 50; top: 0; display: flex; align-items: center; justify-content: space-between; width: 100%; padding: .8rem max(1rem, calc((100vw - var(--max)) / 2)); border-bottom: 1px solid rgba(183,255,60,.18); background: rgba(9,13,10,.92); backdrop-filter: blur(14px); }
  .brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); font-weight: 900; line-height: 1; text-decoration: none; text-transform: uppercase; }
  .brand small { display: block; margin-top: .18rem; color: var(--acid); font-family: monospace; font-size: .64rem; letter-spacing: .19em; }
  .brand-mark { position: relative; display: grid; width: 2.2rem; height: 2.2rem; flex: 0 0 auto; place-items: center; border: 2px solid var(--acid); border-radius: 50%; box-shadow: inset 0 0 0 4px var(--bg); background: transparent; }
  .brand-mark::before { content: ""; width: .9rem; height: .9rem; border: 2px solid var(--acid); border-radius: 50%; }
  .brand-mark::after { content: ""; position: absolute; top: .25rem; right: .3rem; width: 3px; height: .72rem; border-radius: 2px; background: var(--amber); transform: rotate(24deg); }
  .main-nav { display: flex; align-items: center; gap: .3rem; }
  .main-nav a { padding: .55rem .7rem; border-radius: 8px; color: var(--muted); font-size: .9rem; font-weight: 750; text-decoration: none; }
  .main-nav a:hover, .main-nav a.active { background: var(--surface-2); color: var(--ink); }
  .main-nav a.active { box-shadow: inset 0 -2px var(--acid); }
  .menu-button { display: none; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
  main { overflow: hidden; }
  .breadcrumbs { display: flex; gap: .6rem; width: min(var(--max), calc(100% - 2rem)); margin: 1.25rem auto 0; color: var(--muted); font-size: .82rem; }
  .breadcrumbs span:last-child { overflow: hidden; max-width: 45ch; text-overflow: ellipsis; white-space: nowrap; }
  .hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); align-items: center; min-height: 690px; width: min(var(--max), calc(100% - 2rem)); margin: 0 auto; padding: 5rem 0; }
  .hero-copy { position: relative; z-index: 2; }
  .eyebrow, .kicker { color: var(--acid); font-family: monospace; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
  .eyebrow::before, .kicker::before { content: "// "; color: var(--amber); }
  .lede { max-width: 64ch; margin-top: 1.5rem; color: #cbd2c7; font-size: clamp(1.05rem, 2vw, 1.3rem); }
  .verified { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 2rem; }
  .verified span { padding: .36rem .65rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-family: monospace; font-size: .72rem; text-transform: uppercase; }
  .verified span:first-child { border-color: rgba(183,255,60,.4); color: var(--acid); }
  .pit-visual { position: relative; min-height: 470px; isolation: isolate; }
  .pit-visual::before { content: ""; position: absolute; inset: 3% 0; border: 1px solid rgba(183,255,60,.15); background: repeating-linear-gradient(90deg, transparent 0 30px, rgba(183,255,60,.04) 30px 31px); clip-path: polygon(20% 0,100% 0,100% 85%,76% 100%,0 100%,0 20%); }
  .gantry { position: absolute; top: 10%; right: 1%; width: 75%; height: 25%; border: 8px solid #273129; border-bottom: 0; transform: perspective(350px) rotateX(-25deg) rotateZ(7deg); }
  .pit-ring { position: absolute; left: 50%; top: 54%; border: 7px solid #2f3b31; border-radius: 50%; transform: translate(-50%,-50%) rotateX(68deg); box-shadow: 0 0 45px rgba(183,255,60,.1); }
  .pit-ring.one { width: 78%; aspect-ratio: 1; }
  .pit-ring.two { width: 55%; aspect-ratio: 1; border-color: var(--acid); box-shadow: 0 0 75px rgba(183,255,60,.18), inset 0 0 30px rgba(183,255,60,.12); }
  .pit-core { position: absolute; left: 50%; top: 55%; display: grid; width: 34%; aspect-ratio: 1; place-items: center; border-radius: 50%; transform: translate(-50%,-50%); background: radial-gradient(circle, #000 0 45%, #0b1409 70%); color: var(--acid); font-family: monospace; font-size: .72rem; letter-spacing: .22em; box-shadow: 0 0 90px rgba(183,255,60,.22); }
  .feed-line { position: absolute; top: 13%; right: 18%; width: 4px; height: 45%; background: repeating-linear-gradient(var(--amber) 0 9px, transparent 9px 17px); transform: rotate(18deg); transform-origin: bottom; }
  .content { width: min(920px, calc(100% - 2rem)); margin: 0 auto 7rem; }
  .content > section { content-visibility: auto; contain-intrinsic-size: auto 560px; padding: 5rem 0; border-top: 1px solid var(--line); }
  .content > section:first-child { border-top-color: rgba(183,255,60,.4); }
  .content section > p, .content section > ul, .content section > ol { max-width: 72ch; }
  .kicker { margin-bottom: .75rem; }
  .patch-callout, .notice { margin: 0 0 1rem; padding: clamp(1.4rem, 4vw, 2.5rem) !important; border: 1px solid rgba(183,255,60,.35) !important; border-radius: var(--radius); background: linear-gradient(135deg, rgba(183,255,60,.09), rgba(183,255,60,.015)); }
  .notice { border-color: rgba(255,176,0,.4) !important; background: linear-gradient(135deg, rgba(255,176,0,.09), transparent); }
  .patch-callout > div { display: flex; align-items: center; gap: .5rem; margin-bottom: 1.2rem; color: var(--acid); font-family: monospace; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
  .status-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--acid); box-shadow: 0 0 12px var(--acid); }
  .fact-grid, .guide-grid, .diagnostic-grid, .split { display: grid; gap: 1rem; margin-top: 2rem; }
  .fact-grid { grid-template-columns: repeat(3, 1fr); }
  .guide-grid, .diagnostic-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr 1fr; }
  .fact-grid article, .diagnostic-grid article, .split article { padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .fact-grid h3, .diagnostic-grid h3, .split h3 { margin: 1rem 0 .55rem; }
  .fact-grid p, .diagnostic-grid p, .split p { color: var(--muted); }
  .guide-card { position: relative; min-height: 230px; padding: 1.5rem; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, var(--surface-2), #0d120e); color: var(--ink); text-decoration: none; transition: transform .2s, border-color .2s; }
  .guide-card:hover { transform: translateY(-4px); border-color: var(--acid); color: var(--ink); }
  .guide-card > span { color: rgba(183,255,60,.26); font-family: Impact, sans-serif; font-size: 4rem; line-height: 1; }
  .guide-card h3 { margin: .5rem 0; font-size: 1.7rem; }
  .guide-card p { color: var(--muted); }
  .guide-card b { position: absolute; bottom: 1.4rem; color: var(--acid); font-family: monospace; font-size: .8rem; text-transform: uppercase; }
  .factory-diagram, .phase-line { display: flex; align-items: center; gap: .6rem; margin: 2rem 0; padding: 2rem; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #080b08; }
  .factory-diagram .machine, .phase-line span { flex: 1 0 120px; padding: 1rem; border: 1px solid #58635a; background: var(--surface-2); font-family: monospace; font-size: .78rem; text-align: center; text-transform: uppercase; }
  .factory-diagram .warning { border-color: var(--amber); color: var(--amber); }
  .factory-diagram .maw { flex: 1 0 120px; padding: 1.3rem .7rem; border: 3px double var(--acid); border-radius: 50%; background: #000; color: var(--acid); font-family: monospace; text-align: center; }
  .factory-diagram i, .phase-line i { color: var(--amber); font-style: normal; font-weight: 900; }
  .legend { display: grid; gap: .8rem; margin: 2rem 0; }
  .legend p { display: flex; align-items: center; gap: .8rem; }
  .evidence { display: inline-block; padding: .22rem .48rem; border: 1px solid currentColor; border-radius: 999px; font-family: monospace; font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
  .evidence.official { color: var(--acid); }
  .evidence.developer { color: var(--blue); }
  .evidence.community { color: var(--amber); }
  .evidence.demo { color: var(--rose); }
  .steps { display: grid; gap: .75rem; padding: 0; list-style: none; counter-reset: field-step; }
  .steps li { position: relative; display: grid; grid-template-columns: minmax(160px,.55fr) 1fr; gap: 1.2rem; padding: 1.1rem 1.1rem 1.1rem 4.3rem; border-left: 2px solid var(--line); background: var(--surface); counter-increment: field-step; }
  .steps li::before { content: counter(field-step, decimal-leading-zero); position: absolute; left: 1rem; top: 1rem; color: var(--acid); font-family: monospace; font-weight: 900; }
  .steps span { color: var(--muted); }
  .table-wrap { margin: 2rem 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
  table { width: 100%; border-collapse: collapse; background: rgba(17,23,19,.75); }
  th, td { padding: .95rem 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
  th { background: #1b241d; color: var(--acid); font-family: monospace; font-size: .73rem; letter-spacing: .08em; text-transform: uppercase; }
  tr:last-child td { border-bottom: 0; }
  td { color: #d3d8d0; }
  .achievement-table th:first-child { min-width: 150px; }
  .achievement-table input { width: 1.1rem; height: 1.1rem; margin-right: .55rem; accent-color: var(--acid); }
  .achievement-table tr:has(input:checked) { opacity: .58; }
  .achievement-table tr:has(input:checked) strong { text-decoration: line-through; }
  details { margin-top: .55rem; }
  summary { color: var(--amber); cursor: pointer; font-size: .83rem; font-weight: 750; }
  details p { padding: .75rem 0; color: var(--muted); font-size: .88rem; }
  .tracker-tools { display: flex; align-items: center; justify-content: space-between; margin: 1.4rem 0 .5rem; }
  .tracker-tools button, .button { padding: .55rem .8rem; border: 1px solid var(--acid); border-radius: 7px; background: transparent; color: var(--acid); cursor: pointer; font-weight: 800; text-decoration: none; }
  .tracker-tools button:hover, .button:hover { background: var(--acid); color: #081008; }
  .tracker-tools span { color: var(--muted); font-family: monospace; font-size: .78rem; }
  .decision-tree { display: grid; gap: 2px; padding-left: 1rem; border-left: 4px solid var(--acid); }
  .decision-tree p { margin: 0; padding: 1rem 1.2rem; background: var(--surface); }
  .decision-tree strong { color: var(--acid); }
  .check-list { display: grid; gap: .7rem; padding: 0; list-style: none; }
  .check-list li { position: relative; padding-left: 1.8rem; }
  .check-list li::before { content: "×"; position: absolute; left: 0; color: var(--rose); font-family: monospace; font-weight: 900; }
  .sources { color: var(--muted); font-size: .93rem; }
  .small { color: var(--muted); font-size: .85rem; }
  .phase-line span { border-color: rgba(114,217,255,.5); }
  .site-footer { display: grid; grid-template-columns: 1fr auto; gap: 2rem; width: min(var(--max), calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0; border-top: 1px solid var(--line); color: var(--muted); }
  .site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; align-content: start; }
  .site-footer nav a { color: var(--muted); font-size: .88rem; }
  .footer-brand { margin-bottom: 1rem; }
  .legal { grid-column: 1/-1; padding-top: 1.2rem; border-top: 1px solid #202720; font-size: .78rem; }
  .not-found { display: grid; min-height: 100vh; place-content: center; width: min(760px, calc(100% - 2rem)); margin: auto; text-align: center; }
  .not-found h1 { max-width: none; margin: 1rem auto; }
  .not-found .button { justify-self: center; margin-top: 2rem; }
  .analytics-consent { position: fixed; z-index: 100; right: 1rem; bottom: 1rem; width: min(520px, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: 1.25rem; overflow-y: auto; overscroll-behavior: contain; border: 1px solid rgba(183,255,60,.5); border-radius: var(--radius); background: #101611; box-shadow: 0 18px 60px rgba(0,0,0,.55); }
  .analytics-consent h2 { margin-bottom: .55rem; font-size: 1.45rem; }
  .analytics-consent p { color: var(--muted); font-size: .92rem; }
  .analytics-consent-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
  .analytics-consent-actions button { padding: .55rem .8rem; border: 1px solid var(--acid); border-radius: 7px; background: transparent; color: var(--acid); cursor: pointer; font-weight: 800; }
  .analytics-consent-actions button:hover { background: var(--acid); color: #081008; }
  .analytics-consent-actions .secondary { border-color: var(--line); color: var(--muted); }
}

@layer utilities {
  @media (max-width: 860px) {
    .site-header { flex-wrap: wrap; }
    .menu-button { display: block; }
    .main-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-top: .8rem; }
    .main-nav.open { display: flex; }
    .hero { grid-template-columns: 1fr; min-height: auto; padding: 4rem 0 2rem; }
    .pit-visual { min-height: 360px; order: -1; opacity: .82; }
    .fact-grid { grid-template-columns: 1fr; }
    .site-footer { grid-template-columns: 1fr; }
    .legal { grid-column: auto; }
  }
  @media (max-width: 620px) {
    body { background-size: 32px 32px, 32px 32px, auto, auto; }
    h1 { font-size: clamp(2.55rem, 12vw, 3.7rem); letter-spacing: -.035em; }
    .hero { width: min(100% - 1.25rem, var(--max)); }
    .pit-visual { min-height: 280px; }
    .content { width: min(100% - 1.25rem, 920px); }
    .content > section { padding: 3.5rem 0; }
    .guide-grid, .diagnostic-grid, .split { grid-template-columns: 1fr; }
    .steps li { grid-template-columns: 1fr; padding-left: 3.8rem; }
    .factory-diagram, .phase-line { padding: 1rem; }
    .tracker-tools { align-items: flex-start; flex-direction: column; gap: .7rem; }
    .legend p { align-items: flex-start; flex-direction: column; gap: .35rem; }
  }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  }
}
