/* ABOUTME: Single stylesheet for the Oakferry Games site. Holds the studio
   shell, the per-game palette blocks, and the shared components. */

/* ---------- fonts (self-hosted; the site loads nothing from anyone else) --- */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('../fonts/bricolage-latin.woff2') format('woff2-variations');
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: 'Familjen Grotesk';
  src: url('../fonts/familjen-latin.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
}

/* ---------- tokens ------------------------------------------------------- */

:root {
  /* studio shell: near-black, so a game's own colour is the only colour in view */
  --shell-deep:  #06090d;
  --shell-bg:    #0a0f15;
  --shell-panel: #111820;
  --shell-line:  #1d2833;
  --shell-text:  #e9f1f5;
  --shell-dim:   #8fa3b0;

  --ink:      var(--shell-text);
  --dim:      var(--shell-dim);
  --bg:       var(--shell-bg);
  --deep:     var(--shell-deep);
  --panel:    var(--shell-panel);
  --line:     var(--shell-line);
  --accent:   #7fe9ff;
  --accent-2: #9bffb0;
  --warm:     #ffe39b;

  --measure: 68ch;
  --shell-max: 1120px;
  --radius: 18px;

  --display: 'Bricolage Grotesque', 'Familjen Grotesk', system-ui, sans-serif;
  --body: 'Familjen Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  color-scheme: dark;
}

/* Fathomling's palette, lifted from the app's Theme.kt so the site and the
   game are the same product. Applied by wrapping a page or section in
   .game-fathomling. */
.game-fathomling {
  --deep:     #021019;
  --bg:       #031b2e;
  --grad-top: #0a3a52;
  --panel:    #13414f;
  --panel-2:  #1e5e78;
  --line:     #10394c;
  --accent:   #7fe9ff;
  --accent-2: #9bffb0;
  --warm:     #ffe39b;
  --danger:   #ff4d6d;
  --ink:      #ffffff;
  --dim:      #a8c4d2;
}

/* ---------- base --------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--deep);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
  font-variation-settings: 'opsz' 48;
}

h1 { font-size: clamp(2.9rem, 9vw, 5.6rem); }
h2 { font-size: clamp(1.9rem, 4.6vw, 3rem); letter-spacing: -0.025em; }
h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.015em; }

p { margin: 0 0 1.1em; max-width: var(--measure); }

.wrap {
  width: min(100% - 2.5rem, var(--shell-max));
  margin-inline: auto;
}

.narrow { --shell-max: 760px; }

.eyebrow {
  font-family: var(--display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.lede { font-size: clamp(1.1rem, 2.1vw, 1.3rem); color: var(--dim); }

.dim { color: var(--dim); }

/* ---------- header ------------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--deep) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-head > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 66px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark .mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #ffffff 0%, var(--accent) 42%, #1c6f8c 100%);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 55%, transparent);
  flex: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-size: 0.94rem;
}

.site-nav a { color: var(--dim); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--ink); }

/* ---------- buttons ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: #04121b;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent);
}

.btn-primary:hover {
  color: #04121b;
  transform: translateY(-2px);
  box-shadow: 0 10px 34px -12px color-mix(in srgb, var(--accent) 75%, transparent);
}

.btn-ghost {
  background: transparent;
  border-color: color-mix(in srgb, var(--ink) 22%, transparent);
  color: var(--ink);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* the store button, honest about not being live yet */
.btn-soon {
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  border-color: color-mix(in srgb, var(--ink) 16%, transparent);
  color: var(--dim);
  cursor: default;
}

.btn-soon .play-mark { opacity: 0.55; }

.play-mark { width: 19px; height: 21px; flex: none; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: 2rem;
}

.btn-note {
  font-size: 0.86rem;
  color: var(--dim);
  margin: 0.9rem 0 0;
}

