/* Preptide design system — every bite counts
   Brand: deep teal + mint + coral on warm cream
   Voice: calm, intelligent, premium, trustworthy */

:root {
  /* Cream surface — warm, premium paper */
  --bg: #FFF7EA;
  --bg-2: #F5ECD9;
  --paper: #FFFCF4;

  /* Deep teal — the primary brand mark, medical-trust */
  --ink: #0B5F5A;
  --ink-2: #1F2323;
  --ink-soft: #4A6B68;

  /* Coral — warmth, life, food, the appetite cue */
  --rust: #FF7A66;
  --rust-2: #E85F4A;
  --rust-glow: #FFB8AC;

  /* Mint — the soft "yes", fibre, protein */
  --butter: #D0F5DA;
  --butter-2: #A8E5BA;

  /* Stones — supporting greys with warmth */
  --stone: #9AA8A6;
  --stone-2: #C5D2D0;
  --hairline: rgba(11, 95, 90, 0.14);
  --hairline-2: rgba(11, 95, 90, 0.07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  margin: 0;
  line-height: 1.55;
}

.font-display {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  letter-spacing: -0.02em;
  line-height: 1.02;
}

.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: -0.01em;
}

/* Hairline + paper texture — the "apothecary" feel */
.paper {
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 122, 102, 0.06), transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(11, 95, 90, 0.05), transparent 60%),
    var(--bg);
  position: relative;
}
.paper::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent 0,
      transparent 2px,
      rgba(11, 95, 90, 0.012) 2px,
      rgba(11, 95, 90, 0.012) 3px
    );
  z-index: 0;
}

.hairline { border-color: var(--hairline); }
.hairline-2 { border-color: var(--hairline-2); }

/* "Specimen card" — pharmacy-lab card framing for meal photography */
.specimen {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.specimen::before {
  content: '';
  position: absolute;
  top: 12px; bottom: 12px; left: 12px; right: 12px;
  border: 1px solid var(--hairline-2);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}
.specimen-tag {
  position: absolute;
  top: 18px; left: 18px;
  z-index: 2;
  padding: 4px 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.specimen-img {
  position: relative;
  z-index: 0;
  aspect-ratio: 4/3;
  width: 100%;
  object-fit: cover;
  filter: contrast(1.04) saturate(1.08);
  display: block;
}

/* Macro readout — like a lab spec sheet */
.macro-readout {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.macro-readout > div {
  padding: 10px 12px;
  border-right: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.macro-readout > div:last-child { border-right: none; }
.macro-readout .k {
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.macro-readout .v {
  font-weight: 600;
  color: var(--ink);
}

/* Phase chip */
.phase-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.phase-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.phase-on { background: rgba(255, 122, 102, 0.10); color: var(--rust); }
.phase-trans { background: rgba(208, 245, 218, 0.6); color: var(--ink); }
.phase-maint { background: rgba(11, 95, 90, 0.10); color: var(--ink-2); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 28px;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 200ms cubic-bezier(0.2, 0.7, 0.3, 1.0),
              background 200ms,
              border-color 200ms;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--ink-2);
  transform: translateY(-1px);
}
.btn-rust {
  background: var(--rust);
  color: white;
  border-color: var(--rust);
}
.btn-rust:hover {
  background: var(--rust-2);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--hairline);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-arrow { display: inline-block; transition: transform 200ms; }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* Eyebrow label */
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--ink-soft);
}

/* Reveal-on-load stagger */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 700ms cubic-bezier(0.2, 0.7, 0.3, 1.0) both; }
.delay-1 { animation-delay: 80ms; }
.delay-2 { animation-delay: 160ms; }
.delay-3 { animation-delay: 240ms; }
.delay-4 { animation-delay: 320ms; }
.delay-5 { animation-delay: 400ms; }

/* Phase timeline connector */
.timeline-line {
  position: absolute;
  top: 60px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0,
    var(--rust) 20%,
    var(--butter-2) 50%,
    var(--ink-2) 80%,
    transparent 100%);
  z-index: 0;
}

/* Phase card */
.phase-card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  padding: 28px;
  position: relative;
  z-index: 1;
  transition: border-color 200ms, transform 200ms;
}
.phase-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}
.phase-num {
  font-family: 'Fraunces', serif;
  font-size: 14px;
  font-style: italic;
  font-weight: 400;
  color: var(--rust);
}

