/* The home page (index.html), which introduces the game. The game's own art carries it: the Rise of Rome title screen as
   the hero, then papyrus pages between scenes from the game's menus (legionaries, the war table, a Stone Age
   village). The one loud element is the title, in the gilt of the game's logo. Cinzel has no Vietnamese
   letters, so it sets only the Roman numerals of the ages; everything else is EB Garamond.
   Pictures live in game/intro/ (tools/intro_art.py); without them each scene falls back to its dusk colour. */
@font-face { font-family: Cinzel; font-weight: 700; font-display: swap; src: url(vendor/fonts/cinzel/cinzel-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'EB Garamond'; font-weight: 400; font-display: swap; src: url(vendor/fonts/eb-garamond/eb-garamond-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-weight: 400; font-style: italic; font-display: swap; src: url(vendor/fonts/eb-garamond/eb-garamond-latin-400-italic.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-weight: 600; font-display: swap; src: url(vendor/fonts/eb-garamond/eb-garamond-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'EB Garamond'; font-weight: 400; font-display: swap; src: url(vendor/fonts/eb-garamond/eb-garamond-vietnamese-400-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'EB Garamond'; font-weight: 400; font-style: italic; font-display: swap; src: url(vendor/fonts/eb-garamond/eb-garamond-vietnamese-400-italic.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'EB Garamond'; font-weight: 600; font-display: swap; src: url(vendor/fonts/eb-garamond/eb-garamond-vietnamese-600-normal.woff2) format('woff2'); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }

:root {
  --dusk: #1e140c;        /* the shadows of the title screen; every scene's fallback */
  --on-dusk: #f2e6cc;
  --on-dusk-soft: #d6c4a0;
  --papyrus: #e6d4ad;     /* the pages between scenes */
  --ink: #2b1d10;
  --ink-soft: #5b4630;    /* 6:1 on papyrus */
  --gilt: #e0ae55;        /* the logo's gold, on dark only */
  --crimson: #9a2a1d;     /* the Rise of Rome red: the main action */
  --numerals: var(--crimson);
  --rule: rgb(43 29 16 / .2);
  --text: 'EB Garamond', Garamond, Georgia, serif;
  --numeral: Cinzel, 'Trajan Pro', Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --papyrus: #2a1f15; --ink: #efe2c6; --ink-soft: #c8b591; --numerals: var(--gilt); --rule: rgb(239 226 198 / .16);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --papyrus: #2a1f15; --ink: #efe2c6; --ink-soft: #c8b591; --numerals: var(--gilt); --rule: rgb(239 226 198 / .16);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--dusk); scroll-behavior: smooth; }
body { margin: 0; background: var(--papyrus); color: var(--ink); font: 1.1875rem/1.6 var(--text); }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gilt); outline-offset: 3px; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
p, dd, li { text-wrap: pretty; }
[hidden] { display: none !important; }

/* ---- actions */
.cta {
  display: inline-block; padding: 12px 30px; background: var(--crimson); color: #fbefd6; text-decoration: none;
  font-weight: 600; font-size: 1.2rem; letter-spacing: .01em; border: 1px solid #d8a24c; border-radius: 2px;
  box-shadow: inset 0 0 0 3px var(--crimson), inset 0 0 0 4px rgb(240 196 106 / .55), 0 6px 18px rgb(0 0 0 / .35);
}
.cta:hover { background: #ad3424; box-shadow: inset 0 0 0 3px #ad3424, inset 0 0 0 4px rgb(240 196 106 / .7), 0 6px 18px rgb(0 0 0 / .35); }
.quiet { color: var(--on-dusk); text-decoration-color: var(--gilt); text-decoration-thickness: 1px; }
.quiet:hover { text-decoration-thickness: 2px; }

/* ---- hero: the Rise of Rome title screen, title and all */
.hero {
  position: relative; isolation: isolate; min-height: min(100svh, 980px); display: grid; align-items: end; overflow: hidden;
  color: var(--on-dusk); background: var(--dusk);
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background: url(game/intro/rise-of-rome.png) 50% 0 / cover no-repeat;
  animation: settle 2.6s cubic-bezier(.2, .7, .2, 1) both;
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, var(--dusk) 0%, rgb(30 20 12 / .88) 26%, rgb(30 20 12 / .25) 58%, transparent 75%);
}
@keyframes settle { from { transform: scale(1.07); filter: brightness(.6); } }
.hero-nav { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 16px clamp(16px, 4vw, 48px); font-size: 1.05rem; }
.hero-nav a { color: var(--on-dusk); text-decoration: none; text-shadow: 0 1px 6px rgb(0 0 0 / .8); }
.hero-nav a:hover { text-decoration: underline; text-decoration-color: var(--gilt); }
.hero-text { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) clamp(40px, 8vh, 88px); }
.hero h1 {
  margin: 0; padding-top: .12em; font-size: clamp(4.2rem, 16vw, 9.5rem); line-height: 1.12; letter-spacing: .01em;
  background: linear-gradient(180deg, #fff4cf 8%, #f0c46a 40%, #a8681e 56%, #e8b75c 74%, #fbe1a0 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #3b220b) drop-shadow(0 10px 24px rgb(0 0 0 / .55));
  animation: rise 1.4s .5s cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.hero-line { margin: 0; font: italic 400 clamp(1.5rem, 4.2vw, 2.4rem)/1.25 var(--text); color: var(--on-dusk); }
.hero-lede { max-width: 34rem; margin: 18px 0 0; font-size: 1.25rem; color: var(--on-dusk-soft); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin: 30px 0 0; }

/* ---- papyrus pages */
.page { background: var(--papyrus); padding: clamp(56px, 9vw, 104px) 0; }
.column { max-width: 1080px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }
.page h2, .scene h2 { margin: 0 0 14px; font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.15; letter-spacing: -.005em; }
.lede { max-width: 40rem; margin: 0; font-size: 1.3rem; color: var(--ink-soft); }

/* The four ages: a sequence, so numbered. Each row: numeral, text, the units it brings. */
.age-list { list-style: none; margin: 48px 0 0; padding: 0; }
.age-list > li {
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; align-items: center; gap: 12px 28px;
  padding: 26px 0; border-top: 1px solid var(--rule);
}
.age-list > li:last-child { border-bottom: 1px solid var(--rule); }
.age-num { margin: 0; font: 700 clamp(2rem, 4vw, 2.8rem)/1 var(--numeral); color: var(--numerals); letter-spacing: .04em; }
.age-text h3 { margin: 0 0 4px; font-size: 1.55rem; line-height: 1.25; }
.age-text p { margin: 0; max-width: 30rem; color: var(--ink-soft); }
/* Fixed columns, so the portraits line up from age to age whatever the captions. */
.portraits { display: grid; grid-template-columns: auto 88px 88px; align-items: end; gap: 12px; }
.portraits figure { margin: 0; display: grid; justify-items: center; align-content: end; gap: 6px; text-align: center; }
/* Framed like the game's own portrait panel: a bevelled bronze edge. */
.portraits img {
  display: block; width: 75px; height: 75px; image-rendering: pixelated; background: #000;
  border: 3px solid; border-color: #d6a855 #6e4a1c #5a3b14 #c39444;
  box-shadow: 0 0 0 1px #2b1d10, 0 4px 10px rgb(43 29 16 / .3);
}
.portraits .lead img { width: 150px; height: 150px; }
.portraits figcaption { font-size: .95rem; line-height: 1.25; font-style: italic; color: var(--ink-soft); }

/* ---- scenes: the game's menu art behind the text */
.scene { position: relative; color: var(--on-dusk); background: var(--dusk) no-repeat center / cover; }
.friends { background-image: linear-gradient(90deg, rgb(30 20 12 / .94) 0%, rgb(30 20 12 / .82) 46%, rgb(30 20 12 / .1) 80%), url(game/intro/legion.png); background-position: center, 70% 40%; }
.scene-panel { max-width: 1080px; margin: 0 auto; padding: clamp(64px, 10vw, 120px) clamp(16px, 4vw, 48px); }
.perks { margin: 28px 0 0; max-width: 40rem; display: grid; grid-template-columns: 1fr 1fr; gap: 26px 36px; }
.perks div { border-top: 1px solid rgb(224 174 85 / .45); padding-top: 12px; }
.perks dt { font-weight: 600; font-size: 1.25rem; color: var(--gilt); }
.perks dd { margin: 4px 0 0; color: var(--on-dusk-soft); line-height: 1.5; }

/* The war table: the steps are laid on it like the map. */
.table { background-image: linear-gradient(rgb(30 20 12 / .55), rgb(30 20 12 / .7)), url(game/intro/war-table.png); background-position: center, 50% 60%; padding: clamp(56px, 9vw, 110px) 16px; }
.map {
  max-width: 820px; margin: 0 auto; padding: clamp(28px, 5vw, 52px) clamp(20px, 5vw, 56px);
  background: #e9d7ae; color: #2b1d10; border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / .4), 0 0 0 7px #b69a62, 0 0 0 8px rgb(0 0 0 / .45), 0 24px 60px rgb(0 0 0 / .6);
}
.steps { list-style: none; margin: 26px 0 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.6rem 1fr; column-gap: 14px; padding: 14px 0; border-top: 1px solid rgb(43 29 16 / .18); }
.steps li::before { content: counter(step); grid-row: 1 / 3; font: 700 1.5rem/1.25 var(--numeral); color: var(--crimson); }
.steps h3 { margin: 0; font-size: 1.3rem; line-height: 1.3; }
.steps p { margin: 2px 0 0; color: #4f3c27; }
.steps b { font-weight: 600; color: #2b1d10; }
.game-button {
  display: inline-block; padding: 0 8px; background: #393126; color: #fff; border: 2px solid #b7a47c;
  font: 600 .9em/1.45 Arial, Helvetica, sans-serif; white-space: nowrap;
}

/* ---- keys */
kbd {
  display: inline-block; min-width: 1.7em; padding: 0 6px; text-align: center; font: 600 .85em/1.55 var(--text); font-variant-numeric: lining-nums;
  color: #2b1d10; background: #f3e6c8; border: 1px solid rgb(43 29 16 / .35); border-bottom-width: 3px; border-radius: 4px; white-space: nowrap;
}
.keys { padding-bottom: 24px; }
.key-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 20px 44px; margin-top: 30px; }
.key-groups h3 { margin: 0 0 6px; font-size: 1.3rem; }
.key-groups dl { display: grid; grid-template-columns: max-content 1fr; gap: 0 16px; margin: 0; }
.key-groups dt, .key-groups dd { margin: 0; padding: 6px 0; border-top: 1px solid var(--rule); }
.key-groups dd { color: var(--ink-soft); }

/* ---- before playing */
.page.before { padding-top: 48px; }
.notes { margin: 18px 0 0; padding: 0 0 0 1.2em; max-width: 44rem; }
.notes li { margin: 0 0 8px; padding-left: 4px; }
.notes li::marker { color: var(--numerals); }

/* ---- the end: the Stone Age village at dusk */
.village {
  min-height: min(88svh, 760px); display: grid; align-content: end; gap: 40px; padding: 120px clamp(16px, 4vw, 48px) 28px;
  background-image: linear-gradient(to top, rgb(30 20 12 / .92) 0%, rgb(30 20 12 / .35) 45%, rgb(30 20 12 / .05) 70%), url(game/intro/village.png);
  background-position: center, 50% 70%;
}
.farewell, .credits { max-width: 1080px; width: 100%; margin: 0 auto; }
.farewell-line { margin: 0 0 24px; font: italic 400 clamp(2rem, 6vw, 3.6rem)/1.15 var(--text); color: var(--on-dusk); text-shadow: 0 2px 16px rgb(0 0 0 / .6); }
.credits { font-size: .95rem; color: var(--on-dusk-soft); }

@media (max-width: 760px) {
  /* A tall screen would crop the title off the sides: show the top of the picture whole instead. */
  .hero::before { background-size: auto 74%; }
  .age-list > li { grid-template-columns: 3.4rem minmax(0, 1fr); }
  .portraits { grid-column: 2; }
  .portraits .lead img { width: 112px; height: 112px; image-rendering: auto; }
  .perks { grid-template-columns: 1fr; }
  .friends { background-image: linear-gradient(rgb(30 20 12 / .78), rgb(30 20 12 / .9)), url(game/intro/legion.png); }
}
@media (max-width: 420px) {
  .portraits { gap: 8px; grid-template-columns: auto 76px 76px; }
  .portraits img { width: 64px; height: 64px; image-rendering: auto; }
  .portraits .lead img { width: 96px; height: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero::before, .hero h1 { animation: none; }
}
