/* =====================================================================
   Bread Cookbook — app page for mermoz.net
   Palette and hero animation mirror the app's SplashScreenView:
   dark oven gradient, gold→orange glyph, amber grain particles.
   All fonts are local system stacks; no external resources.
   ===================================================================== */

:root {
  /* Splash palette (from SplashScreenView.swift) */
  --oven-top:    #170F05;   /* Color(0.09, 0.06, 0.02) */
  --oven-bottom: #261708;   /* Color(0.15, 0.09, 0.03) */
  --grain:       #F2BF59;   /* grain particles */
  --amber:       #EBBD75;   /* tagline (0.92, 0.74, 0.46) */
  --gold:        #FFE073;   /* icon gradient start */
  --orange:      #F57A1A;   /* icon gradient end */
  --glow:        #FFA626;   /* halo (1.0, 0.65, 0.15) */

  /* Bakery daylight palette */
  --flour:       #FAF3E8;
  --flour-deep:  #F1E5CE;
  --parchment:   #FFFDF8;
  --crust:       #B4691E;
  --crust-deep:  #8A4A12;
  --cocoa:       #3B2410;
  --cocoa-soft:  #6E5638;
  --line:        #E6D8BC;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  color: var(--cocoa);
  background: var(--flour);
}

/* =====================================================================
   Hero — the splash screen
   ===================================================================== */

.hero {
  position: relative;
  min-height: calc(100svh - 62px);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(to bottom, var(--oven-top), var(--oven-bottom));
  overflow: hidden;
}

/* --- Site header: same geometry as the other project pages, bread-theme colours --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(23, 15, 5, 0.82);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgba(235, 189, 117, 0.22);
}
.header-inner {
  width: 100%; max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 62px; padding: 0 20px;
  font-family: var(--sans);
}
.brand {
  font-family: var(--sans); font-weight: 700; font-size: 1.15rem;
  color: #F7ECD9; letter-spacing: -0.02em; text-decoration: none; white-space: nowrap;
}
.brand:hover { color: #fff; text-decoration: none; }
.site-nav { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--sans); color: var(--amber); opacity: 0.9;
  font-size: 0.95rem; font-weight: 500; padding: 0.4rem 0.7rem;
  border-radius: 999px; text-decoration: none; transition: background 0.2s, color 0.2s;
}
.site-nav a:hover { opacity: 1; color: #FBEAD0; background: rgba(235, 189, 117, 0.12); text-decoration: none; }
.site-nav a[aria-current="page"] { opacity: 1; color: #fff; background: rgba(235, 189, 117, 0.18); }
.nav-toggle { display: none; }

@media (max-width: 980px) {
  .header-inner { position: relative; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; border: 1px solid rgba(235, 189, 117, 0.3);
    border-radius: 10px; background: transparent; color: var(--amber); cursor: pointer;
  }
  .nav-toggle svg { width: 22px; height: 22px; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(23, 15, 5, 0.98); border-bottom: 1px solid rgba(235, 189, 117, 0.18);
    padding: 0.5rem; display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.7rem 0.8rem; border-radius: 8px; }
}

.hero-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 24px 72px;
  text-align: center;
}

/* --- Floating grain particles (staggered fade-in, endless float) --- */
.grains { position: relative; width: 140px; height: 60px; }
.grains span {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: var(--s);
  height: var(--s);
  margin-left: var(--x);
  border-radius: 50%;
  background: var(--grain);
  opacity: 0;
  animation:
    grain-fade 0.3s ease-in var(--delay) forwards,
    grain-float var(--dur) ease-in-out var(--delay) infinite alternate;
}
@keyframes grain-fade  { to { opacity: 0.55; } }
@keyframes grain-float { from { transform: translateY(0); } to { transform: translateY(var(--float)); } }

/* --- Glow halo + oven glyph (spring scale-in, slow bloom) --- */
.hero-icon-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 166, 38, 0.35) 12%, transparent 62%);
  opacity: 0;
  animation: glow-bloom 1.1s ease-out 0.1s forwards;
}
@keyframes glow-bloom { to { opacity: 1; } }

.hero-icon {
  width: 132px;
  height: 132px;
  opacity: 0;
  transform: scale(0.35);
  animation: icon-spring 0.9s cubic-bezier(0.34, 1.45, 0.5, 1) forwards;
}
@keyframes icon-spring {
  0%   { opacity: 0; transform: scale(0.35); }
  55%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}

