:root {
  --paper: #F8EEDC;
  --paper-2: #F1E1C2;
  --cream: #FFF8EA;
  --ink: #2E1B0E;
  --ink-soft: #5E4632;
  --rule: #CDB18A;
  --tomato: #C8432B;
  --tomato-dark: #9E3220;
  --butter: #F2C14E;
  --syrup: #8B4513;
  --leaf: #5E8A3A;

  --serif: "Fraunces", "Iowan Old Style", Charter, Georgia, serif;
  --mono: "Courier Prime", "Courier New", monospace;

  /* Jupiter swap box colors (r, g, b): a dark griddle panel, butter buttons */
  --jupiter-plugin-primary: 242, 193, 78;
  --jupiter-plugin-background: 46, 27, 14;
  --jupiter-plugin-primaryText: 255, 248, 234;
  --jupiter-plugin-warning: 232, 140, 60;
  --jupiter-plugin-interactive: 92, 62, 38;
  --jupiter-plugin-module: 64, 41, 24;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .18 0 0 0 0 .11 0 0 0 0 .05 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  font-variation-settings: "SOFT" 50, "WONK" 0;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--butter); color: var(--ink); }

a { color: inherit; }

:focus-visible { outline: 3px solid var(--tomato); outline-offset: 3px; }

img, svg { max-width: 100%; }

[hidden] { display: none !important; }

/* ---------- top ---------- */

.sunday-bar {
  background: var(--tomato);
  color: var(--cream);
  text-align: center;
  border-bottom: 3px solid var(--ink);
}
.sunday-bar p { margin: 0; padding: 9px 16px; font-weight: 700; font-style: italic; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  border-bottom: 2px solid var(--ink);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.wordmark svg { width: 38px; height: 38px; }

.top nav { display: flex; align-items: center; gap: 22px; }
.top nav a:not(.btn) {
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
}
.top nav a:not(.btn):hover { border-bottom-color: var(--tomato); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  background: var(--tomato);
  color: var(--cream);
  font: inherit;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .08s ease, box-shadow .08s ease, background-color .15s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); background: var(--tomato-dark); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-quiet { background: var(--cream); color: var(--ink); }
.btn-quiet:hover { background: var(--paper-2); }
.btn-small { padding: 8px 14px; font-size: 16px; }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 56px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.dayline {
  margin: 0 0 12px;
  color: var(--tomato);
  font-style: italic;
  font-weight: 600;
  font-size: 21px;
}

h1, h2, h3 { font-variation-settings: "SOFT" 100, "WONK" 1; }

h1 {
  margin: 0 0 20px;
  font-size: clamp(46px, 6.6vw, 92px);
  line-height: .95;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.lead { margin: 0 0 28px; font-size: 21px; max-width: 32em; color: var(--ink-soft); }
.lead span { color: var(--ink); font-weight: 600; }

.count {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin: 0 0 26px;
  padding: 14px 0 16px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
.count-num {
  font-size: clamp(64px, 8.6vw, 116px);
  line-height: .82;
  font-weight: 900;
  color: var(--tomato);
  font-variant-numeric: tabular-nums lining-nums;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.03em;
}
.count-num.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: translateY(-6px) scale(1.04); } }
.count-label { font-size: 20px; font-weight: 700; line-height: 1.2; padding-bottom: 4px; }
.count-label small { font-size: 15px; font-weight: 400; font-style: italic; color: var(--ink-soft); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }

.receipt {
  margin: 0;
  max-width: 440px;
  font-family: var(--mono);
  font-size: 16px;
}
.receipt div { display: flex; align-items: baseline; padding: 3px 0; }
.receipt dt { display: flex; flex: 1; align-items: baseline; }
.receipt dt::after {
  content: "";
  flex: 1;
  margin: 0 8px;
  border-bottom: 2px dotted var(--rule);
  transform: translateY(-4px);
}
.receipt dd { margin: 0; font-weight: 700; }

/* the illustration */

.plate-frame { margin: 0; }
.scene-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  border: 3px solid var(--ink);
  border-radius: 6px;
  overflow: hidden;
  background: #F5E4C6;
  box-shadow: 8px 8px 0 var(--ink);
}
#scene { display: block; width: 100%; height: 100%; }

.plate-frame figcaption {
  margin-top: 22px;
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
  min-height: 2.4em;
}

.cal-day { font: 700 13px var(--serif); fill: var(--cream); letter-spacing: .08em; }
.cal-date { font: 900 58px var(--serif); fill: var(--ink); }
.cal-note { font: italic 600 12px var(--serif); fill: var(--tomato); }

