/* ============================================================
   NUESTRA HISTORIA — editorial layer on top of styles.css tokens
   Works in any theme (Forno / Fresco / Punch) — only tokens change.
   ============================================================ */

.hist { background: var(--bg); color: var(--ink); }

/* match the product/storefront display font (Plus Jakarta Sans 800).
   Higher specificity than .app[data-theme="..."] so it wins on the root. */
.hist.app[data-theme] {
  --display: "Plus Jakarta Sans", system-ui, sans-serif;
  --display-wght: 800;
  --display-tracking: -0.035em;
}

/* page width a touch narrower than the shop for an editorial measure */
.hist .container { max-width: 1140px; }
.measure { max-width: 64ch; }

/* ---------- shared reveal (scroll-in) ---------- */
/* Visible by default. The hidden/animated state is layered on ONLY after JS
   "arms" it (data-reveal="armed") and motion is on — so content is never
   stranded at opacity:0 if JS or IntersectionObserver fail to run. */
.reveal { opacity: 1; transform: none; }
.app[data-motion="on"][data-reveal="armed"] .reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .8s cubic-bezier(.22,.61,.36,1), transform .8s cubic-bezier(.22,.61,.36,1);
}
.app[data-motion="on"][data-reveal="armed"] .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }

/* ============================================================
   HERO
   ============================================================ */