/* ---------- hero --------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(4rem, 12vh, 8rem) 0 clamp(3.5rem, 9vh, 6rem);
  background:
    radial-gradient(120% 80% at 50% -10%, var(--grad-top, #14202b) 0%, transparent 62%),
    linear-gradient(180deg, var(--bg) 0%, var(--deep) 100%);
  overflow: hidden;
}

.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.hero-inner { position: relative; }

.hero h1 { margin-bottom: 1.4rem; }

.hero h1 .glow {
  background: linear-gradient(102deg, var(--ink) 18%, var(--accent) 58%, var(--accent-2) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lede { max-width: 54ch; }

/* ---------- sections ----------------------------------------------------- */

section { position: relative; }

.band {
  padding: clamp(4rem, 10vh, 7rem) 0;
  border-top: 1px solid var(--line);
  background: var(--deep);
}

.band-raised { background: var(--bg); }

.section-head { margin-bottom: 3rem; max-width: 60ch; }
.section-head p { margin-bottom: 0; }

/* ---------- the depth rule: a dive log down the left of the game page ----- */

.depth-mark {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: color-mix(in srgb, var(--accent) 62%, transparent);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
}

.depth-mark::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 40%, transparent), transparent);
}

/* ---------- controls: the three-beat explanation of the whole game -------- */

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  counter-reset: beat;
}

.control {
  position: relative;
  padding: 1.9rem 1.5rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 42%, transparent), transparent);
  overflow: hidden;
}

.control::before {
  counter-increment: beat;
  content: '0' counter(beat);
  position: absolute;
  top: 1.1rem;
  right: 1.2rem;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: color-mix(in srgb, var(--ink) 26%, transparent);
}

.control h3 { margin-bottom: 0.45rem; color: var(--accent); }
.control p { margin: 0; color: var(--dim); font-size: 0.97rem; }

/* a small diagram: the orb and its direction of travel */
.control .orb-track {
  display: block;
  width: 100%;
  height: 54px;
  margin-bottom: 1.1rem;
}

/* ---------- feature rows ------------------------------------------------- */

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

.feature {
  padding: 1.8rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 28%, transparent);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-3px); }

.feature h3 { margin-bottom: 0.5rem; }
.feature p { margin: 0; color: var(--dim); font-size: 0.97rem; }

.feature .sigil { display: block; width: 34px; height: 34px; margin-bottom: 1rem; }

/* wide first card, for the claim that carries the most weight */
.features .feature-wide { grid-column: 1 / -1; }

@media (min-width: 860px) {
  .features { grid-template-columns: repeat(3, 1fr); }
  .features .feature-wide { grid-column: span 2; }
}

/* ---------- phone frames + screenshot rail ------------------------------- */

.shots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.2rem, 3vw, 2.4rem);
  padding: 0.5rem 0 1rem;
  max-width: 920px;
}

/* Below three columns the row becomes a swipeable rail. */
@media (max-width: 720px) {
  .shots {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--panel) transparent;
    padding-bottom: 2rem;
  }
  .shot { flex: none; width: 232px; scroll-snap-align: center; }
}

.shots::-webkit-scrollbar { height: 8px; }
.shots::-webkit-scrollbar-thumb { background: var(--panel); border-radius: 99px; }

.shot { min-width: 0; }