.pupil { transition: transform .4s cubic-bezier(.3, .7, .3, 1); }
#monkeyBack, #monkeyFront, #tail, #eyes, #brows { transform-box: fill-box; }
#tail { transform-origin: 90% 95%; animation: sway 4.5s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(-5deg); } }
.fx-label { font: 800 20px var(--serif); fill: var(--ink); paint-order: stroke; stroke: var(--cream); stroke-width: 5px; }

/* ---------- section heads ---------- */

section { scroll-margin-top: 20px; }

.section-head { max-width: 1200px; margin: 0 auto 32px; padding: 0 24px; }
.section-head h2 {
  margin: 0 0 6px;
  font-size: clamp(36px, 4.6vw, 58px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.section-head p { margin: 0; font-size: 19px; font-style: italic; color: var(--ink-soft); }

/* ---------- story ---------- */

.story { padding: 72px 0 80px; border-top: 2px solid var(--ink); }

.book {
  display: grid;
  grid-template-columns: 1fr 1fr;
  row-gap: 32px;
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 24px;
}
.page {
  position: relative;
  padding: 34px 38px 58px;
  border: 2.5px solid var(--ink);
  background: var(--cream);
}
.page:nth-child(odd) {
  border-right-width: 1px;
  background: linear-gradient(to left, rgba(46, 27, 14, .12), rgba(46, 27, 14, 0) 46px), var(--cream);
}
.page:nth-child(even) {
  border-left-width: 1px;
  background: linear-gradient(to right, rgba(46, 27, 14, .12), rgba(46, 27, 14, 0) 46px), var(--cream);
}
.page h3 { margin: 0 0 16px; font-size: 34px; line-height: 1.05; font-weight: 800; }
.page .ch { display: block; margin-bottom: 4px; font-size: 17px; font-style: italic; font-weight: 600; color: var(--tomato); }
.page p { margin: 0 0 14px; font-size: 19px; }
.dropcap::first-letter {
  float: left;
  margin: 6px 10px 0 0;
  font-size: 3.7em;
  line-height: .78;
  font-weight: 900;
  color: var(--tomato);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.folio {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  text-align: center;
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
}

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  max-width: 1152px;
  margin: 56px auto 0;
  padding: 0;
  list-style: none;
  border-top: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
}
.week li {
  position: relative;
  padding: 16px 14px 18px;
  border-left: 1px solid var(--rule);
  font-size: 16px;
  line-height: 1.35;
}
.week li:first-child { border-left: 0; }
.week b {
  display: block;
  margin-bottom: 4px;
  font-size: 24px;
  font-weight: 900;
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.week li[data-day="0"] b { color: var(--tomato); }
.wk-ticker { display: block; margin-bottom: 4px; font: 700 14px var(--mono); color: var(--tomato); word-break: break-all; }
.wk-ticker:empty { display: none; }
.wk-ticker a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.week li.past { color: var(--ink-soft); opacity: .6; }
.week li.today { background: var(--cream); }
.week li.today b::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 6px;
  width: 74px;
  height: 46px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 74 46'%3E%3Cpath d='M58 8C44 0 12 2 5 18s14 26 34 25 32-10 30-24C67 9 52 4 38 6' fill='none' stroke='%23C8432B' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
  pointer-events: none;
}

/* ---------- kitchen ---------- */

.kitchen { padding: 72px 0 80px; border-top: 2px solid var(--ink); background: rgba(241, 225, 194, .45); }

.kitchen-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  align-items: start;
}

.menu {
  padding: 30px 34px 26px;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  outline: 1.5px solid var(--ink);
  outline-offset: -9px;
}
.menu h3 { margin: 0; text-align: center; font-size: 40px; font-style: italic; font-weight: 800; }
.menu-sub { margin: 0 0 20px; text-align: center; font-style: italic; color: var(--ink-soft); }
.menu-list { margin: 0 0 20px; padding: 0; list-style: none; }
.menu-list li { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; font-size: 19px; }
.menu-list li span:first-child { font-weight: 700; }
.menu-list li span:last-child { font-family: var(--mono); font-size: 16px; }
.menu-list i { flex: 1; border-bottom: 2px dotted var(--rule); transform: translateY(-5px); }
.menu-note { margin: 0; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 16px; color: var(--ink-soft); }

.tickets-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tickets-head h3 { margin: 0; font-size: 28px; font-weight: 800; }
.live { font-family: var(--mono); font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--butter); border: 1.5px solid var(--ink); }
.live.on::before { background: var(--leaf); animation: pulse 2s ease-in-out infinite; }
.live.demo::before { background: var(--tomato); }
@keyframes pulse { 50% { opacity: .35; } }

