/* Spark Chamber site styles. Plain CSS, no build step. */

:root {
  --bg: #0D0F0E;
  --bg-alt: #111412;
  --surface: #141715;
  --line: #262A27;
  --line-2: #2C312D;
  --line-3: #3A3F3B;
  --line-btn: #4A504B;
  --line-input: #6B716C;
  --text: #E9E6DD;
  --text-2: #C9C6BD;
  --muted: #A3A69E;
  --accent: #E8A33D;
  --accent-hover: #F5C46E;
  --on-accent: #15110A;
  --fail: #F08A6C;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

/* Base */

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

h1, h2, p, ol, ul, figure, pre { margin: 0; }
/* Even line lengths in headings; no single word left alone on a line in paragraphs. */
h1, h2, .panel-title { text-wrap: balance; }
p, li { text-wrap: pretty; }
strong { font-weight: 600; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* Keyboard focus: an amber ring outside the element, visible on every background. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 30;
  padding: 10px 16px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }
.skip-link:hover { color: var(--on-accent); }

/* Header */

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
/* On wider screens the header stays at the top, slightly see-through. */
@media (min-width: 720px) {
  .site-header { position: sticky; top: 0; z-index: 20; background: rgba(13, 15, 14, 0.92); }
  @supports (backdrop-filter: blur(1px)) {
    .site-header { background: rgba(13, 15, 14, 0.78); backdrop-filter: blur(12px); }
  }
}
/* Keep jump targets clear of the sticky header. */
[id] { scroll-margin-top: 88px; }

.nav {
  max-width: 1160px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand, .brand:hover {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand-name { font-weight: 600; font-size: 19px; letter-spacing: 0.02em; }
.badge {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--bg);
  background: var(--muted);
  padding: 2px 8px;
  border-radius: 3px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  font-size: 15px;
}
.nav-link { color: var(--text-2); text-decoration: none; transition: color 0.15s ease; }
.nav-link:hover { color: var(--text); }

/* Buttons */

.btn, .btn:hover {
  color: var(--on-accent);
  background: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 4px;
  min-height: 48px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--accent-hover); }
.btn-sm, .btn-sm:hover { padding: 10px 18px; min-height: 44px; }
.btn-secondary, .btn-secondary:hover {
  color: var(--text);
  background: none;
  border: 1px solid var(--line-btn);
  font-weight: 500;
}
.btn-secondary:hover { background: rgba(233, 230, 221, 0.06); border-color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }
.actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

/* Layout */

.band { border-top: 1px solid var(--line); }
.band-alt { background: var(--bg-alt); }

.container { max-width: 1160px; margin: 0 auto; padding: 72px 24px; }
@media (min-width: 900px) {
  .container { padding: 104px 24px; }
  .hero { padding: 96px 24px 80px; }
}
.container-sm { max-width: 1160px; margin: 0 auto; padding: 56px 24px; }
.hero { max-width: 1160px; margin: 0 auto; padding: 72px 24px 56px; }
.page-intro { max-width: 1160px; margin: 0 auto; padding: 64px 24px 32px; }

.stack { display: flex; flex-direction: column; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

/* Two columns that stack below about 900 px. */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 48px;
}
.split.gap-40 { gap: 40px; }
.align-center { align-items: center; }
.align-start { align-items: start; }

/* Card grids */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
}
.cards.gap-12 { gap: 12px; }

.section-intro { display: flex; flex-direction: column; gap: 12px; max-width: 46em; }

/* Type */

.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.eyebrow-lg { font-size: 14px; }