.phone {
  position: relative;
  border-radius: 30px;
  padding: 7px;
  background: linear-gradient(168deg, #2b3a45 0%, #0d1419 46%, #202d36 100%);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent) inset,
    0 26px 50px -26px rgba(0, 0, 0, 0.95);
}

.phone::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #05090c;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.phone img { border-radius: 24px; width: 100%; }

.shot figcaption {
  margin-top: 0.95rem;
  font-size: 0.88rem;
  color: var(--dim);
  line-height: 1.45;
}

/* ---------- game card (home page hero panel) ----------------------------- */

.game-panel {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  padding: clamp(1.8rem, 4vw, 3rem);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 26px;
  background:
    radial-gradient(90% 120% at 88% 8%, color-mix(in srgb, var(--grad-top, #0a3a52) 78%, transparent) 0%, transparent 68%),
    linear-gradient(158deg, #04202f 0%, #021019 78%);
  box-shadow: 0 40px 90px -50px #000;
}

@media (min-width: 800px) {
  .game-panel { grid-template-columns: 1.25fr 0.75fr; }
}

.game-panel .game-copy h2 {
  font-size: clamp(2.3rem, 5.4vw, 3.4rem);
  margin-bottom: 0.9rem;
}

.game-panel .tagline {
  color: var(--warm);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin-bottom: 1.1rem;
}

.game-panel .shot { width: min(228px, 100%); margin-inline: auto; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.36rem 0.85rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent-2) 40%, transparent);
  background: color-mix(in srgb, var(--accent-2) 10%, transparent);
  color: var(--accent-2);
  font-family: var(--display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: breathe 2.8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.72); }
}

/* ---------- studio statement --------------------------------------------- */

.tenets {
  display: grid;
  gap: 1.6rem 2.4rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.tenets li { border-top: 1px solid var(--line); padding-top: 1.1rem; }

.tenets strong {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.015em;
  margin-bottom: 0.35rem;
}

.tenets span { color: var(--dim); font-size: 0.96rem; }

/* ---------- prose (privacy, terms, support) ------------------------------ */

.prose { padding: clamp(3rem, 8vh, 5rem) 0 5rem; }
.prose h2 { margin: 2.6rem 0 0.9rem; font-size: clamp(1.4rem, 3vw, 1.85rem); }
.prose h3 { margin: 1.8rem 0 0.6rem; color: var(--accent); }
.prose ul { color: var(--dim); padding-left: 1.15rem; max-width: var(--measure); }
.prose li { margin-bottom: 0.5rem; }
.prose p { color: var(--dim); }
.prose p.lead { color: var(--ink); font-size: 1.1rem; }

.meta {
  font-size: 0.86rem;
  color: var(--dim);
  border-left: 2px solid var(--line);
  padding-left: 1rem;
}

/* ---------- closing call ------------------------------------------------- */

.closer {
  text-align: center;
  padding: clamp(4rem, 11vh, 7rem) 0;
  border-top: 1px solid var(--line);
  background: radial-gradient(80% 120% at 50% 110%, color-mix(in srgb, var(--accent) 13%, transparent) 0%, transparent 60%), var(--deep);
}

.closer h2 { margin-bottom: 1rem; }
.closer p { margin-inline: auto; }
.closer .btn-row { justify-content: center; }

/* ---------- footer ------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--shell-deep);
  padding: 3rem 0 3.5rem;
  font-size: 0.92rem;
  color: var(--shell-dim);
}

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  justify-content: space-between;
  align-items: flex-start;
}

.site-foot a { color: var(--shell-dim); text-decoration: none; }
.site-foot a:hover { color: var(--shell-text); text-decoration: underline; }

.foot-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }

.foot-legal { margin: 0; max-width: 42ch; line-height: 1.6; }

/* ---------- error page --------------------------------------------------- */

.lost {
  min-height: 68vh;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}

.lost p { margin-inline: auto; }

/* The home panel shows a phone as an object in the layout, not a full spec
   sheet: crop it to the part that matters so the panel stays a panel. */
.game-panel .shot { width: min(196px, 100%); }

.game-panel .phone img {
  max-height: 392px;
  object-fit: cover;
  object-position: center 42%;
}

/* object-fit needs an explicit height to crop against; without it the rule
   above does nothing and the phone grows to full screenshot height. */
.game-panel .phone img { height: 392px; }

/* The privacy policy quotes an Android constant by name, so inline code needs
   to read as code without shouting. */
.prose code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.86em;
  padding: 0.12em 0.42em;
  border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  overflow-wrap: anywhere;
}

.prose h1 { font-size: clamp(2.1rem, 5.6vw, 3.2rem); margin-bottom: 1rem; }
.prose .meta { margin-bottom: 2rem; }
.prose ul strong, .prose p strong { color: var(--ink); font-weight: 600; }

/* Sizing that used to sit in inline style attributes, which a strict
   style-src refuses. */
.lost h1 { font-size: clamp(2.4rem, 7vw, 4rem); }
.lost .btn-row { justify-content: center; }
