/*
 * The landing page's look is the game's own interface, not an invention: every colour below was sampled out of the
 * pack's Egyptian HUD panel (`sprites/interface/50741.png`, the `game_c` strip the game screen draws at the bottom) and
 * the wordmark in the client's own style.css.
 *
 *   #d0a878  the sandstone the panel is mostly made of      #906848  its mid shadow
 *   #e8d8c0  its top highlight                              #785840  its deep shadow
 *   #d8c098 / #e0c8a8  the lighter stone                    #684820  the darkest line in the bevel
 *   #b88860 / #a88058 / #a07048  the carved relief          #e8c766  the DECHE.ONLINE gold (--gold in the client)
 *
 * The page is built out of those: tan stone panels with a one-pixel bevel (light top-left, dark bottom-right) the way
 * the original's buttons and borders are drawn, on the black-to-stone radial the wordmark sits on.
 */

:root {
  --stone: #d0a878;
  --stone-light: #d8c098;
  --stone-lighter: #e0c8a8;
  --stone-highlight: #e8d8c0;
  --relief: #b88860;
  --relief-mid: #a07048;
  --shadow: #906848;
  --shadow-deep: #785840;
  --bevel-dark: #684820;
  --gold: #e8c766;
  --ink: #2a1c0c;
  --ink-soft: #4a3621;
  --night: #12100d;
  --night-mid: #2b2824;
  --night-stone: #5a5248;
  --parchment-text: #ead9bd;
  /* Georgia is the game's own wordmark face, but it has no precomposed Vietnamese glyphs: Chromium then stacks the
   * tone mark on the vowel by hand and "Đế Chế" comes out as "Đê´ Chê´". So the serif used for Vietnamese text is a
   * stack that starts with faces that do cover it (Cambria and Constantia on Windows, Times New Roman everywhere),
   * and Georgia is kept for the DECHE.ONLINE wordmark alone, which is ASCII. */
  --serif: Cambria, Constantia, 'Palatino Linotype', 'Times New Roman', Georgia, serif;
  --serif-latin: Georgia, 'Palatino Linotype', Palatino, serif;
  --sans: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--parchment-text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  /* The art is 1998 pixel art: let it stay sharp when it scales instead of going soft. */
  image-rendering: pixelated;
}

a {
  color: var(--gold);
}

.wrap {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--stone);
  color: var(--ink);
  padding: 0.5rem 0.9rem;
}

/* ---------- The wordmark ---------- */

.brand {
  font-family: var(--serif-latin);
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  color: var(--gold);
  text-shadow: 0 2px 0 #000;
}
.brand-dot {
  color: var(--relief);
}
.brand-tld {
  color: var(--stone-light);
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(18, 16, 13, 0.92);
  border-bottom: 1px solid var(--bevel-dark);
  backdrop-filter: blur(6px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 60px;
}
.nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
  font-size: 0.95rem;
}
.nav a {
  color: var(--stone-light);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ---------- Buttons, drawn like the game's own ---------- */

.btn {
  display: inline-block;
  font-family: var(--serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(180deg, var(--stone-lighter), var(--stone) 55%, var(--shadow));
  border: 1px solid var(--bevel-dark);
  box-shadow:
    inset 1px 1px 0 var(--stone-highlight),
    inset -1px -1px 0 var(--shadow-deep),
    0 2px 0 rgba(0, 0, 0, 0.5);
  padding: 0.6rem 1.3rem;
  font-size: 0.95rem;
}
.btn:hover {
  background: linear-gradient(180deg, var(--stone-highlight), var(--stone-light) 55%, var(--relief));
}
.btn:active {
  box-shadow:
    inset -1px -1px 0 var(--stone-highlight),
    inset 1px 1px 0 var(--shadow-deep);
  transform: translateY(1px);
}
.btn-small {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}
.btn-big {
  padding: 0.9rem 2.2rem;
  font-size: 1.15rem;
}
.btn-ghost {
  background: transparent;
  color: var(--gold);
  border-color: var(--relief-mid);
  box-shadow: none;
}
.btn-ghost:hover {
  background: rgba(208, 168, 120, 0.12);
  color: var(--stone-highlight);
}

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(90, 82, 72, 0.55) 0%, rgba(43, 40, 36, 0.3) 45%, transparent 70%),
    linear-gradient(180deg, var(--night-mid), var(--night));
  border-bottom: 1px solid var(--bevel-dark);
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--relief);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  color: var(--stone-highlight);
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal;
  color: var(--gold);
  text-shadow: 0 2px 0 #000, 0 0 22px rgba(232, 199, 102, 0.3);
}
.lead {
  margin: 0 0 1.6rem;
  font-size: 1.08rem;
  color: var(--parchment-text);
  max-width: 34em;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}
.hero-facts li {
  display: flex;
  flex-direction: column;
}
.hero-facts strong {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--gold);
  line-height: 1.1;
}
.hero-facts span {
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-light);
}

