:root {
  --red: #E60000;
  --red-bright: #F5141A;
  --red-dark: #B80000;
  --ink: #25282B;
  --ink-2: #2e3135;
  --muted-on-dark: #c4c7cc;
  --muted: #5b5f66;
  --body: #4a4e55;
  --rail: #9aa0a6;
  --gutter: max(5vw, 20px);
  --display: 'Inter Tight', Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--red); font-family: Inter, system-ui, sans-serif; color: var(--ink); }
a { color: #fff; } a:hover { color: #ffe0e0; }
svg { display: block; }

.page { display: flex; flex-direction: column; overflow-x: clip; }
.wrap { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; }

/* Hero */
.hero {
  background: radial-gradient(1100px 620px at 50% 30%, var(--red-bright) 0%, var(--red) 55%, var(--red-dark) 100%);
  color: #fff; display: flex; flex-direction: column;
}
.topbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 12px 24px; padding: 22px var(--gutter); border-bottom: 1px solid rgba(255,255,255,0.18);
}
.brand { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; }
.clock { display: flex; align-items: baseline; gap: 10px; font-size: 15px; }
.clock-label { color: rgba(255,255,255,0.85); }
.clock-time { font-family: var(--display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }

.hero-body {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: clamp(28px, 4vw, 52px);
  padding: clamp(40px, 6vw, 88px) var(--gutter) clamp(48px, 7vw, 96px);
}
.hero-title { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
  background: rgba(0,0,0,0.18); font-size: 15px; font-weight: 500;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.hero h1 {
  margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(52px, 9vw, 128px);
  line-height: 1; letter-spacing: -0.03em; text-wrap: balance;
}
.hero-title p { margin: 0; font-size: clamp(16px, 1.7vw, 21px); color: rgba(255,255,255,0.92); }
.done-msg { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 5vw, 64px); }

/* Flip timer */
.timer { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(18px, 3vw, 44px); }
.timer[hidden] { display: none !important; }
.unit { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.digits { display: flex; gap: clamp(4px, 0.6vw, 10px); }
.unit-label { font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.9); }
.flap {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: clamp(40px, 7.2vw, 104px); height: clamp(58px, 10.2vw, 148px);
  border-radius: clamp(6px, 0.8vw, 12px);
  background: linear-gradient(180deg, #2c2e33 0%, #232529 49.6%, #16171a 50.4%, #1c1d21 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 22px 44px rgba(90,0,0,0.45);
  perspective: 400px; overflow: hidden;
}
.flap::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: #0a0a0b;
}
.flap span {
  display: block; font-family: var(--display); font-weight: 700; font-size: clamp(38px, 6.8vw, 100px);
  line-height: 1; color: #fff; font-variant-numeric: tabular-nums;
}
.flap.flip span { animation: flip .55s cubic-bezier(.2,.8,.2,1); }
@keyframes flip {
  0% { transform: rotateX(85deg) translateY(-18%); opacity: .2; }
  60% { transform: rotateX(-8deg); opacity: 1; }
  100% { transform: none; }
}

/* Line / progress */
.line { background: var(--ink); color: #fff; padding: clamp(36px, 5vw, 64px) var(--gutter); }
.line .wrap { gap: 28px; }
.line-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; }
.line-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(26px, 3vw, 36px); line-height: 1.1; }
.line-pct { font-size: 16px; color: var(--muted-on-dark); }
.line-pct strong { color: #fff; font-variant-numeric: tabular-nums; }

.track { position: relative; height: 150px; }
.train { --tw: 200px; width: var(--tw); position: absolute; left: 0; bottom: 30px; }
.train svg { overflow: visible; width: 100%; height: auto; }
.sleepers {
  position: absolute; left: 0; right: 0; bottom: 22px; height: 12px;
  background: repeating-linear-gradient(90deg, #6b4a2f 0 6px, transparent 6px 18px);
}
.rail { position: absolute; left: 0; right: 0; height: 3px; background: var(--rail); }
.rail-top { bottom: 30px; }
.rail-bottom { bottom: 23px; }
.station { position: absolute; bottom: 0; display: flex; flex-direction: column; align-items: center; }
.station span { font-size: 13px; font-weight: 500; color: var(--muted-on-dark); white-space: nowrap; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: rgba(255,255,255,0.1); border-radius: 14px; overflow: hidden;
}
.stat { background: var(--ink-2); padding: 18px 22px; display: flex; flex-direction: column; gap: 4px; }
.stat-label { font-size: 13px; color: #b4b8be; }
.stat-value { font-family: var(--display); font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* After cards */
.after { background: #fff; padding: clamp(40px, 6vw, 80px) var(--gutter); }
.after .wrap { gap: 32px; }
.after-head { display: flex; flex-direction: column; gap: 8px; }
.after-head h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.08; color: var(--ink); }
.after-head p { margin: 0; font-size: 17px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.card { border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.card svg { width: 100%; height: auto; }
.card-golf { background: #F4F7E6; }
.card-guitar { background: #FFF6E5; }
.card-train { background: #E3F5F8; }
.card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.card-body h3 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; }
.card-body p { margin: 0; font-size: 16px; color: var(--body); }

.footer {
  background: #fff; border-top: 1px solid #e6e7e9; padding: 20px var(--gutter) 28px;
  font-size: 13px; color: var(--muted); text-align: center;
}

/* Animations */
.blink { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.puff { transform-box: fill-box; transform-origin: center; animation: puff 2.4s ease-out infinite; opacity: 0; }
.p2 { animation-delay: .8s; } .p3 { animation-delay: 1.6s; }
@keyframes puff { 0% { transform: translate(0,0) scale(.4); opacity: .9; } 100% { transform: translate(-26px,-30px) scale(1.8); opacity: 0; } }
.bob { animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
.roll { transform-box: fill-box; animation: roll 3.6s cubic-bezier(.3,.6,.4,1) infinite; }
@keyframes roll { 0% { transform: translateX(0); opacity: 1; } 80% { transform: translateX(150px); opacity: 1; } 88%, 100% { transform: translateX(150px) translateY(4px); opacity: 0; } }
.wave { transform-box: fill-box; transform-origin: left center; animation: wave 1.4s ease-in-out infinite; }
@keyframes wave { 0%, 100% { transform: skewY(0); } 50% { transform: skewY(6deg) scaleX(.9); } }
.string { animation: vib .09s linear infinite alternate; }
.s2 { animation-duration: .11s; } .s3 { animation-duration: .13s; } .s4 { animation-duration: .15s; }
@keyframes vib { from { transform: translateX(-0.6px); } to { transform: translateX(0.6px); } }
.note { transform-box: fill-box; animation: note 3s ease-out infinite; opacity: 0; }
.n2 { animation-delay: 1.5s; }
@keyframes note { 0% { transform: translate(0,10px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(14px,-60px); opacity: 0; } }
.spin { transform-box: view-box; transform-origin: 160px 110px; animation: spin 7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tablet */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Phone */
@media (max-width: 600px) {
  .brand { display: none; }
  .topbar { justify-content: center; }
  /* Days on their own row, then hours / minutes / seconds a little smaller */
  .timer { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; column-gap: 16px; row-gap: 22px; }
  .unit-days { grid-column: 1 / -1; }
  .flap { width: 10.5vw; height: 14.5vw; border-radius: 7px; }
  .flap span { font-size: 9.5vw; }
  .unit-days .flap { width: 14vw; height: 19.5vw; border-radius: 9px; }
  .unit-days .flap span { font-size: 13vw; }
  .train { --tw: 140px; }
  .station.mid { display: none; }
  .track { height: 118px; }
  .stat { padding: 16px 18px; }
  .stat-value { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .flap.flip span, .blink, .puff, .bob, .roll, .wave, .string, .note, .spin { animation: none; }
  .puff, .note { opacity: .6; }
}
