/* Longwalker landing page: the app's colors (ui/theme/Color.kt, ui/components/Kit.kt), night by default,
   parchment for day. Serif titles, sans body, cards, chips and bars like the app. */

:root {
  --bg: #151F24;
  --surface: #252A24;
  --surface-high: #2F352E;
  --surface-highest: #3A4038;
  --ink: #EBE2CC;
  --ink-soft: #B5AC97;
  --ink-faint: #5E6458;
  --primary: #E8896C;          /* NightEmber */
  --primary-ink: #151F24;
  --primary-wash: #5A2A1E;
  --sea: #86B7CF;

  /* Meaning colors (night): strong / container / on-container */
  --hp: #E24B4A;       --hp-c: #501313;       --hp-on: #F7C1C1;
  --xp: #EF9F27;       --xp-c: #412402;       --xp-on: #FAC775;
  --strydes: #5DCAA5;  --strydes-c: #04342C;  --strydes-on: #9FE1CB;
  --gold: #EFC14A;     --gold-c: #3D2E06;     --gold-on: #F8DE8E;
  --energy: #85B7EB;   --energy-c: #042C53;   --energy-on: #B5D4F4;
  --talent: #AFA9EC;   --talent-c: #26215C;   --talent-on: #CECBF6;
  --danger: #F09595;   --danger-c: #501313;
  --good: #97C459;     --good-c: #173404;     --good-on: #C0DD97;
  --neutral-c: #2F352E; --neutral-on: #D8CDB5;

  /* Rarity */
  --r-common: #BDB6A6; --r-uncommon: #7CCB6B; --r-rare: #6FA8F0; --r-epic: #C08AF0; --r-legendary: #F0A34E;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --serif: "Noto Serif", Georgia, "Times New Roman", serif;
  --sans: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ECE4CF;
    --surface: #F4EEDF;
    --surface-high: #E3D9C0;
    --surface-highest: #D8CDB5;
    --ink: #2D2922;
    --ink-soft: #6A6152;
    --ink-faint: #B9AE95;
    --primary: #8A2F1C;
    --primary-ink: #ECE4CF;
    --primary-wash: #EBCDBF;
    --sea: #2F5A70;
    --hp: #C0392B;       --hp-c: #FCEBEB;       --hp-on: #791F1F;
    --xp: #BA7517;       --xp-c: #FAEEDA;       --xp-on: #633806;
    --strydes: #0F6E56;  --strydes-c: #E1F5EE;  --strydes-on: #085041;
    --gold: #9A7208;     --gold-c: #FAF0D2;     --gold-on: #5C4405;
    --energy: #185FA5;   --energy-c: #E6F1FB;   --energy-on: #0C447C;
    --talent: #534AB7;   --talent-c: #EEEDFE;   --talent-on: #3C3489;
    --danger: #A32D2D;   --danger-c: #FCEBEB;
    --good: #3B6D11;     --good-c: #EAF3DE;     --good-on: #27500A;
    --neutral-c: #E3D9C0; --neutral-on: #2D2922;
    --r-common: #6B6558; --r-uncommon: #2E7D32; --r-rare: #1E5BB8; --r-epic: #7B2FBE; --r-legendary: #B25400;
    --shadow: 0 10px 30px rgba(45, 41, 34, .15);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }
.small { font-size: .82rem; }
.accent { color: var(--primary); font-weight: 500; letter-spacing: .04em; }

