/*
 * The pages around the room (/about, /contact, /terms, /refunds, /delivery, /privacy, the 404), in the brand's own look:
 * Patol's orange on a dusk night, cream by day, Fraunces and Nunito. Colours are tokens, set here only; small text is
 * held to WCAG AA in both schemes by src/device/__tests__/sitePages.test.ts. /about adds about.css and about-more.css.
 */

:root {
  color-scheme: dark;
  --bg: #120d12;
  --bg-raised: #1c141b;
  --ink: 248, 236, 221;
  --text-1: #f8ecdd;
  --text-2: rgba(248, 236, 221, 0.78);
  --text-3: rgba(248, 236, 221, 0.62);
  --line: rgba(248, 236, 221, 0.1);
  --line-strong: rgba(248, 236, 221, 0.2);
  --panel: rgba(248, 236, 221, 0.035);
  --accent: #ff6b2c;
  --accent-shadow: rgba(255, 107, 44, 0.55);
  --on-accent: #2a1206;
  --link: #ffb48a;
  --leaf: #8fcf99;
  --glow-a: rgba(255, 120, 60, 0.14);
  --glow-b: rgba(150, 120, 255, 0.07);
  --shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.85);
  /* The devices on /about are dark glass in both schemes; their metal follows the page. */
  --bezel: #0b090b;
  --device-edge: rgba(255, 255, 255, 0.08);
  --device-dot: rgba(255, 255, 255, 0.2);
  --device-bar: #1d1a1e;
  --metal-1: #3a3439;
  --metal-2: #19151a;
  /* Each skin's own light, for the glow behind the devices while it is on screen. */
  --skin-pro: rgba(255, 90, 31, 0.42);
  --skin-lofi: rgba(255, 166, 108, 0.5);
  --skin-retro: rgba(255, 214, 0, 0.32);
  --skin-chroma: rgba(150, 220, 210, 0.42);
  --skin-synth: rgba(255, 60, 200, 0.4);
  --skin-paper: rgba(120, 150, 210, 0.4);
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-ui: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;
  --t-quick: 140ms;
  --t-base: 240ms;
  --t-calm: 460ms;
  --t-slow: 800ms;
  --t-scene: 1.4s;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 4vw, 32px);
  --col: 680px;
  --wide: 1120px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #fff6ec;
    --bg-raised: #fffbf6;
    --ink: 43, 29, 22;
    --text-1: #2b1d16;
    --text-2: rgba(43, 29, 22, 0.8);
    --text-3: rgba(43, 29, 22, 0.66);
    --line: rgba(43, 29, 22, 0.12);
    --line-strong: rgba(43, 29, 22, 0.24);
    --panel: rgba(255, 255, 255, 0.55);
    --accent-shadow: rgba(255, 107, 44, 0.4);
    --link: #b9400c;
    --leaf: #3d7650;
    --glow-a: rgba(255, 140, 80, 0.2);
    --glow-b: rgba(120, 150, 255, 0.1);
    --shadow: 0 40px 80px -40px rgba(74, 51, 38, 0.5);
    --metal-1: #ece6df;
    --metal-2: #bfb7ae;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-1);
  font: 400 17px/1.65 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The dusk at the top of every page: a little of Patol's lamp, a little of the night. */
body::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 760px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(55% 70% at 22% 0%, var(--glow-a), transparent 72%),
    radial-gradient(45% 60% at 88% 6%, var(--glow-b), transparent 70%);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--bg-raised);
  color: var(--text-1);
  z-index: 10;
}
.skip:focus { top: 12px; }

/* ---------- The header: the mark home, and the room one tap away ---------- */

.site-head {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text-1);
  text-decoration: none;
}
.mark img {
  width: 30px;
  height: 30px;
}
.word {
  font: italic 400 1.5rem/1 var(--font-display);
  font-variation-settings: 'SOFT' 100, 'opsz' 72;
  letter-spacing: -0.01em;
}
.word em {
  color: var(--text-2);
}

/* ---------- Buttons: one orange action per view, the rest quiet ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font: 700 1rem/1 var(--font-ui);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--t-base) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out),
    background-color var(--t-base),
    border-color var(--t-base);
}
.btn--go {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 12px 30px -12px var(--accent-shadow);
}
.btn--go:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px -12px var(--accent-shadow);
}
.btn--quiet {
  border-color: var(--line-strong);
  color: var(--text-1);
}
.btn--quiet:hover {
  background: rgba(var(--ink), 0.06);
}
.btn--small {
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.92rem;
}
.btn .arrow {
  transition: transform var(--t-base) var(--ease-out);
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* ---------- A page you read: the legal pages, contact, the 404 ---------- */

