/* ==========================================================================
   Chirp Up — game site
   Tokens mirror the Flutter app's "Sea Glass" property
   (cardgame/lib/design/tokens.dart, chirpUpTokens). Keep them in sync.
   ========================================================================== */

:root {
  /* Surfaces and ink */
  --page:        #E8F2E4;
  --surface:     #F4FAF0;
  --recessed:    #D5E8CC;
  --hairline:    #A8C8A0;
  --ink:         #0C2818;
  --ink-soft:    #22523A;
  --muted:       #3D6B4C;  /* darkened from the app's #5E8868 to clear 4.5:1 on --page */
  --muted-dark:  #9FC4A8;  /* secondary text on --ink */
  --on-dark:     #C7E0C6;

  /* Brand */
  --accent:         #137C88;  /* button fill; darkened from #1A9BAA so white text clears 4.5:1 */
  --accent-pressed: #0F656F;
  --accent-bright:  #1A9BAA;  /* decorative + buttons on dark ground */
  --link:           #0F6B76;

  /* Kickstarter banner (site-only; white text on --ks-teal is 5.7:1) */
  --ks-teal:  #2F6F79;
  --on-teal:  #E3F1F2;  /* 4.9:1 on --ks-teal */
  --sticker:  #F2C14E;

  /* Habitat colours — from configs/chirp_up/data.json categories[].color */
  --aquatic:   #2A8FD0;
  --forest:    #1C6838;
  --shrubbery: #7050AC;

  /* Type */
  --display: 'Baloo 2', 'Trebuchet MS', sans-serif;
  --body:    'Nunito', 'Trebuchet MS', sans-serif;

  /* Layout */
  --measure: 1280px;
  --gutter: 24px;
  --section-y: 72px;
  --radius: 14px;
}

@media (min-width: 900px) {
  :root { --gutter: 80px; }
}

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

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background-color: var(--page);
  background-image: url("images/bg-pattern.png");
  background-size: 420px 420px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
p { margin: 0; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 3px; }

