/* ==========================================================================
   PROJECT404 · v2 — minimal high-tech
   Single dark theme (brand). One accent, hairline structure, mono for data.
   Effects: decode-on-reveal headings, wordmark glitch on hover, faint
   binary field in the hero. All motion is off under prefers-reduced-motion.
   ========================================================================== */
:root {
  --bg: #050807;
  --bg-2: #0a0f0d;
  --line: #16211c;
  --line-2: #22312a;
  --fg: #e4ece8;
  --muted: #7f8f88;
  --dim: #4d5b55;
  --em: #c2e83f;
  --em-soft: color-mix(in srgb, var(--em) 10%, transparent);
  --amber: #f5b84a;
  --f-mark: "Orbitron", "Geist", system-ui, sans-serif;
  --f-body: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --max: 1120px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body.v2 {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
:where(.v2) a { color: inherit; text-decoration: none; }
.v2 :focus-visible { outline: 1px solid var(--em); outline-offset: 3px; }
.v2 ::selection { background: var(--em); color: var(--bg); }

/* Faint grid behind everything */
.v2-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
  opacity: 0.55;
}

.wrap {
  max-width: var(--max); margin: 0 auto;
  padding-left: var(--gutter); padding-right: var(--gutter-r);
}
.mono { font-family: var(--f-mono); }
.label {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(5, 8, 7, 0.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
body.v2::before {
  content: ""; position: fixed; inset: 0 0 auto; z-index: 51;
  height: env(safe-area-inset-top, 0px); background: var(--bg);
}
.nav__in { display: flex; align-items: center; gap: 24px; height: 60px; }
.mark {
  font-family: var(--f-mark); font-weight: 700; font-size: 15px; letter-spacing: 0.12em;
  position: relative; display: inline-block; white-space: nowrap;
}
.mark b { color: var(--em); font-weight: 700; }
.nav__links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav__links a { font-size: 14px; color: var(--muted); transition: color .15s; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--fg); }
.nav__toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--line-2);
  color: var(--fg); font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em;
  padding: 8px 12px; border-radius: 2px; cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 13px 20px; border: 1px solid var(--line-2); border-radius: 2px;
  color: var(--fg); background: transparent; position: relative;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--em); color: var(--em); }
.btn--em { background: var(--em); border-color: var(--em); color: #121500; font-weight: 500; }
.btn--em:hover { background: color-mix(in srgb, var(--em) 80%, #fff); color: #121500; }
.btn--sm { padding: 8px 14px; font-size: 12px; }
.btn .arr { transition: transform .15s; }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- Hero ---------- */
.hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero__bits { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.9; }
.hero__in { position: relative; padding-block: clamp(88px, 16vw, 168px) clamp(72px, 12vw, 128px); }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--em); box-shadow: 0 0 6px color-mix(in srgb, var(--em) 60%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.hero h1 {
  font-family: var(--f-mark); font-weight: 900; margin: 28px 0 0;
  font-size: clamp(44px, 11.5vw, 132px); line-height: 0.95; letter-spacing: 0.02em;
}
.hero h1 b { color: var(--em); font-weight: 900; }
.hero__lead { font-size: clamp(19px, 2.4vw, 24px); line-height: 1.45; max-width: 30ch; margin: 28px 0 0; color: var(--fg); text-wrap: balance; }
.hero__lead span { color: var(--muted); }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.prompt { margin-top: 48px; font-family: var(--f-mono); font-size: 13px; color: var(--dim); }
.prompt i { font-style: normal; color: var(--em); }
.caret { display: inline-block; width: 8px; height: 15px; background: var(--em); vertical-align: -2px; margin-left: 4px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Sections ---------- */
.sec { padding-block: clamp(72px, 10vw, 120px); border-bottom: 1px solid var(--line); }
.sec__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; margin-bottom: 48px; }
.sec__head h2 {
  font-size: clamp(30px, 4.4vw, 48px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 600; margin: 12px 0 0; text-wrap: balance;
}
.sec__head p { color: var(--muted); margin: 0; max-width: 46ch; }

/* ---------- Sector index ---------- */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1.6fr) auto 24px;
  gap: 24px; align-items: center; padding: 22px 8px; border-bottom: 1px solid var(--line);
  position: relative; transition: background .15s;
}
.row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--em);
  transform: scaleY(0); transform-origin: top; transition: transform .2s ease;
}
.row:hover { background: linear-gradient(90deg, var(--em-soft), transparent 60%); }
.row:hover::before { transform: scaleY(1); }
.row__id { font-family: var(--f-mono); font-size: 12px; color: var(--dim); letter-spacing: .1em; }
.row__t { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.row__d { color: var(--muted); font-size: 15px; }
.row__go { color: var(--dim); font-family: var(--f-mono); transition: color .15s, transform .15s; }
.row:hover .row__go { color: var(--em); transform: translateX(3px); }

.chip {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  padding: 4px 8px; border: 1px solid var(--line-2); border-radius: 2px; color: var(--muted);
}
.chip--live { color: var(--em); border-color: color-mix(in srgb, var(--em) 35%, transparent); }
.chip--warn { color: var(--amber); border-color: rgba(245, 184, 74, .35); }

.also { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; align-items: center; }
.also a { font-size: 14px; color: var(--muted); display: inline-flex; gap: 10px; align-items: center; }
.also a:hover { color: var(--fg); }

/* ---------- Emma feature ---------- */
.feature {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px;
  border: 1px solid var(--line-2); padding: clamp(28px, 5vw, 56px); position: relative; background: var(--bg-2);
}
.feature::before, .feature::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--em); border-style: solid;
}
.feature::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.feature::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.feature h2 { font-size: clamp(28px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; margin: 14px 0 16px; text-wrap: balance; }
.feature p { color: var(--muted); margin: 0 0 28px; max-width: 44ch; }
.spec { list-style: none; margin: 0; padding: 0; font-family: var(--f-mono); font-size: 13px; align-self: center; }
.spec li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--line-2); }
.spec li:last-child { border-bottom: 0; }
.spec span { color: var(--muted); }
.spec b { font-weight: 500; color: var(--fg); text-align: right; }
.spec b.em { color: var(--em); }