/* ---- Top bar ---- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--ink-faint) 40%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.25rem; }
.brand-mark { width: auto; height: 40px; filter: drop-shadow(0 0 6px rgba(40, 210, 220, .35)); }

/* ---- Buttons and chips ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 0;
  background: var(--primary); color: var(--primary-ink);
  font: 500 1rem var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:focus-visible, .link-btn:focus-visible, .option:focus-visible, input:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.btn-ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }
.btn-small { padding: 8px 16px; font-size: .9rem; }
.btn-tiny { padding: 5px 10px; font-size: .72rem; }
.btn-wide { width: 100%; padding: 14px; font-size: 1.05rem; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; filter: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.chips.tight { gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--neutral-c); color: var(--neutral-on);
  font-size: .85rem; font-weight: 500;
}
.chips.tight .chip { padding: 4px 9px; font-size: .7rem; }
.chip-strydes { background: var(--strydes-c); color: var(--strydes-on); }
.chip-xp { background: var(--xp-c); color: var(--xp-on); }
.chip-gold { background: var(--gold-c); color: var(--gold-on); }
.chip-talent { background: var(--talent-c); color: var(--talent-on); }
.chip-neutral { background: var(--neutral-c); color: var(--neutral-on); }
.t-strydes { color: var(--strydes); }
.t-gold { color: var(--gold); }
.r-common { color: var(--r-common); font-weight: 500; }
.r-legendary { color: var(--r-legendary); font-weight: 500; }
.rare { color: var(--r-rare); font-weight: 500; }
.link { color: var(--primary); font-weight: 500; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-title { display: flex; justify-content: space-between; gap: 8px; font-size: .75rem; font-weight: 500; letter-spacing: .06em; color: var(--sea); margin-bottom: 8px; }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; }
.hero-map {
  position: absolute; inset: 0;
  background: url("assets/art/hero-greenhollow.webp") center 40% / cover no-repeat;
  opacity: .75;
  mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 42%, transparent 75%),
    linear-gradient(to bottom, transparent 70%, var(--bg) 100%);
}
.hero-inner {
  position: relative; z-index: 1;
  max-width: 1160px; margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) clamp(16px, 4vw, 40px) clamp(48px, 8vw, 96px);
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(28px, 5vw, 64px); align-items: center;
}
.hero-logo { width: clamp(96px, 12vw, 140px); height: auto; margin-bottom: 14px; }
.eyebrow { color: var(--primary); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; font-size: .8rem; }
.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 36em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }

/* The phone mock, drawn like the app */
.phone {
  justify-self: center;
  width: min(340px, 100%);
  padding: 12px;
  border-radius: 38px;
  background: #0d1316;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5), inset 0 0 0 2px #2b3338;
  transform: rotate(2deg);
}
.phone-screen {
  border-radius: 28px; overflow: hidden;
  background: #151F24; color: #EBE2CC;
  padding: 16px 12px; display: grid; gap: 10px;
  /* The phone always shows the app at night, like the screenshots will. */
  --surface: #252A24; --ink-soft: #B5AC97; --primary: #E8896C; --sea: #86B7CF;
  --strydes-c: #04342C; --strydes-on: #9FE1CB; --gold-c: #3D2E06; --gold-on: #F8DE8E; --neutral-c: #2F352E; --neutral-on: #D8CDB5;
  --hp: #E24B4A; --xp: #EF9F27; --r-rare: #6FA8F0;
}
.phone .card { padding: 12px; box-shadow: none; background: #252A24; }
.phone .muted { color: #B5AC97; }
.hero-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.emblem { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #4F7F3A; font-size: 1.2rem; }
.hero-name { font-family: var(--serif); font-weight: 700; font-size: 1.02rem; }
.bar { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.bar-icon { width: 14px; font-size: .8rem; text-align: center; }
.bar-icon.hp { color: var(--hp); } .bar-icon.xp { color: var(--xp); }
.track { flex: 1; height: 7px; border-radius: 99px; background: #3A4038; overflow: hidden; }
.fill { height: 100%; border-radius: 99px; }
.fill.hp { background: var(--hp); } .fill.xp { background: var(--xp); }
.card-region-sm { background: #14263A !important; }
.track.road { margin-bottom: 8px; } .fill.road { background: #6FB3D6; }
.toggle { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid #B5AC97; border-radius: 99px; overflow: hidden; font-size: .78rem; text-align: center; }
.toggle span { padding: 6px; } .toggle .on { background: #5A2A1E; }
.card-encounter { box-shadow: inset 0 0 0 1.5px #E8896C !important; }
.card-encounter p { margin: 4px 0 8px; font-size: .88rem; }
.encounter-actions { display: flex; gap: 6px; }

/* ---- Sections ---- */
.section { max-width: 1160px; margin: 0 auto; padding: clamp(40px, 7vw, 80px) clamp(16px, 4vw, 40px); }
.section-lede { color: var(--ink-soft); font-size: 1.08rem; max-width: 46em; margin-bottom: 28px; }
.grid { display: grid; gap: 16px; }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.feature p { color: var(--ink-soft); margin: 0; font-size: .95rem; }
.feature-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; margin-bottom: 12px; }
.tone-strydes { background: var(--strydes-c); } .tone-energy { background: var(--energy-c); }
.tone-gold { background: var(--gold-c); } .tone-talent { background: var(--talent-c); }

/* ---- World ---- */
.map-frame { margin: 0 0 20px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid color-mix(in srgb, var(--ink-faint) 50%, transparent); }
.regions { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: region; }
.region {
  counter-increment: region;
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--tone) 14%, var(--surface));
  box-shadow: var(--shadow);
}
.region img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.region-text { display: grid; gap: 2px; padding: 12px 14px 14px 46px; border-top: 3px solid var(--tone); }
.region::before {
  content: counter(region);
  position: absolute; left: 16px; bottom: 22px;
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: var(--tone);
}
.region-name { font-family: var(--serif); font-weight: 600; }
.region-meta { font-size: .85rem; color: var(--ink-soft); }

/* ---- Monsters and adventures ---- */
.monsters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.monster, .place, .race, .hero-class { margin: 0; overflow: hidden; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.monster img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.monster figcaption { padding: 10px 14px; font-family: var(--serif); font-weight: 600; }
.places { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.place { position: relative; }
.place img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.place figcaption { position: absolute; inset: auto 0 0; display: grid; padding: 36px 16px 12px; color: #EBE2CC; background: linear-gradient(to top, rgba(10, 14, 16, .88), transparent); }
.place strong { font-family: var(--serif); font-size: 1.15rem; }
.place span { font-size: .85rem; color: #D8CDB5; }

/* ---- Classes ---- */
.classes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
/* The portraits are painted on white. On a parchment tile with multiply, the white becomes the page, in day and night alike. */
.class-art { background: #F1E9D6; padding: 8px 6px 0; }
.class-art img { width: 100%; aspect-ratio: 2 / 3; object-fit: contain; object-position: bottom; mix-blend-mode: multiply; }
.hero-class figcaption { display: grid; gap: 1px; padding: 10px 12px 12px; }
.hero-class strong { font-family: var(--serif); font-size: 1.02rem; }
.hero-class .role { width: auto; margin: 0; font-size: .8rem; font-weight: 500; }
.sub { font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin: 44px 0 .4em; }
.races { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.race img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.race figcaption { display: grid; gap: 1px; padding: 10px 12px 12px; }
.race strong { font-family: var(--serif); font-size: .98rem; }
.race span { font-size: .78rem; color: var(--ink-soft); }

/* ---- Guilds ---- */
.guild { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(20px, 4vw, 40px); align-items: center; padding: clamp(20px, 4vw, 32px); }
.guild-copy p { color: var(--ink-soft); }
.guild-art { width: 100%; border-radius: var(--radius-sm); }
.guild-icons { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.guild-icons li { width: 64px; height: 64px; padding: 9px; border-radius: 50%; background: var(--disc); }
.guild-icons img { width: 100%; height: 100%; object-fit: contain; }

.role { width: 100%; font-size: 1rem; margin: 0 0 4px; }
.role.tank { color: var(--energy); } .role.heal { color: var(--good); } .role.support { color: var(--talent); } .role.dps { color: var(--hp); }

/* ---- Fair ---- */
.fair { border-left: 4px solid var(--good); }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ticks li { padding-left: 28px; position: relative; color: var(--ink-soft); }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 700; }
.ticks strong { color: var(--ink); }

/* ---- Join form ---- */
.join { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(20px, 4vw, 48px); padding: clamp(20px, 4vw, 40px); box-shadow: var(--shadow), inset 0 0 0 1.5px var(--primary); }
.join-copy p { color: var(--ink-soft); }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-weight: 500; font-size: .92rem; }
.field input, .challenge-input {
  width: 100%; padding: 12px 14px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--surface-highest);
  background: var(--bg); color: var(--ink);
  font: 1rem var(--sans);
}
.field input::placeholder { color: var(--ink-faint); }
.field input:focus, .challenge-input:focus { border-color: var(--primary); outline: none; }

/* Honeypot: off-screen for people and screen readers; bots fill it in. */
.honeypot { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.challenge {
  margin: 0; padding: 14px 16px 10px;
  border: 1.5px dashed var(--talent); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--talent-c) 45%, transparent);
}
.challenge legend { padding: 0 6px; font-family: var(--serif); font-weight: 600; color: var(--talent); }
.challenge-prompt { margin: 0 0 10px; font-size: 1.02rem; word-spacing: .08em; }
.challenge-prompt .critters { display: block; font-size: 1.5rem; letter-spacing: .12em; margin-top: 6px; line-height: 1.5; }
.challenge-prompt .scramble { display: inline-block; margin-top: 6px; font-family: var(--serif); font-weight: 700; font-size: 1.5rem; letter-spacing: .3em; color: var(--gold); }
.challenge-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.challenge-options:empty { display: none; }
.option {
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--surface-highest); background: var(--surface-high); color: var(--ink);
  font: 500 .95rem var(--sans); text-align: left; cursor: pointer;
}
.option:hover { border-color: var(--talent); }
.option[aria-checked="true"] { border-color: var(--talent); background: var(--talent-c); color: var(--talent-on); }
.challenge-input { margin-bottom: 4px; }
.link-btn { background: none; border: 0; padding: 6px 0; color: var(--talent); font: 500 .85rem var(--sans); cursor: pointer; }
.challenge.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; color: var(--ink-soft); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--primary); }
.required { color: var(--primary); font-weight: 500; white-space: nowrap; }
.consent-hint { margin: -6px 0 0; text-align: center; }
.form-note { margin: -4px 0 0; font-size: .82rem; color: var(--ink-soft); }
.form-message { min-height: 1.4em; margin: 0; font-size: .92rem; }
.form-message.error { color: var(--danger); }
.joined { text-align: center; align-self: center; padding: 24px; border-radius: var(--radius); background: var(--good-c); color: var(--good-on); }
.joined h3 { font-size: 1.6rem; }
.joined-icon { font-size: 3rem; }

/* ---- Privacy policy and other text pages ---- */
.legal { max-width: 780px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) clamp(16px, 4vw, 40px); }
.legal h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.legal h2 { font-size: 1.35rem; margin-top: 1.6em; }
.legal section { scroll-margin-top: 80px; }
.legal p, .legal li { color: var(--ink-soft); }
.legal strong { color: var(--ink); }
.legal ul { padding-left: 1.2em; display: grid; gap: 6px; margin: 0 0 1em; }
.legal-summary { margin: 24px 0; border-left: 4px solid var(--good); }
.legal-summary h2, .legal-toc h2 { margin-top: 0; font-size: 1.15rem; }
.legal-summary .ticks { padding-left: 0; }
.legal-toc ol { margin: 0; padding-left: 1.3em; columns: 2; column-gap: 32px; }
.legal-toc li { margin: 2px 0; break-inside: avoid; }
@media (max-width: 560px) { .legal-toc ol { columns: 1; } }

/* ---- Footer ---- */
.footer { text-align: center; padding: 40px 16px 56px; border-top: 1px solid color-mix(in srgb, var(--ink-faint) 40%, transparent); }
.footer p { margin: 4px 0; }

/* ---- Small screens ---- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero::after { background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 80%, transparent) 0%, var(--bg) 100%); }
  .phone { transform: none; }
  .grid.four { grid-template-columns: repeat(2, 1fr); }
  .classes { grid-template-columns: repeat(3, 1fr); }
  .races { grid-template-columns: repeat(3, 1fr); }
  .regions { grid-template-columns: repeat(2, 1fr); }
  .monsters { grid-template-columns: repeat(2, 1fr); }
  .guild { grid-template-columns: 1fr; }
  .join { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid.four, .regions, .places { grid-template-columns: 1fr; }
  .classes, .races { grid-template-columns: repeat(2, 1fr); }
  .challenge-options { grid-template-columns: 1fr; }
  .top .btn-small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .challenge.shake { transition: none; animation: none; }
}
