/* Arcana, arcana.flow7.org
   Arcana's own design language, taken from the app's tokens (src/design/tokens.ts) and design direction:
   EB Garamond for everything read, the system sans for controls and metadata, brass as the only accent,
   Paper by day and the Night Table after dark, hairlines instead of panels, and the engraved card's frame. */

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/EBGaramond-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/EBGaramond-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/EBGaramond-Italic.ttf") format("truetype");
}

:root {
  /* Paper */
  --ground: #F2ECE1;
  --surface: #FAF6EE;
  --raised: #FFFDF8;
  --ink: #1E2320;
  --muted: #5B574F;
  --faint: #8C877D;
  --line: rgba(30, 35, 32, 0.13);
  --shadow: rgba(43, 34, 22, 0.16);
  /* The Night Table: the opening of the landing page, and every page in dark mode */
  --table: #0D1412;
  --table-raised: #1B2522;
  --table-ink: #EDE4D3;
  --table-muted: #A9A293;
  --table-line: rgba(237, 228, 211, 0.12);
  --table-brass: #C9A46B;

  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 35rem;
  --page: 66rem;
  color-scheme: light dark;
}

body {
  /* Brass: the Paper palette's darker brass on light ground */
  --accent: #87672F;
  --accent-ink: #FFF9EE;
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 19px/1.53 var(--serif);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0D1412;
    --surface: #151E1B;
    --raised: #1B2522;
    --ink: #EDE4D3;
    --muted: #A9A293;
    --faint: #7C776D;
    --line: rgba(237, 228, 211, 0.12);
    --shadow: rgba(0, 0, 0, 0.5);
  }
  /* The Night Table's brass */
  body { --accent: #C9A46B; --accent-ink: #16110A; }
}

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

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

a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

strong { font-weight: 500; }

::selection { background: rgba(201, 164, 107, 0.32); }

.sans { font-family: var(--sans); }

/* Masthead: the wordmark set as on the store art, spaced capitals in the serif */
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: min(var(--page), 100% - 32px); margin-inline: auto; padding: 20px 0;
}
.wordmark {
  font: 400 17px/1 var(--serif); letter-spacing: 0.32em; text-transform: uppercase;
  text-decoration: none; color: var(--ink); padding: 10px 0;
}
.masthead nav { display: flex; gap: 22px; font: 500 14px/1 var(--sans); }
.masthead nav a { color: var(--muted); text-decoration: none; padding: 10px 0; }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { color: var(--ink); }

