/* DebackTech
   Layout: full-bleed video/point-cloud bands with centered uppercase headings (Anduril-style),
   a transparent header that sits on the page, and quiet content sections between the bands.
   Single dark theme by design. */
:root {
  --bg: #08090b;
  --bg-raised: #111318;
  --bg-sunk: #050607;
  --line: #1d2127;
  --line-strong: #2c3139;
  --fg: #f3eee7;          /* warm cream, from the badge face */
  --muted: #a29d96;
  --dim: #6c6862;
  --accent: #ee6a2c;      /* gear orange */
  --accent-hover: #ff7d40;
  --blue: #4683f2;        /* jet blue, lifted for a dark ground */
  --ink: #08090b;         /* text on orange / cream */

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.45rem, 1.15rem + 1.2vw, 2rem);
  --step-3: clamp(2rem, 1.3rem + 3vw, 3.5rem);
  --step-4: clamp(2.5rem, 1.1rem + 6.2vw, 6.25rem);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --header-h: 72px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
.display {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.92;
  font-variation-settings: "wdth" 100;
}
h1.display { font-size: var(--step-4); }
h2.display { font-size: var(--step-3); }
h2:not(.display) { font-size: var(--step-3); font-weight: 600; letter-spacing: -0.02em; line-height: 1.02; }
h3 { font-size: var(--step-1); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; max-width: 64ch; }
.lede { font-size: var(--step-1); color: var(--muted); line-height: 1.5; }
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.label .sep { color: var(--accent); padding-inline: 0.35em; }

/* ---------- header: sits on the page, no divider ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  padding-top: env(safe-area-inset-top, 0px);
  transition: transform .35s ease;
}
.site-header::before {
  content: ""; position: absolute; inset: 0 0 -48px 0; pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 92%, transparent) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 55%, transparent 100%);
  opacity: 0; transition: opacity .35s ease;
}
.site-header.is-scrolled::before { opacity: 1; }
.site-header.is-hidden { transform: translateY(-110%); }
.site-header .wrap {
  position: relative; max-width: none; height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; justify-self: start; }
.brand img { width: 36px; height: 36px; }
.brand span { font-weight: 700; letter-spacing: 0.06em; font-size: 1rem; font-variation-settings: "wdth" 110; }
.nav { display: flex; gap: clamp(20px, 3.5vw, 48px); }
.nav a { text-decoration: none; font-size: 0.95rem; color: var(--fg); opacity: .78; transition: opacity .15s; }
.nav a:hover, .nav a[aria-current="page"] { opacity: 1; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 8px; text-decoration-thickness: 2px; }
.header-cta { justify-self: end; }
@media (max-width: 640px) {
  :root { --header-h: 60px; }
  .site-header .wrap { grid-template-columns: auto 1fr auto; }
  .brand span { display: none; }
  .nav { justify-self: end; gap: 18px; }
  .nav a { font-size: 0.9rem; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  text-decoration: none; padding: 14px 22px; border: 1px solid color-mix(in srgb, var(--fg) 70%, transparent);
  color: var(--fg); background: transparent; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--fg); border-color: var(--fg); color: var(--ink); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--ink); }
.btn--sm { padding: 10px 14px; font-size: 0.7rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions--center { justify-content: center; }

/* ---------- media backgrounds (video over point-cloud fallback) ---------- */
.media-bg { position: absolute; inset: 0; overflow: hidden; background: var(--bg-sunk); }
.media-bg canvas, .media-bg video { position: absolute; inset: 0; width: 100%; height: 100%; }
.media-bg video { object-fit: cover; object-position: var(--x, 50%) 50%; opacity: 0; transition: opacity .8s ease; }
.media-bg .veil { position: absolute; inset: 0; background: var(--bg); opacity: var(--veil, .3); pointer-events: none; }
.media-bg.has-video video { opacity: 1; }
.media-bg.has-video canvas { display: none; }

/* ---------- heroes: centered, blended into the page ---------- */
.hero { position: relative; display: grid; align-items: center; overflow: hidden; isolation: isolate; }
.hero--full { min-height: clamp(560px, 92svh, 980px); }
.hero--page { min-height: clamp(420px, 64svh, 720px); }
.hero .shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 52%, color-mix(in srgb, var(--bg) 55%, transparent) 0%, transparent 70%),
    linear-gradient(to bottom, color-mix(in srgb, var(--bg) 60%, transparent) 0%, transparent 22%, transparent 62%, var(--bg) 100%);
}
.hero-inner {
  position: relative; z-index: 1; text-align: center;
  display: grid; justify-items: center; gap: 24px;
  padding-block: calc(var(--header-h) + 48px) 72px;
}
.hero-inner h1 { max-width: 16ch; }
.hero-inner .lede { max-width: 48ch; color: color-mix(in srgb, var(--fg) 78%, transparent); }
.hero-inner .label { color: color-mix(in srgb, var(--fg) 75%, transparent); }
.scroll-cue {
  position: absolute; z-index: 1; bottom: 28px; left: 50%; transform: translateX(-50%);
  width: 1px; height: 44px; background: linear-gradient(var(--fg), transparent); opacity: .5;
}
@media (max-width: 640px) { .scroll-cue { display: none; } }

