/* gamakon — navigate the frontier
   Phone-first, Instagram-story feed: every tile fills the screen,
   dots at the top of each story, swipe right through tiles,
   swipe down to the next story.
   One family: Latin Modern Roman, self-hosted (the old CDN was a 404 —
   only machines with LaTeX installed ever saw it, and Safari blocks
   local fonts). Slate + antique gold. */

@font-face {
  font-family: "Latin Modern";
  src: url("../assets/fonts/LM-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Latin Modern";
  src: url("../assets/fonts/LM-bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Latin Modern";
  src: url("../assets/fonts/LM-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Latin Modern";
  src: url("../assets/fonts/LM-bold-italic.woff2") format("woff2");
  font-weight: 700; font-style: italic; font-display: swap;
}

/* Latin Modern Sans (demi-condensed) — narrow companion for body copy */
@font-face {
  font-family: "Latin Modern Sans";
  src: url("../assets/fonts/LMSans-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Latin Modern Sans";
  src: url("../assets/fonts/LMSans-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --bg: #273641;
  --bg-deep: #1e2a33;
  --card: #1e2d36;
  --text: #e8ecff;
  --muted: #97a3ac;
  --accent: #b8a160;
  --accent-bright: #d4bd7a;
  --hairline: rgba(255, 255, 255, 0.10);
  --gold-hairline: rgba(184, 161, 96, 0.25);
  --serif: "Latin Modern", Georgia, serif;
  /* narrow sans for white body copy — Latin Modern Sans (demi-condensed),
     with narrow system fallbacks if the webfont hasn't loaded */
  --sans: "Latin Modern Sans", "Arial Narrow", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --nav-h: 3.1rem;
  /* max width of the story-feed column — keeps wide monitors from sprawling */
  --feed-max: 46rem;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  /* root bumped 16->18px so every rem-based size scales up a touch */
  font-size: 18px;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1.06rem;
}

/* gold display type stays in the Latin Modern serif; white body copy is sans */
h1, h2, h3,
.hero-name, .hero-byline, .kicker, .door { font-family: var(--serif); }

.mono { font-family: var(--mono); }

/* ======================= HERO — the dark water ======================= */

.hero {
  height: 100svh;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 42%,
              #2e4050 0%, var(--bg) 55%, var(--bg-deep) 100%);
}

.hero-doors {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 1.4rem 1.5rem;
}

.door {
  font-size: 1.05rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.04em;
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s;
}

.door:hover { color: var(--accent-bright); border-color: var(--accent-bright); }

.hero-center { text-align: center; padding: 0 2rem; }

.hero-logo {
  width: min(62vw, 300px);
  height: auto;
  display: block;
  margin: 0 auto 1.6rem;
}

.hero-name {
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--accent-bright);
  letter-spacing: 0.01em;
}

.hero-byline {
  font-style: italic;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-top: 0.3rem;
}

/* ======================= FIXED NAV (appears after the hero) ============ */

.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1.4rem, 6vw, 3rem);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.topnav.visible { transform: none; }

.topnav a {
  font-size: 1.02rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.03em;
  padding-bottom: 0.15rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.topnav a.active {
  color: var(--accent-bright);
  border-color: var(--accent-bright);
}

/* ======================= STORIES (vertical feed) ======================= */

.row {
  height: 100svh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding-top: var(--nav-h);
}

/* dots — the story control panel, centered at the top like a story */
.dots {
  order: -1;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 0.9rem 1rem 0.8rem;
}

.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.dot.active {
  background: var(--accent-bright);
  transform: scale(1.25);
}

.row-head {
  padding: 0 1.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.8rem;
}

.row-head h2 {
  font-size: 1.45rem;
  color: var(--accent-bright);
  font-weight: 700;
}

.row-sub {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.counter { display: none; }

/* ======================= TILES (horizontal story) ====================== */

.carousel {
  flex: 1;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;              /* the swipe is the interface */
  -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }

.card {
  flex: 0 0 100%;
  min-width: 100%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  /* safe center: when a card is taller than the viewport (Chrome's smaller
     mobile viewport), align to the top and scroll instead of clipping the
     kicker off the top edge */
  justify-content: safe center;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: none;
  /* extra side room so the rail arrows sit outside the text column */
  padding: 1.2rem 2.9rem 3rem;
  background: transparent;
  border: 0;
}
.card::-webkit-scrollbar { display: none; }

/* readable column inside the full-bleed tile */
.card > * {
  width: 100%;
  max-width: 30rem;
  margin-left: auto;
  margin-right: auto;
}

.kicker {
  font-size: 0.92rem;
  color: var(--accent);
  font-style: italic;
  letter-spacing: 0.05em;
  margin-bottom: 0.8rem;
}

.card h3 {
  font-size: 1.9rem;
  color: var(--accent-bright);
  line-height: 1.22;
  margin-bottom: 0.9rem;
  font-weight: 700;
}

.lede {
  color: var(--text);
  font-size: 1.04rem;
  margin-bottom: 1.1rem;
}

.facts { list-style: none; margin-bottom: 1.1rem; }

.facts li {
  color: var(--muted);
  font-size: 0.95rem;
  padding-left: 1.35rem;
  position: relative;
  margin-bottom: 0.45rem;
}

.facts li::before {
  content: "\2192";           /* → */
  position: absolute;
  left: 0;
  color: var(--accent);
}

.card-link {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--accent-bright);
  text-decoration: none;
  letter-spacing: 0.03em;
  margin-top: 0.4rem;
}
.card-link:hover { color: #e8d48a; }

/* transaction tile — the till at the end of every story */

.card-cta { background: var(--card); }

.cta {
  display: block;
  text-align: center;
  font-size: 1.05rem;
  color: var(--bg-deep);
  background: var(--accent-bright);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  text-decoration: none;
  font-weight: 700;
}
.cta:hover { background: #e8d48a; }

.cta-quiet {
  background: transparent;
  color: var(--accent-bright);
  border: 1px solid var(--gold-hairline);
  margin-top: 0.6rem;
  font-weight: 400;
}
.cta-quiet:hover { background: rgba(184, 161, 96, 0.08); }

.mono-snippet {
  font-family: var(--mono);
  color: var(--accent-bright);
  background: var(--bg-deep);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* ======================= FOOTER ======================= */

.foot {
  scroll-snap-align: end;
  border-top: 1px solid var(--hairline);
  padding: 2rem 1.5rem 2.4rem;
  text-align: center;
  color: var(--muted);
}

.foot a { color: var(--accent); text-decoration: none; }
.foot a:hover { color: var(--accent-bright); }
.foot-small { font-size: 0.85rem; opacity: 0.75; margin-top: 0.5rem; }

/* ======================= DETAIL PAGES ======================= */

.detail {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.2rem 1.5rem 4rem;
}

.return {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  margin: 0.6rem 0 1.8rem;
}
.return:hover { color: var(--accent-bright); }

.detail h1 {
  font-size: 2.1rem;
  color: var(--accent-bright);
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.detail .dek {
  font-style: italic;
  font-size: 1.15rem;
  color: var(--muted);
  margin-bottom: 1.6rem;
}

.detail figure { margin: 1.6rem 0; }

.detail img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: #fff;
}

.detail figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.55rem;
  font-style: italic;
}

.detail h2 {
  font-size: 1.35rem;
  color: var(--accent-bright);
  margin: 1.8rem 0 0.6rem;
}

.detail p { margin-bottom: 0.9rem; }
.detail p a { color: var(--accent-bright); }

.detail table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0 1.4rem;
  font-size: 0.92rem;
}

.detail th, .detail td {
  text-align: left;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--hairline);
}

.detail th {
  color: var(--accent);
  font-weight: 700;
}

.detail td.num, .detail th.num { text-align: right; font-family: var(--mono); font-size: 0.88rem; }

.detail .facts { margin: 0.4rem 0 1.2rem; }

.detail-cta-block {
  margin-top: 2.2rem;
  border: 1px solid rgba(184, 161, 96, 0.55);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  background: var(--card);
}

.detail-cta-block .cta { margin-top: 0.9rem; }

.smallprint { font-size: 0.85rem; color: var(--muted); }

/* ======================= WIDER SCREENS ======================= */

@media (min-width: 700px) {
  .card > * { max-width: 34rem; }
  .card h3 { font-size: 2.3rem; }
  .row-head { padding-left: 2.2rem; }
}

/* ============ FILMSTRIP: shaded moving strip + thin gold edge =========== */
/* The carousel is the strip that moves; give it a slightly deeper inky-blue
   than the surround, and a single clean gold hairline across the top. */
.carousel {
  background:
    linear-gradient(rgba(184, 161, 96, 0.6), rgba(184, 161, 96, 0.6))
      top left / 100% 1px no-repeat,
    color-mix(in srgb, var(--bg) 93%, #000);
  box-shadow: inset 0 9px 13px -11px rgba(0, 0, 0, 0.5);
}

/* ============ GOLD RAIL ARROWS: swipe affordance, embossed ============== */
.row { position: relative; }

.rail-arrow {
  position: absolute;
  top: 58%;
  transform: translateY(-50%);
  width: 34px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  z-index: 4;
  opacity: 0.55;
  transition: opacity 0.25s;
}
.rail-arrow:hover { opacity: 1; }

.rail-arrow::before {
  content: "";
  width: 12px;
  height: 12px;
  border-style: solid;
  border-color: var(--accent-bright);
  /* dark drop + light top edge = softly embossed into the strip */
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.55))
          drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.12));
}

/* wide screens: pull the story-feed into a centered column, not full-bleed */
.row-head,
.carousel {
  max-width: var(--feed-max);
  margin-inline: auto;
  width: 100%;
}

/* keep the rail arrows at the edges of that column, not the viewport */
.rail-left  { left:  max(0.35rem, calc((100% - var(--feed-max)) / 2 + 0.35rem)); }
.rail-right { right: max(0.35rem, calc((100% - var(--feed-max)) / 2 + 0.35rem)); }
.rail-left::before  { border-width: 0 0 2px 2px; transform: rotate(45deg);  margin-left: 3px; }
.rail-right::before { border-width: 2px 2px 0 0; transform: rotate(45deg); margin-right: 3px; }

/* fade the arrow that has nowhere left to go */
.carousel.at-start ~ .rail-left,
.carousel.at-end   ~ .rail-right {
  opacity: 0;
  pointer-events: none;
}