/* The Night Table */
.table {
  --ink: var(--table-ink);
  --muted: var(--table-muted);
  --line: var(--table-line);
  --accent: var(--table-brass);
  --accent-ink: #16110A;
  color: var(--ink);
  background: radial-gradient(120% 90% at 50% 0%, #18231F 0%, var(--table) 64%);
  border-bottom: 1px solid var(--table-line);
}

/* Opening: the welcome before a reading */
.opening { text-align: center; padding: clamp(32px, 7vw, 88px) 16px clamp(64px, 10vw, 120px); }
.opening .icon {
  width: 88px; height: 88px; margin: 0 auto 32px;
  border-radius: 22.5%; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}
.opening h1 {
  font: 400 clamp(46px, 9vw, 96px)/1 var(--serif);
  letter-spacing: 0.3em; text-indent: 0.3em; text-transform: uppercase; margin: 0;
}
.opening .by { font: 400 14px/1 var(--sans); color: var(--muted); margin: 16px 0 0; }
.opening .promise {
  font: 400 clamp(25px, 3.4vw, 34px)/1.24 var(--serif);
  max-width: 19em; margin: 40px auto 0;
}
.opening .promise::after {
  content: ""; display: block; width: 28px; height: 1px; margin: 28px auto 0; background: var(--accent);
}
.opening .lede { color: var(--muted); font-size: 20px; line-height: 1.55; max-width: var(--measure); margin: 28px auto 0; }
.begin {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; min-width: 220px; padding: 0 32px; margin-top: 40px;
  border-radius: 14px; background: var(--accent); color: var(--accent-ink);
  font: 600 17px/1 var(--sans); text-decoration: none;
}
.begin:hover { filter: brightness(1.06); }
.availability { font: 400 14px/1.4 var(--sans); color: var(--muted); margin: 18px 0 0; }

/* A reading: its spread and question, then the four stages */
.reading-head { width: min(var(--page), 100% - 32px); margin: 0 auto; padding: clamp(56px, 9vw, 104px) 0 0; }
.reading-head .spread { font: 400 15px/1.3 var(--sans); color: var(--muted); margin: 0 0 8px; }
.reading-head .question { font: 400 clamp(30px, 4.4vw, 44px)/1.12 var(--serif); letter-spacing: -0.01em; margin: 0; max-width: 20em; }
.reading-head .intro { color: var(--muted); max-width: var(--measure); margin: 20px 0 0; }

/* The stage bar, as in the app: done in pale brass, the current stage in brass, the rest a hairline */
.stage-bar {
  position: sticky; top: 0; z-index: 5; margin-top: 28px;
  background: var(--ground);
  background: color-mix(in srgb, var(--ground) 90%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.stage-bar ol {
  list-style: none; margin: 0 auto; padding: 14px 0 12px;
  width: min(var(--page), 100% - 32px);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.stage-bar a {
  display: block; padding-top: 10px; border-top: 2px solid var(--line);
  font: 500 14px/1.2 var(--sans); color: var(--muted); text-decoration: none;
}
.stage-bar a.done { border-top-color: rgba(201, 164, 107, 0.55); }
.stage-bar a[aria-current="step"] { border-top-color: var(--accent); color: var(--ink); }

.stage {
  width: min(var(--page), 100% - 32px); margin: 0 auto;
  padding: clamp(56px, 9vw, 112px) 0; scroll-margin-top: 56px;
  display: grid; gap: 40px; align-items: center;
}
.stage + .stage { border-top: 1px solid var(--line); }
@media (min-width: 860px) {
  .stage { grid-template-columns: minmax(0, 1fr) 320px; gap: 80px; }
}
.numeral { font: 400 clamp(46px, 6vw, 64px)/1 var(--serif); color: var(--accent); margin: 0 0 20px; letter-spacing: 0.04em; }
.stage h2 { font: 400 clamp(38px, 5vw, 54px)/1.04 var(--serif); letter-spacing: -0.01em; margin: 0 0 20px; }
.stage .say { font: 400 clamp(23px, 2.6vw, 27px)/1.3 var(--serif); margin: 0 0 18px; max-width: 22em; }
.stage p { max-width: var(--measure); }
.stage .body { margin: 0 0 16px; }
.prompt { font-style: italic; color: var(--ink); margin: 28px 0 0; }
.prompt::before { content: ""; display: block; width: 24px; height: 1px; margin-bottom: 16px; background: var(--accent); }
.stage figure { margin: 0; justify-self: center; }
.stage figure img {
  width: min(320px, 82vw); border-radius: 24px;
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px var(--shadow);
}
.stage .aside { font: 400 15px/1.45 var(--sans); color: var(--muted); }

/* The decks: the one a new install starts in is marked in brass, like the current stage */
.decks { border-top: 1px solid var(--line); }
.decks-inner { width: min(var(--page), 100% - 32px); margin: 0 auto; padding: clamp(64px, 10vw, 120px) 0; }
.section-title { font: 400 clamp(38px, 5vw, 54px)/1.04 var(--serif); letter-spacing: -0.01em; margin: 0 0 16px; }
.section-intro { color: var(--muted); max-width: var(--measure); margin: 0 0 48px; }
.deck-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 48px 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.deck { padding-top: 18px; border-top: 2px solid var(--line); }
.deck.is-chosen { border-top-color: var(--accent); }
.deck h3 { font: 500 26px/1.2 var(--serif); margin: 0 0 4px; }
.deck .tagline { font: 400 14px/1.4 var(--sans); color: var(--muted); margin: 0 0 12px; }
.deck p { margin: 0 0 10px; }
.deck .chosen { margin-top: 14px; font: 500 14px/1.3 var(--sans); color: var(--muted); }
.deck .chosen::before { content: "\2713"; color: var(--accent); font-weight: 700; margin-right: 8px; }
.attribution { font: 400 14px/1.45 var(--sans); color: var(--muted); margin: 40px 0 0; }

/* Around the reading: grouped hairline rows, as in Settings */
.around { border-top: 1px solid var(--line); }
.around-inner { width: min(var(--page), 100% - 32px); margin: 0 auto; padding: clamp(64px, 10vw, 120px) 0; }
.groups { display: grid; gap: 48px 64px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.group-label { font: 400 14px/1.3 var(--sans); color: var(--muted); margin: 0 0 8px; }
.rows { margin: 0; }
.rows div { padding: 16px 0; border-top: 1px solid var(--line); }
.rows div:last-child { border-bottom: 1px solid var(--line); }
.rows dt { font: 500 20px/1.3 var(--serif); }
.rows dd { margin: 4px 0 0; color: var(--muted); font-size: 18px; line-height: 1.45; }

/* What tarot is here: set as one of the app's prompts */
.note { border-top: 1px solid var(--line); padding: clamp(64px, 10vw, 112px) 16px; text-align: center; }
.note p { font: italic 400 clamp(22px, 2.8vw, 28px)/1.4 var(--serif); max-width: 30em; margin: 0 auto; }
.note p::before { content: ""; display: block; width: 28px; height: 1px; margin: 0 auto 28px; background: var(--accent); }

/* Colophon: the foot of a card, a double rule and a small title */
.colophon { border-top: 3px double var(--line); padding: 40px 16px 56px; text-align: center; font: 400 14px/1.5 var(--sans); color: var(--muted); }
.colophon .mark { font: 400 13px/1 var(--serif); letter-spacing: 0.32em; text-indent: 0.32em; text-transform: uppercase; color: var(--ink); margin: 0 0 20px; }
.colophon .mark::before, .colophon .mark::after { content: "\2726"; color: var(--accent); font-family: var(--sans); font-size: 10px; letter-spacing: 0; margin: 0 14px; vertical-align: 2px; }
.colophon nav { display: flex; justify-content: center; gap: 24px; margin: 0 0 10px; }
.colophon nav a { text-decoration: none; padding: 6px 0; }
.colophon nav a:hover { color: var(--ink); }
.colophon p { margin: 0; }

/* Privacy and support: a page of reading text */
.prose { width: min(var(--measure), 100% - 32px); margin: 0 auto; padding: clamp(40px, 8vw, 88px) 0 clamp(64px, 10vw, 104px); }
.prose .kicker { font: 400 15px/1.3 var(--sans); color: var(--muted); margin: 0 0 10px; }
.prose h1 { font: 400 clamp(38px, 6vw, 52px)/1.06 var(--serif); letter-spacing: -0.01em; margin: 0; }
.prose h1::after { content: ""; display: block; width: 28px; height: 1px; margin: 28px 0 0; background: var(--accent); }
.prose .updated { font: 400 14px/1.4 var(--sans); color: var(--muted); margin: 20px 0 36px; }
.prose h2 { font: 500 24px/1.25 var(--serif); margin: 48px 0 10px; }
.prose h3 { font: 500 20px/1.3 var(--serif); margin: 0 0 6px; }
.prose p { margin: 0 0 16px; }
.prose ul { padding-left: 1.1em; margin: 0 0 16px; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--accent); }
.prose .callout { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; margin: 40px 0; }
.prose .callout h2 { margin-top: 0; }
.prose .callout p:last-child { margin-bottom: 0; }
.prose .contact { font: 400 clamp(24px, 3.4vw, 30px)/1.2 var(--serif); }
.faq > div { padding: 22px 0; border-top: 1px solid var(--line); }
.faq > div:last-child { border-bottom: 1px solid var(--line); }
.faq p:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
  body { font-size: 18px; }
  .masthead nav { gap: 18px; }
  .stage-bar a { font-size: 13px; }
}