.display { font-size: clamp(38px, 5.5vw, 60px); line-height: 1.06; font-weight: 600; letter-spacing: -0.02em; }
.display-sm { font-size: clamp(34px, 5vw, 52px); line-height: 1.1; font-weight: 600; letter-spacing: -0.015em; }
.title-lg { font-size: clamp(30px, 3.6vw, 36px); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.title-md { font-size: 26px; font-weight: 600; }
.title-sm { font-size: 22px; font-weight: 600; }

.lead { font-size: 19px; color: var(--text-2); max-width: 34em; }
.lead-wide { max-width: 38em; }
.text { color: var(--text-2); }
.note { font-size: 15px; color: var(--muted); }
.fine { font-size: 14px; color: var(--muted); }
.mono { font-family: var(--mono); font-size: 14px; }

.list { padding-left: 22px; color: var(--text-2); display: flex; flex-direction: column; }

/* Home: hero figure */

.figure { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tree-art { width: 100%; max-width: 540px; height: auto; }
.caption { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* Home: tree legend */

.legend-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legend-title { display: flex; align-items: center; gap: 10px; }

/* Panels: work order, design review, release notes */

.panel {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.panel-head { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.panel-head.wrap { flex-wrap: wrap; }
.panel-title { font-family: 'IBM Plex Sans', sans-serif; font-size: 20px; font-weight: 600; color: var(--text); }
.spec { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; color: var(--text-2); }
.spec .key { color: var(--muted); }
.verdict { border-top: 1px solid var(--line-2); padding-top: 10px; display: flex; gap: 10px; align-items: baseline; }
.verdict-text { color: var(--text); }
.tag-fail { color: var(--bg); background: var(--fail); padding: 1px 8px; border-radius: 3px; font-weight: 600; }

/* Home: correctness checks */

.check { border-top: 2px solid var(--accent); padding-top: 16px; display: flex; flex-direction: column; gap: 6px; }

/* Home: subject chips */

.chips { display: flex; flex-wrap: wrap; gap: 10px; font-family: var(--mono); font-size: 14px; }
.chip { border: 1px solid var(--line-3); color: var(--muted); padding: 8px 14px; border-radius: 4px; }
.chip-on { border-color: var(--accent); color: var(--text); }

/* Download page */

.platforms {
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px 24px 56px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}
.platform {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.platform-featured { border-color: var(--accent); }
.platform .btn { align-self: flex-start; }
.platform-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.platform-tag { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.planned { max-width: 1160px; margin: 0 auto; padding: 0 24px 56px; }
.planned-item { border: 1px dashed var(--line-3); border-radius: 6px; padding: 16px; color: var(--muted); }

.code {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 16px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
}

/* Text pages: privacy, safety, credits */

.page-body { max-width: 1160px; margin: 0 auto; padding: 24px 24px 72px; }
.prose { max-width: 46em; display: flex; flex-direction: column; gap: 40px; }
.prose h2 { line-height: 1.25; }
.prose section { display: flex; flex-direction: column; gap: 12px; }
.prose .list { gap: 8px; }
.credit { color: var(--text-2); }
.prose code { font-family: var(--mono); font-size: 0.88em; color: var(--text); overflow-wrap: anywhere; }

/* Feedback form */

.feedback-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
@media (min-width: 960px) {
  .feedback-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; }
  .feedback-aside { position: sticky; top: 104px; }
}
.feedback-card {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: clamp(20px, 4vw, 36px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .kind-group legend, .field-group summary { font-weight: 600; font-size: 16px; }
.optional { font-weight: 400; color: var(--muted); }
.hint { font-size: 14px; color: var(--muted); }
.feedback-card input[type="text"],
.feedback-card input[type="email"],
.feedback-card textarea {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-input);
  border-radius: 6px;
  padding: 11px 14px;
  min-height: 46px;
  box-sizing: border-box;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.feedback-card textarea { resize: vertical; line-height: 1.55; min-height: 150px; }
.feedback-card ::placeholder { color: #7D827C; opacity: 1; }
.feedback-card input:hover, .feedback-card textarea:hover { border-color: var(--muted); }
.feedback-card input:focus-visible, .feedback-card textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.25);
}
.feedback-card button { font: inherit; font-weight: 600; border: 0; cursor: pointer; }

.kind-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.kind-group legend { padding: 0; margin-bottom: 12px; }
.kind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  gap: 10px;
}
.kind-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--line-input);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.kind-tile:hover { border-color: var(--muted); }
.kind-tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.kind-name { font-weight: 600; font-size: 15px; color: var(--text); }
.kind-desc { font-size: 13px; line-height: 1.4; color: var(--muted); }
.kind-tile:has(input:checked) { border-color: var(--accent); background: rgba(232, 163, 61, 0.08); }
.kind-tile:has(input:checked) .kind-name { color: var(--accent); }
.kind-tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 600px) {
  .kind-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kind-desc { display: none; }
  .kind-tile { padding: 12px; justify-content: center; min-height: 48px; }
}

.field-group {
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 14px 18px;
  background: var(--bg);
}
.field-group summary { cursor: pointer; min-height: 24px; list-style-position: inside; }
.field-group summary::marker { color: var(--muted); }
.field-group[open] summary { margin-bottom: 8px; }
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 16px;
  margin-top: 14px;
}

.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line-2);
}
.form-footer .btn { min-width: 180px; justify-content: center; }

.notice {
  border: 1px solid var(--fail);
  border-left-width: 4px;
  border-radius: 6px;
  padding: 12px 16px;
  color: var(--text);
  background: rgba(240, 138, 108, 0.08);
}

.feedback-aside { display: flex; flex-direction: column; gap: 16px; }
.aside-title { font-size: 18px; font-weight: 600; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 16px; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; color: var(--text-2); font-size: 15px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  display: grid;
  place-items: center;
}
.steps strong { color: var(--text); display: block; }
/* Hidden from people; bots that fill every field give themselves away. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Motion: smooth jumps and the tree lighting up, only for people who allow motion. */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .tree-lit-lines path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: tree-draw 1.4s ease-out 0.3s forwards; }
  .tree-lit-nodes, .tree-ready, .tree-halo { opacity: 0; animation: tree-fade 0.8s ease-out forwards; }
  .tree-lit-nodes { animation-delay: 0.9s; }
  .tree-ready { animation-delay: 1.5s; }
  .tree-halo { animation-delay: 0.2s; }
  .tree-core { transform-origin: 300px 300px; animation: tree-pop 0.6s ease-out both; }
}
@keyframes tree-draw { to { stroke-dashoffset: 0; } }
@keyframes tree-fade { to { opacity: 1; } }
@keyframes tree-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Footer */

.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--text-2); transition: color 0.15s ease; }
.footer-links a:hover { color: var(--text); }