.doc {
  max-width: var(--col);
  margin: 0 auto;
  padding: clamp(24px, 6vw, 64px) var(--gutter) 8px;
}
.doc h1 {
  margin: 0 0 14px;
  font: 400 clamp(2.3rem, 7vw, 3.3rem)/1.08 var(--font-display);
  font-variation-settings: 'SOFT' 100, 'opsz' 144;
  letter-spacing: -0.02em;
}
.lede {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 1.14rem;
}
.when {
  margin: 0 0 32px;
  color: var(--text-3);
  font-size: 0.9rem;
}
.doc h2 {
  margin: 48px 0 10px;
  font: 400 1.55rem/1.25 var(--font-display);
  font-variation-settings: 'SOFT' 100, 'opsz' 72;
  letter-spacing: -0.01em;
  scroll-margin-top: 20px;
}
.doc h3 {
  margin: 24px 0 6px;
  font: 700 1rem/1.4 var(--font-ui);
}
.doc p,
.doc li {
  color: var(--text-2);
}
.doc p {
  margin: 0 0 12px;
}
.doc ul,
.doc ol {
  margin: 0 0 14px;
  padding-left: 1.3em;
}
.doc li + li {
  margin-top: 6px;
}
.doc strong {
  color: var(--text-1);
  font-weight: 700;
}
.doc code {
  color: var(--text-1);
  font: 0.88em ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* "The short version": what most people came for, before any detail. */
.short {
  margin: 0 0 36px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
}
.short h2 {
  margin: 0 0 10px;
  color: var(--text-3);
  font: 700 0.78rem/1.2 var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.short ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.short li {
  position: relative;
  margin: 0;
  padding-left: 26px;
  color: var(--text-1);
}
.short li::before {
  content: '✓';
  position: absolute;
  left: 2px;
  color: var(--leaf);
  font-weight: 700;
}

/* The contents of a long page, in two columns where there is room. */
.toc {
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  columns: 2 220px;
  column-gap: 28px;
  font-size: 0.95rem;
}
.toc li {
  margin: 0 0 6px;
  break-inside: avoid;
}
.toc a {
  color: var(--text-2);
  text-decoration: none;
}
.toc a:hover {
  color: var(--text-1);
  text-decoration: underline;
}

/* Facts in two columns: what, then the thing itself. */
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 22px;
  margin: 0 0 20px;
}
.facts dt {
  color: var(--text-3);
}
.facts dd {
  margin: 0;
  color: var(--text-1);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 8px;
}

/* ---------- Contact: the address, and the reasons people write ---------- */

.mail {
  display: inline-block;
  margin: 6px 0 8px;
  color: var(--text-1);
  font: 400 clamp(1.55rem, 6.4vw, 2.5rem)/1.2 var(--font-display);
  font-variation-settings: 'SOFT' 100, 'opsz' 96;
  letter-spacing: -0.01em;
  text-decoration: none;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--line-strong);
  transition: border-color var(--t-base);
}
.mail:hover {
  border-color: var(--link);
}

.topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin: 20px 0 8px;
  padding: 0;
  list-style: none;
}
.doc .topics li {
  margin: 0;
}
.topic {
  display: block;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text-1);
  text-decoration: none;
  transition:
    border-color var(--t-base),
    transform var(--t-base) var(--ease-out);
}
.topic:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}
.topic b {
  display: block;
  font-weight: 700;
}
.topic span {
  color: var(--text-3);
  font-size: 0.9rem;
}

/* ---------- The footer: every page, the address, and the room ---------- */

.site-foot {
  max-width: var(--wide);
  margin: 80px auto 0;
  padding: 28px var(--gutter) 44px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  color: var(--text-3);
  font-size: 0.92rem;
}
.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 20px;
}
.site-foot a {
  display: inline-block;
  padding: 8px 0;
  color: var(--text-2);
  text-decoration: none;
}
.site-foot a:hover {
  color: var(--text-1);
}
.site-foot a[aria-current='page'] {
  color: var(--text-1);
  text-decoration: underline;
}
.site-foot p {
  margin: 0;
}
.credits {
  flex-basis: 100%;
  font-size: 0.82rem;
}
.site-foot .credits a {
  padding: 0;
  color: var(--text-3);
  text-decoration: underline;
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .facts {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .facts dd {
    margin-bottom: 10px;
  }
  .site-foot nav {
    gap: 0 18px;
  }
  .site-foot a {
    padding: 11px 0;
  }
}

/* ---------- Reduced motion: every duration collapses, as in the room (docs/DESIGN.md §6) ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}
