/* Lonebird site — shared shell.
   -------------------------------------------------------------------------
   The palette is lifted straight from the game's dawn biome (lib/game/palette.dart)
   so the site and the first thing a player sees are the same place. Type pairs a
   quirky variable grotesque for display with a serif for prose: the legal pages
   are the ones people actually read, and a serif at a comfortable measure reads
   like a document rather than like a dashboard. */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,800&family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,600;1,6..72,400&display=swap');

:root {
  --ink:        #0a0c16;
  --ink-2:      #10132a;
  --surface:    #161a33;
  --surface-2:  #1d2242;
  --line:       #2b3157;

  --dawn-top:   #241a4d;
  --dawn-mid:   #8e3a6e;
  --dawn-low:   #f79a55;

  --gold:       #ffd166;
  --ember:      #f79a55;
  --mint:       #7bffd4;
  --rose:       #ff6b8a;

  --text:       #e9edff;
  --text-dim:   #a2abd0;
  --text-faint: #6d769c;

  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --prose:   'Newsreader', ui-serif, Georgia, serif;

  --measure: 68ch;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--prose);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* A fine grain over everything. Flat dark backgrounds band badly on phone
   OLEDs; a little noise hides the steps and gives the page some tooth. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- typography */

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.05;
  margin: 0;
}

a { color: var(--mint); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--gold); }

strong { color: #fff; font-weight: 600; }
em { color: var(--gold); font-style: italic; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .86em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: .12em .45em;
  border-radius: 5px;
  color: var(--gold);
}

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

.sky {
  position: relative;
  min-height: min(86vh, 760px);
  display: grid;
  align-content: center;
  /* Bottom padding keeps the copy clear of the hills, which occupy roughly the
     lower fifth of the header's width-driven height. */
  padding: 6rem 1.5rem clamp(7rem, 16vw, 13rem);
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 78% 18%, rgba(255,209,102,.28), transparent 58%),
    linear-gradient(180deg, var(--dawn-top) 0%, var(--dawn-mid) 58%, var(--dawn-low) 100%);
}

/* Star field, hills and ground are one inline SVG per layer, positioned
   absolutely — same construction as the in-game backdrop. */
.sky__layer { position: absolute; left: 0; right: 0; pointer-events: none; }
.sky__stars { top: 0; height: 60%; opacity: .55; }
.sky__hills { bottom: 0; width: 100%; display: block; }

.sun {
  position: absolute;
  top: 12%; right: 12%;
  width: clamp(90px, 14vw, 170px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
    #fff3cf 0%, #ffe093 34%, rgba(255,209,102,.7) 52%,
    rgba(255,190,110,.28) 68%, rgba(255,180,110,0) 84%);
  animation: rise 1.6s var(--ease) both;
}

.hero {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.wordmark {
  font-size: clamp(3.2rem, 13vw, 8.5rem);
  letter-spacing: -.045em;
  background: linear-gradient(178deg, #fff3d0 8%, var(--gold) 46%, var(--ember) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 26px rgba(0,0,0,.5));
  animation: rise .9s var(--ease) both;
}

.tagline {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  color: rgba(255,255,255,.86);
  margin: .6rem 0 0;
  letter-spacing: .005em;
  animation: rise .9s var(--ease) .1s both;
}

.blurb {
  max-width: 44ch;
  margin: 1.4rem 0 0;
  color: rgba(255,255,255,.76);
  font-size: 1.15rem;
  animation: rise .9s var(--ease) .2s both;
}

.bird {
  position: absolute;
  right: max(4vw, 1rem);
  bottom: 26%;
  width: clamp(130px, 22vw, 280px);
  animation: rise 1s var(--ease) .35s both, glide 7s ease-in-out 1.4s infinite;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.45));
}

/* transform-box: view-box so the origin below is in viewBox units — the wing
   pivots at the shoulder rather than at the SVG's bounding box. */
.bird__wing {
  transform-box: view-box;
  transform-origin: 70px 64px;
  animation: flap 1.4s ease-in-out infinite;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}
@keyframes glide {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-16px) rotate(-1deg); }
}
@keyframes flap {
  0%, 100% { transform: rotate(-7deg); }
  50%      { transform: rotate(11deg); }
}

/* On a phone the hero is a single column and the bird's slot on the right is
   gone — it lands on top of the buttons. Fly it above the headline instead,
   and give it the sun's corner rather than crowding both into one. */
@media (max-width: 620px) {
  .sun { display: none; }
  .bird {
    width: 118px;
    top: 5.5rem;
    bottom: auto;
    right: 5vw;
  }
}

/* ------------------------------------------------------------------ reveals */

/* Visible by default; the script arms them. Content must never depend on JS
   having run to be readable. */
.reveal--armed {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal--in { opacity: 1; transform: none; }

/* -------------------------------------------------------------- screenshots */

.shots {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(.6rem, 2.5vw, 1.8rem);
  margin-top: 1.8rem;
}
.shot {
  margin: 0;
  flex: 1 1 0;
  max-width: 300px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink-2);
  box-shadow: 0 30px 70px -34px #000;
  transition: transform .35s var(--ease);
}
.shot img { display: block; width: 100%; height: auto; }
.shot--lift { transform: translateY(-2.2rem) scale(1.05); z-index: 1; border-color: rgba(255,209,102,.35); }
.shot:hover { transform: translateY(-.5rem); }
.shot--lift:hover { transform: translateY(-2.7rem) scale(1.05); }

