/* Dr Kravens Candy Co. — retro soda-fountain, modern layout.
   Fonts are self-hosted (SIL OFL 1.1): Oswald, Source Sans 3, Pacifico. */

@font-face {
  font-family: "Oswald";
  src: url("/static/assets/fonts/oswald-var.bd73278ee0.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/static/assets/fonts/source-sans-3-var.19143dca07.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Pacifico";
  src: url("/static/assets/fonts/pacifico-400.99ec044ad9.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #FBF3E2;
  --cream-2: #F4E6C8;
  --teal: #2A7776;
  --teal-dark: #1F5C5B;
  --cherry: #C2182B;
  --cherry-dark: #9E1222;
  --brown: #2B1D14;
  --tan: #8A5A36;
  --white: #FFFFFF;

  --font-head: "Oswald", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-script: "Pacifico", "Brush Script MT", cursive;

  --radius: 14px;
  --shadow: 0 2px 0 var(--brown), 0 10px 24px rgba(43, 29, 20, 0.12);
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--brown);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.75rem, 9vw, 5.5rem); color: var(--cherry); }
h2 { font-size: clamp(2rem, 5.5vw, 3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

a { color: var(--teal-dark); text-underline-offset: 0.15em; }
a:hover { color: var(--cherry); }

:focus-visible {
  outline: 3px solid var(--cherry);
  outline-offset: 3px;
  border-radius: 4px;
}

.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;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--brown); color: var(--cream);
  padding: 0.5rem 1rem; z-index: 100; border-radius: 0 0 8px 8px;
}
.skip-link:focus { top: 0; color: var(--cream); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.center { text-align: center; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 3px solid var(--brown);
  background: var(--cream);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--brown);
}
.brand:hover { color: var(--brown); }
.brand-mark {
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--cherry); color: var(--cream);
  font-family: var(--font-script); font-size: 1.35rem; line-height: 1;
  box-shadow: 0 0 0 3px var(--cream), 0 0 0 5px var(--brown);
}
.brand-name { font-family: var(--font-script); font-size: 1.6rem; line-height: 1; color: var(--cherry); }
.brand-sub {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.85rem; font-weight: 600;
}
.nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 0.25rem 1.25rem; flex-wrap: wrap;
}
.nav-list a {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600; font-size: 1rem; color: var(--brown); text-decoration: none;
  padding: 0.5rem 0.1rem; display: inline-block;
}
.nav-list a:hover { color: var(--cherry); text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 700; font-size: 1.1rem; line-height: 1.2;
  padding: 0.85rem 1.6rem; min-height: 48px;
  border: 3px solid var(--brown); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.btn-primary { background: var(--cherry); color: var(--white); box-shadow: 0 4px 0 var(--brown); }
.btn-primary:hover { background: var(--cherry-dark); color: var(--white); transform: translateY(-1px); box-shadow: 0 5px 0 var(--brown); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--brown); }
.btn-ghost { background: transparent; color: var(--brown); }
.btn-ghost:hover { background: var(--brown); color: var(--cream); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(1.25rem, 4vw, 2.5rem) 0 clamp(2.5rem, 7vw, 4.5rem);
  background:
    radial-gradient(ellipse at 70% 40%, rgba(251, 243, 226, 0) 0%, var(--cream) 70%),
    var(--cream);
}
/* Headline spans the banner width: one line on wider screens, two on phones */
.hero h1 {
  text-align: center; margin: 0 0 clamp(0.75rem, 2vw, 1.25rem);
  font-size: clamp(2.25rem, 13.9vw, 4.1rem); line-height: 0.95; letter-spacing: 0.005em;
}
@media (min-width: 600px) {
  .hero h1 { font-size: min(7.4vw, 5.4rem); white-space: nowrap; }
  .hero h1 .line { display: inline; }
}
.hero-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 2.5rem; margin-top: clamp(1.25rem, 3vw, 2rem);
}
.hero .lede { margin: 0; flex: 1 1 26rem; }
.hero-actions { margin-top: 0; }

/* Hero banner: the vintage poster, already aged at its edges */
.hero-banner { display: block; }
.hero-banner img {
  width: 100%; height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 0 rgba(58, 30, 12, 0.35), 0 18px 36px rgba(58, 30, 12, 0.28);
}
.eyebrow {
  font-family: var(--font-script); color: var(--teal-dark);
  font-size: clamp(1.35rem, 3.5vw, 1.75rem); margin-bottom: 0.25em;
}
.lede { font-size: clamp(1.15rem, 2.4vw, 1.35rem); max-width: 34em; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.75rem; }

