/* The Spatial Studios — shared styles
   Concept: drafting paper. Cream paper, navy ink, axis colours used only where they mean X / Y / Z. */

@font-face { font-family: "Bricolage"; src: url("/assets/fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Literata"; src: url("/assets/fonts/literata-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --paper: #F6EFE4;
  --paper-deep: #EDE2CF;
  --grid: #E2D3BB;
  --rule: #D6C4A6;
  --ink: #1F2A44;
  --ink-soft: #4C5672;
  --x: #C8643A;        /* X axis, terracotta */
  --z: #3B6EA8;        /* Z axis, blue */
  --origin: #E8A33D;   /* the origin point, amber */
  --link: #2D5A8E;
  --display: "Bricolage", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Literata", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  --step-3: clamp(2.5rem, 1.4rem + 4.2vw, 4.25rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: var(--step-0); line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--z); outline-offset: 3px; border-radius: 4px; }
::selection { background: #F3D49A; }

h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: var(--step-3); font-weight: 680; line-height: 1.02; letter-spacing: -0.03em; }
h2 { font-size: var(--step-2); font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; }
h3 { font-size: var(--step-1); font-weight: 620; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 64ch; text-wrap: pretty; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.site-header { padding: 18px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; line-height: 0; }
.brand img { height: 34px; width: auto; }
.nav { display: flex; gap: clamp(14px, 3vw, 32px); font-family: var(--display); font-weight: 520; font-size: 1rem; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--origin); }
@media (max-width: 560px) {
  .brand img { height: 28px; }
  .nav .nav-optional { display: none; }
}

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px;
  font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: -0.005em;
  border-radius: 999px; text-decoration: none; border: 2px solid var(--ink); transition: background-color .15s, color .15s, transform .15s;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #2A3858; }
.btn-secondary { background: transparent; color: var(--ink); }
.btn-secondary:hover { background: var(--paper-deep); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- hero (home) ---------- */
.hero { padding: clamp(20px, 4vw, 56px) 0 clamp(40px, 6vw, 72px); }
.hero + .section { padding-top: clamp(24px, 4vw, 48px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-copy .lede { font-size: 1.2rem; color: var(--ink-soft); margin-top: 22px; max-width: 40ch; }
@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-copy .lede { max-width: 46ch; }
}

/* the stage: isometric grid + origin + live coordinates */
.stage { position: relative; aspect-ratio: 56 / 50; border-radius: 22px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--rule); overflow: hidden; }
.stage svg { width: 100%; height: 100%; }
.stage .grid line { stroke: var(--grid); stroke-width: 1; }
.stage .guides, .stage .probe { transition: opacity .35s ease; }
.stage.is-idle .guides, .stage.is-idle .probe { opacity: 0; }
.inspector {
  position: absolute; right: 14px; bottom: 14px; pointer-events: none;
  background: rgba(246, 239, 228, 0.92); border: 1.5px solid var(--rule); border-radius: 10px;
  padding: 9px 12px 10px; font-family: var(--mono); font-size: 0.8rem; line-height: 1.3; color: var(--ink);
}
.inspector-title { font-family: var(--display); font-weight: 600; font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 6px; }
.inspector-row { display: flex; gap: 8px; align-items: center; }
.coord { display: inline-flex; align-items: center; gap: 5px; min-width: 4.6em; }
.coord b { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 4px; color: #fff; font-weight: 600; font-size: 0.72rem; }
.coord-x b { background: var(--x); }
.coord-y b { background: var(--ink); }
.coord-z b { background: var(--z); }
.coord span { font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .inspector { right: 8px; bottom: 8px; font-size: 0.72rem; padding: 7px 9px; } }

/* ---------- sections ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: clamp(24px, 4vw, 40px); }
.section + .section { border-top: 1.5px solid var(--rule); }

/* app feature */
.app-feature { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.app-feature .shot { border-radius: 18px; overflow: hidden; background: var(--paper-deep); aspect-ratio: 16 / 9; }
.app-feature .shot img { width: 100%; height: 100%; object-fit: cover; }
.app-feature h3 { font-size: var(--step-2); font-weight: 650; letter-spacing: -0.02em; }
.app-feature .tag { font-family: var(--display); font-weight: 520; color: var(--ink-soft); margin: 6px 0 16px; }
.facts { list-style: none; margin: 18px 0 0; padding: 0; }
.facts li { padding-left: 22px; position: relative; margin: 6px 0; }
.facts li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 9px; height: 9px; border-radius: 50%; background: var(--origin); }
@media (max-width: 820px) { .app-feature { grid-template-columns: 1fr; } }

.next-slot {
  margin-top: clamp(28px, 4vw, 44px); display: flex; gap: 22px; align-items: center;
  border: 2px dashed var(--rule); border-radius: 18px; padding: 22px 26px;
}
.next-slot svg { width: 58px; flex: none; }
.next-slot p { margin: 0; color: var(--ink-soft); }
.next-slot strong { font-family: var(--display); font-weight: 600; color: var(--ink); display: block; font-size: 1.1rem; }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 72px); }
.about dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 28px 0 0; padding-top: 22px; border-top: 1.5px solid var(--rule); }
.about dt { font-family: var(--display); font-weight: 600; }
.about dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 820px) { .about { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .about dl { grid-template-columns: 1fr; gap: 2px; } .about dd { margin-bottom: 10px; } }

/* contact */
.contact { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 40px; }
.contact > div:first-child { flex: 1 1 420px; }
.contact .actions { margin-top: 20px; }
.contact p { color: var(--ink-soft); margin: 14px 0 0; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #D8DDEA; padding: 44px 0 36px; font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 28px 48px; justify-content: space-between; align-items: flex-start; }
.site-footer img { height: 30px; width: auto; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 28px; font-family: var(--display); font-weight: 500; }
.site-footer a { color: #F6EFE4; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .legal { width: 100%; color: #9AA3BC; font-size: 0.85rem; margin: 0; }

/* ---------- long-form legal pages ---------- */
.doc { padding: clamp(28px, 5vw, 64px) 0 clamp(64px, 9vw, 112px); }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: var(--step-2); }
.doc .meta { color: var(--ink-soft); margin: 10px 0 36px; }
.doc h2 { font-size: 1.35rem; margin: 40px 0 10px; }
.doc ul { padding-left: 1.2em; }
.doc li { margin: 6px 0; max-width: 64ch; }
.doc .summary { background: var(--paper-deep); border-radius: 14px; padding: 18px 22px; margin-bottom: 8px; }
.doc .summary p:last-child { margin-bottom: 0; }

/* ---------- 404 ---------- */
.lost { padding: clamp(24px, 5vw, 56px) 0 clamp(64px, 9vw, 104px); }
.lost .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
@media (max-width: 820px) { .lost .wrap { grid-template-columns: 1fr; } }
