/* The Great Breakfast Review — a retro diner order-ticket.
   Palette: buttermilk paper, ketchup red, butter/yolk gold, espresso ink,
   and a mint-green reserved to mean "just right". */

:root {
  --cream: #fff6e9;
  --paper: #fffdf7;
  --ketchup: #c8382e;
  --ketchup-dark: #9c2a22;
  --mustard: #e8a72c;
  --espresso: #2a211b;
  --mint: #3c7a6a;
  --chrome: #ddd0bd;
  --ink-soft: #6a5c4e;

  --serif: "Anton", "Arial Narrow", "Impact", sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
  --body: "DM Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--espresso);
  line-height: 1.5;
  overflow-x: hidden;
  /* diner counter: warm dark backdrop with faint gingham dots */
  background-color: #24140f;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 22px 22px;
  padding: clamp(0px, 3vw, 40px);
}

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

/* --- the ticket (paper card) --------------------------------------------- */
.ticket {
  max-width: 660px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: 4px;
  padding: clamp(20px, 5vw, 44px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  /* torn-receipt top & bottom edges */
  position: relative;
}
.ticket::before,
.ticket::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 12px;
  background:
    radial-gradient(circle at 8px -2px, transparent 8px, var(--paper) 9px) repeat-x;
  background-size: 20px 12px;
}
.ticket::before { top: -11px; transform: rotate(180deg); }
.ticket::after { bottom: -11px; }

/* --- masthead ------------------------------------------------------------ */
.masthead { text-align: center; }

.order-no {
  font-family: var(--hand);
  font-size: 1.35rem;
  color: var(--mint);
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

.masthead h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 15vw, 5.4rem);
  line-height: 0.86;
  letter-spacing: 0.01em;
  color: var(--ketchup);
  margin: 0.1em 0 0.2em;
  text-transform: uppercase;
  max-width: 100%;
  overflow-wrap: break-word;
  -webkit-text-stroke: 1px var(--ketchup-dark);
}

.tagline {
  font-size: 1.02rem;
  color: var(--ink-soft);
  max-width: 34ch;
  margin: 0 auto 1.4em;
}

.polaroid {
  display: inline-block;
  margin: 0 auto 1.2em;
  background: #fff;
  padding: 10px 10px 42px;
  border-radius: 2px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transform: rotate(-2.2deg);
  max-width: 300px;
}
.polaroid img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1px;
}
.polaroid figcaption {
  font-family: var(--hand);
  font-size: 1.25rem;
  color: var(--espresso);
  margin-top: 8px;
}

.how-to {
  background: #fbeede;
  border: 1px dashed var(--mustard);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-align: left;
}
.how-to strong { color: var(--mint); }

/* --- courses ------------------------------------------------------------- */
.course {
  border-top: 2px dashed var(--chrome);
  padding-top: 26px;
  margin-top: 30px;
}

.course-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.course-head > div { min-width: 0; }
.course-face {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid var(--mustard);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}
.eyebrow {
  font-family: var(--hand);
  font-size: 1.4rem;
  color: var(--ketchup);
  margin: 0;
  line-height: 1;
}
.course-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 5.5vw, 2rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 2px 0 4px;
  color: var(--espresso);
}
.blurb {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* --- questions ----------------------------------------------------------- */
.question { margin: 22px 0; }
.prompt {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 12px;
}

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* photo rating stamps — grid with minmax(0,1fr) so the 5 columns always
   divide the available width and can never overflow a narrow screen */
.scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(5px, 1.6vw, 12px);
}
.stamp {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-align: center;
}
.stamp input { position: absolute; opacity: 0; pointer-events: none; }
.stamp img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  border: 3px solid transparent;
  filter: grayscale(0.85) contrast(0.95) opacity(0.6);
  transition: transform 0.14s ease, filter 0.14s ease, border-color 0.14s ease;
  background: #eee;
}
.stamp-label {
  font-size: 0.72rem;
  line-height: 1.15;
  color: var(--ink-soft);
  min-height: 2.2em;
}
.stamp:hover img { filter: grayscale(0.3) opacity(0.9); transform: translateY(-2px); }
.stamp input:checked ~ img {
  filter: none;
  border-color: var(--ketchup);
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(200, 56, 46, 0.35);
}
.stamp input:checked ~ .stamp-label { color: var(--espresso); font-weight: 700; }
.stamp input:focus-visible ~ img { outline: 3px solid var(--mustard); outline-offset: 3px; }