.hero-copy { position: relative; z-index: 1; }
h1 .line { display: block; }
.pouch-art { position: relative; display: grid; place-items: center; min-height: 320px; padding: 1.5rem 0; }
/* Static SVG (a CSS conic-gradient + mask cost ~500ms of main-thread paint on mobile). */
.sunburst {
  position: absolute; z-index: 0;
  left: 50%; top: 50%;
  width: min(150vw, 760px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: url("/static/assets/sunburst.0251a6fc42.svg") center / contain no-repeat;
}
.pouch {
  position: relative; z-index: 1;
  width: min(78vw, 380px);
  filter: drop-shadow(0 18px 24px rgba(43, 29, 20, 0.28));
  transform: rotate(-4deg);
}
.pouch img { width: 100%; height: auto; }
.badge {
  position: absolute; z-index: 2; right: 6%; top: 4%;
  width: 6.5rem; height: 6.5rem; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: var(--cherry); color: var(--white);
  font-family: var(--font-head); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; font-size: 1rem; line-height: 1.1; padding: 0.75rem;
  border: 3px dashed var(--cream); box-shadow: 0 0 0 4px var(--cherry), var(--shadow);
  transform: rotate(10deg); margin: 0;
}

/* ---------- Sections ---------- */
.section { padding: clamp(3rem, 8vw, 5.5rem) 0; }
.section-intro { max-width: 40em; font-size: 1.2rem; }

.band-dark { background: var(--brown); color: var(--cream); padding: clamp(3rem, 8vw, 5rem) 0; position: relative; }
.band-dark h2 { color: var(--cream); }
.story p { font-size: clamp(1.2rem, 2.6vw, 1.4rem); }
.story h2::after, .band-teal h2::after {
  content: ""; display: block; width: 4.5rem; height: 5px; margin-top: 0.6rem;
  background: var(--cherry); border-radius: 3px;
}

.band-teal { background: var(--teal); color: var(--white); }
.band-teal h2 { color: var(--white); }
.band-teal h2::after { background: var(--cream); }

.band-cherry { background: var(--cherry); color: var(--white); }
.band-cherry h2 { color: var(--white); }
.band-cherry a:not(.btn) { color: var(--white); }


.card {
  background: var(--white); color: var(--brown);
  border: 3px solid var(--brown); border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--brown);
  padding: clamp(1.25rem, 4vw, 2.25rem);
}

/* ---------- Forms ---------- */
.field { margin-bottom: 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; }
label { font-weight: 600; }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  font: inherit; font-size: 1.05rem; color: var(--brown);
  background: var(--cream); width: 100%;
  border: 2px solid var(--tan); border-radius: 10px;
  padding: 0.7rem 0.85rem; min-height: 48px;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: 3px solid rgba(42, 119, 118, 0.35); outline-offset: 0; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--cherry); }

.field.check { flex-direction: row; align-items: flex-start; gap: 0.65rem; }
.field.check input { width: 1.4rem; height: 1.4rem; margin: 0.15rem 0 0; flex: none; accent-color: var(--cherry); }
.field.check label { font-weight: 400; }

.grid-2 { display: grid; gap: 0 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Honeypot: off-screen, not display:none (some bots skip hidden fields) */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin: 1rem 0 0; font-weight: 600; min-height: 1.6em; }
.form-status:focus { outline: none; }
.form-status.is-error { color: var(--cherry); }
.form-status.is-success {
  color: var(--teal-dark); background: var(--cream);
  border-left: 5px solid var(--teal); padding: 0.75rem 1rem; border-radius: 6px;
}
.band-teal .form-status.is-error { color: var(--cherry); }

/* ---------- Flavor vote ---------- */
.flavor-grid {
  border: 0; padding: 0; margin: 2rem 0;
  display: grid; gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .flavor-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .flavor-grid { grid-template-columns: repeat(3, 1fr); } }
.flavor { position: relative; }
.flavor input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
}
.flavor label {
  display: flex; flex-direction: column; gap: 0.35rem; height: 100%;
  background: var(--cream); color: var(--brown);
  border: 3px solid var(--brown); border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1.25rem; cursor: pointer;
  box-shadow: 4px 4px 0 var(--brown);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  font-weight: 400;
}
.flavor label:hover { transform: translateY(-2px); box-shadow: 6px 6px 0 var(--brown); }
.flavor-number {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 0.85rem; font-weight: 600; color: var(--tan);
}
.flavor-name { font-family: var(--font-script); font-size: 1.6rem; line-height: 1.3; color: var(--cherry); }
.flavor-desc { font-size: 1rem; }
.flavor-check {
  position: absolute; top: 0.85rem; right: 0.85rem;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 3px solid var(--brown); background: var(--white);
}
.flavor input:checked + label { background: var(--white); outline: 4px solid var(--cherry); outline-offset: 0; }
.flavor input:checked + label .flavor-check {
  background: var(--cherry);
  box-shadow: inset 0 0 0 3px var(--white);
}
.flavor input:focus-visible + label { outline: 4px solid var(--cream); outline-offset: 3px; }
.flavor-grid[aria-invalid="true"] .flavor label { border-color: var(--cherry); }

.vote-details { max-width: 640px; }

