/* ==========================================================================
   Farting Chicken — fartingchicken.com
   Palette and type lifted straight from the game (see Chicken.swift, Theme).
   Hand-written CSS, no framework, no build step.
   ========================================================================== */

:root {
  /* Straight out of the game's Theme enum */
  --sky:        #87cffa;
  --sky-top:    #6bb8f7;
  --hills:      #70c25c;
  --hills-back: #99d47a;
  --grass:      #66b852;
  --ground:     #8c6640;
  --outline:    #473321;
  --red:        #eb3d47;
  --orange:     #ff9e1f;
  --stink:      #8cd959;
  --fox:        #e67a33;
  --corn:       #fbcb33;

  --cream:      #fff8ea;
  --paper:      #fffdf7;
  --ink:        #3b2a1b;
  --ink-soft:   #6b5544;

  --radius:     22px;
  --radius-sm:  14px;
  --shadow:     0 4px 0 var(--outline);
  --shadow-lg:  0 8px 0 rgba(71, 51, 33, .18);

  --measure:    68ch;
  --wrap:       1120px;
}

/* --- reset ------------------------------------------------------------- */
*, *::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: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }

/* --- type -------------------------------------------------------------- */
/* Chalkboard SE is the in-game face. It ships on Apple devices, so Apple users
   see the exact game font; everyone else falls back to a rounded web-safe stack. */
body {
  font-family: "Chalkboard SE", "Chalkboard", "Comic Sans MS", "Trebuchet MS",
               system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(1rem, .95rem + .35vw, 1.125rem);
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.9rem); letter-spacing: -.5px; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.2rem); margin-top: 1.6em; }
h3 { font-size: clamp(1.15rem, 1.05rem + .5vw, 1.4rem); margin-top: 1.5em; }
p, ul, ol { margin: 0 0 1.1em; }
/* Cap the reading measure on prose only. Layout lists (badge rows, area chips,
   download lists) must be excluded or they get squeezed to 68ch and wrap early. */
:is(main, .card) :is(p, ul, ol, h3):not(.badges):not(.areas):not(.dl-list):not(.btn-row) {
  max-width: var(--measure);
}
/* A centred block needs auto margins too, or it just centres text inside a
   left-aligned 68ch column and looks off-centre on the page. */
:is(main, .card) :is(p, ul, ol, h3).center { margin-inline: auto; }
li { margin-bottom: .4em; }
small { font-size: .85rem; color: var(--ink-soft); }

a { color: #1f7ac4; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px;
}

/* --- layout ------------------------------------------------------------ */
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 760px); margin-inline: auto; }
main { padding-bottom: 4rem; }
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--paper);
  padding: .8rem 1.2rem; border-radius: 0 0 12px 0; z-index: 999; font-weight: bold;
}
.skip:focus { left: 0; }

/* --- header / nav ------------------------------------------------------ */
.site-head {
  background: var(--paper);
  border-bottom: 3px solid var(--outline);
  position: sticky; top: 0; z-index: 100;
}
.site-head .wrap {
  display: flex; align-items: center; gap: 1rem;
  justify-content: space-between; padding: .6rem 0; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: bold; font-size: 1.15rem; color: var(--ink); text-decoration: none;
}
.brand img { width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--outline); }
.brand:hover { color: var(--red); }

nav ul { display: flex; gap: .3rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
nav a {
  display: block; padding: .45rem .8rem; border-radius: 999px;
  text-decoration: none; color: var(--ink); font-weight: bold; font-size: .95rem;
}
nav a:hover { background: var(--cream); color: var(--red); }
nav a[aria-current="page"] { background: var(--hills); color: #fff; }

/* --- hero -------------------------------------------------------------- */
/* The sky/grass split sits low (76%) so the headline and buttons stay on sky and
   only the scenery strip and the chicken's feet land on the grass. */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky) 76%, var(--hills-back) 76%, var(--hills) 100%);
  border-bottom: 4px solid var(--outline);
  padding: clamp(2.5rem, 6vw, 5rem) 0 1.5rem;
}
.hero .wrap {
  position: relative; z-index: 3;
  display: grid; gap: 2rem; align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 860px) { .hero .wrap { grid-template-columns: 1.05fr .95fr; } }

