/* Countrio: the page's own layer over the engine floor.
   Six tokens and one face. Navy is the ground (the Illuminated sea); cream,
   parchment and gold are the game's own palette constants, not a mood. */

@font-face {
  font-family: "EB Garamond";
  src: url("/assets/eb-garamond-500-f85bd65edb.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("/assets/eb-garamond-700-46866c5597.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --sc-canvas: #0b1b26;
  --sc-surface: #12283a;
  --sc-ink: #fae8bd;
  --sc-ink-soft: #d3b47f;
  --sc-accent: #daa544;
  --sc-accent-ink: #1b1307;
  --sc-font-display: "EB Garamond", Georgia, "Times New Roman", serif;
  --sc-font-text: "EB Garamond", Georgia, "Times New Roman", serif;

  --gut: clamp(20px, 5vw, 76px);
  --top: calc(env(safe-area-inset-top, 0px) + 76px);
  --ink-dark: #2b1d0e;
  --paper: #f4e4c1;
  --title-gold: #ffd67a;
  --halo: #c14a34;
  --shade: 8 20 29;
  --wood: 12 8 5;
}

body { font-weight: 500; }

/* ------------------------------------------------------------- stage -- */
.stage {
  position: fixed;
  left: 0; top: 0;
  width: 100%;
  height: 100lvh;
  z-index: var(--sc-z-stage);
  overflow: hidden;
  background: #160c06;
}
.stage__map { width: 100%; height: 100%; }

/* Objects on the desk. Sized in px at their resting framing and moved by the
   same camera matrix as the canvas. */
.plane {
  position: absolute;
  left: 0; top: 0;
  transform-origin: 0 0;
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity;
  pointer-events: none;
}
.plane img { position: absolute; max-width: none; }
.plane--cairo { filter: drop-shadow(10px 16px 14px rgb(0 0 0 / 0.55)); }
.plane__frame { inset: 0; width: 100%; height: 100%; }
.plane__paint { left: 18.3%; top: 13.5%; width: 63.2%; height: auto; }

.plane--passport { filter: drop-shadow(14px 22px 18px rgb(0 0 0 / 0.6)); }
.passport__book { inset: 0; width: 100%; height: 100%; }
.passport__stamp {
  width: 15.4%;
  height: auto;
  opacity: 0;
  transform: rotate(var(--r, 0deg)) scale(1.3);
  transition: opacity 240ms ease-out, transform 320ms cubic-bezier(.2, .9, .25, 1.2);
}
.passport__stamp[data-stamp="ch"] { left: 11.5%; top: 11%; --r: -7deg; }
.passport__stamp[data-stamp="eg"] { left: 29%; top: 14%; --r: 5deg; }
.passport__stamp[data-stamp="np"] { left: 12.5%; top: 52%; --r: 4deg; }
.passport__stamp[data-stamp="nz"] { left: 29.5%; top: 50%; --r: -5deg; }
.passport__stamp.is-inked { opacity: 1; transform: rotate(var(--r)) scale(1); }
.passport__stamp.is-faded {
  opacity: 0.34;
  transform: rotate(var(--r)) scale(1);
  filter: grayscale(0.75) sepia(0.25);
}
.passport__title,
.passport__inked {
  position: absolute;
  left: 55%;
  width: 36%;
  margin: 0;
  color: var(--ink-dark);
  text-align: center;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
  line-height: 1.15;
}
.passport__title { top: 16%; font-size: calc(var(--pw, 480px) * 0.034); font-weight: 700; }
.passport__inked { top: 27%; font-size: calc(var(--pw, 480px) * 0.03); color: #6b4a1f; }

/* ----------------------------------------------------------- chrome -- */
.skip {
  position: fixed;
  left: var(--gut); top: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--sc-ink);
  color: var(--ink-dark);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-180%);
}
.skip:focus-visible { transform: none; }

