/* ==========================================================================
   Roll Call Canteen — opening-soon site
   Tokens are lifted from the Roll Call Canteen design system
   (tokens/colors.css, typography.css, spacing.css). Values are exact.
   Layout: one dark-green page read top to bottom — the lockup, the
   attendance card (sign-up), the cream footer. Type does the work; the
   only ornament is the brand's own ephemera (ovals, stamps, speckle).
   ========================================================================== */

:root {
  /* Colour */
  --rc-green-900: #163B1F;
  --rc-green-600: #2F613B;
  --rc-lime-400: #CDFC7C;
  --rc-lime-200: #E1FAB6;
  --rc-cream-100: #FFF8F3;
  --rc-cream-50: #FFFAF0;
  --rc-bone-100: #F7F7E3;

  --surface-page: var(--rc-green-900);
  --surface-paper: var(--rc-cream-50);
  --surface-card: var(--rc-cream-100);
  --text-on-green: var(--rc-lime-400);
  --text-on-green-quiet: var(--rc-cream-100);
  --text-on-cream: var(--rc-green-900);
  --line-on-green: color-mix(in oklab, var(--rc-lime-400) 30%, transparent);
  --line-hairline: color-mix(in oklab, var(--rc-green-900) 22%, transparent);

  /* Type. Freitag Heavy lives only in the outlined wordmark. Perfectly
     Nineties and Graphik are licensed and not yet supplied, so the
     documented Google Fonts substitutes carry the live text for now. */
  --font-serif: "Perfectly Nineties", "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Graphik", "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --size-serif-1: clamp(40px, 6vw, 88px);
  --size-serif-2: clamp(30px, 3.8vw, 56px);
  --size-serif-3: 24px;
  --size-body-lg: 18px;
  --size-body: 15px;
  --size-mono: 12px;
  --size-mono-sm: 10px;

  --tracking-label: 0.14em;
  --tracking-serif: -0.005em;

  /* Space */
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --page-margin: clamp(20px, 5vw, 88px);
  --page-max: 1280px;

  --radius-pill: 999px;
  --border-rule: 1.5px;

  --ease-standard: cubic-bezier(.2, .6, .2, 1);
  --ease-out-back: cubic-bezier(.34, 1.4, .64, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 420ms;

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-on-green-quiet);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--size-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color var(--duration-fast) var(--ease-standard); }
a:hover { color: var(--text-on-green); }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--rc-lime-400); color: var(--rc-green-900); }
:focus-visible { outline: 2px solid var(--rc-lime-400); outline-offset: 3px; }
.on-cream :focus-visible { outline-color: var(--rc-green-900); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.mono {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--size-mono);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  line-height: 1.4;
}
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: var(--tracking-serif); }
.nowrap { white-space: nowrap; }

/* ---------- Page frame ---------- */
.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-left: max(var(--page-margin), env(safe-area-inset-left, 0px));
  padding-right: max(var(--page-margin), env(safe-area-inset-right, 0px));
}

/* ---------- Header ---------- */
/* The header floats over the hero so the hero alone can be exactly one
   screen tall, with the sign-up starting just below the fold. */
:root { --head-h: 72px; }
.site-head {
  position: absolute;
  inset: 0 0 auto;
  z-index: 4;
  padding-block: var(--space-5);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.site-head .brand { color: var(--text-on-green); display: block; height: 18px; width: auto; }
.site-head .brand svg { height: 100%; width: auto; fill: currentColor; }
.site-head .meta {
  color: var(--text-on-green-quiet);
  opacity: .85;
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: flex-end;
  text-align: right;
}
.site-head .meta .sep { opacity: .5; }

/* ---------- Hero ---------- */
/* One screen: the lockup group is centred in the space left over, the
   "Sign the roll" cue sits on the bottom edge. */
.hero {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  row-gap: var(--space-5);
  min-height: 100vh;
  min-height: 100svh;
  padding-block: calc(var(--head-h) + var(--space-4)) var(--space-5);
}
.hero > .wrap {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: clamp(20px, 4.8vh, 56px);
  text-align: center;
}
/* The lockup is sized by whichever runs out first, width or height, so the
   whole hero fits a laptop screen without scrolling. 3.33 is its aspect ratio;
   440px is everything else in the hero. */
.lockup-wrap {
  position: relative;
  width: min(100%, 1120px, max(520px, calc((100vh - 440px) * 3.33)));
  width: min(100%, 1120px, max(520px, calc((100svh - 440px) * 3.33)));
  container-type: inline-size;
}
.lockup {
  position: relative;
  width: 100%;
  margin: 0;
  color: var(--text-on-green);
}
.lockup svg { width: 100%; height: auto; overflow: visible; fill: currentColor; }
.lockup svg.stack { display: none; }
.lockup .g { transform-box: fill-box; transform-origin: 50% 100%; }

.statement {
  font-size: var(--size-serif-2);
  line-height: 1.04;
  max-width: 22ch;
  margin: 0;
  color: var(--text-on-green-quiet);
  text-wrap: balance;
}
.menu-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-on-green-quiet);
  opacity: .85;
}
.menu-line li + li::before { content: "/"; margin-right: var(--space-4); opacity: .5; }

