/* Traincremental site. One visual world: bright clay water, cream paper tickets, coral stubs. */
@font-face { font-family: "Nunito"; src: url("fonts/nunito-latin-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito-latin-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito-latin-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --water: #2f8fe3;
  --water-deep: #1f6fc0;
  --paper: #fbf1da;
  --paper-edge: #efdfbb;
  --ink: #23324a;
  --ink-soft: #55647a;
  --coral: #d9483b;
  --coral-deep: #b2352a;
  --cream: #fff6e2;
  --round: "Nunito", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --stub: 280px;
  --notch: 18px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--water); }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 600 17px/1.5 var(--round);
}
/* the water stays put behind the page (a fixed layer also works on phones, unlike background-attachment: fixed) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: var(--water) url("water-bg.webp") center / cover no-repeat;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--cream); outline-offset: 3px; border-radius: 6px; }

.page {
  max-width: 1080px; margin: 0 auto;
  padding-block: 28px 40px;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; /* nothing may push a phone page sideways */
}

/* the station announcement */
.pa {
  justify-self: center; display: flex; gap: 10px; align-items: center;
  background: rgba(20, 45, 80, .78); color: var(--cream);
  border-radius: 999px; padding: 9px 18px; font-size: .95rem; max-width: 100%;
  text-wrap: balance;
}
.pa svg { flex: none; width: 20px; height: 20px; }

/* ---------- the ticket ---------- */
.hero { position: relative; padding-bottom: 70px; }
.ticket-wrap { filter: drop-shadow(0 22px 26px rgba(8, 40, 85, .38)) drop-shadow(0 3px 4px rgba(8, 40, 85, .25)); }
.ticket { display: grid; grid-template-columns: minmax(0, 1fr) var(--stub); transform: rotate(-1.6deg); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.ticket:hover { transform: rotate(-.6deg); }

.ticket-body {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .36 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--paper), #f7e8c8);
  border-radius: 22px 0 0 22px;
  padding: 34px 40px 28px 44px;
  display: grid; gap: 20px; align-content: start;
  -webkit-mask: radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
}
.ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.logo { width: min(470px, 100%); }
.logo img { width: 100%; } /* navy outline is baked in by tools/make_assets.py */
h1.sub { margin: 6px 0 0 6px; font: 800 1.05rem/1.2 var(--round); color: var(--ink-soft); letter-spacing: .01em; }
.serial { font: 700 .72rem/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); text-align: right; white-space: nowrap; }
.serial b { display: block; font-size: 1rem; color: var(--coral-deep); letter-spacing: .08em; }

.fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 22px; margin: 0; font-family: var(--mono); }
.fields dt { font: 700 .74rem/2.1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.fields dd { margin: 0; font: 700 1.38rem/1.5 var(--mono); color: var(--ink); }

.ticket-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end; }
/* a real Code 128 (tools/make_barcode.py); scan it */
.barcode { height: 46px; color: var(--ink); opacity: .92; }
.barcode svg { display: block; width: 100%; height: 100%; }
.fine { font: 500 .72rem/1.35 var(--mono); color: var(--ink-soft); text-align: right; max-width: 21ch; }

/* the stub: the main action. The link stays whole for the pointer; the coloured face is what tears.
   On hover the stub rips from the top of the perforation and curls back (geometry drawn by peel.js). */