@media (max-width: 620px) {
  /* Three phones side by side stop being legible well before they stop
     fitting; below this the outer two are decoration, not information. */
  .shots .shot:not(.shot--lift) { display: none; }
  .shot--lift { transform: none; max-width: 320px; }
  .shot--lift:hover { transform: translateY(-.5rem); }
}

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

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.wrap--wide { max-width: 1080px; }

section { padding: clamp(3rem, 7vw, 5.5rem) 0; }

.eyebrow {
  font-family: var(--display);
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}

.rule-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  background:
    linear-gradient(180deg, rgba(255,209,102,.06), transparent 60%),
    var(--surface);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.9);
}
.rule-card h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.rule-card p:last-child { margin-bottom: 0; }
.rule-card p { max-width: 62ch; }

/* Heading left, argument right — keeps the prose at a readable measure while
   the card itself spans the same grid as the tiles beneath it. */
.rule-card--split {
  display: grid;
  gap: clamp(1rem, 3vw, 2.6rem);
  align-items: start;
}
@media (min-width: 820px) {
  .rule-card--split { grid-template-columns: minmax(0, 8fr) minmax(0, 11fr); }
}
.rule-card--split p:first-child { margin-top: 0; }

/* Four birds trailing off — the flock the heading is talking about. */
.flock {
  display: block;
  width: min(100%, 250px);
  margin-top: 1.7rem;
  color: var(--gold);
}
@media (max-width: 819px) { .flock { display: none; } }

.rule-card--center { text-align: center; }
.rule-card--center p { margin-left: auto; margin-right: auto; max-width: 48ch; }
.rule-card--center .actions { justify-content: center; }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-top: 1.6rem;
}
/* auto-fit would give this three tiles two columns on a mid-width screen and
   leave a hole; there are exactly three and they belong on one row. */
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
/* Six tiles. A 230px minimum fits four across and strands the last two; 300
   caps it at three so the rows come out even. */
.grid--wide-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.tile {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.3rem 1.4rem;
  background: var(--surface);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.tile:hover { border-color: rgba(255,209,102,.5); transform: translateY(-3px); }
.tile h3 {
  font-size: 1.02rem;
  letter-spacing: .01em;
  margin-bottom: .3rem;
  color: var(--gold);
}
.tile p { margin: 0; color: var(--text-dim); font-size: .97rem; line-height: 1.6; }

/* ------------------------------------------------------------------ legal doc */

.doc { padding: clamp(3rem, 8vw, 5.5rem) 0 6rem; }
.doc h1 { font-size: clamp(2.1rem, 6vw, 3.2rem); margin-bottom: .4rem; }
.doc h2 {
  font-size: 1.32rem;
  margin: 2.8rem 0 .7rem;
  color: var(--gold);
  scroll-margin-top: 2rem;
}
.doc p, .doc li { color: var(--text-dim); }
.doc li { margin: .4rem 0; }
.doc ul { padding-left: 1.15rem; }
.doc ul li::marker { color: var(--gold); }

.meta {
  font-family: var(--display);
  font-weight: 600;
  font-size: .84rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 2.6rem;
}
/* The package name lives in this line; uppercasing a monospace identifier
   makes it look like a different string than the one in the manifest. */
.meta code { text-transform: none; letter-spacing: 0; }

.lede {
  font-size: 1.22rem;
  line-height: 1.65;
  color: var(--text);
  border-left: 2px solid var(--gold);
  padding-left: 1.15rem;
  margin: 0 0 2rem;
}

table { border-collapse: collapse; width: 100%; margin: 1.2rem 0; font-size: .96rem; }
th, td { text-align: left; padding: .72rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-family: var(--display);
  font-weight: 600;
  font-size: .74rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-faint);
}
td { color: var(--text-dim); }
.scroll-x { overflow-x: auto; }

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  background: var(--surface);
  padding: 1.2rem 1.4rem;
  margin: 1.6rem 0;
}
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout ol { margin: 0; padding-left: 1.2rem; }
.callout li { margin: .55rem 0; color: var(--text); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .01em;
  text-decoration: none;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.btn--primary {
  background: linear-gradient(120deg, var(--gold), var(--ember));
  color: #17130a;
  box-shadow: 0 12px 34px -14px rgba(255,180,80,.9);
}
.btn--primary:hover { transform: translateY(-2px); color: #17130a; }
.btn--ghost { border-color: var(--line); color: var(--text); background: rgba(255,255,255,.03); }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-2px); }

.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; animation: rise .9s var(--ease) .3s both; }

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

.back {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  text-decoration: none;
  margin-bottom: 2.4rem;
}
.back:hover { color: var(--gold); }

footer {
  border-top: 1px solid var(--line);
  padding: 2.4rem 0 3.2rem;
  color: var(--text-faint);
  font-size: .95rem;
}
footer .wrap { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; align-items: center; }
footer a { color: var(--text-dim); text-decoration: none; }
footer a:hover { color: var(--gold); }
footer .spacer { flex: 1 1 auto; }