/* ---------- sections ---------- */
.section { padding-block: clamp(72px, 10vw, 136px); }
.section + .section { border-top: 1px solid var(--line); }
.section--tight { padding-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head > div { display: grid; gap: 14px; }
.section-head--center { justify-content: center; text-align: center; }
.section-head--center > div { justify-items: center; }

/* featured build */
.feature { position: relative; display: grid; grid-template-columns: 1.35fr 1fr; text-decoration: none; background: var(--bg-raised); border: 1px solid var(--line); transition: border-color .2s; }
.feature:hover { border-color: var(--line-strong); }
.feature .media { position: relative; min-height: 340px; }
.feature .body { padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.feature .body h3 { font-size: var(--step-2); text-transform: uppercase; letter-spacing: -0.02em; }
.feature .body p { color: var(--muted); }
.feature .more { margin-top: auto; font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } .feature .media { min-height: 0; aspect-ratio: 16 / 9; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; width: fit-content;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 10px; border: 1px solid var(--line-strong); color: var(--fg); background: color-mix(in srgb, var(--bg) 60%, transparent);
}
.chip--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
.chip--blue { border-color: color-mix(in srgb, var(--blue) 55%, transparent); color: color-mix(in srgb, var(--blue) 30%, var(--fg)); }
.chip--orange { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: color-mix(in srgb, var(--accent) 35%, var(--fg)); }
.chip--done { background: var(--fg); border-color: var(--fg); color: var(--ink); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* about */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.split > * { min-width: 0; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 20px; align-content: start; }
.stack > p { color: var(--muted); }
.rows { margin: 0; border-top: 1px solid var(--line); }
.rows > div { display: grid; grid-template-columns: 9rem 1fr; gap: 16px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.rows dt, .rows dd { margin: 0; }
.rows dd { color: var(--muted); }
@media (max-width: 480px) { .rows > div { grid-template-columns: 1fr; gap: 4px; } }

/* follow */
.follow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.follow a { background: var(--bg); padding: 28px; display: grid; gap: 10px; text-decoration: none; transition: background .2s; min-width: 0; }
.follow a:hover { background: var(--bg-raised); }
.follow strong { font-weight: 600; font-size: var(--step-1); overflow-wrap: anywhere; }
.follow a:nth-child(1) .label { color: color-mix(in srgb, var(--accent) 70%, var(--fg)); }
.follow a:nth-child(2) .label { color: color-mix(in srgb, var(--blue) 70%, var(--fg)); }
@media (max-width: 760px) { .follow { grid-template-columns: 1fr; } }

/* ---------- project blocks (Projects page) ---------- */
.blocks { display: grid; }
.block { position: relative; min-height: clamp(520px, 86svh, 920px); display: grid; align-items: end; overflow: hidden; isolation: isolate; text-decoration: none; }
.block + .block { border-top: 1px solid var(--bg); }
.block .shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg) 92%, transparent) 0%, color-mix(in srgb, var(--bg) 40%, transparent) 38%, transparent 70%);
}
.block-inner { position: relative; z-index: 1; display: grid; justify-items: center; text-align: center; gap: 18px; padding-block: 96px clamp(48px, 7vw, 88px); }
.block-inner h2 { font-size: clamp(2.6rem, 1rem + 7.4vw, 7.5rem); }
.block-inner p { color: color-mix(in srgb, var(--fg) 80%, transparent); max-width: 52ch; }
.block-index { position: absolute; z-index: 1; top: clamp(20px, 3vw, 36px); left: var(--gutter); color: var(--fg); }
.block-status { position: absolute; z-index: 1; top: clamp(16px, 3vw, 32px); right: var(--gutter); }
.block:hover .btn { background: var(--fg); border-color: var(--fg); color: var(--ink); }
.block:hover .btn .arrow { transform: translateX(3px); }

