/* ClapOut's reading pages (the guides, the rules, the FAQ, the legal pages): static HTML, no script.
   The same paper, ink, gold and four suit hues as the phone client (src/styles.css), set for long reading. */

@font-face {
  font-family: 'Unbounded';
  src: url('/fonts/Unbounded.ttf') format('truetype');
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --ink: #0f0e1f; --ink-soft: #4d4a6b; --ink-label: #6b6787;
  --paper: #f5f1e8; --paper-hi: #fffbf2; --paper-lo: #eae4d6; --sky: #fff3c4;
  --gold: #f0c96a; --gold-edge: #d9ae4a; --gold-ink: #8a6414; --ink-on-gold: #2a1a00;
  --ember: #ff5a4e; --sol: #ffb627; --tide: #19c6c0; --dusk: #8a5cf6;
  --ember-ink: #b8321f; --sol-ink: #8a5a00; --tide-ink: #0e7a76; --dusk-ink: #5b34c4;
  --hair: rgba(31,24,60,.10); --hair-2: rgba(31,24,60,.22);
  --shadow: 0 10px 30px rgba(31,24,60,.12), 0 1px 0 rgba(255,255,255,.6) inset;
  --display: 'Unbounded', system-ui, sans-serif;
  --ui: -apple-system, 'Segoe UI', Roboto, Inter, system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: linear-gradient(var(--sky), var(--paper) 420px) no-repeat, var(--paper);
  color: var(--ink); font-family: var(--ui); font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased;
}
a { color: var(--tide-ink); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
img, svg { max-width: 100%; }
.g { width: 1em; height: 1em; vertical-align: -0.14em; display: inline-block; }

/* ---- The header: the mark and the wordmark, the four main links, PLAY FREE ---------------------- */
.site-head {
  display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; justify-content: space-between;
  max-width: 1040px; margin: 0 auto; padding: 14px 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 900; font-size: 1.35rem; letter-spacing: -0.01em; }
.brand .mark { width: 34px; height: 34px; }
.brand b { background: linear-gradient(transparent 36%, var(--gold) 36%, var(--gold) 90%, transparent 90%); border-radius: 2px; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-weight: 600; font-size: .95rem; }
.site-head nav a { color: var(--ink); text-decoration: none; padding: 6px 0; }
.site-head nav a:hover, .site-head nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gold-edge); text-decoration-thickness: 3px; }
.btn, .site-head nav a.play {
  display: inline-block; background: var(--gold); color: var(--ink-on-gold); border: 1px solid var(--gold-edge);
  border-radius: 12px; padding: 10px 18px; font-weight: 800; text-decoration: none;
  box-shadow: 0 3px 0 var(--gold-edge), 0 8px 20px rgba(217,174,74,.3);
}
.btn:hover, .site-head nav a.play:hover { color: var(--ink-on-gold); text-decoration: none; filter: brightness(1.04); }
.btn.quiet { background: var(--paper-hi); border-color: var(--hair-2); box-shadow: 0 2px 8px rgba(31,24,60,.1); color: var(--ink); }

/* ---- The page: one reading column on paper ------------------------------------------------------ */
main.doc { max-width: 760px; margin: 0 auto; padding: 8px 16px 48px; }
.crumbs { font-size: .85rem; color: var(--ink-label); margin: 8px 0 14px; }
.crumbs a { color: var(--ink-label); }
article, .sheet {
  background: var(--paper-hi); border: 1px solid var(--hair); border-radius: 20px; box-shadow: var(--shadow);
  padding: 28px clamp(18px, 5vw, 44px) 32px; position: relative; overflow: hidden;
}
article::before, .sheet::before { content: ''; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--ember) 0 25%, var(--sol) 25% 50%, var(--tide) 50% 75%, var(--dusk) 75%); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.01em; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 900; margin: 6px 0 12px; }
h2 { font-size: 1.3rem; font-weight: 800; margin: 2.1em 0 .5em; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 1.6em 0 .4em; }
.lede { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 10px; }
.meta { font-size: .85rem; color: var(--ink-label); margin: 0 0 24px; }
p, ul, ol { margin: 0 0 1em; }
li { margin: .25em 0; }
strong { font-weight: 750; }
hr { border: 0; border-top: 1px solid var(--hair-2); margin: 2em 0; }

/* A table of the rules: paper rows, an ink hairline, scrolls sideways on its own when a phone is narrow. */
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--hair-2); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--hair); }
th { background: var(--paper-lo); font-weight: 750; }
tr:last-child td { border-bottom: 0; }