/* Tab pills */
.tab-pill {
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ink-soft);
  transition: all 180ms;
  font-family: inherit;
  letter-spacing: -0.005em;
}
.tab-pill:hover { color: var(--ink); border-color: var(--ink); }
.tab-pill[data-active="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Big numerics — protein, calorie callouts */
.numeric {
  font-family: 'Fraunces', serif;
  font-variation-settings: 'opsz' 144;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* Marquee — trust signals scrolling */
.marquee {
  overflow: hidden;
  position: relative;
}
.marquee-track {
  display: flex;
  gap: 56px;
  animation: scroll 36s linear infinite;
  width: max-content;
}
@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Sticky mobile CTA */
.sticky-cta {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  z-index: 60;
  box-shadow: 0 8px 32px rgba(11, 95, 90, 0.18), 0 2px 8px rgba(11, 95, 90, 0.08);
}

@media (min-width: 768px) {
  .sticky-cta { display: none; }
}

/* Form */
.field {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--hairline);
  background: var(--paper);
  border-radius: 4px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 180ms;
}
.field:focus { outline: none; border-color: var(--ink); }

/* FAQ accordion */
details.faq {
  border-bottom: 1px solid var(--hairline);
  padding: 24px 0;
}
details.faq summary {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: '+';
  font-family: 'DM Sans', sans-serif;
  font-size: 24px;
  font-weight: 300;
  color: var(--ink-soft);
  transition: transform 200ms;
}
details.faq[open] summary::after {
  content: '–';
  transform: rotate(180deg);
}
details.faq p {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
  max-width: 60ch;
}

/* Decorative serial number — apothecary detail */
.serial {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* Scientific bracket — used for callouts */
.bracket {
  position: relative;
  padding: 24px 32px;
}
.bracket::before, .bracket::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--ink);
  border-style: solid;
}
.bracket::before {
  top: 0; left: 0;
  border-width: 1px 0 0 1px;
}
.bracket::after {
  bottom: 0; right: 0;
  border-width: 0 1px 1px 0;
}

/* Navigation */
.nav-link {
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  transition: color 180ms;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0;
  height: 1px;
  background: var(--ink);
  transition: width 200ms;
}
.nav-link:hover::after { width: 100%; }

/* ============ HERO V2 — cinematic ============ */
.hero-v2 {
  position: relative;
  background:
    radial-gradient(ellipse at 80% 30%, rgba(255, 122, 102, 0.16), transparent 55%),
    radial-gradient(ellipse at 20% 90%, rgba(11, 95, 90, 0.08), transparent 60%),
    radial-gradient(ellipse at 95% 80%, rgba(255, 184, 172, 0.12), transparent 50%),
    var(--bg);
  overflow: hidden;
}
.hero-v2::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent 0, transparent 2px, rgba(11, 95, 90, 0.012) 2px, rgba(11, 95, 90, 0.012) 3px);
  pointer-events: none;
  z-index: 0;
}

.headline-mega {
  font-family: 'Fraunces', Georgia, serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 80;
  font-weight: 480;
  letter-spacing: -0.035em;
  line-height: 0.92;
}
@media (min-width: 1024px) {
  .headline-mega { font-size: 108px; }
}
@media (min-width: 1280px) {
  .headline-mega { font-size: 124px; }
}

.must-have-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.must-have-pill::before {
  content: '';
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--rust);
  display: block;
  flex-shrink: 0;
  position: relative;
}
.must-have-pill .arrow-mark {
  display: block;
  width: 24px;
  height: 24px;
  background: var(--rust);
  border-radius: 50%;
  margin-right: 4px;
  position: relative;
}
.must-have-pill .arrow-mark::after {
  content: '✦';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper);
  font-size: 11px;
  line-height: 1;
}

/* Hero food image cluster — overlapping cinematic stack */
.hero-food-stack {
  position: relative;
  height: 100%;
  min-height: 480px;
}

.hero-plate {
  position: absolute;
  border-radius: 6px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--hairline);
  transition: transform 240ms cubic-bezier(0.2, 0.7, 0.3, 1.0);
}
.hero-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.05) saturate(1.1);
}
.hero-plate:hover { transform: translateY(-4px) scale(1.01); z-index: 10; }