/* ---------- Stickers (the brand's oval ephemera) ---------- */
.stickers { position: absolute; inset: 0; pointer-events: none; }
.sticker {
  --rot: 0deg;
  position: absolute;
  display: inline-grid;
  place-items: center;
  padding: .42em 1.1em .5em;
  min-width: 4.6em;
  aspect-ratio: 2.25 / 1;
  border-radius: 50%;
  background: var(--rc-lime-400);
  color: var(--rc-green-900);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(20px, 2.6vw, 38px);
  line-height: 1;
  letter-spacing: var(--tracking-serif);
  white-space: nowrap;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  rotate: var(--rot);
  transition: scale var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard);
  box-shadow: 0 1px 0 color-mix(in oklab, var(--rc-green-900) 40%, transparent);
}
.sticker.round { aspect-ratio: 1; min-width: 2.6em; padding: .4em; font-style: normal; }
.sticker.outline { background: transparent; color: var(--rc-lime-400); box-shadow: inset 0 0 0 1.5px var(--rc-lime-400); }
.sticker.lifted { cursor: grabbing; scale: 1.06; box-shadow: 0 10px 24px -8px rgb(0 0 0 / .45); z-index: 3; }
.sticker.lifted, .sticker.dragged { transition: scale var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard); }

/* "opening soon" sits top right of the lockup, in the empty space beside
   "Canteen", sized against the lockup so it never touches a letter. */
.sticker.s-open {
  --rot: -8deg;
  right: 0;
  top: 63%;
  margin: 0;
  font-size: 2.6vw;
  font-size: 3.1cqi;
}
.sticker.s-everyday { --rot: 7deg; left: clamp(0px, 3vw, 40px); bottom: clamp(24px, 10vh, 120px); }