/* the middle of a goldilocks arc is the good answer — hint it in mint */
.stamp.sweet-spot img { border-color: var(--mint); border-style: dashed; }
.stamp.sweet-spot input:checked ~ img {
  border-color: var(--mint);
  border-style: solid;
  box-shadow: 0 6px 16px rgba(60, 122, 106, 0.4);
}
.stamp.sweet-spot input:checked ~ .stamp-label { color: var(--mint); }

.axis {
  display: flex;
  justify-content: space-between;
  margin: 8px 2px 0;
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--ink-soft);
}
.axis span:nth-child(2) { color: var(--mint); }

/* fun radio choices as pills */
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: inline-block;
  padding: 9px 16px;
  border: 2px solid var(--chrome);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  background: var(--paper);
}
.choice:hover span { border-color: var(--mustard); }
.choice input:checked + span {
  background: var(--ketchup);
  border-color: var(--ketchup);
  color: #fff;
}
.choice input:focus-visible + span { outline: 3px solid var(--mustard); outline-offset: 2px; }

textarea {
  width: 100%;
  border: 2px solid var(--chrome);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--espresso);
  background: var(--cream);
  resize: vertical;
}
textarea:focus-visible { outline: 3px solid var(--mustard); outline-offset: 1px; border-color: var(--mustard); }

/* --- the check (receipt) ------------------------------------------------- */
.check {
  border-top: 3px double var(--espresso);
  margin-top: 34px;
  padding-top: 20px;
}
.check-head {
  font-family: var(--serif);
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-align: center;
  margin: 0 0 14px;
}
.check-line {
  display: flex;
  align-items: baseline;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 6px 0;
}
.check-line .dots {
  flex: 1;
  margin: 0 8px;
  border-bottom: 2px dotted var(--chrome);
  transform: translateY(-3px);
}
#progress { font-weight: 700; color: var(--espresso); }
.check-note {
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--ketchup);
  text-align: center;
  margin: 12px 0 18px;
}

#send {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--ketchup);
  color: #fff;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 16px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--ketchup-dark);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
#send:hover { background: #d13f34; }
#send:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ketchup-dark); }
#send:focus-visible { outline: 3px solid var(--mustard); outline-offset: 3px; }

.warn {
  margin: 12px 0 0;
  color: var(--ketchup);
  font-weight: 700;
  text-align: center;
}

.colophon {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 2px dashed var(--chrome);
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* --- thank-you page ------------------------------------------------------ */
.thanks-ticket { text-align: center; }
.thanks-face {
  width: 160px; height: 160px;
  object-fit: cover; object-position: top;
  border-radius: 50%;
  border: 5px solid var(--mustard);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  margin-bottom: 10px;
}
.thanks-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 10vw, 3.6rem);
  color: var(--ketchup);
  text-transform: uppercase;
  margin: 6px 0 14px;
}
.thanks-body { max-width: 42ch; margin: 0 auto 18px; color: var(--ink-soft); }
.thanks-sign { font-family: var(--hand); font-size: 1.4rem; color: var(--espresso); margin: 0 0 24px; }
.again-link { color: var(--mint); font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--mint); }
.again-link:hover { color: var(--ketchup); border-color: var(--ketchup); }

/* --- larger screens: labels roomier ------------------------------------- */
@media (min-width: 560px) {
  .stamp-label { font-size: 0.8rem; }
}

/* --- respect reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .polaroid { transform: none; }
}