.hero-plate--main {
  top: 0;
  right: -40px;
  width: 75%;
  aspect-ratio: 4/5;
  z-index: 3;
  box-shadow: 0 60px 100px -30px rgba(11, 95, 90, 0.45),
              0 30px 60px -20px rgba(11, 95, 90, 0.25);
}
.hero-plate--top {
  top: -50px;
  left: -10px;
  width: 42%;
  aspect-ratio: 1/1;
  z-index: 2;
  transform: rotate(-4deg);
  box-shadow: 0 30px 50px -20px rgba(11, 95, 90, 0.30);
}
.hero-plate--bottom {
  bottom: -40px;
  left: -50px;
  width: 50%;
  aspect-ratio: 5/4;
  z-index: 4;
  transform: rotate(3deg);
  box-shadow: 0 40px 70px -20px rgba(11, 95, 90, 0.40);
}

/* Phase tag overlay on hero plates */
.hero-plate-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  padding: 5px 12px;
  background: rgba(11, 95, 90, 0.92);
  color: var(--paper);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.hero-plate-tag.rust { background: rgba(255, 122, 102, 0.95); }
.hero-plate-tag.butter { background: rgba(208, 245, 218, 0.92); color: var(--ink); }

/* Macro readout overlay — floating bottom-right of main image */
.hero-macro-overlay {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 5;
  background: rgba(251, 247, 238, 0.96);
  backdrop-filter: blur(8px);
  border-radius: 4px;
  padding: 10px 14px;
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 14px;
}
.hero-macro-overlay > div { display: flex; flex-direction: column; gap: 1px; }
.hero-macro-overlay .lbl {
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.hero-macro-overlay .val {
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  line-height: 1;
}

/* ============ COMPARISON TABLE ============ */
.cmp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}
.cmp-table th, .cmp-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
}
.cmp-table thead th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
}
.cmp-table .preptide-col {
  background: var(--ink);
  color: var(--paper);
}
.cmp-table thead .preptide-col {
  background: var(--ink);
  color: var(--paper);
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  text-transform: none;
}
.cmp-table tbody tr:last-child td { border-bottom: none; }
.cmp-table tbody tr:last-child .preptide-col { border-radius: 0 0 6px 6px; }
.cmp-table thead .preptide-col { border-radius: 6px 6px 0 0; }
.cmp-yes {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--rust);
  color: var(--paper);
  font-size: 12px;
  line-height: 1;
}
.cmp-yes-paper { background: var(--rust-glow); color: var(--ink); }
.cmp-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  color: var(--ink-soft);
  font-size: 14px;
  opacity: 0.45;
}

/* ============ FOOD GALLERY ============ */
.food-gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 100px;
  gap: 8px;
}
.food-tile {
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: var(--paper);
  cursor: pointer;
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
.food-tile:hover { transform: scale(1.015); z-index: 5; }
.food-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.04) saturate(1.08);
}
.food-tile-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 16px 12px;
  background: linear-gradient(to top, rgba(11, 95, 90, 0.85) 0%, rgba(11, 95, 90, 0) 100%);
  color: var(--paper);
}
.food-tile-overlay h4 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.food-tile-overlay .meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  opacity: 0.9;
}
.food-tile-tag {
  position: absolute;
  top: 12px; left: 12px;
  padding: 3px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(251, 247, 238, 0.92);
  color: var(--ink);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.food-tile-tag.rust { background: var(--rust); color: var(--paper); }
.food-tile-tag.butter { background: var(--butter); color: var(--ink); }

/* Hero rotating phrases */
.rotator {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
}
.rotator span {
  display: inline-block;
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  opacity: 0;
  animation: rotateWords 12s linear infinite;
  font-style: italic;
  color: var(--rust);
}
.rotator span:nth-child(1) { animation-delay: 0s; }
.rotator span:nth-child(2) { animation-delay: 3s; }
.rotator span:nth-child(3) { animation-delay: 6s; }
.rotator span:nth-child(4) { animation-delay: 9s; }
@keyframes rotateWords {
  0%, 22% { opacity: 1; transform: translateY(0); }
  25%, 100% { opacity: 0; transform: translateY(-8px); }
}

/* Image fallback — applied via JS when an img errors */
img[data-fallback] {
  background: var(--bg-2) url('meal-fallback.svg') center/cover no-repeat;
  color: transparent;
}

/* Brand lockup — logo mark + wordmark */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.brand-mark {
  width: 28px;
  height: 36px;
  display: block;
  flex-shrink: 0;
}
.brand-word {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--ink);
  line-height: 1;
}

/* Hide things gracefully */
[hidden] { display: none !important; }