/* ---------- "Sign the roll" cue ---------- */
.cue {
  position: relative;
  z-index: 2;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 13px 24px;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1.5px var(--rc-lime-400);
  color: var(--rc-lime-400);
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.cue:hover { background: var(--rc-lime-400); color: var(--rc-green-900); }
.cue svg { width: 12px; height: 15px; animation: bob 1.8s var(--ease-standard) infinite; }
@keyframes bob { 0%, 100% { translate: 0 -1px; } 50% { translate: 0 3px; } }
.register { scroll-margin-top: 0; }

/* ---------- Register band ---------- */
.register {
  position: relative;
  background-color: var(--rc-green-900);
  background-image: url("assets/speckle.webp");
  background-size: clamp(360px, 42vw, 560px);
  background-repeat: repeat;
  padding-block: clamp(64px, 10vw, 128px);
}
.register .wrap { display: grid; justify-items: center; }

.card {
  position: relative;
  width: min(100%, 720px);
  background: var(--surface-card);
  color: var(--text-on-cream);
  border: var(--border-rule) solid var(--rc-green-900);
  box-shadow: inset 0 0 0 6px var(--surface-card), inset 0 0 0 7px var(--rc-green-900);
  padding: clamp(28px, 5vw, 56px) clamp(22px, 5vw, 56px) clamp(32px, 5vw, 56px);
  display: grid;
  gap: var(--space-5);
  justify-items: center;
  text-align: center;
}
.card .rc { color: var(--rc-green-900); height: 26px; }
.card .rc svg { height: 100%; width: auto; }
.card h2 {
  margin: 0;
  font-size: clamp(36px, 5.6vw, 62px);
  line-height: 1;
  color: var(--rc-green-900);
  text-wrap: balance;
}
.card .lede {
  margin: 0;
  max-width: 40ch;
  font-weight: 300;
  font-size: var(--size-body-lg);
  line-height: 1.4;
  color: var(--rc-green-900);
}

.roll-form { width: 100%; display: grid; gap: var(--space-3); justify-items: center; }
.roll-form .row {
  width: min(100%, 520px);
  display: flex;
  gap: var(--space-3);
  align-items: stretch;
}
.roll-form .row[hidden] { display: none; }
.roll-form .field { flex: 1 1 200px; min-width: 0; position: relative; }
.roll-form input[type="email"] {
  width: 100%;
  font: inherit;
  font-family: var(--font-sans);
  font-size: 17px;
  color: var(--rc-green-900);
  background: transparent;
  border: 0;
  border-bottom: var(--border-rule) solid var(--rc-green-900);
  border-radius: 0;
  padding: 12px 2px;
  outline-offset: 6px;
  transition: border-color var(--duration-fast) var(--ease-standard);
}
.roll-form input[type="email"]::placeholder { color: color-mix(in oklab, var(--rc-green-900) 45%, transparent); }
.roll-form input[type="email"][aria-invalid="true"] { border-bottom-color: #B3261E; }
.btn {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  padding: 12px 26px 13px;
  border-radius: var(--radius-pill);
  border: var(--border-rule) solid var(--rc-green-900);
  background: var(--rc-green-900);
  color: var(--rc-lime-400);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--size-mono);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.btn:hover { background: var(--rc-lime-400); color: var(--rc-green-900); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.roll-form .note { margin: 0; color: var(--rc-green-900); opacity: .7; font-size: var(--size-mono-sm); }
.roll-form .msg { margin: 0; min-height: 1.4em; color: var(--rc-green-900); font-weight: 400; }
.roll-form .msg[data-tone="error"] { color: #B3261E; }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Attendance grid — the brand's loyalty card, borrowed */
.attendance {
  position: relative;
  width: min(100%, 520px);
  margin-top: var(--space-2);
}
.attendance ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: var(--border-rule) solid var(--rc-green-900);
  box-shadow: 0 0 0 4px var(--surface-card), 0 0 0 5px var(--rc-green-900);
}
.attendance li {
  position: relative;
  aspect-ratio: 1.15 / 1;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: var(--size-serif-3);
  color: var(--rc-green-900);
  border-right: 1px solid var(--rc-green-900);
  border-bottom: 1px solid var(--rc-green-900);
  font-variant-numeric: tabular-nums;
}
.attendance li:nth-child(5n) { border-right: 0; }
.attendance li:nth-child(n+6) { border-bottom: 0; }
.attendance .stamp {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--rc-green-900);
  opacity: 0;
  pointer-events: none;
}
.attendance .stamp svg { width: 58%; height: auto; rotate: -14deg; }
.attendance.stamped .stamp { opacity: .92; animation: stamp 520ms var(--ease-out-back) both; }
@keyframes stamp {
  0%   { opacity: 0; transform: scale(2.4) rotate(8deg); }
  55%  { opacity: 1; transform: scale(.92) rotate(0deg); }
  100% { opacity: .92; transform: scale(1) rotate(0deg); }
}
.attendance .brb {
  position: absolute;
  left: -14px;
  bottom: -22px;
  font-size: 18px;
  padding: .3em .9em .4em;
  min-width: 3.2em;
  --rot: -6deg;
  cursor: default;
  pointer-events: none;
  color: var(--rc-green-900);
  box-shadow: inset 0 0 0 1.5px var(--rc-green-900);
}
.attendance .welldone {
  position: absolute;
  right: -18px;
  top: -28px;
  font-size: clamp(18px, 2.2vw, 24px);
  --rot: 6deg;
  cursor: default;
  pointer-events: none;
  opacity: 0;
  scale: .6;
}
.attendance.stamped .welldone { animation: pop 460ms 220ms var(--ease-out-back) both; }
@keyframes pop { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }

/* ---------- Footer ---------- */
.site-foot {
  background: var(--surface-paper);
  color: var(--text-on-cream);
  padding-block: clamp(56px, 8vw, 96px) var(--space-6);
}
.site-foot a:hover { color: var(--rc-green-600); }
.foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-7) var(--space-6);
  border-top: var(--border-rule) solid var(--rc-green-900);
  padding-top: var(--space-6);
}
.foot-grid > div { min-width: 0; display: grid; gap: var(--space-3); align-content: start; }
.foot-grid .mono { opacity: .75; }
.foot-grid .serif { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.12; margin: 0; }
.foot-grid .serif a { text-decoration-thickness: 1.5px; }
.foot-grid .fine { margin: 0; font-weight: 300; opacity: .8; max-width: 32ch; }

