/* Tarn Software. Palette taken from the logo (assets/tarn-*.svg): night sky, snow peaks, glacier shade,
   periwinkle moon and water. The home page is the tarn itself: a horizon through the logo's own shoreline,
   sky above, water below. Type is Jost, a geometric sans that matches the wordmark's letterforms. */
:root {
  --night: #1c1f2a;   /* logo background */
  --slate: #2a2f40;   /* icon tile */
  --lake: #151823;    /* the night, a shade deeper, for water */
  --snow: #f2f3f7;    /* peaks, wordmark */
  --glacier: #c3cbe6; /* peak shade */
  --moon: #8fa6f5;    /* moon, water, shoreline */
  --mist: #c9d4fb;    /* the moon's reflection */

  --measure: 760px;
  --font: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--lake);
  color: var(--glacier);
  font: 400 18px/1.65 var(--font);
  font-kerning: normal;
}
img, svg { display: block; max-width: 100%; }

a { color: var(--moon); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--mist); }
:focus-visible { outline: 2px solid var(--moon); outline-offset: 4px; border-radius: 4px; }

h1, h2, h3 { color: var(--snow); margin: 0; }
h2 { font-weight: 300; font-size: clamp(30px, 4.4vw, 40px); line-height: 1.15; letter-spacing: 0.01em; }
h3 { font-weight: 500; font-size: 28px; line-height: 1.2; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--snow); color: var(--night); padding: 8px 14px; }

/* ---- The tarn (home hero) -------------------------------------------------------------------------- */
.tarn {
  --horizon: 52%;
  --mark: clamp(190px, 34vw, 330px);
  position: relative;
  height: clamp(560px, 86vh, 820px);
  overflow: hidden;
  /* Sky lightens a touch toward the horizon; the water starts darker and deepens. */
  background:
    linear-gradient(to bottom, #191c27 0%, var(--night) 40%, #232838 var(--horizon),
                    #12141d var(--horizon), var(--lake) 100%);
}
.horizon {
  position: absolute;
  left: 0; right: 0;
  top: var(--horizon);
  height: 2px;
  margin-top: -1px;
  background: linear-gradient(90deg, transparent 0%, var(--moon) 18%, var(--moon) 82%, transparent 100%);
  transform-origin: 50% 50%;
}
.tarn .mark {
  position: absolute;
  left: 50%;
  top: var(--horizon);
  width: var(--mark);
  height: auto;
  /* The mark's own shoreline sits at exactly half its height, so centring it puts it on the horizon. */
  transform: translate(-50%, -50%);
}
.tarn-copy {
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--horizon) + var(--mark) * 0.3875 + 36px);
  text-align: center;
  padding: 0 16px;
}
.tarn-copy h1 { margin: 0 auto; width: clamp(200px, 34vw, 340px); }
.tarn-copy h1 img { width: 100%; height: auto; }
.tarn-copy p {
  margin: 22px 0 0;
  color: var(--glacier);
  font-weight: 300;
  font-size: clamp(17px, 2vw, 20px);
  letter-spacing: 0.04em;
}

/* One moment on arrival: the horizon draws out from the centre, then the reflection settles on the water.
   Visible is the resting state; the animation starts from hidden, so anything that stops it shows the page. */
@media (prefers-reduced-motion: no-preference) {
  .horizon { animation: draw 1.6s cubic-bezier(0.22, 0.7, 0.2, 1) 0.2s both; }
  .tarn .reflection { animation: settle 1.4s ease-out 1.1s both; }
}
@keyframes draw { from { transform: scaleX(0); } }
@keyframes settle { from { opacity: 0; } }

@media (max-width: 600px) {
  .tarn { --horizon: 46%; height: 600px; }
}

/* ---- Page body --------------------------------------------------------------------------------------- */
.page { max-width: calc(var(--measure) + 32px); margin: 0 auto; padding: 72px 16px 24px; }
.page section + section { margin-top: 88px; }
.page h2 { margin-bottom: 28px; }