/* A callout: a tip, a rule to remember, an example worked through. */
.note { border-left: 5px solid var(--gold-edge); background: #fff6db; border-radius: 0 12px 12px 0; padding: 12px 16px; margin: 0 0 1.2em; }
.note.tide { border-color: var(--tide); background: #e6f8f7; }
.note.ember { border-color: var(--ember); background: #fff0ee; }
.note.dusk { border-color: var(--dusk); background: #f2edff; }
.note > :last-child { margin-bottom: 0; }
.note .label { display: block; font-family: var(--display); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }

/* The suits named in running text: the glyph in the suit's hue, the name in its ink (contrast ≥ 4.5:1 on paper). */
.suit { font-weight: 750; white-space: nowrap; }
.suit .g { margin-right: .18em; }
.suit.ember { color: var(--ember-ink); } .suit.ember .g { color: var(--ember); }
.suit.sol { color: var(--sol-ink); } .suit.sol .g { color: var(--sol); }
.suit.tide { color: var(--tide-ink); } .suit.tide .g { color: var(--tide); }
.suit.dusk { color: var(--dusk-ink); } .suit.dusk .g { color: var(--dusk); }

/* A card drawn small: a rounded tile in the suit's hue, the index and glyph in white. (No oval, ever.) */
.card { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 54px; height: 76px; border-radius: 9px; color: #fff; font-family: var(--display); font-weight: 900; font-size: 1.25rem;
  box-shadow: 0 2px 0 rgba(0,0,0,.15), 0 6px 14px rgba(31,24,60,.18); vertical-align: middle; line-height: 1; }
.card .g { width: 20px; height: 20px; }
.card small { font-family: var(--ui); font-size: .55rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.card.ember { background: var(--ember); } .card.sol { background: var(--sol); color: var(--ink-on-gold); }
.card.tide { background: var(--tide); } .card.dusk { background: var(--dusk); }
.card.wild { background: conic-gradient(var(--ember) 0 25%, var(--sol) 0 50%, var(--tide) 0 75%, var(--dusk) 0); }
.card.wild > * { background: var(--ink); border-radius: 6px; padding: 2px 4px; }
.cards { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 1.2em; }
.cards .arrow { font-size: 1.4rem; color: var(--ink-label); }

/* A grid of links to other pages (the guides hub, "read next"). */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 0 0 1.4em; padding: 0; list-style: none; }
.tiles li { margin: 0; }
.tiles a { display: block; height: 100%; background: var(--paper-hi); border: 1px solid var(--hair-2); border-radius: 14px; padding: 14px 16px; text-decoration: none; color: var(--ink); box-shadow: 0 2px 8px rgba(31,24,60,.08); }
.tiles a:hover { border-color: var(--gold-edge); }
.tiles b { display: block; font-family: var(--display); font-size: .98rem; margin-bottom: 4px; }
.tiles span { display: block; font-size: .9rem; color: var(--ink-soft); line-height: 1.5; }
.next { margin-top: 28px; }
.next h2 { font-size: 1.05rem; margin: 0 0 12px; }
.cta { text-align: center; margin: 28px 0 0; }

/* FAQ: every answer a <details>, the question its summary. */
details { border-bottom: 1px solid var(--hair); padding: 12px 0; }
details summary { cursor: pointer; font-weight: 750; list-style-position: outside; }
details[open] summary { margin-bottom: 8px; }
details > :last-child { margin-bottom: 0; }

/* ---- The footer: every page, the legal line ------------------------------------------------------ */
.site-foot { border-top: 1px solid var(--hair-2); background: var(--paper-lo); margin-top: 24px; }
.site-foot .inner { max-width: 1040px; margin: 0 auto; padding: 28px 16px 36px; display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.site-foot h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; color: var(--ink-label); }
.site-foot ul { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.site-foot li { margin: 4px 0; }
.site-foot a { color: var(--ink); }
.site-foot .legal { grid-column: 1 / -1; font-size: .85rem; color: var(--ink-label); border-top: 1px solid var(--hair); padding-top: 16px; margin: 0; }

@media (max-width: 520px) {
  .site-head { padding: 12px 16px 4px; position: relative; }
  .site-head nav { width: 100%; justify-content: space-between; }
  /* PLAY FREE rides up beside the wordmark, so the four links keep one row under it. */
  .site-head nav a.play { position: absolute; top: 12px; right: 16px; padding: 7px 14px; font-size: .9rem; }
  article, .sheet { border-radius: 16px; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print { .site-head nav, .site-foot, .cta, .next { display: none; } article { box-shadow: none; border: 0; } }