.hist-hero {
  position: relative; overflow: hidden;
  background: var(--hero-bg);
  border-bottom: 1px solid var(--line);
}
.hist-hero-inner {
  position: relative; z-index: 2;
  padding: clamp(64px, 11vw, 132px) 0 clamp(40px, 6vw, 72px);
}
.hist-kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--body); font-weight: 700; font-size: 13px;
  letter-spacing: .22em; text-transform: uppercase; color: var(--primary);
  margin: 0 0 26px;
}
.hist-kicker::before {
  content: ""; width: 38px; height: 2px; background: var(--primary); display: block;
}
.hist-title {
  font-family: var(--display); font-weight: var(--display-wght);
  letter-spacing: var(--display-tracking); text-transform: var(--display-transform);
  font-size: clamp(46px, 9vw, 116px); line-height: 1.16; margin: 0;
  max-width: 15ch; position: relative; z-index: 2;
}
.app[data-theme="forno"] .hist-title { font-size: clamp(48px, 9.4vw, 126px); }
.hist-title em {
  font-style: italic; color: var(--primary);
}
.app[data-theme="punch"] .hist-title em { color: #fff; -webkit-text-stroke: 0; }
.hist-lede {
  font-size: clamp(19px, 2.1vw, 25px); line-height: 1.55; color: var(--ink-2);
  max-width: 54ch; margin: clamp(26px, 3vw, 38px) 0 0; font-weight: 400;
  text-wrap: pretty; position: relative; z-index: 2;
}
.hist-lede strong { color: var(--ink); font-weight: 600; }

/* decorative slowly-spinning pizza behind the hero */
.hero-pizza {
  position: absolute; z-index: 1; pointer-events: none;
  width: clamp(320px, 40vw, 600px); aspect-ratio: 1;
  right: -16%; top: 46%; transform: translateY(-50%);
  opacity: .9;
}
.app[data-theme="forno"] .hero-pizza { opacity: .4; }
.hero-pizza .pizza { width: 100%; box-shadow: inset 0 -6px 18px rgba(120,60,10,.25), 0 40px 120px rgba(0,0,0,.4); }
.app[data-motion="on"] .hero-pizza { animation: histSpin 60s linear infinite; }
@keyframes histSpin { to { transform: translateY(-50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hero-pizza { animation: none !important; } }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 0; margin-top: clamp(40px, 6vw, 70px);
  border-top: 1px solid var(--line); position: relative; z-index: 2;
}
.hero-meta .hm {
  flex: 1; min-width: 150px; padding: 22px 26px 22px 0;
  border-right: 1px solid var(--line);
}
.hero-meta .hm:last-child { border-right: none; }
.hero-meta .hm-k {
  font-family: var(--display); font-weight: var(--display-wght);
  font-size: clamp(30px, 3.4vw, 44px); line-height: 1; color: var(--ink);
  letter-spacing: var(--display-tracking);
}
.app[data-theme="forno"] .hero-meta .hm-k { color: var(--gold, #E5B567); }
.hero-meta .hm-l {
  font-size: 12.5px; color: var(--ink-3); margin-top: 8px;
  letter-spacing: .05em; text-transform: uppercase; font-weight: 600;
}

/* ============================================================
   CHAPTERS  (numbered editorial sections)
   ============================================================ */
.chapter { padding: clamp(56px, 9vw, 104px) 0; border-bottom: 1px solid var(--line); }
.chapter-grid {
  display: grid; grid-template-columns: 280px 1fr; gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.chapter-aside { position: sticky; top: 110px; }
.chapter-num {
  font-family: var(--display); font-weight: var(--display-wght);
  font-size: clamp(64px, 9vw, 128px); line-height: .8; color: var(--primary);
  letter-spacing: -.02em; display: block;
}
.app[data-theme="forno"] .chapter-num {
  color: transparent; -webkit-text-stroke: 1.4px var(--primary);
  text-stroke: 1.4px var(--primary);
}
.chapter-label {
  font-family: var(--display); font-weight: var(--display-wght);
  text-transform: var(--display-transform); letter-spacing: var(--display-tracking);
  font-size: clamp(26px, 3vw, 38px); line-height: 1.12; margin: 22px 0 0;
}
.chapter-rule { width: 56px; height: 3px; background: var(--primary); margin-top: 20px; border: none; }

.prose { max-width: 60ch; }
.prose p {
  font-size: clamp(17px, 1.35vw, 20px); line-height: 1.72; color: var(--ink-2);
  margin: 0; text-wrap: pretty;
}
.prose p + p { margin-top: 1.15em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose .lead { color: var(--ink); font-size: clamp(20px, 1.8vw, 26px); line-height: 1.5; font-weight: 400; }
.app[data-theme="forno"] .prose .lead { font-family: var(--display); line-height: 1.42; }
.app[data-theme="forno"] .prose .lead + p { margin-top: 1.6em; }

/* drop cap on the opening chapter */
.prose.dropcap > p:first-of-type::first-letter {
  font-family: var(--display); font-weight: var(--display-wght);
  float: left; font-size: 4.4em; line-height: .72; padding: 8px 14px 0 0;
  color: var(--primary);
}

/* ============================================================
   FIGURES  (image-slot placeholders)
   ============================================================ */
.figure { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--tile); }
.figure image-slot { display: block; width: 100%; }
.figure-cap {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px; letter-spacing: .03em; color: var(--ink-3);
  margin-top: 12px; display: flex; align-items: center; gap: 8px;
}
.figure-cap::before { content: ""; width: 14px; height: 1px; background: var(--ink-3); display: block; }

.chapter-figure { margin-top: 38px; }
.figure-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 38px; }

/* ============================================================
   PULL QUOTE  (full-bleed statement)
   ============================================================ */
.pull { padding: clamp(64px, 11vw, 130px) 0; text-align: center; border-bottom: 1px solid var(--line); position: relative; }
.app[data-theme="punch"] .pull { background: var(--primary); }
.pull-mark {
  font-family: var(--display); font-size: clamp(80px, 12vw, 150px); line-height: 0;
  color: var(--primary); opacity: .9; display: block; height: .5em;
}
.app[data-theme="punch"] .pull-mark { color: #fff; }
.pull q {
  display: block; quotes: none; max-width: 22ch; margin: 38px auto 0;
  font-family: var(--display); font-weight: var(--display-wght);
  text-transform: var(--display-transform); letter-spacing: var(--display-tracking);
  font-size: clamp(32px, 5.4vw, 68px); line-height: 1.12; color: var(--ink);
  text-wrap: balance;
}
.app[data-theme="punch"] .pull q { color: #fff; }
.pull q em { font-style: italic; color: var(--primary); }
.app[data-theme="punch"] .pull q em { color: #ffd9d3; }
.pull-by { margin-top: 30px; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.app[data-theme="punch"] .pull-by { color: rgba(255,255,255,.85); }

/* ============================================================
   STATS BAND
   ============================================================ */
.stats { background: var(--surface); border-bottom: 1px solid var(--line); padding: clamp(48px, 7vw, 84px) 0; }
.app[data-theme="forno"] .stats { background: #100C0A; }
.stats-head { text-align: center; margin-bottom: clamp(34px, 5vw, 56px); }
.stats-head .eyebrow { justify-content: center; }
.stats-head h2 {
  font-family: var(--display); font-weight: var(--display-wght);
  text-transform: var(--display-transform); letter-spacing: var(--display-tracking);
  font-size: clamp(28px, 3.6vw, 46px); margin: 10px 0 0;
}
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: clamp(26px, 3.5vw, 42px) 26px; }
.app[data-theme="forno"] .stat { background: #15100D; }
.stat-num {
  font-family: var(--display); font-weight: var(--display-wght);
  letter-spacing: var(--display-tracking); text-transform: var(--display-transform);
  font-size: clamp(40px, 5.4vw, 68px); line-height: 1.04; color: var(--primary);
}
.app[data-theme="forno"] .stat-num { color: var(--gold, #E5B567); }
.stat-num .u { font-size: .42em; color: var(--ink-2); margin-left: 4px; letter-spacing: 0; }
.stat-label { margin-top: 12px; font-size: 14px; line-height: 1.45; color: var(--ink-2); max-width: 26ch; }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline-wrap { padding: clamp(60px, 9vw, 116px) 0; border-bottom: 1px solid var(--line); }
.timeline-head { text-align: center; margin-bottom: clamp(48px, 7vw, 84px); }
.timeline-head h2 {
  font-family: var(--display); font-weight: var(--display-wght);
  text-transform: var(--display-transform); letter-spacing: var(--display-tracking);
  font-size: clamp(34px, 5vw, 64px); margin: 14px 0 0; line-height: 1.08;
}
.timeline-head p { color: var(--ink-2); font-size: 17px; margin: 18px auto 0; max-width: 50ch; }

.timeline { position: relative; max-width: 980px; margin: 0 auto; }
.timeline::before {
  content: ""; position: absolute; left: 50%; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--line-2), var(--line)); transform: translateX(-50%);
}
.tl-item {
  position: relative; width: 50%; padding: 0 56px 56px 0; box-sizing: border-box;
}
.tl-item:nth-child(even) { margin-left: 50%; padding: 0 0 56px 56px; text-align: left; }
.tl-item:nth-child(odd) { text-align: right; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; top: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--primary);
  z-index: 2;
}
.tl-item:nth-child(odd) .tl-dot { right: -8px; }
.tl-item:nth-child(even) .tl-dot { left: -8px; }
.tl-year {
  font-family: var(--display); font-weight: var(--display-wght);
  letter-spacing: var(--display-tracking); text-transform: var(--display-transform);
  font-size: clamp(28px, 3.4vw, 42px); color: var(--primary); line-height: 1.08;
}
.app[data-theme="forno"] .tl-year { color: var(--gold, #E5B567); }
.tl-tag {
  display: inline-block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-3); margin-bottom: 12px;
}
.tl-card-title { font-family: var(--body); font-weight: 700; font-size: 19px; margin: 10px 0 0; color: var(--ink); }
.tl-card-body { font-size: 15px; line-height: 1.6; color: var(--ink-2); margin: 8px 0 0; }
.tl-item:nth-child(odd) .tl-card-body, .tl-item:nth-child(odd) .tl-card-title { margin-left: auto; }
.tl-card-body, .tl-card-title { max-width: 38ch; }
.tl-item:nth-child(odd) .tl-card-body, .tl-item:nth-child(odd) .tl-card-title { margin-left: auto; }

/* ============================================================
   CLOSING
   ============================================================ */
.closing { padding: clamp(72px, 12vw, 150px) 0; text-align: center; background: var(--hero-bg); }
.closing .eyebrow { justify-content: center; margin-bottom: 22px; }
.closing h2 {
  font-family: var(--display); font-weight: var(--display-wght);
  text-transform: var(--display-transform); letter-spacing: var(--display-tracking);
  font-size: clamp(38px, 6.4vw, 88px); line-height: 1.12; margin: 0 auto; max-width: 16ch;
  text-wrap: balance;
}
.closing h2 em { font-style: italic; color: var(--primary); }
.app[data-theme="punch"] .closing h2 { color: #fff; }
.app[data-theme="punch"] .closing h2 em { color: #ffd9d3; }
.closing p { color: var(--ink-2); font-size: 18px; max-width: 48ch; margin: 28px auto 0; line-height: 1.6; }
.app[data-theme="punch"] .closing p { color: rgba(255,255,255,.9); }
.closing-cta { display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 38px; }

/* ============================================================
   SIMPLE STATIC HEADER (this is a single page, not the React app)
   ============================================================ */
.hist-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.hist-header-row { display: flex; align-items: center; gap: 18px; height: 68px; }
.hist-header .logo { color: var(--primary); }
.hist-header .crumb {
  font-size: 13px; color: var(--ink-3); font-weight: 600; letter-spacing: .02em;
  padding-left: 18px; margin-left: 4px; border-left: 1px solid var(--line); white-space: nowrap;
}
.hist-header .spacer { flex: 1; }
.hist-header nav { display: flex; align-items: center; gap: 4px; }
.hist-header nav a {
  padding: 9px 14px; border-radius: var(--radius-pill); font-weight: 600; font-size: 13.5px;
  color: var(--ink-2); white-space: nowrap;
}
.hist-header nav a:hover { background: var(--tile); color: var(--ink); }
.hist-header nav a.active { color: var(--primary); }
.hist-header .h-cta {
  padding: 10px 18px; border-radius: var(--radius-pill); border: 1.5px solid var(--ink);
  font-weight: 700; font-size: 13.5px; color: var(--ink);
}
.app[data-theme="forno"] .hist-header .h-cta { border-color: var(--line-2); }
.hist-header .h-cta:hover { background: var(--ink); color: var(--bg); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .chapter-grid { grid-template-columns: 1fr; gap: 24px; }
  .chapter-aside { position: static; }
  .chapter-num { font-size: clamp(56px, 16vw, 96px); }
  .figure-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-pizza { opacity: .28; right: -28%; }
  .hero-meta .hm { min-width: 44%; flex: 1 1 44%; border-bottom: 1px solid var(--line); }

  /* timeline collapses to a single left rail */
  .timeline::before { left: 7px; }
  .tl-item, .tl-item:nth-child(even), .tl-item:nth-child(odd) {
    width: 100%; margin-left: 0; padding: 0 0 44px 38px; text-align: left;
  }
  .tl-item:nth-child(odd) .tl-dot, .tl-item:nth-child(even) .tl-dot { left: -1px; right: auto; }
  .tl-item:nth-child(odd) .tl-card-body, .tl-item:nth-child(odd) .tl-card-title { margin-left: 0; }
}
@media (max-width: 560px) {
  .hist-header nav { display: none; }
  .hist-header .crumb { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .hero-meta .hm { min-width: 100%; border-right: none; padding-right: 0; }
  /* mobile: drop the hero pizza, give the page comfortable side padding */
  .hero-pizza { display: none; }
  .hist .container { padding-left: 24px; padding-right: 24px; }
}
