/* ============================================================
   SATURNTRADING.ORG — INK DESK · MINT STAMP
   Mechanism from Shop (brand hero, claim rise, grain, sheet,
   margin-bar). Costume is Trading ink/paper desk — mint for
   LIVE/state only. Never Shop gold.
   ============================================================ */

:root {
  --bg: #17140f;
  --surface: #211d15;
  --ink: #e9e3d2;
  --ink-muted: #a89f8b;
  --accent: #d9e8cf;
  --accent-ink: #17140f;
  --line: 1px solid var(--ink);
  --pad: clamp(16px, 4vw, 40px);

  --fs-xs: 0.64rem;
  --fs-sm: 0.8rem;
  --fs-base: 1rem;
  --fs-lg: 1.25rem;

  --space-050: 4px;
  --space-100: 8px;
  --space-150: 12px;
  --space-200: 16px;
  --space-300: 24px;
  --space-400: 32px;
  --space-600: 48px;

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

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-weight: 500;
  font-size: var(--fs-base);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3 { text-transform: uppercase; font-weight: 400; }
a { color: inherit; text-decoration: none; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- full-bleed desk film ---------- */
.desk-film {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}
.desk-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.grain {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.85 0 0 0 0 0.82 0 0 0 0 0.72 0 0 0 0.11 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- header ---------- */
.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-200);
  padding: var(--space-200) var(--pad);
}
.chip {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  border: 1px solid var(--ink-muted);
  padding: 6px 10px;
  color: var(--ink-muted);
}
.chip--mint {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.header-links { display: flex; gap: var(--space-200); align-items: center; }
.header-link {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.header-link:hover { color: var(--ink); }

/* ---------- hero stage ---------- */
.stage {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 0 var(--pad) clamp(28px, 6vh, 64px);
  width: 100%;
  min-height: calc(100svh - 72px);
}
.stage-core {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.brand-hero {
  font-family: var(--display);
  font-size: clamp(28px, 6.5vw, 56px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-100);
  animation: claim-rise 0.5s steps(5) both;
}
.brand-hero-tld { color: var(--accent); }
.claim {
  font-family: var(--display);
  font-size: clamp(40px, 7.5vw, 96px);
  line-height: 0.92;
  margin-bottom: var(--space-150);
  animation: claim-rise 0.55s steps(5) 0.05s both;
}
@keyframes claim-rise {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.claim-sub {
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--ink-muted);
  margin-bottom: clamp(14px, 2.2vh, 22px);
  max-width: 34em;
}
.cta-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-150);
  width: 100%;
  max-width: 420px;
}
.btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid var(--ink);
  display: inline-flex;
  align-items: stretch;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s steps(2), color 0.15s steps(2);
}
.btn > span { display: flex; align-items: center; padding: 0 16px; }
.btn .btn-arrow { border-left: 2px solid currentColor; font-size: 16px; }
.cta-primary {
  width: 100%;
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--accent);
  justify-content: stretch;
}
.cta-primary > span:first-child { flex: 1; justify-content: center; }
.cta-primary:hover { background: var(--accent); color: var(--accent-ink); }
.cta-secondary {
  font-family: var(--mono);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.cta-secondary:hover { color: var(--ink); }
.cta-tertiary {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  opacity: 0.85;
}
.cta-tertiary:hover { color: var(--ink); opacity: 1; }

/* ---------- shared section chrome ---------- */
.rail, .anatomy, .receipts, .sheet, .note-machine {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: var(--space-600) var(--pad);
  border-top: var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.section-head, .sheet-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-100);
  margin-bottom: var(--space-300);
  align-items: baseline;
}
.section-name, .sheet-head-name {
  font-family: var(--display);
  font-size: clamp(22px, 4vw, 36px);
  letter-spacing: 0.02em;
}
.section-key, .sheet-head-key {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

/* dual rail — open hairline, not cards */
.rail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: var(--line);
}
.rail-col {
  padding: var(--space-300) var(--space-200) var(--space-200) 0;
}
.rail-col + .rail-col {
  border-left: var(--line);
  padding-left: var(--space-200);
}
.rail-stamp {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  margin-bottom: var(--space-100);
}
.rail-stamp--mint { color: var(--accent); }
.rail-col h3 {
  font-family: var(--display);
  font-size: var(--fs-lg);
  margin-bottom: var(--space-100);
}
.rail-col p { color: var(--ink-muted); font-weight: 600; max-width: 28em; }