/* A stone frame around the screenshots, the bevel of the game's own panels. */
.hero-shot,
.shots figure {
  margin: 0;
  background: var(--stone);
  border: 1px solid var(--bevel-dark);
  box-shadow:
    inset 2px 2px 0 var(--stone-highlight),
    inset -2px -2px 0 var(--shadow-deep),
    0 10px 30px rgba(0, 0, 0, 0.55);
  padding: 10px;
}
.hero-shot figcaption,
.shots figcaption {
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: center;
  padding-top: 8px;
  letter-spacing: 0.04em;
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}
.section-alt {
  background: linear-gradient(180deg, var(--night), #171511 50%, var(--night));
  border-block: 1px solid var(--bevel-dark);
}
.kicker {
  margin: 0 0 0.4rem;
  color: var(--relief);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.section h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  color: var(--gold);
  margin: 0 0 2rem;
  text-shadow: 0 2px 0 #000;
}

/* ---------- Feature cards: the game's stone panel ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.1rem;
}
.card {
  background: linear-gradient(180deg, var(--stone-lighter), var(--stone) 70%, var(--relief));
  color: var(--ink);
  border: 1px solid var(--bevel-dark);
  box-shadow:
    inset 1px 1px 0 var(--stone-highlight),
    inset -1px -1px 0 var(--shadow-deep);
  padding: 1.25rem 1.3rem 1.4rem;
}
.card h3 {
  font-family: var(--serif);
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: #3a2a12;
}
.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* ---------- Screenshots ---------- */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
}

/* The phone shots are portrait (454x982), so they get a row of their own and a narrow column: dropped into the
 * landscape grid above they would tower over everything beside them. */
.shots-sub {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--stone-light);
  letter-spacing: 0.06em;
  margin: 2.5rem 0 1rem;
}
.shots-phone {
  grid-template-columns: repeat(auto-fit, minmax(190px, 240px));
  justify-content: center;
}

/* ---------- Steps ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.1rem;
  margin: 0;
  padding: 0;
}
.steps li {
  border: 1px solid var(--bevel-dark);
  background: rgba(208, 168, 120, 0.08);
  padding: 1.25rem 1.3rem;
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  background: linear-gradient(180deg, var(--stone-lighter), var(--stone));
  border: 1px solid var(--bevel-dark);
  box-shadow: inset 1px 1px 0 var(--stone-highlight), inset -1px -1px 0 var(--shadow-deep);
  margin-bottom: 0.7rem;
}
.steps h3 {
  font-family: var(--serif);
  margin: 0 0 0.35rem;
  color: var(--stone-highlight);
  font-size: 1.1rem;
}
.steps p {
  margin: 0;
  color: var(--parchment-text);
  font-size: 0.97rem;
}
.cta-center {
  text-align: center;
  margin-top: 2.2rem;
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  gap: 0.6rem;
  max-width: 54rem;
}
.faq details {
  border: 1px solid var(--bevel-dark);
  background: rgba(208, 168, 120, 0.07);
}
.faq summary {
  cursor: pointer;
  padding: 0.9rem 1.1rem;
  font-family: var(--serif);
  font-size: 1.03rem;
  color: var(--stone-highlight);
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::before {
  content: '▸';
  color: var(--gold);
  margin-right: 0.6rem;
}
.faq details[open] summary::before {
  content: '▾';
}
.faq details[open] summary {
  color: var(--gold);
}
.faq p {
  margin: 0;
  padding: 0 1.1rem 1.1rem 2.3rem;
  color: var(--parchment-text);
  font-size: 0.97rem;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--bevel-dark);
  background: var(--night);
  padding: 2.5rem 0;
}
.footer-inner {
  display: grid;
  gap: 0.6rem;
  text-align: center;
}
.brand-footer {
  margin: 0;
  font-size: 1.05rem;
}
.footer-note {
  margin: 0;
  color: #9d8d78;
  font-size: 0.86rem;
  max-width: 46em;
  margin-inline: auto;
}
.footer-links {
  margin: 0.4rem 0 0;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
  .nav {
    display: none;
  }
  .topbar-inner {
    justify-content: space-between;
  }
  .brand {
    margin-right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------- The phone guide ---------- */

.section-lead {
  margin: -1.2rem 0 2rem;
  max-width: 44em;
  color: var(--parchment-text);
}

/* The list beside the phone it describes: on a narrow screen the picture drops under the list rather than shrinking
 * into a thumbnail nobody can read the buttons in. */
.touch-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.touch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}
.touch-list li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(104, 72, 32, 0.6);
}
.touch-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
/* The buttons are drawn as the game draws them, so the name on the page looks like the thing under the thumb. */
.touch-key {
  display: inline-block;
  text-align: center;
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--ink);
  background: linear-gradient(180deg, var(--stone-lighter), var(--stone) 60%, var(--shadow));
  border: 1px solid var(--bevel-dark);
  box-shadow: inset 1px 1px 0 var(--stone-highlight), inset -1px -1px 0 var(--shadow-deep);
  padding: 0.3rem 0.5rem;
  white-space: nowrap;
}
.touch-list p {
  margin: 0;
  font-size: 0.97rem;
}
.touch-shot {
  position: sticky;
  top: 80px;
  margin: 0;
  background: var(--stone);
  border: 1px solid var(--bevel-dark);
  box-shadow:
    inset 2px 2px 0 var(--stone-highlight),
    inset -2px -2px 0 var(--shadow-deep),
    0 10px 30px rgba(0, 0, 0, 0.55);
  padding: 10px;
}
.touch-shot figcaption {
  font-size: 0.82rem;
  color: var(--ink-soft);
  text-align: center;
  padding-top: 8px;
}

@media (max-width: 860px) {
  .touch-guide {
    grid-template-columns: 1fr;
  }
  .touch-shot {
    position: static;
    max-width: 300px;
    margin-inline: auto;
  }
  .touch-list li {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .touch-key {
    justify-self: start;
  }
}