/* Games: a list that grows one row per game, each row divided from the next like a shoreline. */
.games { list-style: none; margin: 0; padding: 0; }
.game {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 28px;
  align-items: start;
  padding: 32px 0;
  border-top: 1px solid var(--slate);
}
.game:last-child { border-bottom: 1px solid var(--slate); }
.game-icon img { width: 112px; height: 112px; border-radius: 24px; }
.game h3 a { color: var(--snow); text-decoration: none; }
.game h3 a:hover { color: var(--mist); text-decoration: underline; text-decoration-color: var(--moon); }
.game h3 { margin-bottom: 8px; }
/* A game's release state: plain text (it is not a link), marked with a small moon. */
.status { color: var(--glacier); font-size: 16px; margin: 0; display: flex; align-items: center; gap: 10px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--moon); flex: none; }

@media (max-width: 520px) {
  .game { grid-template-columns: 80px 1fr; gap: 18px; }
  .game-icon img { width: 80px; height: 80px; border-radius: 18px; }
  h3 { font-size: 24px; }
}

/* ---- Sub-page chrome --------------------------------------------------------------------------------- */
.bar { background: var(--night); border-bottom: 1px solid var(--slate); }
.bar-inner { max-width: calc(var(--measure) + 32px); margin: 0 auto; padding: 14px 16px; }
.home { display: inline-block; }
.home img { height: 40px; width: auto; }
.sub { background: var(--night); }
.sub .page { padding-top: 56px; }

.crumb { margin: 0 0 14px; font-size: 16px; }
.crumb a { text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

/* Game page header */
.game-head { display: grid; grid-template-columns: 144px 1fr; gap: 32px; align-items: center; }
.game-head img { width: 144px; height: 144px; border-radius: 32px; }
.game-head h1 { font-weight: 400; font-size: clamp(40px, 7vw, 60px); line-height: 1.05; margin-bottom: 12px; }
.lead { color: var(--snow); font-size: 20px; font-weight: 300; margin-bottom: 10px; }
@media (max-width: 560px) {
  .game-head { grid-template-columns: 1fr; gap: 20px; }
  .game-head img { width: 112px; height: 112px; border-radius: 24px; }
}

/* Screenshots: wider than the text column on big screens so all four show, a row that scrolls sideways on
   narrow ones rather than shrinking to stamps. */
.shots {
  list-style: none;
  width: min(1040px, calc(100vw - 32px));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 56px 0 0;
  padding: 0 0 12px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--slate) transparent;
}
.shots li { scroll-snap-align: start; }
.shots + section { margin-top: 80px; }
.shots img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--slate); }

.features { padding-left: 20px; margin: 0 0 1em; }
.features li { margin-bottom: 6px; }
.features li::marker { color: var(--moon); }

/* Policy text */
.doc h1 { font-weight: 400; font-size: clamp(34px, 5.6vw, 48px); line-height: 1.1; margin-bottom: 8px; }
.doc .meta { color: var(--glacier); opacity: 0.8; font-size: 16px; margin-bottom: 40px; }
.doc h2 { font-size: 26px; font-weight: 400; margin: 44px 0 14px; }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.doc li::marker { color: var(--moon); }
.doc strong { color: var(--snow); font-weight: 500; }
code { font-family: inherit; color: var(--snow); background: var(--slate); padding: 1px 6px; border-radius: 5px; font-size: 0.92em; }

/* ---- Footer ------------------------------------------------------------------------------------------ */
.foot {
  max-width: calc(var(--measure) + 32px);
  margin: 96px auto 0;
  padding: 28px 16px 40px;
  border-top: 1px solid var(--slate);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  font-size: 15px;
  color: var(--glacier);
}
.foot svg { width: 36px; height: auto; }
.foot p { margin: 0; }
.foot .links { margin-left: auto; display: flex; gap: 24px; }
@media (max-width: 520px) { .foot .links { margin-left: 0; width: 100%; } }