.brand {
  position: fixed;
  left: var(--gut);
  top: calc(env(safe-area-inset-top, 0px) + 20px);
  z-index: var(--sc-z-chrome);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 16px 5px 5px;
  border-radius: 999px;
  background: rgb(var(--shade) / 0.8);
  color: var(--sc-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}
.brand img { width: 36px; height: 36px; }

.locator {
  position: fixed;
  right: var(--gut);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  z-index: var(--sc-z-chrome);
  color: var(--sc-ink);
}
.locator__toggle { display: none; }
.locator__panel {
  width: 266px;
  padding: 12px 12px 10px;
  border: 1px solid rgb(218 165 68 / 0.38);
  border-radius: 14px;
  background: rgb(var(--shade) / 0.88);
  box-shadow: 0 18px 40px -22px rgb(0 0 0 / 0.9);
}
.locator__map {
  width: 240px;
  height: 106px;
  border-radius: 6px;
  cursor: pointer;
}
.locator__stops {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: space-between;
  gap: 2px 6px;
  margin: 10px 0 6px;
  padding: 0;
  list-style: none;
}
.locator__stops button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  font-size: 1.02rem;
  line-height: 1.1;
}
.locator__stops button:hover { background: rgb(250 232 189 / 0.08); }
.locator__stops button[aria-current] { color: var(--title-gold); }
.locator__stops i {
  flex: none;
  width: 10px; height: 10px;
  border: 1.5px solid var(--sc-accent);
  border-radius: 50%;
}
.locator__stops .is-inked i { background: var(--sc-accent); }
.locator__stops .is-faded i { background: rgb(218 165 68 / 0.3); }
.locator__end { grid-column: 1 / -1; }
.locator__end button { color: var(--sc-ink-soft); }
.locator__scale {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 6px 0;
  font-size: 0.86rem;
  color: var(--sc-ink-soft);
  font-variant-numeric: lining-nums tabular-nums;
}
.locator__bar {
  display: block;
  height: 6px;
  width: 60px;
  border: 1.5px solid currentColor;
  border-top: 0;
}

/* ------------------------------------------------------------ copy -- */
.copylayer {
  position: fixed;
  inset: 0;
  z-index: var(--sc-z-copy);
  pointer-events: none;
}
.sc-ready .scrim,
.sc-ready .answers { opacity: 0; }
.scrim { position: absolute; inset: 0; pointer-events: none; will-change: opacity; }
.answers { will-change: opacity, transform; }

.slot {
  position: absolute;
  left: var(--gut);
  top: var(--top);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 40px);
  width: min(31rem, 38vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  pointer-events: none;
}
.slot--hero { width: min(34rem, 39vw); }
.slot--trail { left: auto; right: var(--gut); width: min(27rem, 31vw); }

.copy h1,
.copy h2 {
  margin: 0;
  font-family: var(--sc-font-display);
  font-weight: 500;
  color: var(--sc-ink);
  text-wrap: balance;
}
.copy h1 {
  font-size: clamp(2.6rem, 4.9vw, 4.9rem);
  line-height: 1.0;
  letter-spacing: -0.012em;
}
.copy h2 {
  font-size: clamp(2rem, 3.1vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -0.008em;
}
.copy p {
  margin: 14px 0 0;
  max-width: 30rem;
  font-size: clamp(1.14rem, 1.35vw, 1.34rem);
  line-height: 1.42;
  color: var(--sc-ink-soft);
  text-wrap: pretty;
}
.copy .lede { margin-top: 20px; font-size: clamp(1.22rem, 1.55vw, 1.5rem); color: var(--sc-ink); }

.greeting {
  font-weight: 700;
  font-size: clamp(3.2rem, 6.2vw, 5.8rem) !important;
  line-height: 1 !important;
  color: var(--title-gold) !important;
  letter-spacing: 0.01em;
}
.greeting .k { display: inline-block; white-space: pre; will-change: transform, opacity; }

.reveal {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--sc-ink) !important;
  font-size: clamp(1.5rem, 2.2vw, 2.1rem) !important;
  line-height: 1.15 !important;
}
.reveal .verdict__stamp { width: 52px; }
.reveal { opacity: 0; transition: opacity 360ms ease-out; }
.reveal.is-shown { opacity: 1; }
.caps { font-variant-caps: all-small-caps; letter-spacing: 0.06em; }

.count { font-variant-numeric: lining-nums tabular-nums; color: var(--title-gold); }
.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.copy .small { margin-top: 18px; font-size: 0.98rem; color: var(--sc-ink-soft); }
.copy .small a { color: var(--sc-ink); }

/* ------------------------------------------------------------ stores -- */
/* Both stores' own badges, unaltered, at least 40px tall and with a quarter of
   their height clear around them. Google's file carries that clear space
   inside it — a 564x168 badge with 41px all round, so the badge is 67.2% of
   the image's height — and Apple's does not. So the Play image is drawn
   1/0.672 taller for the two badges themselves to come out the same height,
   and the row's gap keeps the clear space Apple's needs. */