/* ---------- Buy ---------- */
.buy .btn-primary { background: var(--white); color: var(--cherry); }
.buy .btn-primary:hover { background: var(--cream); color: var(--cherry-dark); }
.coming-soon {
  display: inline-block; font-family: var(--font-head); text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 700; font-size: 1.25rem;
  border: 3px dashed var(--white); border-radius: 999px; padding: 0.75rem 1.75rem;
  margin-bottom: 1rem;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--brown); color: var(--cream); padding: 2rem 0; font-size: 1rem; }
.site-footer a { color: var(--cream); }
.site-footer a:hover { color: var(--white); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; justify-content: space-between; }
.footer-inner p { margin: 0; }

.noscript { background: var(--cream-2); padding: 1rem var(--gutter); margin: 0; text-align: center; }

/* ---------- Privacy / prose ---------- */
.prose h1 { font-size: clamp(2.25rem, 7vw, 3.5rem); }
.prose h2 { font-size: 1.6rem; margin-top: 2rem; color: var(--teal-dark); }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.5rem; }
.draft-banner {
  display: inline-block; background: var(--cherry); color: var(--white);
  font-family: var(--font-head); font-weight: 700; letter-spacing: 0.06em;
  padding: 0.3rem 0.8rem; border-radius: 6px;
}

/* Trademark symbol beside the script wordmark */
.tm {
  font-family: var(--font-body); font-weight: 600;
  font-size: 0.45em; vertical-align: super; line-height: 0;
  margin-left: 0.1em; color: var(--brown);
}

/* ======================================================================
   Antique tin-sign theme (textures from art/make-art.sh)
   Raster textures only: no CSS filters/blend modes on large areas (paint cost).
   ====================================================================== */
:root {
  --rust: #8A3F16;
  --rust-dark: #5A2A0E;
  --tin: #EFE2C4;
  --age-shadow: rgba(58, 30, 12, 0.38);
}

/* Aged paper everywhere light */
body,
.site-header,
.hero {
  background-color: var(--cream);
  background-image: url("/static/assets/paper.1df40bd902.webp");
  background-size: 480px 480px;
}

/* Hero: darkened, aged edges like an old print */
.hero {
  box-shadow: inset 0 0 120px rgba(138, 90, 54, 0.22);
}

/* Colored bands: light grain + burnt top/bottom edges (straight lines, no scallops) */
.band-dark, .band-teal, .band-cherry, .site-footer {
  background-image: url("/static/assets/grain-light.99b836f26e.webp");
  background-size: 480px 480px;
  box-shadow:
    inset 0 22px 30px -22px rgba(0, 0, 0, 0.55),
    inset 0 -22px 30px -22px rgba(0, 0, 0, 0.55);
}
.site-header { border-bottom-color: var(--rust-dark); }

/* Tin-sign cards: rusty rim (9-slice border image), aged tin face */
.card {
  border: 16px solid transparent;
  border-image: url("/static/assets/rust-frame.849ce28e39.webp") 48 round;
  border-radius: 0;
  background: var(--tin) url("/static/assets/paper.1df40bd902.webp") padding-box;
  background-size: 480px 480px;
  box-shadow: none;
}
.card input[type="text"], .card input[type="email"], .card input[type="tel"],
.card select, .card textarea {
  background: #FFFBF2;
  border-color: #9C7A55;
}

/* Flavor cards as little tin tags */
.flavor label {
  border: 10px solid transparent;
  border-image: url("/static/assets/rust-frame.849ce28e39.webp") 48 round;
  border-radius: 0;
  background: var(--tin) url("/static/assets/paper.1df40bd902.webp") padding-box;
  background-size: 480px 480px;
  box-shadow: none;
  padding: 0.85rem 1rem 1rem;
}
.flavor label:hover { box-shadow: none; transform: translateY(-2px); }
.flavor-check { top: 1rem; right: 1rem; }
.flavor input:checked + label { background-color: #FFFBF2; outline: 4px solid var(--cream); outline-offset: 2px; }

/* Story: copy + pouch */
.story-inner {
  display: grid; gap: 2.5rem; align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 860px) {
  .story-inner { grid-template-columns: 1.1fr 0.9fr; gap: 4rem; }
}
.story-copy { max-width: 36em; }
.story .pouch { filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.5)); }

/* Buttons: a touch of age */
.btn-primary { box-shadow: 0 4px 0 var(--rust-dark), inset 0 0 12px rgba(0, 0, 0, 0.18); border-color: var(--rust-dark); }
.btn-ghost { border-color: var(--rust-dark); }
.badge { box-shadow: 0 0 0 4px var(--cherry), 0 8px 18px var(--age-shadow); }

/* Story band: keep the pouch sunburst from causing horizontal scroll */
.story { overflow: hidden; }

/* Phones: let the hero banner run edge to edge so its lettering stays legible */
@media (max-width: 599px) {
  .hero-banner-wrap { margin: 0 calc(-1 * var(--gutter)); }
  .hero-banner img { border-radius: 0; box-shadow: 0 10px 20px rgba(58, 30, 12, 0.25); }
}