.ticket-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ticket {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 16px;
  align-items: baseline;
  padding: 12px 16px;
  background: #FFFDF6;
  border: 1.5px solid var(--ink);
  border-left: 8px solid var(--tomato);
  font-family: var(--mono);
  font-size: 15px;
  text-decoration: none;
  color: var(--ink);
}
a.ticket:hover { background: var(--cream); }
.ticket.big { border-left-color: var(--syrup); }
.ticket.mine { border-left-color: var(--butter); background: #FFF6DA; }
.ticket-no { font-weight: 700; }
.ticket-what { font-family: var(--serif); font-size: 17px; }
.ticket-what b { font-weight: 800; }
.ticket-sol { font-weight: 700; text-align: right; }
.ticket-when { grid-column: 3; text-align: right; color: var(--ink-soft); font-size: 13px; }
.ticket-who { grid-column: 1 / 3; color: var(--ink-soft); font-size: 13px; }
.ticket.new { animation: ticketIn .45s cubic-bezier(.2, .8, .3, 1.2); }
@keyframes ticketIn { from { opacity: 0; transform: translateY(-14px) rotate(-1deg); } }
.ticket-empty { padding: 18px; border: 1.5px dashed var(--rule); font-style: italic; color: var(--ink-soft); }

/* ---------- order ---------- */

.order { padding: 72px 0 88px; border-top: 2px solid var(--ink); }

.order-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  align-items: start;
}

.swap {
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  background: var(--cream);
  overflow: hidden;
}
.swap-off { padding: 34px 36px; }
.swap-off-big { margin: 0 0 10px; font-size: 30px; font-weight: 800; font-variation-settings: "SOFT" 100, "WONK" 1; }
.swap-off p:last-child { margin: 0; color: var(--ink-soft); }
.swap:has(.jup:not([hidden])) { background: var(--ink); }
.jup { width: 100%; height: 480px; padding: 12px 0; }

.contract h3 { margin: 0 0 12px; font-size: 28px; font-weight: 800; }
.ca {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #FFFDF6;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ca:hover { background: var(--cream); }
.ca code { font-family: var(--mono); font-size: 15px; word-break: break-all; }
.ca span { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--tomato); }

.links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 20px 0; padding: 0; list-style: none; }
.links a { font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--tomato); }
.links a:hover { color: var(--tomato); }

.fineprint {
  margin: 0;
  padding-left: 14px;
  border-left: 3px solid var(--tomato);
  font-size: 16px;
  color: var(--ink-soft);
}

/* ---------- footer ---------- */

.foot {
  padding: 34px 24px 48px;
  border-top: 2.5px solid var(--ink);
  background: var(--paper-2);
  font-size: 15px;
  color: var(--ink-soft);
}
.foot p { max-width: 900px; margin: 0 auto 8px; }
.demo-note { font-weight: 700; color: var(--tomato); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--cream);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 10;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- smaller screens ---------- */

@media (max-width: 980px) {
  .hero { gap: 40px; }
  .kitchen-grid, .order-grid { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .week li:nth-child(5) { border-left: 0; }
  .week li:nth-child(n+5) { border-top: 1px solid var(--rule); }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .top { padding: 12px 16px; }
  .top nav { gap: 14px; }
  .top nav a:not(.btn) { display: none; }
  .wordmark { font-size: 22px; }

  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 28px 16px 56px; }
  .hero-text { display: contents; }
  .dayline { order: 1; font-size: 18px; }
  .hero h1 { order: 2; }
  .plate-frame { order: 3; margin-bottom: 24px; }
  .count { order: 4; }
  .actions { order: 5; }
  .lead { order: 6; font-size: 19px; }
  .receipt { order: 7; }
  .scene-wrap { box-shadow: 5px 5px 0 var(--ink); }
  .plate-frame figcaption { font-size: 17px; margin-top: 16px; }
  .count-label { font-size: 17px; }
  .actions .btn { flex: 1 1 auto; }

  .section-head { padding: 0 16px; }
  .story, .kitchen, .order { padding: 56px 0 60px; }
  .book { grid-template-columns: 1fr; padding: 0 16px; row-gap: 16px; }
  .page, .page:nth-child(odd), .page:nth-child(even) { border-width: 2.5px; background: var(--cream); padding: 26px 22px 50px; }
  .page h3 { font-size: 30px; }

  .week { grid-template-columns: 1fr; margin: 40px 16px 0; }
  .week li { display: flex; gap: 14px; align-items: baseline; border-left: 0; border-top: 1px solid var(--rule); padding: 10px 6px; }
  .week li:first-child { border-top: 0; }
  .week b { min-width: 48px; margin: 0; font-size: 20px; }
  .week li.today b::after { left: -8px; top: -2px; }

  .kitchen-grid, .order-grid { padding: 0 16px; gap: 32px; }
  .menu { padding: 26px 22px 22px; }
  .menu-list li { font-size: 17px; }
  .menu-list li span:last-child { font-size: 14px; }
  .swap-off { padding: 26px 22px; }
  .jup { height: 470px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #tail { animation: none; }
  .ticket.new, .count-num.bump { animation: none; }
}