/* ---------- Join band ---------- */
.join { text-align: left; }
.join h2 { font-family: var(--f-mark); font-weight: 700; font-size: clamp(28px, 5vw, 56px); line-height: 1.05; letter-spacing: 0.02em; margin: 14px 0 20px; max-width: 18ch; }
.join p { color: var(--muted); margin: 0 0 36px; max-width: 48ch; }

/* ---------- Footer ---------- */
.foot { padding-block: 56px 40px; }
.foot__top { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot__top p { color: var(--muted); font-size: 14px; margin: 12px 0 0; max-width: 32ch; }
.foot h4 { font-family: var(--f-mono); font-weight: 400; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin: 0 0 14px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.foot ul a { font-size: 14px; color: var(--muted); }
.foot ul a:hover { color: var(--em); }
.foot__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-family: var(--f-mono); font-size: 12px; color: var(--dim); letter-spacing: .08em; }

/* ==========================================================================
   Inner-page components (shared by every page except the homepage hero)
   ========================================================================== */

/* Page hero: smaller than the homepage, same parts (.status, .hero__lead, .hero__ctas, .prompt) */
.hero--page .hero__in { padding-block: clamp(72px, 12vw, 128px) clamp(56px, 9vw, 96px); }
.hero--page h1 {
  font-family: var(--f-body); font-weight: 600; letter-spacing: -0.03em; line-height: 1.02;
  font-size: clamp(40px, 7vw, 84px); max-width: 16ch; text-wrap: balance;
}
.hero--page h1 b, .hero--page h1 em { color: var(--em); font-weight: 600; font-style: normal; }
.crumb { font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--em); }

/* Plain section heading when .sec__head's two columns don't fit */
.sec h2.h2 { font-size: clamp(30px, 4.4vw, 48px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 600; margin: 12px 0 20px; text-wrap: balance; }
.lead { font-size: clamp(17px, 1.8vw, 19px); color: var(--muted); max-width: 60ch; margin: 0 0 24px; }
.lead strong { color: var(--fg); font-weight: 500; }
.prose { max-width: 66ch; color: var(--muted); }
.prose p { margin: 0 0 16px; }
.prose strong, .prose b { color: var(--fg); font-weight: 500; }
.prose a { color: var(--em); }
.note { font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; color: var(--dim); }

/* Two-column split */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 64px; align-items: start; }

/* Card grid: hairline cells. Each card draws its own 1px ring and the 1px gap
   makes neighbours share it, so an unfilled last row stays empty, not a solid block. */