/* ---------- project page ---------- */
.specs { display: grid; grid-template-columns: repeat(5, 1fr); border-block: 1px solid var(--line); margin: 0; }
.specs div { padding: 20px 20px 20px 0; display: grid; gap: 6px; min-width: 0; align-content: start; }
.specs div + div { padding-left: 20px; border-left: 1px solid var(--line); }
.specs dt, .specs dd { margin: 0; }
.specs dd { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .specs { grid-template-columns: 1fr 1fr; }
  .specs div { padding: 16px 0; border-left: 0 !important; padding-left: 0 !important; }
  .specs div:nth-child(even) { padding-left: 16px !important; border-left: 1px solid var(--line) !important; }
  .specs div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .specs div:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.video { position: relative; aspect-ratio: 16 / 9; max-width: 100%; background: var(--bg-sunk); overflow: hidden; border: 1px solid var(--line); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .shade { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 55%, transparent); }
.video .placeholder { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; padding: 24px; }
.video .placeholder p { color: color-mix(in srgb, var(--fg) 75%, transparent); }
@media (max-width: 600px) {
  .video--pending { aspect-ratio: auto; }
  .video--pending .placeholder { position: relative; padding-block: 64px; }
}

.prose { display: grid; gap: clamp(56px, 8vw, 96px); }
.prose > section { display: grid; grid-template-columns: 13rem 1fr; gap: 24px; }
.prose > section > div { display: grid; gap: 18px; min-width: 0; }
.prose p { color: var(--muted); }
.prose p strong { color: var(--fg); font-weight: 500; }
@media (max-width: 760px) { .prose > section { grid-template-columns: 1fr; gap: 14px; } }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); counter-reset: step; }
.steps li { background: var(--bg); padding: 24px; display: grid; gap: 12px; align-content: start; counter-increment: step; min-width: 0; }
.steps li::before { content: "0" counter(step); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: .12em; color: var(--accent); }
.steps h3 { text-transform: uppercase; letter-spacing: 0; font-size: 1.05rem; }
.steps p { font-size: 0.95rem; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.progress { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.progress li { display: grid; grid-template-columns: 1.5rem 1fr; gap: 12px; padding-block: 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.progress li::before { content: ""; width: 12px; height: 12px; margin-top: 6px; border: 1.5px solid var(--dim); border-radius: 50%; }
.progress li.done { color: var(--fg); }
.progress li.done::before { background: var(--accent); border-color: var(--accent); }
.progress li.now::before { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 35%, transparent); }
.progress-group { display: grid; gap: 10px; }
.copyable { font-family: var(--font-mono); font-size: 0.95rem; color: var(--fg); user-select: all; overflow-wrap: anywhere; }

/* ---------- ideas board ---------- */
.board { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(32px, 5vw, 64px); align-items: start; }
@media (max-width: 960px) { .board { grid-template-columns: 1fr; } }
.only-mobile { display: none; }
@media (max-width: 960px) { .only-mobile { display: inline-flex; } .hide-mobile { display: none; } }
.board-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.tabs { display: inline-flex; border: 1px solid var(--line-strong); }
.tabs button { background: none; border: 0; padding: 9px 16px; cursor: pointer; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tabs button[aria-pressed="true"] { background: var(--fg); color: var(--ink); }
.ideas { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.idea { background: var(--bg); display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 18px; padding: 20px; }
.idea h3 { font-size: 1.15rem; overflow-wrap: anywhere; }
.idea p { color: var(--muted); font-size: 0.97rem; overflow-wrap: anywhere; white-space: pre-line; }
.idea .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 4px; }
.idea .body { display: grid; gap: 8px; align-content: start; }
.vote {
  display: grid; justify-items: center; align-content: center; gap: 2px; width: 64px; height: 72px;
  border: 1px solid var(--line-strong); background: var(--bg-raised); cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.vote svg { width: 14px; height: 14px; }
.vote .count { font-family: var(--font-mono); font-size: 1rem; font-variant-numeric: tabular-nums; }
.vote:hover { border-color: var(--accent); }
.vote[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.vote[disabled] { cursor: progress; opacity: .7; }
.idea.is-new { animation: arrive .6s ease; }
@keyframes arrive { from { background: color-mix(in srgb, var(--accent) 18%, var(--bg)); } to { background: var(--bg); } }
.board-empty { background: var(--bg); padding: 40px 24px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.notice { font-size: 0.92rem; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--blue) 45%, var(--line)); background: color-mix(in srgb, var(--blue) 10%, var(--bg)); color: var(--fg); margin-bottom: 20px; }
.notice--error { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }

.panel { border: 1px solid var(--line); background: var(--bg-raised); padding: clamp(20px, 3vw, 28px); display: grid; gap: 20px; }
@media (min-width: 961px) { .board aside { position: sticky; top: calc(var(--header-h) + 16px); } }
#post { scroll-margin-top: calc(var(--header-h) + 12px); }
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.field .count { color: var(--dim); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.field .hint { font-size: 0.85rem; color: var(--dim); }
input, select, textarea {
  font: inherit; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 0; padding: 12px 14px; width: 100%;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { min-height: 96px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.status { font-size: 0.92rem; padding: 12px 14px; border: 1px solid var(--line-strong); }
.status--ok { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.status--error { border-color: color-mix(in srgb, var(--accent) 80%, var(--line)); color: var(--fg); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.fine { font-size: 0.85rem; color: var(--dim); }
.quota { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: .08em; color: color-mix(in srgb, var(--accent) 70%, var(--fg)); }
.panel.is-full .form .field, .panel.is-full .form button[type=submit] { opacity: .45; }

/* teaser on home */
.top-ideas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.top-ideas li { background: var(--bg); padding: 24px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.top-ideas .votes { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); letter-spacing: .08em; }
.top-ideas h3 { font-size: 1.1rem; overflow-wrap: anywhere; }
.top-ideas p { color: var(--muted); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 860px) { .top-ideas { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 48px calc(48px + env(safe-area-inset-bottom, 0px)); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 24px; }
.site-footer a { text-decoration: none; color: var(--muted); font-size: 0.9rem; }
.site-footer a:hover { color: var(--fg); }

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