.hero h1 { color: #fff; text-shadow: 3px 3px 0 var(--outline); }
.hero .tagline {
  font-size: clamp(1.1rem, 1rem + .6vw, 1.4rem);
  color: #fff; text-shadow: 2px 2px 0 rgba(71,51,33,.55); font-weight: bold;
  max-width: 30ch;
}
.hero-art { position: relative; text-align: center; padding-bottom: 1rem; }
.hero-art .chicken { width: min(78%, 380px); margin-inline: auto; position: relative; z-index: 2; }
/* Soft contact shadow so the chicken sits on the ground instead of floating */
.hero-art::after {
  content: ""; position: absolute; z-index: 1;
  left: 50%; transform: translateX(-50%);
  bottom: .6rem; width: min(46%, 220px); height: 22px;
  background: radial-gradient(ellipse at center, rgba(71,51,33,.28) 0%, rgba(71,51,33,0) 70%);
}
.hero-art .puff {
  /* Sits low and just behind the chicken so it reads as coming from the vent,
     not from its back. */
  position: absolute; width: 34%; max-width: 165px; left: 1%; bottom: 4%;
  z-index: 1; opacity: .95;
  animation: waft 3.4s ease-in-out infinite;
}
@keyframes waft {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: .95; }
  50%      { transform: translate(-12px, -10px) scale(1.07); opacity: .75; }
}
.hero .sun {
  position: absolute; top: 6%; right: 5%; width: clamp(70px, 9vw, 120px);
  z-index: 1; animation: spin 60s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Scenery strip along the bottom of the hero */
.scenery {
  position: relative; z-index: 2; display: flex; align-items: flex-end;
  justify-content: center; gap: clamp(.5rem, 3vw, 2.5rem);
  padding: 0 1rem; margin-top: -1rem; pointer-events: none;
}
.scenery img { width: clamp(46px, 7vw, 92px); opacity: .95; }
.scenery img:nth-child(even) { width: clamp(36px, 5.5vw, 74px); }
@media (max-width: 620px) { .scenery img:nth-child(n+5) { display: none; } }

/* --- buttons ----------------------------------------------------------- */
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.4rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.6rem; border-radius: 999px;
  font-weight: bold; font-size: 1.05rem; text-decoration: none;
  border: 3px solid var(--outline); box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
  cursor: pointer;
}
.btn:hover  { transform: translateY(2px); box-shadow: 0 2px 0 var(--outline); }
.btn:active { transform: translateY(4px); box-shadow: none; }
.btn-primary   { background: var(--red);    color: #fff; }
.btn-primary:hover { color: #fff; }
.btn-secondary { background: var(--corn);   color: var(--ink); }
.btn-secondary:hover { color: var(--ink); }
.btn-ghost     { background: var(--paper);  color: var(--ink); }
.btn-ghost:hover { color: var(--red); }
.btn[aria-disabled="true"] { opacity: .8; cursor: default; }
.btn[aria-disabled="true"]:hover { transform: none; box-shadow: var(--shadow); }

/* --- sections & cards -------------------------------------------------- */
.section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section-alt { background: var(--paper); border-block: 3px solid rgba(71,51,33,.12); }
.section > .wrap > h2:first-child,
.section > .narrow > h2:first-child { margin-top: 0; }

.grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--paper); border: 3px solid var(--outline);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-lg);
}
.card h3 { margin-top: 0; display: flex; align-items: center; gap: .55rem; }
.card img.ico { width: 42px; height: 42px; object-fit: contain; flex: none; }
.card p:last-child { margin-bottom: 0; }