.badges { --badge-h: 54px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 28px; }
.store { display: block; flex: none; border-radius: 9px; transition: transform 220ms ease-out; }
.store:hover { transform: translateY(-2px); }
.store img { display: block; width: auto; height: var(--badge-h); }
.store--play { margin: calc(var(--badge-h) / -4); }
.store--play img { height: calc(var(--badge-h) / 0.672); }

/* The live site's footer links, kept on the page that would replace it.
   Padded so each one is at least 24px tall. */
.copy .foot-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 14px; font-size: 0.98rem; }
.copy .foot-links a { display: inline-block; padding: 3px 0; color: var(--sc-ink); }

/* ------------------------------------------------------------ answers -- */
.tiles { display: grid; gap: 10px; max-width: 22rem; }
.tile,
.card {
  position: relative;
  border: 1px solid rgb(58 42 23 / 0.55);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink-dark);
  cursor: pointer;
  box-shadow: 0 12px 26px -16px rgb(0 0 0 / 0.9);
  transition: transform 200ms ease-out, background-color 200ms ease-out;
}
.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 10px 18px 10px 12px;
  font-size: 1.36rem;
  font-weight: 700;
  text-align: left;
}
.tile img { width: 44px; height: 33px; border-radius: 3px; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.18); }
.tile:hover:not([aria-disabled="true"]),
.card:hover:not([aria-disabled="true"]) { transform: translateY(-2px); }
.tile[aria-disabled="true"],
.card[aria-disabled="true"] { cursor: default; }
.is-right { background: #ecb04d; border-color: #8a5a14; }
.is-wrong { background: var(--halo); border-color: #7d2618; color: #fff4e4; }
.is-dim { opacity: 0.55; }

.tiles--flags { grid-template-columns: repeat(3, 1fr); max-width: 30rem; gap: 12px; }
.card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 6px 6px 8px;
  font-size: 1.02rem;
  font-weight: 700;
}
.card img { width: 100%; height: auto; border-radius: 6px; }

.verdict {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  margin: 14px 0 0;
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--sc-ink);
}
.verdict__stamp {
  flex: none;
  width: 50px;
  height: auto;
  opacity: 0;
  transform: rotate(-8deg) scale(1.35);
  transition: opacity 220ms ease-out, transform 300ms cubic-bezier(.2, .9, .25, 1.25);
}
.is-inked > .verdict__stamp { opacity: 1; transform: rotate(-8deg) scale(1); }
.is-faded > .verdict__stamp {
  opacity: 0.38;
  transform: rotate(-8deg) scale(1);
  filter: grayscale(0.75) sepia(0.25);
}

/* ------------------------------------------------------------ scrims -- */
.scrim[data-place="hero"] {
  background: linear-gradient(90deg, rgb(var(--wood) / 0.62) 0%, rgb(var(--wood) / 0.36) 34%, transparent 52%);
}
.scrim[data-place="lead"],
.scrim[data-place="split"] {
  background: linear-gradient(90deg,
    rgb(var(--shade) / 0.93) 0%, rgb(var(--shade) / 0.88) 33%,
    rgb(var(--shade) / 0.55) 48%, transparent 62%);
}
.scrim[data-place="trail"] {
  background: linear-gradient(270deg,
    rgb(var(--shade) / 0.93) 0%, rgb(var(--shade) / 0.88) 30%,
    rgb(var(--shade) / 0.55) 42%, transparent 56%);
}
.scrim[data-place="close"] {
  background: linear-gradient(90deg, rgb(var(--wood) / 0.7) 0%, rgb(var(--wood) / 0.5) 34%, transparent 50%);
}

/* ------------------------------------------------------------- glass -- */
.glass {
  position: absolute;
  left: 0; top: 0;
  width: var(--g, 300px);
  height: var(--g, 300px);
  z-index: 5;
  transform-origin: 35.05% 33.52%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity;
  filter: drop-shadow(16px 22px 16px rgb(0 0 0 / 0.5));
}
.glass__lens {
  position: absolute;
  left: 11.05%; top: 9.52%;
  width: 48%; height: 48%;
  border-radius: 50%;
}
.glass__body { position: absolute; inset: 0; width: 100%; height: 100%; }

/* The track is the whole document flow, and it is empty. */
.track__leg { pointer-events: none; }