.container {
  width: 100%;
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band {
  background: var(--surface);
  border-block: 1px solid var(--hairline);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.dot { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.dot-accent    { background: var(--accent-bright); }
.dot-aquatic   { background: var(--aquatic); }
.dot-forest    { background: var(--forest); }
.dot-shrubbery { background: var(--shrubbery); }

.fine { font-size: 15px; font-weight: 600; color: var(--muted); }
.fine-dark { font-size: 14px; font-weight: 700; color: var(--muted-dark); }

.section-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; line-height: 1.1; }
.section-head p { font-size: clamp(16px, 1.6vw, 18px); color: var(--muted); }

.section-head-split { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 32px; }
.section-head-split > div { display: flex; flex-direction: column; gap: 10px; }
.link-arrow { font-size: 17px; font-weight: 800; white-space: nowrap; }

@media (max-width: 860px) {
  .section-head-split { flex-direction: column; align-items: flex-start; gap: 16px; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding-inline: 36px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  transition: background-color 120ms ease, color 120ms ease;
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(12, 40, 24, 0.22);
}
.btn-primary:hover { background: var(--accent-pressed); color: #FFFFFF; }

.btn-outline {
  background: var(--surface);
  border: 2px solid var(--ink);
  color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--surface); }

.btn-teal {
  background: var(--accent-bright);
  color: #06201A;
  font-weight: 800;
  font-size: 23px;
  min-height: 66px;
  padding-inline: 40px;
}
.btn-teal:hover { background: #2FB4C4; color: #06201A; }

.btn-sm { min-height: 46px; padding-inline: 24px; font-family: var(--body); font-size: 16px; font-weight: 800; box-shadow: 0 2px 6px rgba(12, 40, 24, 0.18); }

/* -------------------------------------------------- kickstarter banner --- */

.ks-banner {
  background: var(--ks-teal);
  overflow: hidden;
}

.ks-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  padding-block: 32px;
}

.ks-sticker {
  flex: none;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: 50%;
  background: var(--sticker);
  border: 3px dashed var(--ink);
  transform: rotate(-12deg);
  font-family: var(--display);
  font-size: 15px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-align: center;
}

.ks-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 6px; }
.ks-headline { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1.1; color: #FFFFFF; }
.ks-subline { font-size: 17px; line-height: 1.4; color: var(--on-teal); }

.ks-deck {
  flex: none;
  width: 120px;
  height: auto;
  transform: rotate(4deg);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
}

.ks-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;  /* type and size match .btn */
  padding: 12px 36px;
  border-radius: 999px;
  background: var(--ink);
  color: #FFFFFF;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.ks-btn:hover { color: #FFFFFF; background: var(--ink-soft); transform: translateY(-2px); }
.ks-btn:focus-visible { outline-color: var(--sticker); }

@media (max-width: 720px) {
  /* stacked: deck image, then text, then a full-width button */
  .ks-banner-inner { gap: 20px; padding-block: 28px; }
  .ks-sticker { display: none; }
  .ks-deck { order: -1; width: 180px; margin-inline: auto; }
  .ks-text { flex-basis: 100%; gap: 4px; }
  .ks-headline { font-size: 24px; }
  .ks-subline { font-size: 15px; }
  .ks-btn { flex-basis: 100%; padding-inline: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ks-btn { transition: none; }
  .ks-btn:hover { transform: none; }
}

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

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 46px; height: auto; }
.brand-wordmark { width: 148px; height: auto; }

.site-nav { display: flex; align-items: center; gap: 36px; }
.site-nav > a { font-size: 16px; font-weight: 700; color: var(--ink); }
.site-nav > a.btn { color: #FFFFFF; }

@media (max-width: 680px) {
  .header-inner { min-height: 64px; }
  .brand-mark { width: 34px; }
  .brand-wordmark { width: 108px; }
  .site-nav > a:not(.btn) { display: none; }
  .btn-sm { min-height: 44px; padding-inline: 18px; font-size: 15px; }
}

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

.hero { padding-block: clamp(36px, 6vw, 76px) clamp(48px, 6vw, 80px); }

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.hero-copy { display: flex; flex-direction: column; gap: 26px; max-width: 600px; }
.hero-copy h1 { font-size: clamp(46px, 5.6vw, 76px); font-weight: 800; line-height: 1.02; }
.lede { font-size: clamp(18px, 1.8vw, 21px); line-height: 1.5; color: var(--ink-soft); max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px 24px; }
.hero-action { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }

.hero-art { display: flex; flex-direction: column; align-items: center; gap: 28px; min-width: 0; }

.card-fan { display: flex; justify-content: center; align-items: center; max-width: 100%; }
.card-fan img {
  width: clamp(96px, 11.5vw, 160px);
  aspect-ratio: 5 / 7;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(12, 40, 24, 0.26);
  margin-inline: -14px;
}
.card-fan img:nth-child(1) { transform: rotate(-14deg) translateY(22px); }
.card-fan img:nth-child(2) { transform: rotate(-6deg) translateY(6px); }
.card-fan img:nth-child(3) { transform: rotate(2deg); z-index: 1; box-shadow: 0 16px 34px rgba(12, 40, 24, 0.28); }
.card-fan img:nth-child(4) { transform: rotate(10deg) translateY(8px); }

.art-credit {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 12px 22px;
  box-shadow: 0 4px 12px rgba(12, 40, 24, 0.12);
  text-align: center;
}

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  /* phone order matches the mobile artboard: eyebrow, cards, headline */
  .hero-copy { order: 2; }
  .hero-art { order: 1; }
  .hero-action { flex: 1 1 260px; align-items: stretch; }
}

@media (max-width: 600px) {
  .fan-hide-sm { display: none; }
  .card-fan img { margin-inline: -10px; }
  .art-credit { font-size: 14px; }
}

/* ------------------------------------------------------- how it plays --- */

.how { padding-block: var(--section-y); }

.video-frame {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.video-frame video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: var(--page);
  object-fit: contain;
  border: 1px solid var(--hairline);
  box-shadow: 0 10px 28px rgba(12, 40, 24, 0.2);
}

.video-caption { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 580px; text-align: center; }
.video-caption h3 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; color: var(--ink); }
.video-caption p { font-size: clamp(15px, 1.6vw, 17px); line-height: 1.5; color: var(--muted); }

@media (max-width: 700px) {
  .how { padding-block: 48px; }
  .video-frame { gap: 18px; }
  .video-frame video { border-radius: 14px; }
}

/* ------------------------------------------------------------ gallery --- */

.gallery { padding-block: var(--section-y); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 24px;
}

.card-grid li { display: flex; flex-direction: column; gap: 8px; }

.card-grid img {
  width: 100%;
  aspect-ratio: 5 / 7;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(12, 40, 24, 0.18);
  margin-bottom: 4px;
}

.card-name { font-size: 15px; font-weight: 800; color: var(--ink); }
.card-habitat { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.card-habitat .dot { width: 9px; height: 9px; }

@media (max-width: 1100px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px)  { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
                             .gallery { padding-block: 48px; } }

/* -------------------------------------------------------- kickstarter --- */

.kickstarter { background: var(--ink); padding-block: 48px; }

.kickstarter-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.kickstarter-copy { display: flex; flex-direction: column; gap: 16px; max-width: 700px; }
.kickstarter-copy img { width: 176px; height: auto; }
.kickstarter-copy h2 { font-size: clamp(30px, 3.4vw, 40px); font-weight: 800; line-height: 1.12; color: var(--surface); }
.kickstarter-copy p { font-size: clamp(16px, 1.6vw, 18px); line-height: 1.5; color: var(--on-dark); }

.kickstarter-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }

@media (max-width: 900px) {
  .kickstarter-inner { flex-direction: column; align-items: stretch; gap: 24px; }
  .kickstarter-cta { align-items: stretch; }
  .kickstarter-copy img { width: 150px; }
}

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

.site-footer { background: var(--page); padding-block: 40px; }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.footer-brand { display: flex; align-items: center; gap: 16px; }
.footer-brand img { width: 54px; height: auto; }
.footer-tagline { font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--ink); }

.footer-links { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.footer-links nav { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: flex-end; }
.footer-links nav a { font-size: 16px; font-weight: 700; }
.footer-links .fine { text-align: right; font-weight: 400; font-size: 14px; }

@media (max-width: 900px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 18px; }
  .footer-links { align-items: flex-start; }
  .footer-links nav { justify-content: flex-start; }
  .footer-links .fine { text-align: left; line-height: 1.5; }
}

/* ------------------------------------------------------------ motion --- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