/* Trust badges. Explicit column counts so it's always a clean 2x2 or 1x4,
   never three-and-one-orphan. */
.badges { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); list-style: none; padding: 0; margin: 0; }
@media (min-width: 760px) { .badges { grid-template-columns: repeat(4, 1fr); } }
.badges li {
  background: var(--paper); border: 3px solid var(--outline); border-radius: var(--radius-sm);
  padding: 1rem; text-align: center; font-weight: bold; margin: 0;
}
.badges .big { display: block; font-size: 1.5rem; color: var(--hills); }

/* Area list */
.areas { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0 0 1.2em; list-style: none; }
.areas li {
  background: var(--hills); color: #fff; font-weight: bold; font-size: .92rem;
  padding: .4rem .9rem; border-radius: 999px; border: 2px solid var(--outline); margin: 0;
}

/* FAQ */
details {
  background: var(--paper); border: 3px solid var(--outline); border-radius: var(--radius-sm);
  padding: .9rem 1.2rem; margin-bottom: .8rem;
}
details[open] { box-shadow: var(--shadow-lg); }
summary { font-weight: bold; cursor: pointer; font-size: 1.05rem; }
summary::marker { color: var(--red); }
details > *:not(summary) { max-width: var(--measure); }
details > p:first-of-type { margin-top: .8em; }
details > p:last-child { margin-bottom: .2em; }

/* Page header for interior pages */
.page-head {
  background: linear-gradient(180deg, var(--sky-top), var(--sky));
  border-bottom: 4px solid var(--outline);
  padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
}
.page-head h1 { color: #fff; text-shadow: 3px 3px 0 var(--outline); margin-bottom: .3em; }
.page-head p { color: #fff; text-shadow: 1px 1px 0 rgba(71,51,33,.5); font-weight: bold; margin: 0 auto; max-width: 48ch; }

/* Prose pages (privacy, terms, support) */
.prose { padding-top: 2.5rem; }
.prose h2 { border-bottom: 3px solid rgba(71,51,33,.15); padding-bottom: .3em; }
.updated { color: var(--ink-soft); font-size: .9rem; margin-bottom: 2rem; }
.callout {
  background: var(--paper); border: 3px solid var(--hills); border-left-width: 10px;
  border-radius: var(--radius-sm); padding: 1.2rem 1.4rem; margin: 1.6rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-color: var(--orange); }

/* Press kit download list */
.dl-list { list-style: none; padding: 0; }
.dl-list li {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: var(--paper); border: 3px solid var(--outline); border-radius: var(--radius-sm);
  padding: .9rem 1.2rem; margin-bottom: .7rem;
}
.dl-list img { width: 54px; height: 54px; border-radius: 10px; border: 2px solid var(--outline); }
.dl-list .meta { flex: 1 1 200px; }
.dl-list .meta strong { display: block; }

.copyblock {
  background: var(--paper); border: 3px solid var(--outline); border-radius: var(--radius-sm);
  padding: 1.1rem 1.3rem; white-space: pre-wrap; font-size: .95rem; margin-bottom: 1.2rem;
}

/* --- footer ------------------------------------------------------------ */
.site-foot {
  background: var(--outline); color: #f4e9dc;
  padding: 2.5rem 0 2rem; border-top: 5px solid var(--ground);
}
.site-foot .wrap { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-foot h3 { color: #fff; font-size: 1rem; margin: 0 0 .6em; }
/* small inherits a dark ink colour by default — unreadable on the dark footer */
.site-foot small, .site-foot p { color: #e6d6c3; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot a { color: #ffd98a; }
.site-foot a:hover { color: #fff; }
.site-foot .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.18); padding-top: 1.2rem; font-size: .88rem; }
.foot-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: .8rem; }
.foot-brand img { width: 46px; height: 46px; border-radius: 11px; }

/* --- utilities --------------------------------------------------------- */
.center { text-align: center; }
.mt0 { margin-top: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