/* desk anatomy */
.anatomy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: var(--line);
}
.anatomy-col {
  padding: var(--space-300) var(--space-200) 0 0;
}
.anatomy-col + .anatomy-col {
  border-left: var(--line);
  padding-left: var(--space-200);
}
.anatomy-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: var(--space-100);
}
.anatomy-col p { color: var(--ink-muted); font-weight: 600; }

/* receipts */
.receipt-stage {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-400);
  align-items: flex-end;
}
.ticket {
  width: min(100%, 320px);
  background: var(--surface);
  border: var(--line);
  padding: var(--space-200);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.45);
  transform-origin: top center;
}
.ticket.is-print {
  animation: ticket-print 0.55s steps(8) both;
}
@keyframes ticket-print {
  from { transform: translateY(-18px) scaleY(0.86); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.ticket-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  border-bottom: 1px dashed var(--ink-muted);
  padding-bottom: var(--space-100);
  margin-bottom: var(--space-150);
}
.ticket-mint { color: var(--accent); }
.ticket-body { font-weight: 600; margin-bottom: var(--space-200); }
.ticket-foot {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}
.receipt-note {
  flex: 1;
  min-width: 200px;
  color: var(--ink-muted);
  font-weight: 600;
  max-width: 28em;
}

/* build sheet */
.points { display: grid; gap: 0; border-top: var(--line); }
.point {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: var(--space-200);
  padding: var(--space-200) 0;
  border-bottom: var(--line);
  align-items: start;
}
.point h3 {
  font-family: var(--display);
  font-size: var(--fs-lg);
  margin-bottom: var(--space-050);
}
.point p { color: var(--ink-muted); font-weight: 600; max-width: 42em; }
.point-state {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  border: 1px solid var(--ink-muted);
  color: var(--ink-muted);
  padding: 4px 6px;
}
.point-state--live {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: var(--accent);
}
.point-state--cancel {
  border-color: var(--ink-muted);
  text-decoration: line-through;
}

/* note machine */
.machine {
  max-width: 560px;
  background: var(--surface);
  border: var(--line);
  box-shadow: 0 0 0 3px var(--accent), 6px 6px 0 rgba(0,0,0,0.45);
  padding: var(--space-200);
}
.machine-label {
  display: block;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin-bottom: var(--space-100);
}
.machine-field { display: block; margin-bottom: var(--space-150); }
.machine-form input,
.machine-form textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  border: 2px solid var(--ink-muted);
  background: var(--bg);
  color: var(--ink);
  padding: var(--space-150);
  min-height: 48px;
  border-radius: 0;
  resize: vertical;
}
.machine-form input:focus-visible,
.machine-form textarea:focus-visible {
  outline: 3px solid var(--accent);
  border-color: var(--ink);
}
.machine-btn {
  background: var(--ink);
  color: var(--bg);
  width: 100%;
  justify-content: stretch;
}
.machine-btn > span:first-child { flex: 1; justify-content: center; }
.machine-btn:hover { background: var(--accent); color: var(--accent-ink); }
.machine-jam {
  margin-top: var(--space-150);
  color: var(--ink-muted);
  font-weight: 600;
}
.machine-jam a { text-decoration: underline; }
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.ticket-slot { margin-top: var(--space-200); }
.ticket-slot .ticket { width: 100%; }

/* footer */
.margin-bar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-200);
  padding: var(--space-200) var(--pad);
  border-top: var(--line);
  background: var(--bg);
}
.margin-left { display: flex; flex-wrap: wrap; gap: var(--space-200); align-items: center; }
.margin-stamp {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 8px;
}
.margin-note {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}
.margin-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-150) var(--space-200);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.margin-links a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.margin-links a:hover { color: var(--ink); }

@media (max-width: 720px) {
  .desk-film { opacity: 0.28; }
  .rail-grid, .anatomy-grid { grid-template-columns: 1fr; }
  .rail-col + .rail-col,
  .anatomy-col + .anatomy-col {
    border-left: 0;
    border-top: var(--line);
    padding-left: 0;
    padding-top: var(--space-200);
  }
  .point { grid-template-columns: 1fr; gap: var(--space-100); }
  .cta-primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-hero, .claim, .ticket.is-print { animation: none !important; }
}