.stub { position: relative; display: grid; text-decoration: none; color: var(--cream); text-align: center; border-radius: 0 22px 22px 0; }
.stub-face {
  position: relative; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: linear-gradient(170deg, #e4574a, var(--coral) 45%, var(--coral-deep));
  border-radius: 0 22px 22px 0; padding: 30px 26px;
  -webkit-mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
          mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) top / 100% 51% no-repeat,
                radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
}
.stub-face::before { /* perforation */
  content: ""; position: absolute; left: 0; top: var(--notch); bottom: var(--notch); width: 6px;
  background: radial-gradient(circle 3px at 3px 50%, rgba(255, 240, 220, .85) 98%, #0000) 0 0 / 6px 14px repeat-y;
}
.peel { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
/* the ticket holds still while its stub is being torn */
.ticket:has(.stub:hover) { transform: rotate(-1.6deg); }
.stub .icon { width: 74px; height: 74px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12); }
.stub .icon svg { width: 46px; height: 46px; fill: var(--coral-deep); }
.stub .cta { font: 900 2.1rem/1.02 var(--round); text-shadow: 0 2px 0 rgba(90, 20, 15, .35); }
.stub .admit { font: 700 .72rem/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; opacity: .85; }

/* the train peeking in */
.train { position: absolute; left: -96px; bottom: -78px; width: min(370px, 32vw); pointer-events: none; transform: rotate(-3deg); filter: drop-shadow(0 14px 14px rgba(8, 40, 85, .35)); }

/* ---------- small tickets ---------- */
.minis { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; margin-top: -10px; }
.mini {
  --n: 10px;
  display: inline-flex; align-items: center; gap: 12px; min-height: 58px;
  padding: 12px 28px; text-decoration: none; color: var(--ink); cursor: pointer;
  font: 700 1.05rem/1.2 var(--mono); border: 0;
  background: linear-gradient(180deg, var(--paper), #f4e3c0);
  filter: drop-shadow(0 10px 12px rgba(8, 40, 85, .32));
  -webkit-mask: radial-gradient(circle var(--n) at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--n) at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--n) at 0 50%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--n) at 100% 50%, #0000 98%, #000) right / 51% 100% no-repeat;
  border-radius: 8px; transition: transform .25s ease;
}
.mini:nth-child(1) { transform: rotate(1.4deg); }
.mini:nth-child(2) { transform: rotate(-1.2deg); }
.mini:hover, .mini:focus-visible { transform: rotate(0) translateY(-3px); }
.mini svg { width: 20px; height: 20px; flex: none; stroke: var(--coral-deep); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mini span { min-width: 0; overflow-wrap: anywhere; }
.mini .copied { font-size: .78rem; color: var(--coral-deep); }

/* ---------- trailer ---------- */
.screen { display: grid; gap: 16px; justify-items: center; }
.screen h2 { margin: 0; font: 900 1.5rem/1.2 var(--round); text-wrap: balance; text-align: center; color: var(--cream); text-shadow: 0 2px 0 rgba(10, 40, 80, .35); }
.screen video { width: 100%; max-width: 960px; aspect-ratio: 16 / 9; border-radius: 16px; background: #10213a; box-shadow: 0 20px 34px rgba(8, 40, 85, .4); border: 6px solid var(--paper); }

/* ---------- press kit: platforms of paper sheets and photo frames ---------- */
.kit { display: grid; gap: 56px; }
a.logo { display: block; }
.press h1.sub { margin: -12px 0 0 6px; }
.press .fields dd { font-size: 1.12rem; min-width: 0; overflow-wrap: anywhere; }
.press .fields dd a { color: var(--coral-deep); text-underline-offset: 3px; }
.press .stub .cta { font-size: 1.9rem; }

.platform { display: grid; gap: 16px; }
.platform-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.platform-head .no {
  font: 700 .74rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  background: var(--coral-deep); color: var(--cream); padding: 7px 10px; border-radius: 6px;
}
.platform-head h2 { margin: 0; font: 900 1.6rem/1.2 var(--round); color: var(--cream); text-shadow: 0 2px 0 rgba(10, 40, 80, .35); }
.platform-head .hint { font: 500 .8rem/1.3 var(--mono); color: var(--cream); opacity: .9; }
.platform-head .dl { margin-left: auto; }

.sheet, .frame {
  background: linear-gradient(180deg, var(--paper), #f6e6c4);
  box-shadow: 0 16px 24px rgba(8, 40, 85, .3), 0 2px 3px rgba(8, 40, 85, .2);
}
.sheet { border-radius: 18px; padding: 26px 32px; display: grid; gap: 16px; }
.sheet video { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; background: #10213a; display: block; }
.sheet .row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; }
.note { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.note a { color: var(--coral-deep); text-underline-offset: 3px; }
.dls { display: flex; flex-wrap: wrap; gap: 10px; }

.prose { gap: 0; max-width: none; }
.prose .lede { font: 800 1.25rem/1.4 var(--round); margin: 0 0 6px; }
.prose h3 { margin: 18px 0 6px; font: 700 .76rem/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--coral-deep); }
.prose p { margin: 0; max-width: 70ch; }
.prose ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; max-width: 74ch; }
.prose li::marker { color: var(--coral); }
.prose a { color: var(--coral-deep); text-underline-offset: 3px; }

.grid { display: grid; gap: 20px; }
.shots, .loops, .art { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.art { align-items: start; }
.shots .frame:first-child { grid-column: 1 / -1; transform: none; }
.frame { margin: 0; border-radius: 12px; padding: 10px 10px 12px; display: grid; gap: 10px; }
.frame:nth-child(3n+1) { transform: rotate(-.5deg); }
.frame:nth-child(3n+2) { transform: rotate(.4deg); }
.frame.wide { grid-column: 1 / -1; transform: none; }
.frame > a { display: block; border-radius: 7px; overflow: hidden; }
.frame img, .frame video { width: 100%; height: auto; display: block; border-radius: 7px; }
.frame > a img { transition: transform .3s ease; }
.frame > a:hover img { transform: scale(1.03); }
.frame .logo-bg { background: var(--water) url("/assets/water-bg.webp") center / cover; padding: 22px; display: grid; place-items: center; min-height: 150px; }
.frame .logo-bg img { width: auto; max-width: 100%; max-height: 120px; border-radius: 0; }
.frame .logo-bg .icon-img { border-radius: 22%; }
.frame figcaption { display: flex; justify-content: space-between; align-items: center; gap: 10px; font: 700 .82rem/1.3 var(--mono); color: var(--ink); padding: 0 4px; }

/* download chips: little tear-off coupons */
.dl {
  display: inline-flex; align-items: center; gap: 6px; flex: none; white-space: nowrap;
  font: 700 .78rem/1 var(--mono); color: var(--coral-deep); text-decoration: none;
  background: var(--cream); border: 2px dashed rgba(178, 53, 42, .45); border-radius: 8px; padding: 7px 10px;
  transition: background .15s ease, color .15s ease;
}
.dl svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.dl:hover, .dl:focus-visible { background: var(--coral-deep); color: var(--cream); border-color: var(--coral-deep); }
.dl.on-water { box-shadow: 0 6px 12px rgba(8, 40, 85, .3); }

/* ---------- footer ---------- */
footer { display: grid; gap: 6px; justify-items: center; color: var(--cream); font-size: .92rem; text-align: center; }
footer .thanks { font-weight: 800; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; opacity: .9; }
footer a { text-underline-offset: 3px; }

/* ---------- phone: the ticket stands up ---------- */
@media (max-width: 760px) {
  :root { --notch: 15px; }
  .page { gap: 32px; padding-block: 14px 32px; }
  main { gap: 32px !important; }
  .pa { font-size: .8rem; line-height: 1.35; border-radius: 14px; padding: 8px 14px; }
  .pa svg { width: 16px; height: 16px; }
  .ticket { grid-template-columns: 1fr; transform: rotate(-.8deg); }
  .ticket:hover { transform: rotate(-.8deg); }
  .ticket-body {
    border-radius: 20px 20px 0 0; padding: 22px 20px 18px; gap: 14px;
    -webkit-mask: radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) right / 51% 100% no-repeat;
            mask: radial-gradient(circle var(--notch) at 0 100%, #0000 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle var(--notch) at 100% 100%, #0000 98%, #000) right / 51% 100% no-repeat;
  }
  .serial { display: none; }
  h1.sub { font-size: .95rem; }
  .fields { gap: 2px 14px; }
  .fields dt { font-size: .66rem; line-height: 2; }
  .fields dd { font-size: 1rem; }
  .ticket-body > p { font-size: .95rem; line-height: 1.45; }
  .ticket-foot { grid-template-columns: 1fr; gap: 8px; }
  .barcode { height: 30px; }
  .fine { text-align: left; max-width: none; }
  .stub { border-radius: 0 0 20px 20px; }
  .stub-face {
    border-radius: 0 0 20px 20px; padding: 24px 20px 28px; grid-auto-flow: column; gap: 16px; align-items: center;
    -webkit-mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) right / 51% 100% no-repeat;
            mask: radial-gradient(circle var(--notch) at 0 0, #0000 98%, #000) left / 51% 100% no-repeat,
                  radial-gradient(circle var(--notch) at 100% 0, #0000 98%, #000) right / 51% 100% no-repeat;
  }
  .stub-face::before { left: var(--notch); right: var(--notch); top: 0; bottom: auto; width: auto; height: 6px;
    background: radial-gradient(circle 3px at 50% 3px, rgba(255, 240, 220, .85) 98%, #0000) 0 0 / 14px 6px repeat-x; }
  .ticket:has(.stub:hover) { transform: rotate(-.8deg); }
  .stub .icon { width: 58px; height: 58px; }
  .stub .icon svg { width: 36px; height: 36px; }
  .stub .cta { font-size: 1.65rem; text-align: left; }
  .stub .admit { display: none; }
  .train { position: relative; left: auto; bottom: auto; width: 62%; margin: -18px auto 0; transform: rotate(-2deg); }
  .hero { padding-bottom: 0; }
  .minis { flex-direction: column; align-items: stretch; margin-top: 0; }
  .mini { justify-content: center; padding-inline: 20px; font-size: .95rem; }
  .kit { gap: 32px; }
  .press h1.sub { margin-top: -8px; }
  .press .fields dd { font-size: .95rem; }
  .press .stub .cta { font-size: 1.5rem; }
  .sheet { padding: 20px 18px; border-radius: 14px; }
  .prose .lede { font-size: 1.08rem; }
  .shots, .loops, .art { grid-template-columns: 1fr; }
  .frame, .frame:nth-child(n) { transform: none; }
  .platform-head h2 { font-size: 1.35rem; }
  .platform-head .dl { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