/* -------------------------------------------------------- portrait -- */
[data-layout="portrait"] {
  --gut: 20px;
  --top: calc(env(safe-area-inset-top, 0px) + 70px);
}
[data-layout="portrait"] .brand { font-size: 1.3rem; }
[data-layout="portrait"] .brand img { width: 30px; height: 30px; }
[data-layout="portrait"] .slot {
  left: var(--gut);
  right: var(--gut);
  width: auto;
  justify-content: flex-start;
  gap: 16px;
}
[data-layout="portrait"] .slot[data-place="hero"],
[data-layout="portrait"] .slot[data-place="trail"],
[data-layout="portrait"] .slot[data-place="close"] { justify-content: flex-end; }
[data-layout="portrait"] .slot[data-place="split"] { justify-content: space-between; }
[data-layout="portrait"] .copy h1 { font-size: clamp(2.3rem, 10.4vw, 3.4rem); }
[data-layout="portrait"] .copy h2 { font-size: clamp(1.7rem, 7.4vw, 2.4rem); }
[data-layout="portrait"] .copy p { margin-top: 10px; font-size: 1.1rem; line-height: 1.38; }
[data-layout="portrait"] .copy .lede { margin-top: 14px; font-size: 1.18rem; }
[data-layout="portrait"] .badges { --badge-h: 50px; margin-top: 20px; gap: 12px 16px; }
[data-layout="portrait"] .copy .foot-links { margin-top: 8px; gap: 0 16px; font-size: 0.9rem; }
[data-layout="portrait"] .tiles { max-width: none; gap: 8px; }
[data-layout="portrait"] .tile { min-height: 50px; font-size: 1.22rem; padding: 7px 14px 7px 10px; }
[data-layout="portrait"] .tile img { width: 38px; height: 28px; }
[data-layout="portrait"] .tiles--flags { gap: 8px; }
[data-layout="portrait"] .card { font-size: 0.95rem; padding: 4px 4px 6px; }
[data-layout="portrait"] .verdict { min-height: 50px; margin-top: 8px; font-size: 1.12rem; }
[data-layout="portrait"] .verdict__stamp { width: 40px; }
[data-layout="portrait"] .greeting { font-size: clamp(2.8rem, 13vw, 4rem) !important; }
[data-layout="portrait"] .reveal { font-size: 1.45rem !important; }
[data-layout="portrait"] .copy .small { margin-top: 12px; font-size: 0.9rem; line-height: 1.35; }

[data-layout="portrait"] .scrim[data-place="hero"] {
  background: linear-gradient(0deg, rgb(var(--wood) / 0.9) 0%, rgb(var(--wood) / 0.8) 36%, rgb(var(--wood) / 0.4) 50%, transparent 62%);
}
[data-layout="portrait"] .scrim[data-place="lead"] {
  background: linear-gradient(180deg, rgb(var(--shade) / 0.94) 0%, rgb(var(--shade) / 0.86) 30%, rgb(var(--shade) / 0.5) 42%, transparent 54%);
}
[data-layout="portrait"] .scrim[data-place="trail"],
[data-layout="portrait"] .scrim[data-place="close"] {
  background: linear-gradient(0deg, rgb(var(--shade) / 0.95) 0%, rgb(var(--shade) / 0.88) 30%, rgb(var(--shade) / 0.5) 44%, transparent 56%);
}
[data-layout="portrait"] .scrim[data-place="close"] {
  background: linear-gradient(0deg, rgb(var(--wood) / 0.9) 0%, rgb(var(--wood) / 0.82) 40%, rgb(var(--wood) / 0.4) 54%, transparent 64%);
}
[data-layout="portrait"] .scrim[data-place="split"] {
  background: linear-gradient(180deg,
    rgb(var(--shade) / 0.94) 0%, rgb(var(--shade) / 0.84) 20%, transparent 34%,
    transparent 50%, rgb(var(--shade) / 0.84) 64%, rgb(var(--shade) / 0.95) 100%);
}

[data-nav="pill"] .locator {
  top: calc(env(safe-area-inset-top, 0px) + 20px);
  bottom: auto;
  right: var(--gut);
}
[data-nav="pill"] .locator__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid rgb(218 165 68 / 0.45);
  border-radius: 999px;
  background: rgb(var(--shade) / 0.86);
  cursor: pointer;
  font-size: 1.05rem;
}
.locator__pin {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--sc-accent);
  box-shadow: 0 0 0 3px rgb(218 165 68 / 0.28);
}
[data-nav="pill"] .locator__panel { display: none; margin-top: 8px; }
[data-nav="pill"] .locator.is-open .locator__panel { display: block; }

/* ---------------------------------------------------- reduced motion -- */
@media (prefers-reduced-motion: reduce) {
  .passport__stamp,
  .verdict__stamp,
  .tile,
  .card,
  .store { transition: none; }
  .reveal { transition: none; }
  .greeting .k,
  .answers { transform: none !important; }
}
