/* Cresset website — "Ink & Ash", the game's own identity on a web page.
   Every colour below is a token from game/ui/theme/app_theme.gd or
   region_theme.gd (converted to sRGB hex); the page reads top-to-bottom the
   way the endless strip reads left-to-right: day (paper) → dusk → night.
   No script, no web fonts, no third-party resource of any kind. */

:root {
  color-scheme: light;
  /* paper side (AppTheme PAPER_* tokens) */
  --paper: #f4dca3;            /* sampled backdrop paper */
  --paper-fill: #eddcb3;       /* PAPER_FILL — opaque button tint block */
  --paper-hover: #faf0d4;      /* PAPER_HOVER_FILL */
  --paper-pressed: #d6c191;    /* PAPER_PRESSED_FILL */
  --paper-wash: rgba(242, 230, 199, .78); /* PAPER_WASH, a touch more opaque for long lines */
  --ink: #1f1a14;              /* INK_DARK / TEXT_ON_LIGHT */
  --ink-soft: rgba(31, 26, 20, .72);
  --ink-border: rgba(31, 26, 20, .65); /* PAPER_BORDER */
  /* night side */
  --night: #14121a;
  --night-deep: #0b0a10;
  --night-card: #1f1a14;       /* INK_DARK — dialog card */
  --text-on-dark: #f5f0e6;     /* TEXT_ON_DARK */
  --text-on-dark-soft: #bfae8f;
  --accent: #ffd98c;           /* ACCENT */
  --accent-fill: rgba(255, 217, 140, .16);
  --accent-hover: rgba(255, 217, 140, .28);
  --flame: #ff9f3f;
  --ember: #ffd97a;
  --radius: 8px;               /* BUTTON_CORNER_RADIUS */
  --radius-panel: 10px;        /* PANEL_CORNER_RADIUS */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Open Sans", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1rem, 4vw, 2rem);
  --measure: 42rem;
}

*, *::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;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

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