/* --- Title block (slide up, fade) --- */
.hero-title {
  margin-top: 36px;
  opacity: 0;
  transform: translateY(28px);
  animation: title-rise 0.55s ease-out 0.4s forwards;
}
@keyframes title-rise { to { opacity: 1; transform: translateY(0); } }

.hero-title h1 {
  font-size: clamp(2.3rem, 7vw, 3.1rem);
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}

.tagline {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--amber);
}
.tagline .rule {
  width: 32px;
  height: 1px;
  background: var(--amber);
  opacity: 0.5;
}

.hero-sub {
  margin-top: 26px;
  font-size: 1.02rem;
  color: rgba(255, 244, 224, 0.75);
}

.hero-pill {
  display: inline-block;
  margin-top: 26px;
  padding: 9px 22px;
  border: 1px solid rgba(235, 189, 117, 0.45);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
}

/* --- Scroll cue --- */
.scroll-cue {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(235, 189, 117, 0.6);
  animation: cue-bob 2s ease-in-out 1.8s infinite;
  opacity: 0;
  animation-fill-mode: forwards;
}
.scroll-cue svg { width: 26px; height: 26px; }
@keyframes cue-bob {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) translateY(0); }
  50%      { opacity: 1;   transform: translateX(-50%) translateY(7px); }
}

/* =====================================================================
   Content sections
   ===================================================================== */

.section {
  max-width: 660px;
  margin: 0 auto;
  padding: 72px 28px 24px;
}
.section.wide { max-width: 1020px; }

.section h2 {
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 600;
  color: var(--crust-deep);
  margin-bottom: 22px;
  text-align: center;
}

.section p { margin-bottom: 16px; }
.section a { color: var(--crust-deep); }

.ornament {
  text-align: center;
  color: var(--crust);
  padding: 34px 0 6px;
}
.ornament svg { width: 220px; height: 24px; }

/* --- Feature cards --- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 22px;
  margin-top: 36px;
}

.card {
  background: var(--parchment);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px 22px;
  box-shadow: 0 2px 10px rgba(59, 36, 16, 0.05);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F9E7BF, #EFC57F);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.card-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--crust-deep);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--cocoa);
  margin-bottom: 8px;
}
.card p {
  font-size: 0.95rem;
  color: var(--cocoa-soft);
}

.optional {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--crust);
  border: 1px solid var(--crust);
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: 2px;
  margin-left: 6px;
}

/* --- Philosophy band --- */
.band {
  margin-top: 72px;
  padding: 56px 28px;
  background: linear-gradient(to bottom, #2E1B0A, #241406);
  color: rgba(255, 240, 214, 0.85);
  text-align: center;
}
.band p { max-width: 620px; margin: 0 auto; }
.band-lead {
  font-size: clamp(1.4rem, 3.5vw, 1.7rem);
  font-weight: 600;
  color: var(--amber);
  margin-bottom: 14px !important;
}

/* --- Availability facts --- */
.fact-list {
  list-style: none;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}
.fact-list li {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.97rem;
}
.fact-list strong {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cocoa-soft);
  align-self: center;
  white-space: nowrap;
}
.fact-list li > :last-child { text-align: right; }

/* =====================================================================
   Footer
   ===================================================================== */

.footer {
  margin-top: 84px;
  padding: 44px 28px 52px;
  background: linear-gradient(to bottom, var(--oven-bottom), var(--oven-top));
  color: rgba(235, 189, 117, 0.75);
  font-family: var(--sans);
  font-size: 0.82rem;
  text-align: center;
}
.footer a { color: var(--amber); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-links { margin-top: 10px; display: flex; justify-content: center; gap: 22px; }
.footer-legal {
  margin: 26px auto 0;
  max-width: 560px;
  font-size: 0.72rem;
  line-height: 1.6;
  color: rgba(235, 189, 117, 0.45);
}

/* =====================================================================
   Scroll reveal (JS adds .visible; inert without JS)
   ===================================================================== */

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.js .reveal.visible { opacity: 1; transform: none; }

/* =====================================================================
   Reduced motion — everything visible, nothing moves
   ===================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grains span, .hero-glow, .hero-icon, .hero-title, .scroll-cue {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .grains span { opacity: 0.55; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* =====================================================================
   Small screens
   ===================================================================== */

@media (max-width: 480px) {
  .section { padding: 56px 22px 20px; }
  .fact-list li { flex-direction: column; gap: 2px; }
  .fact-list li > :last-child { text-align: left; }
}
