/* birdie.rip — the game's own front door. Flat colour, the app's morning
   sky by day and its dusk by night; the sign, the wire and the land are
   drawn the way the app draws them. */

:root {
  --ink: #2E2745;
  --muted: #6E6688;
  --page: #FBF8FD;
  --card: #F1ECF6;
  --line: #E4DCEC;
  --link: #B4611E;
  --zenith: #B7CDEA;
  --upper: #D3D6F1;
  --lower: #F3D9E6;
  --horizon: #FFE6CF;
  --sun: #FFAE94;
  --copper: #E98A3C;
  --sleeve: #35304F;
  --wood-light: #C99A6C;
  --wood-mid: #A0714B;
  --wood-dark: #7A5236;
  --wood-side: #553824;
  --cream: #FFF3DC;
  --coral: #F2915F;
  --rounded: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Today's land; set from the day's bird group by daily.js. */
  --hill-0: #F6E9D8;
  --hill-1: #BDCEDB;
  --hill-2: #B3AB94;
  --hill-3: #998081;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #EDE9F6;
    --muted: #B2A9C8;
    --page: #1B1826;
    --card: #262233;
    --line: #342F44;
    --link: #F0A060;
    --zenith: #8A90CC;
    --upper: #BE98C8;
    --lower: #E9959A;
    --horizon: #E0606A;
    --sun: #FF6E4E;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.55 var(--rounded); }
a { color: var(--link); text-underline-offset: 3px; }
h1, h2 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.wrap { width: min(760px, 100% - 32px); margin-inline: auto; }

/* ── The hero: sky, sign, words, the wire and the land ───────────────── */

.hero {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(180deg, var(--zenith) 0%, var(--upper) 36%, var(--lower) 70%, var(--horizon) 100%);
  color: #2E2745;
  overflow: hidden;
  padding-top: clamp(64px, 11vw, 110px);
}

/* The hanging sign, as on the app's board. */
.sign {
  position: relative;
  display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 10px;
  padding: 10px 18px 30px;
  border-radius: 16px;
  background:
    repeating-linear-gradient(176deg, rgba(122, 82, 54, 0.16) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, var(--wood-light), var(--wood-mid));
  box-shadow: 0 6px 0 var(--wood-side), 0 14px 24px rgba(46, 39, 69, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform-origin: 50% -80px;
  animation: swing 2.4s cubic-bezier(.2, .7, .3, 1) both;
}
.rope { position: absolute; bottom: 100%; width: 3px; height: 200px; background: linear-gradient(90deg, #8a6a48, #b08a62); }
.rope-left { left: 30%; }
.rope-right { right: 30%; }
.nail { position: absolute; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e8dccb, #6d6358); }
.nail-left { left: calc(30% - 2px); }
.nail-right { right: calc(30% - 2px); }
.engraved { width: 50px; height: 42px; overflow: visible; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35)); }
.engraved.flip { transform: scaleX(-1); }
.engraved .mark-body { fill: rgba(85, 56, 36, 0.85); }
.engraved .mark-legs { stroke: rgba(85, 56, 36, 0.85); stroke-linecap: round; }
.engraved .mark-hole { fill: #B48558; }
.engraved .mark-cut { fill: none; stroke: #B48558; stroke-width: 1; stroke-linecap: round; }
.sign-count { display: grid; justify-items: center; line-height: 1; color: var(--cream); text-shadow: 0 2px 0 rgba(85, 56, 36, 0.9); }
.sign-number { font: 900 46px/1 var(--rounded); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sign-label { font: 900 12px/1 var(--rounded); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 4px; opacity: 0.92; }
.sign-line {
  position: absolute; left: 0; right: 0; bottom: 9px; text-align: center;
  font: 900 12px/1 var(--rounded); letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(85, 56, 36, 0.85); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
@keyframes swing {
  0% { transform: rotate(4deg); }
  30% { transform: rotate(-2.5deg); }
  55% { transform: rotate(1.4deg); }
  78% { transform: rotate(-0.6deg); }
  100% { transform: rotate(0); }
}

.hero-copy { width: min(640px, 100% - 32px); text-align: center; margin-top: clamp(34px, 5vw, 52px); position: relative; z-index: 1; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 6px; font-weight: 800; font-size: 20px; }
.brand img { filter: drop-shadow(0 4px 8px rgba(46, 39, 69, 0.2)); }
.hero h1 { font-size: clamp(44px, 7vw + 12px, 84px); margin: 0 0 14px; }
.lede { font-size: clamp(18px, 0.6vw + 15px, 21px); margin: 0 auto 18px; max-width: 34em; color: rgba(46, 39, 69, 0.82); }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin: 0; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(46, 39, 69, 0.14); }

.scene { display: block; width: 100%; height: clamp(230px, 36vw, 500px); margin-top: -10px; }
.sun { fill: var(--sun); }
.hill-0 { fill: var(--hill-0); }
.hill-1 { fill: var(--hill-1); }
.hill-2 { fill: var(--hill-2); }
.hill-3 { fill: var(--hill-3); }
.pole rect { fill: #9C7250; }
.copper { fill: none; stroke: var(--copper); stroke-width: 3.2; stroke-linecap: round; }
.sleeve { fill: none; stroke: var(--sleeve); stroke-width: 5.2; }
.wire-bird .mark-body { fill: #2E2745; }
.wire-bird .mark-legs { stroke: #2E2745; stroke-linecap: round; }
.wire-bird .mark-hole { fill: #F3E4EC; }
.wire-bird .mark-cut { fill: none; stroke: #F3E4EC; stroke-width: 1; }

@media (prefers-color-scheme: dark) {
  .hero { color: #2E2745; }
  .scene .hill { filter: brightness(0.86); }
}

/* ── The page ──────────────────────────────────────────────────────── */

main { padding-block: clamp(40px, 7vw, 80px) 20px; }
main section { margin-bottom: clamp(44px, 6vw, 72px); }
main h2 { font-size: clamp(26px, 1.6vw + 18px, 36px); margin: 0 0 14px; }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.steps li { counter-increment: step; position: relative; padding: 16px 18px 16px 62px; background: var(--card); border-radius: 18px; }
.steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 14px;
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--sleeve); color: #fff; font-weight: 800; font-size: 16px;
}

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: 20px; padding: 22px 24px; }
.card h2 { font-size: 20px; margin-bottom: 12px; }
.keyed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.keyed li { display: grid; grid-template-columns: 1.8em 1fr; gap: 8px; align-items: baseline; }

.share p { color: var(--muted); margin: 0 0 16px; }
.result {
  margin: 0; max-width: 30em; overflow-x: auto; white-space: pre;
  background: var(--card); border-radius: 18px; padding: clamp(16px, 3vw, 22px) clamp(14px, 3.4vw, 26px);
  font: 500 clamp(12px, 2.4vw + 3px, 16px)/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.week p { color: var(--muted); margin: 0 0 16px; }
.weekdays { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.weekdays li {
  display: grid; justify-items: center; gap: 2px; padding: 10px 2px 12px; border-radius: 14px;
  background: color-mix(in srgb, var(--sleeve) calc(8% + var(--i, 0) * 12%), var(--card));
  font-size: 13px; color: var(--ink);
}
.weekdays li:nth-child(1) { --i: 0; } .weekdays li:nth-child(2) { --i: 1; } .weekdays li:nth-child(3) { --i: 2; }
.weekdays li:nth-child(4) { --i: 3; } .weekdays li:nth-child(5) { --i: 4; } .weekdays li:nth-child(6) { --i: 5; }
.weekdays li:nth-child(7) { --i: 6; }
.weekdays li:nth-child(n+5) { color: #fff; }
.weekdays b { font-size: 14px; }
.weekdays span { font-variant-numeric: tabular-nums; opacity: 0.85; }
.weekdays .is-today { outline: 3px solid var(--coral); outline-offset: 2px; }
.week .fine { margin-top: 10px; }

.app { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; }
.app img { filter: drop-shadow(0 8px 14px rgba(46, 39, 69, 0.22)); }
.app p { margin: 0 0 10px; }

footer { padding-block: 26px 40px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
footer p { margin: 0 0 8px; }
.rip { color: var(--ink); font-weight: 700; }
.fine { font-size: 14px; color: var(--muted); }

@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  .weekdays { gap: 4px; }
  .weekdays li { font-size: 11px; padding-inline: 0; }
  .weekdays b { font-size: 12px; }
  .app { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .sign { animation: none; }
}

/* The 404: just the sky and a line. */
.hero-small { min-height: 100svh; justify-content: center; padding-block: 60px; }
