/* Not My Best Cookbook marketing site. Colours match the app's tokens (cook-ios/docs/DESIGN.md and
   Cook/Design/Theme.swift): cream and ink in light, deep plum in dark, the icon's green for links, and
   the recipe category colours as tints. */

:root {
  --bg: #F7F4EF;
  --bg-2: #EFEAE2;
  --surface: #FFFFFF;
  --surface-2: #EFEAE2;
  --line: #E2DBD0;
  --text: #1E1A2B;
  --text-2: #4F4863;
  --text-3: #6A6380;
  --fill: #1E1A2B;
  --on-fill: #FFFFFF;
  --accent: #2F6B4C;
  --accent-hover: #24563C;
  --header: rgba(247, 244, 239, 0.84);
  --glow: rgba(217, 65, 91, 0.12);

  --breakfast: #C9B52A;
  --lunch: #7FA33A;
  --dinner: #D9415B;
  --appetizer: #E8964B;
  --side: #3E8570;
  --sauce: #D45DB1;
  --dessert: #5A3FCB;
  --snack: #C98A3A;
  --drink: #4A7FA6;

  --font: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: system-ui, -apple-system, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 22px;
  --radius-sm: 14px;
  --gutter: 20px;
  --max: 1120px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1626;
    --bg-2: #211C30;
    --surface: #262236;
    --surface-2: #322E44;
    --line: #3A3352;
    --text: #FFFFFF;
    --text-2: rgba(255, 255, 255, 0.72);
    --text-3: rgba(255, 255, 255, 0.55);
    --fill: #FFFFFF;
    --on-fill: #1A1626;
    --accent: #8CC4A0;
    --accent-hover: #A6D6B6;
    --header: rgba(26, 22, 38, 0.82);
    --glow: rgba(217, 65, 91, 0.16);
    --breakfast: #E5D74F;
    --lunch: #A4C54A;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 0.5em; font-weight: 800; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 7.5vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.muted { color: var(--text-2); }
.small { font-size: 0.9rem; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 10px; background: var(--surface); padding: 8px 14px; z-index: 10; }

/* Header */

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: var(--header);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand:hover { color: var(--text); }
@media (max-width: 400px) {
  .brand { font-size: 1.02rem; gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .nav a:not(:last-child) { display: none; }
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 0.95rem; padding: 8px 10px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav .nav-hide { display: none; }
@media (min-width: 680px) { .nav .nav-hide { display: inline-block; } }

/* Buttons: capsules, one solid fill per screen, like the app */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none;
  border: 0; cursor: pointer; transition: background 0.15s, transform 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--fill); color: var(--on-fill); }
.btn-primary:hover { background: color-mix(in srgb, var(--fill) 86%, var(--bg)); color: var(--on-fill); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-small { min-height: 40px; padding: 0 18px; font-size: 0.95rem; white-space: nowrap; }
.nav .btn-primary, .nav .btn-primary:hover { color: var(--on-fill); background: var(--fill); }
/* The shared recipe page's header has a button instead of links; on a phone the icon stands in for the name. */
@media (max-width: 420px) { .has-cta .brand span { display: none; } }

/* "Coming soon" App Store button. Swap for Apple's official badge once the app is live. */
.appstore {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 22px 8px 16px; border-radius: 16px;
  background: #000; color: #fff; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.appstore:hover { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.appstore svg { width: 26px; height: 26px; flex: none; }
.appstore span { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.appstore small { font-size: 0.72rem; font-weight: 600; color: #B4B4BC; letter-spacing: 0.02em; }
.appstore strong { font-size: 1.15rem; font-weight: 700; }
.appstore[aria-disabled="true"] { cursor: default; }

/* The recipe categories as a row of swatches, the way Tines Studio shows its note colours. */

.swatches { display: flex; align-items: center; gap: 5px; }
.swatches i { width: 12px; height: 22px; border-radius: 4px; display: block; }

/* Hero */

.hero { position: relative; overflow: hidden; padding: 48px 0 64px; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1;
  background:
    radial-gradient(40% 50% at 80% 30%, var(--glow), transparent 70%),
    radial-gradient(35% 40% at 12% 8%, color-mix(in srgb, var(--side) 14%, transparent), transparent 70%);
}
.hero-grid { display: grid; gap: 48px; align-items: center; }
.hero .eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-bottom: 22px; color: var(--text-2); font-weight: 700; }
.hero h1 span { display: block; color: var(--dinner); }
.hero .lede { font-size: 1.2rem; color: var(--text-2); max-width: 34em; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { margin-top: 14px; font-size: 0.9rem; color: var(--text-3); }

@media (min-width: 900px) {
  .hero { padding: 80px 0 96px; }
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
}

/* Phone frame around simulator screenshots */

.phone {
  position: relative; width: min(300px, 78vw); margin: 0 auto;
  aspect-ratio: 1206 / 2622;
  border-radius: 46px; padding: 10px;
  background: linear-gradient(145deg, #3d3a46, #121116);
  box-shadow: 0 40px 80px -24px rgba(30, 26, 43, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.phone picture { display: block; width: 100%; height: 100%; }
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 37px; }

.hero-phones { position: relative; display: flex; justify-content: center; }
.hero-phones .phone-back { display: none; }
@media (min-width: 560px) {
  .hero-phones .phone-back {
    display: block; position: absolute; width: min(250px, 60vw);
    transform: translate(-58%, 8%) rotate(-7deg); opacity: 0.7; filter: saturate(0.9);
  }
  .hero-phones .phone-front { transform: translateX(14%); }
}

/* iPad frame */

.ipad {
  border-radius: clamp(18px, 3vw, 34px); padding: clamp(7px, 1.2vw, 13px);
  background: linear-gradient(145deg, #3d3a46, #121116);
  box-shadow: 0 40px 80px -30px rgba(30, 26, 43, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.ipad picture { display: block; }
.ipad img { width: 100%; border-radius: clamp(12px, 2.2vw, 24px); }

/* Sections */

section { padding: 64px 0; }
.section-head { max-width: 660px; margin-bottom: 36px; }
.section-head p { color: var(--text-2); font-size: 1.1rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.alt { background: linear-gradient(180deg, transparent, var(--bg-2) 12%, var(--bg-2) 88%, transparent); }

.features { display: grid; gap: 16px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .features { grid-template-columns: repeat(3, 1fr); } }

.card { background: var(--surface); border-radius: var(--radius); padding: 24px; border: 1px solid var(--line); }
.card h3 { margin-bottom: 0.35em; }
.card p { color: var(--text-2); margin: 0; }
.icon {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  margin-bottom: 16px; color: #fff; background: var(--tint, var(--accent));
}
.icon svg { width: 24px; height: 24px; }

/* Showcase rows: screenshots beside copy */

.showcase { display: grid; gap: 36px; align-items: center; }
.showcase + .showcase { margin-top: 80px; }
.showcase > * { min-width: 0; }
.showcase .kicker { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--tint, var(--accent)); margin-bottom: 10px; }
.showcase .kicker::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: currentColor; }
.showcase ul { padding: 0; margin: 0 0 1em; list-style: none; }
.showcase li { position: relative; padding-left: 28px; margin-bottom: 10px; color: var(--text-2); }
.showcase li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 12px; height: 12px; border-radius: 4px; background: var(--tint, var(--accent)); opacity: 0.85; }
.showcase li strong { color: var(--text); }
@media (min-width: 860px) {
  .showcase { grid-template-columns: 1fr 1fr; gap: 64px; }
  .showcase.flip .showcase-media { order: 2; }
}

/* Two phones side by side */

.phone-pair { display: flex; justify-content: center; gap: 4%; }
.phone-pair .phone { width: 48%; max-width: 260px; margin: 0; border-radius: clamp(26px, 7vw, 42px); padding: clamp(6px, 1.6vw, 9px); }
.phone-pair .phone img { border-radius: clamp(20px, 5.6vw, 34px); }
.phone-pair .phone:nth-child(2) { transform: translateY(8%); }

/* iPad section */

.ipad-row { display: grid; gap: 20px; align-items: start; }
@media (min-width: 760px) { .ipad-row { grid-template-columns: 1fr 1fr; gap: 28px; } .ipad-row .ipad:nth-child(2) { transform: translateY(10%); } }
.ipad-row + .note { margin-top: 56px; }

/* Share-link callout */

.share {
  display: grid; gap: 24px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 32px 24px;
}
.share p { color: var(--text-2); margin: 0; }
.share code { font-size: 0.95em; background: var(--surface-2); padding: 2px 8px; border-radius: 8px; color: var(--text); overflow-wrap: anywhere; }
@media (min-width: 860px) { .share { grid-template-columns: 1fr auto; padding: 36px 40px; } }

/* CTA */

.cta {
  text-align: center; border-radius: 32px; padding: 48px 24px;
  background:
    radial-gradient(60% 80% at 50% 0%, var(--glow), transparent 70%),
    var(--surface);
  border: 1px solid var(--line);
}
.cta img { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 20px; box-shadow: 0 16px 40px -12px rgba(30, 26, 43, 0.4); }
.cta p { color: var(--text-2); max-width: 32em; margin: 0 auto 26px; }

/* Long-form pages (privacy, terms, support) */

.page-head { padding: 48px 0 8px; }
.page-head p { color: var(--text-2); font-size: 1.1rem; }
.prose { padding: 16px 0 72px; }
.prose h2 { font-size: 1.55rem; margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.45em; }
.prose .summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin: 8px 0 24px; }
.prose .summary ul { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--text); }
.prose td { color: var(--text-2); }
.table-scroll { overflow-x: auto; }

details.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; }
details.faq summary { cursor: pointer; padding: 16px 48px 16px 18px; font-weight: 700; color: var(--text); list-style: none; position: relative; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--text-3); }
details.faq[open] summary::after { content: "–"; }
details.faq > div { padding: 0 18px 4px; }

.contact-card { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.contact-card p { margin: 0; }

/* Shared recipe page (/r/<token>) */

.recipe { display: grid; gap: 20px; padding: 28px 0 64px; }
.recipe .photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--surface); }
.recipe h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin: 0; }
.recipe h2 { font-size: 1.45rem; margin: 8px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 0.9rem; font-weight: 600; }
.recipe ul, .recipe ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ingredients li::before { content: "•"; color: var(--text-3); margin-right: 10px; }
.ingredients .head { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-top: 6px; }
.ingredients .head::before { content: none; }
.steps { counter-reset: step; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; counter-increment: step; }
.steps li::before {
  content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--fill); color: var(--on-fill); font-weight: 700; font-size: 0.9rem;
}
.recipe .about { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; color: var(--text-2); margin: 0; }
.state { text-align: center; padding: 96px 16px; color: var(--text-2); }
[hidden] { display: none !important; }

/* Footer */

.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--text-3); font-size: 0.92rem; }
.site-footer .wrap { display: grid; gap: 20px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0; }
@media (min-width: 760px) {
  .site-footer .wrap { grid-template-columns: 1fr auto; align-items: center; }
}