a { color: inherit; text-decoration-thickness: from-font; text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.night :focus-visible, .site-footer :focus-visible { outline-color: var(--accent); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: .01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.2em; }

.wrap { width: min(100% - 2 * var(--gutter), 68rem); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2 * var(--gutter), var(--measure)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header / nav ---------- */
.site-header { position: relative; z-index: 2; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .9rem; }
.brand-link { display: inline-flex; align-items: center; }
.brand-link img { height: 30px; width: auto; }
.site-nav { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: inline-block; padding: .55rem .8rem; min-height: 44px; line-height: 1.3;
  border-radius: var(--radius); text-decoration: none; font-weight: 600;
  background: var(--paper-wash); color: var(--ink);
}
.site-nav a:hover { background: var(--paper-hover); }
.site-nav a[aria-current="page"] { background: var(--paper-fill); box-shadow: inset 0 0 0 2px var(--ink-border); }
.site-header--over { position: absolute; inset: 0 0 auto 0; }

/* ---------- hero: the start screen ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(92vh, 56rem);
  display: grid; place-items: center;
  padding: 6.5rem var(--gutter) 3rem;
  color: var(--ink);
}
.hero-art { position: absolute; inset: 0; z-index: -1; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; }
.hero-inner { width: min(100%, 38rem); text-align: center; }
.wordmark { width: min(78%, 24rem); margin: 0 auto .9rem; filter: drop-shadow(0 2px 0 rgba(31, 26, 20, .12)); }
.tagline {
  display: inline-block; margin: 0 0 1.4rem; padding: .3rem 1rem;
  font-family: var(--serif); font-size: clamp(1.15rem, 2.4vw, 1.45rem); font-weight: 600;
  background: var(--paper-wash); border-radius: var(--radius-panel);
}
.pitch {
  margin: 0 auto 1.6rem; padding: 1rem 1.25rem; max-width: 34rem;
  background: var(--paper-wash); border-radius: var(--radius-panel);
  font-size: 1.1rem;
}
.pitch strong { font-weight: 700; }

/* the game's paper button (PaperTheme): opaque tint block, pen-stroke
   outline, hover lifts toward clean paper, pressed sinks toward the ink */
.stores { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.store-btn {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  min-width: 11rem; min-height: 56px; padding: .55rem 1.1rem;
  background: var(--paper-fill); border: 2px solid var(--ink-border); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; text-align: left;
  transition: background-color .12s ease, transform .12s ease;
}
.store-btn:hover, .store-btn:focus-visible { background: var(--paper-hover); }
.store-btn:active { background: var(--paper-pressed); transform: translateY(1px); }
.store-btn .where { font-size: .78rem; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-soft); }
.store-btn .what { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.hero-note { display: inline-block; margin: 0; padding: .25rem .8rem; font-size: .95rem; background: var(--paper-wash); border-radius: var(--radius-panel); }

/* ---------- day sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5rem); }
.section-head { max-width: var(--measure); margin-bottom: 2rem; }
.section-head p { font-size: 1.1rem; color: var(--ink-soft); margin: 0; }

.play { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center; }
@media (min-width: 52rem) { .play { grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); gap: 3.5rem; } }
.board-frame { width: min(100%, 24rem); margin-inline: auto; }
.board { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 10px 30px rgba(31, 26, 20, .18); }
.board-caption { margin: .9rem 0 0; font-size: .95rem; color: var(--ink-soft); text-align: center; }

/* day → night, the signature moment, as a 14 s loop: 40 % day, a dusk sweep,
   40 % night, dawn. Motion-reduced readers get the day board and can switch
   with a hover or focus — a hard cut, no transition. */
.board .dusk { opacity: 0; mix-blend-mode: multiply; }
.board .glows { opacity: 0; }
.board .xs { opacity: 1; }
@keyframes cresset-dusk { 0%, 40% { opacity: 0; } 52%, 88% { opacity: .84; } 100% { opacity: 0; } }
@keyframes cresset-glow { 0%, 44% { opacity: 0; } 56%, 88% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cresset-x { 0%, 40% { opacity: 1; } 52%, 88% { opacity: 0; } 100% { opacity: 1; } }
.board .dusk { animation: cresset-dusk 14s ease-in-out infinite; }
.board .glows { animation: cresset-glow 14s ease-in-out infinite; }
.board .xs { animation: cresset-x 14s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .board .dusk, .board .glows, .board .xs { animation: none; }
  .board-frame:hover .dusk, .board-frame:focus-within .dusk { opacity: .84; }
  .board-frame:hover .glows, .board-frame:focus-within .glows { opacity: 1; }
  .board-frame:hover .xs, .board-frame:focus-within .xs { opacity: 0; }
}

.rules { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.rule {
  display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: 1rem; align-items: start;
  padding: 1rem 1.1rem; background: var(--paper-fill);
  border: 2px solid var(--ink-border); border-radius: var(--radius-panel);
}
.rule-icon { width: 3.25rem; height: 3.25rem; }
.rule h3 { margin: .1rem 0 .25rem; }
.rule p { margin: 0; }
.rule-cycle { margin-top: 1.2rem; font-size: 1rem; color: var(--ink-soft); }
.rule-cycle code { font-family: inherit; font-weight: 700; color: var(--ink); background: var(--paper-wash); padding: .1em .4em; border-radius: 4px; }

.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.mode {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 1rem; align-items: start;
  padding: 1.1rem 1.2rem; background: var(--paper-fill);
  border: 2px solid var(--ink-border); border-radius: var(--radius-panel);
}
.mode img { width: 48px; height: 48px; image-rendering: auto; }
.mode h3 { margin: .15rem 0 .3rem; }
.mode p { margin: 0; font-size: 1rem; }

/* ---------- dusk band: the screenshots sit on the sunset ---------- */
.dusk-band {
  position: relative; color: var(--text-on-dark);
  background: linear-gradient(180deg, var(--paper) 0%, #e7bf7f 18%, #b9764f 40%, #4a2f3d 66%, var(--night) 100%);
  padding-block: clamp(3rem, 7vw, 5rem) clamp(2.5rem, 6vw, 4rem);
}
.dusk-band .section-head h2 { color: var(--ink); }
.dusk-band .section-head p { color: var(--ink); }
.shots {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(15rem, 1fr);
  gap: 1.25rem; margin: 0; padding: 0 0 1rem; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--accent) transparent;
}
@media (min-width: 66rem) { .shots { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; } }
.shot { scroll-snap-align: start; margin: 0; }
.shot img {
  width: 100%; aspect-ratio: 640 / 1138; object-fit: cover;
  border: 3px solid var(--night-card); border-radius: 18px;
  box-shadow: 0 16px 40px rgba(11, 10, 16, .45);
  background: var(--night-card);
}
.shot figcaption { margin-top: .75rem; font-size: .95rem; color: var(--text-on-dark); }
.shot figcaption strong { color: var(--accent); font-family: var(--serif); font-size: 1.05rem; }

/* ---------- night: why cresset, footer ---------- */
.night { background: var(--night); color: var(--text-on-dark); padding-block: clamp(3rem, 7vw, 5rem); }
.night h2 { color: var(--accent); }
.night .section-head p { color: var(--text-on-dark-soft); }
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.why li {
  position: relative; padding: 1.1rem 1.2rem 1.1rem 3.1rem;
  background: var(--night-card); border: 2px solid rgba(255, 217, 140, .35); border-radius: var(--radius-panel);
}
.why li::before {
  content: ""; position: absolute; left: 1.05rem; top: 1.25rem; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, var(--ember) 0 22%, var(--flame) 45%, rgba(255, 159, 63, 0) 72%);
  box-shadow: 0 0 14px 4px rgba(255, 159, 63, .45);
}
.why strong { display: block; color: var(--accent); font-family: var(--serif); font-size: 1.1rem; margin-bottom: .2rem; }
.why p { margin: 0; font-size: 1rem; color: var(--text-on-dark); }
.night .stores { justify-content: flex-start; margin-top: 2rem; }
.night .store-btn { background: var(--accent-fill); border-color: var(--accent); color: var(--text-on-dark); }
.night .store-btn:hover, .night .store-btn:focus-visible { background: var(--accent-hover); }
.night .store-btn:active { background: rgba(255, 217, 140, .4); }
.night .store-btn .where { color: var(--text-on-dark-soft); }

.site-footer { background: var(--night-deep); color: var(--text-on-dark-soft); padding-block: 1.75rem 2.25rem; font-size: .92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.site-footer a { color: var(--text-on-dark); text-decoration: none; padding-block: .45rem; display: inline-block; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer p { margin: 0; }

/* ---------- inner pages (support, privacy, impressum): the paper sheet ---------- */
.page-main { padding-block: 1.5rem clamp(3rem, 7vw, 5rem); }
.sheet {
  background: var(--paper-fill); border: 2px solid var(--ink-border); border-radius: var(--radius-panel);
  padding: clamp(1.5rem, 4vw, 2.75rem);
}
.sheet h1 { margin-bottom: .35em; }
.sheet h2 { font-size: 1.5rem; margin-top: 2.25rem; padding-top: 1.5rem; border-top: 2px solid var(--ink-border); }
.sheet h3 { margin-top: 1.6rem; }
.sheet .meta { color: var(--ink-soft); font-size: .95rem; margin-bottom: 1.5rem; }
.sheet a { color: var(--ink); font-weight: 600; }
.sheet address { font-style: normal; margin-bottom: 1em; }