.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1px; padding: 1px;
}
.cards--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.card { background: var(--bg); box-shadow: 0 0 0 1px var(--line); padding: 28px 24px 30px; display: flex; flex-direction: column; gap: 12px; position: relative; transition: background .15s; }
a.card:hover, .card--hover:hover { background: var(--bg-2); }
a.card:hover .card__go { color: var(--em); transform: translateX(3px); }
.card__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card__id { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; color: var(--dim); }
.card h3 { font-size: 19px; line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; margin: 4px 0 0; }
.card p { color: var(--muted); font-size: 15px; margin: 0; }
.card ul { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.card ul li::before { content: "› "; color: var(--em); font-family: var(--f-mono); }
.card__foot { margin-top: auto; padding-top: 8px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.card__go { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); transition: color .15s, transform .15s; }

/* Pricing / clearance tiers */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.tier { border: 1px solid var(--line-2); background: var(--bg-2); padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.tier--feat { border-color: color-mix(in srgb, var(--em) 45%, transparent); }
.tier--feat::before { content: attr(data-flag); position: absolute; top: -10px; left: 20px; padding: 2px 8px; background: var(--em); color: #121500; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.tier h3 { font-size: 20px; font-weight: 500; margin: 0; }
.tier__price { font-family: var(--f-body); font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.tier__price small { font-family: var(--f-mono); font-size: 13px; font-weight: 400; letter-spacing: .04em; color: var(--muted); margin-left: 4px; }
.tier p { color: var(--muted); font-size: 15px; margin: 0; }
.tier ul { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.tier ul li::before { content: "› "; color: var(--em); font-family: var(--f-mono); }
.tier .btn { margin-top: auto; justify-content: center; }

/* Numbered steps */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 32px; }
.steps li { counter-increment: step; border-top: 1px solid var(--line-2); padding-top: 18px; }
.steps li::before { content: counter(step, decimal-leading-zero); display: block; font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; color: var(--em); margin-bottom: 10px; }
.steps h3 { font-size: 18px; font-weight: 500; margin: 0 0 8px; }
.steps p { color: var(--muted); font-size: 15px; margin: 0; }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 4px; display: flex; justify-content: space-between; gap: 16px; font-size: 17px; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--f-mono); color: var(--dim); transition: transform .15s, color .15s; }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--em); }
.faq details > div { padding: 0 4px 22px; color: var(--muted); max-width: 70ch; }

/* Forms */
.form { display: grid; gap: 18px; }
.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span, .field > label, .legend { font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.v2 input[type=text], .v2 input[type=email], .v2 input[type=tel], .v2 input[type=url], .v2 input[type=number], .v2 select, .v2 textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--fg); background: var(--bg-2);
  border: 1px solid var(--line-2); border-radius: 2px; padding: 12px 14px; transition: border-color .15s;
}
.v2 input:focus, .v2 select:focus, .v2 textarea:focus { outline: none; border-color: var(--em); }
.v2 input::placeholder, .v2 textarea::placeholder { color: var(--dim); }
.v2 select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.v2 input[type=checkbox], .v2 input[type=radio] { accent-color: var(--em); width: 16px; height: 16px; }
.opt { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line-2); background: var(--bg-2); padding: 18px; cursor: pointer; transition: border-color .15s, background .15s; }
.opt:hover { border-color: var(--dim); }
.opt:has(input:checked) { border-color: var(--em); background: var(--em-soft); }
.opt input { margin-top: 4px; flex: none; }
.form__msg { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }

/* Data table */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-family: var(--f-mono); font-weight: 400; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 12px 10px; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 14px 10px; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: top; }
.tbl td:first-child { color: var(--fg); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Spacing helpers */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 16px; } .mt-2 { margin-top: 32px; } .mt-3 { margin-top: 56px; }

/* ---------- Glitch (wordmark hover / focus) ---------- */
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; opacity: 0; pointer-events: none;
}
.glitch:hover::before, .glitch:focus-visible::before { opacity: .8; color: var(--em); animation: g1 .38s steps(2) 1; }
.glitch:hover::after, .glitch:focus-visible::after { opacity: .6; color: #59f0ff; animation: g2 .38s steps(2) 1; }
@keyframes g1 {
  0% { clip-path: inset(10% 0 60% 0); transform: translate(-3px, 0); }
  50% { clip-path: inset(55% 0 20% 0); transform: translate(3px, 0); }
  100% { clip-path: inset(0 0 100% 0); transform: none; opacity: 0; }
}
@keyframes g2 {
  0% { clip-path: inset(65% 0 10% 0); transform: translate(3px, 0); }
  50% { clip-path: inset(20% 0 55% 0); transform: translate(-2px, 0); }
  100% { clip-path: inset(0 0 100% 0); transform: none; opacity: 0; }
}
.btn--em:hover { animation: jolt .22s steps(2) 1; }
@keyframes jolt { 50% { transform: translate(1px, -1px); clip-path: inset(0 0 40% 0); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sec__head { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; gap: 28px; }
  .split { grid-template-columns: 1fr; }
  .foot__top { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 6px 16px; }
  .row__d { grid-column: 2 / -1; grid-row: 2; font-size: 14px; }
  .row__go { display: none; }
}
@media (max-width: 760px) {
  .nav__toggle { display: inline-block; }
  .nav__links {
    display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    gap: 0; background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter-r) 20px var(--gutter);
  }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 12px 0; font-size: 16px; border-bottom: 1px solid var(--line); }
  .nav__links .btn { margin-top: 12px; justify-content: center; border-bottom: 1px solid var(--em); }
}
@media (max-width: 480px) {
  .foot__top { grid-template-columns: 1fr; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row__id { display: none; }
  .row__d { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .hero__bits { display: none; }
}