.foot-bottom {
  margin-top: clamp(56px, 8vw, 96px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
  border-top: 1px solid var(--line-hairline);
  padding-top: var(--space-5);
}
.foot-bottom .brb-line { margin: 0; font-size: clamp(24px, 3vw, 36px); line-height: 1; font-style: italic; }
.foot-bottom .brb-line span { font-style: normal; display: inline-block; padding: .05em .55em .14em; border: 1.5px solid currentColor; border-radius: 50%; font-size: .55em; vertical-align: .32em; margin-right: .35em; rotate: -5deg; }
.foot-bottom .legal { opacity: .7; }

/* ---------- Motion: the roll being called ---------- */
.js .lockup .g { opacity: 0; transform: translateY(14%); }
.js.ready .lockup .g { animation: call 640ms var(--ease-out-back) both; animation-delay: calc(140ms + var(--i) * 68ms); }
.js.ready .lockup .c { animation-delay: calc(820ms + var(--i) * 48ms); }
@keyframes call { to { opacity: 1; transform: translateY(0); } }

.js .sticker[data-drag]:not(.lifted):not(.dragged) { opacity: 0; }
.js.ready .sticker[data-drag]:not(.lifted):not(.dragged) { animation: drop 540ms var(--ease-out-back) both; }
.js.ready .s-open { animation-delay: 1380ms; }
.js.ready .s-everyday { animation-delay: 1480ms; }
@keyframes drop { from { opacity: 0; translate: 0 -18px; scale: 1.08; } to { opacity: 1; translate: 0 0; scale: 1; } }

.js .statement, .js .menu-line, .js .cue { opacity: 0; translate: 0 10px; }
.js.ready .cue { animation: fade 640ms 1600ms var(--ease-standard) both; }
.js.ready .statement { animation: fade 640ms 1100ms var(--ease-standard) both; }
.js.ready .menu-line { animation: fade 640ms 1240ms var(--ease-standard) both; }
@keyframes fade { to { opacity: 1; translate: 0 0; } }
.js.ready .menu-line { animation-name: fade-quiet; }
@keyframes fade-quiet { to { opacity: .85; translate: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .lockup .g, .js .sticker[data-drag], .js .statement, .js .menu-line, .js .cue { opacity: 1; transform: none; translate: 0 0; animation: none !important; }
  .cue svg { animation: none; }
  .js.ready .menu-line { opacity: .85; }
  .attendance.stamped .stamp, .attendance.stamped .welldone { animation-duration: 1ms !important; animation-delay: 0ms !important; }
  .sticker { transition: none; }
}

/* ---------- Narrow screens ---------- */
@media (max-width: 720px) {
  :root { --head-h: 64px; }
  .site-head { padding-block: var(--space-4); }
  .site-head .brand { height: 15px; }
  .site-head .meta { font-size: var(--size-mono-sm); flex-direction: column; align-items: flex-end; gap: 2px; }
  .site-head .meta .sep { display: none; }

  /* Phones get the stacked coaster lockup: ROLL over CALL fills the width
     instead of a 50px-tall strip. 1.14 is its aspect ratio. */
  .hero { padding-block: calc(var(--head-h) + var(--space-2)) var(--space-5); }
  .hero > .wrap { gap: clamp(16px, 2.6vh, 28px); }
  .lockup-wrap {
    display: grid;
    width: min(100%, 380px, max(250px, calc((100vh - 470px) * 1.14)));
    width: min(100%, 380px, max(250px, calc((100svh - 470px) * 1.14)));
  }
  .lockup svg.wide { display: none; }
  .lockup svg.stack { display: block; }
  .js.ready .lockup .c { animation-delay: calc(760ms + var(--i) * 48ms); }
  .statement { font-size: clamp(26px, 7.4vw, 32px); max-width: 18ch; }
  .menu-line { font-size: var(--size-mono-sm); display: grid; grid-template-columns: repeat(2, auto); justify-content: center; gap: var(--space-2) var(--space-5); text-align: left; }
  .menu-line li + li::before { content: none; }

  .sticker { font-size: 19px; }
  /* On the stacked lockup there's no room beside "Canteen", so the sticker
     sits just above ROLL, top right, tucked in but clear of the letters. */
  .sticker.s-open { position: relative; order: -1; justify-self: end; top: auto; right: -4px; margin-bottom: 10px; font-size: 20px; --rot: -7deg; }
  .sticker.s-everyday { display: none; }

  .register { background-image: url("assets/speckle-640.webp"); background-size: 320px; padding-block: var(--space-8); }
  .card { padding-top: var(--space-6); }
  .card h2 { font-size: clamp(32px, 9.5vw, 40px); }
  .card .lede { font-size: 16px; }
  .roll-form .row { flex-direction: column; gap: var(--space-5); }
  .roll-form .field { flex-basis: auto; }
  .roll-form .note { font-size: 9px; letter-spacing: .1em; }
  .btn { width: 100%; }
  .attendance .brb { left: -6px; bottom: -20px; font-size: 15px; }
  .attendance .welldone { right: -8px; top: -22px; }
  .attendance li { font-size: 19px; }
}
