/* =========================================================================
   PastPresent — heritage editorial styling
   "Ink, parchment, and gold — the materials of a printed heritage publication."
   Palette + type ported from the app (lib/core/theme/app_colors.dart).
   ========================================================================= */

:root {
  /* Ink */
  --ink: #1a1208;
  --ink-soft: #5a4b3c;
  --muted: #6e5f52;
  /* Paper */
  --cream: #f5f0ea;
  --paper: #fcf8f3;
  --parchment: #ece6de;
  --mist: #f0e8de;
  --card: #ffffff;
  /* Gold */
  --gold: #8b6914;
  --gold-text: #7a5a0f;
  --gold-deep: #6b5010;
  --pure-gold: #ffd700;
  --gold-light: #c8a84e;
  /* Chrome */
  --border: #e0d8ce;
  --ghost: #d4c9b8;

  --measure: 42rem;
  --wrap: 72rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --shadow-soft: 0 1px 2px rgba(26, 18, 8, 0.04), 0 12px 32px rgba(26, 18, 8, 0.08);
  --shadow-device: 0 2px 6px rgba(26, 18, 8, 0.12), 0 24px 60px rgba(26, 18, 8, 0.22);
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--cream);
  line-height: 1.6;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* faint paper grain over the whole page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-deep); }

/* ---- type ---- */
.display { font-family: "Playfair Display", Georgia, serif; font-weight: 600; line-height: 1.04; letter-spacing: -0.01em; }
.serif-italic { font-family: "Instrument Serif", Georgia, serif; font-style: italic; }

.kicker {
  font-family: "DM Sans", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-text);
}

/* ---- layout ---- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1.5rem; }
.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }

/* hairline rule with a centred gold ornament */
.rule { display: flex; align-items: center; gap: 1.25rem; color: var(--ghost); }
.rule::before, .rule::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.rule__mark { font-family: "Playfair Display", serif; color: var(--gold); font-size: 1.1rem; line-height: 1; transform: translateY(-1px); }

/* =========================================================================
   Masthead
   ========================================================================= */
.masthead { padding-top: 1.5rem; }
.masthead__top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-bottom: 1.1rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand__logo { width: 38px; height: 38px; border-radius: 9px; box-shadow: var(--shadow-soft); }
.brand__name { font-family: "Playfair Display", serif; font-weight: 700; font-size: 1.5rem; letter-spacing: -0.01em; }
.brand__name b { color: var(--gold-text); font-weight: 700; }

.masthead__nav { display: flex; align-items: center; gap: 1.75rem; }
.masthead__nav a {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; transition: color 0.2s var(--ease);
}
.masthead__nav a:hover { color: var(--gold-text); }
.masthead__double-rule { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); height: 4px; }
.masthead__strapline {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-top: 0.5rem; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}

@media (max-width: 640px) {
  .masthead__nav { gap: 1.1rem; }
  .masthead__nav a { font-size: 0.72rem; }
  .masthead__strapline span:nth-child(2) { display: none; }
}

/* =========================================================================
   Hero
   ========================================================================= */
.hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.hero__grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
}
.hero__title { font-size: clamp(2.9rem, 7vw, 5rem); margin-top: 1.25rem; }
.hero__title .accent { color: var(--gold-text); }
.hero__title .serif-italic { font-weight: 400; display: block; color: var(--ink-soft); font-size: 0.86em; }
.hero__lede {
  margin-top: 1.6rem; max-width: 30rem; font-size: 1.18rem; color: var(--ink-soft);
}
.hero__cta { margin-top: 2.1rem; }

/* device / phone frame */
.device {
  position: relative; width: min(300px, 82%); margin-inline: auto;
  border-radius: 2.1rem; padding: 0.5rem; background: linear-gradient(160deg, #2a2010, #1a1208);
  box-shadow: var(--shadow-device);
}
.device::after { /* gold hairline rim */
  content: ""; position: absolute; inset: 0; border-radius: 2.1rem; pointer-events: none;
  border: 1px solid rgba(200, 168, 78, 0.35);
}
.device img { border-radius: 1.7rem; width: 100%; }
.hero__device { transform: rotate(2deg); transition: transform 0.5s var(--ease); }
.hero__device:hover { transform: rotate(0deg) translateY(-4px); }
.hero__device-frame { position: relative; }
.hero__device-frame .stamp {
  position: absolute; z-index: 2; left: -1.1rem; top: 2.2rem; transform: rotate(-8deg);
  background: var(--ink); color: var(--pure-gold); font-family: "Playfair Display", serif; font-style: italic;
  padding: 0.4rem 0.9rem; border-radius: 0.4rem; font-size: 0.92rem; box-shadow: var(--shadow-soft);
}

/* hero then/now slideshow — square archival "print" with a crossfade */
.hero-photo { width: min(400px, 100%); margin-inline: auto; }
.hero-stage {
  position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--border); background: var(--ink);
  box-shadow: var(--shadow-device);
  transform: rotate(-1.4deg); transition: transform 0.5s var(--ease);
}
.hero-photo:hover .hero-stage { transform: rotate(0deg) translateY(-3px); }
.hero-stage::after { /* gold hairline mount */
  content: ""; position: absolute; inset: 0; border-radius: 12px; pointer-events: none;
  border: 1px solid rgba(200, 168, 78, 0.30);
}
.hero-slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0;
}
.hero-slide:first-child { opacity: 1; } /* static fallback (reduced motion / no CSS-anim) */
.hero-photo__cap { margin-top: 1.1rem; text-align: center; font-size: 0.95rem; color: var(--muted); }
.hero-photo__cap .serif-italic { color: var(--gold-text); font-size: 1.1rem; }

@media (prefers-reduced-motion: no-preference) {
  .hero-slide { animation: heroFade 22.5s linear infinite; animation-delay: calc(var(--i) * 4.5s); }
  .hero-slide:first-child { opacity: 0; } /* hand control to the animation */
}
@keyframes heroFade {
  0%    { opacity: 0; }
  1.8%  { opacity: 1; }
  18%   { opacity: 1; }
  20%   { opacity: 0; }
  100%  { opacity: 0; }
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: -1; }
  .device { width: min(260px, 70%); }
  .hero__lede { margin-inline: auto; }
  .hero__copy { text-align: center; }
  .hero__title .serif-italic { display: inline; }
}

/* =========================================================================
   Store badges
   ========================================================================= */
.badges { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: stretch; }
.hero__copy .badges { }
@media (max-width: 860px) { .hero__copy .badges { justify-content: center; } }

.badge {
  display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none;
  background: var(--ink); color: var(--paper);
  padding: 0.7rem 1.2rem; border-radius: 0.85rem; min-width: 200px;
  border: 1px solid rgba(200, 168, 78, 0.25);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.badge:hover { transform: translateY(-2px); color: var(--paper); box-shadow: 0 10px 24px rgba(26,18,8,0.28); }
.badge svg { width: 26px; height: 26px; flex: none; fill: currentColor; }
.badge__text { display: flex; flex-direction: column; line-height: 1.15; }
.badge__text small { font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.78; }
.badge__text b { font-family: "DM Sans", sans-serif; font-size: 1.02rem; font-weight: 600; letter-spacing: 0.01em; }
.badge--ios { background: var(--card); color: var(--ink); border-color: var(--border); cursor: default; }
.badge--ios:hover { transform: none; box-shadow: var(--shadow-soft); color: var(--ink); }
.badge--ios .badge__flag {
  margin-left: auto; font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold-text); border: 1px solid var(--ghost); border-radius: 1rem; padding: 0.1rem 0.5rem;
}

/* =========================================================================
   Lead / editorial paragraph
   ========================================================================= */
.lead-block { max-width: var(--measure); margin-inline: auto; text-align: center; }
.lead-block .kicker { display: block; margin-bottom: 1rem; }
.lead-block h2 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.lead-block p { margin-top: 1.25rem; font-size: 1.16rem; color: var(--ink-soft); }
.lead-block p .serif-italic { color: var(--gold-text); }

/* =========================================================================
   Features
   ========================================================================= */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-top: 3rem; }
.feature {
  background: var(--card); border: 1px solid var(--border); border-radius: 1rem;
  padding: 1.9rem; box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.feature:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(26,18,8,0.05), 0 22px 48px rgba(26,18,8,0.12); }
.feature__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--mist); color: var(--gold); margin-bottom: 1.1rem;
}
.feature__icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.feature h3 { font-family: "Playfair Display", serif; font-weight: 600; font-size: 1.35rem; }
.feature p { margin-top: 0.5rem; color: var(--muted); font-size: 1rem; }
.feature__no {
  font-family: "Instrument Serif", serif; font-style: italic; color: var(--ghost);
  font-size: 1.5rem; float: right; line-height: 1;
}
@media (max-width: 620px) { .features { grid-template-columns: 1fr; } }

/* =========================================================================
   Gallery
   ========================================================================= */
.gallery-section { background: var(--paper); border-block: 1px solid var(--border); }
.gallery {
  display: flex; gap: 1.5rem; margin-top: 2.75rem; padding-bottom: 1rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--ghost) transparent;
}
.gallery::-webkit-scrollbar { height: 6px; }
.gallery::-webkit-scrollbar-thumb { background: var(--ghost); border-radius: 99px; }
.gallery { align-items: flex-start; }
/* Composed store panels (1080x1920) — headline + device + caption already baked
   into the image, so they carry no extra bezel or figcaption. */
.panel { flex: 0 0 auto; width: clamp(232px, 66vw, 286px); scroll-snap-align: center; }
.panel img {
  width: 100%; border-radius: 1.15rem; background: var(--cream);
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(26, 18, 8, 0.10), 0 22px 50px rgba(26, 18, 8, 0.16);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.panel img:hover { transform: translateY(-4px); box-shadow: 0 4px 10px rgba(26,18,8,0.12), 0 30px 64px rgba(26,18,8,0.22); }
.shot { flex: 0 0 auto; width: 232px; scroll-snap-align: center; text-align: center; }
.shot .device { width: 100%; }
.shot figcaption {
  margin-top: 1rem; font-size: 0.92rem; color: var(--muted);
}
.shot figcaption b { display: block; font-family: "Playfair Display", serif; color: var(--ink); font-weight: 600; font-size: 1.02rem; margin-bottom: 0.1rem; }
.gallery-hint { margin-top: 1.25rem; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ghost); }

/* =========================================================================
   Tiers
   ========================================================================= */
.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 2.75rem; }
.tier { border: 1px solid var(--border); border-radius: 1rem; padding: 2rem; background: var(--card); }
.tier--pro { background: var(--ink); color: var(--cream); border-color: var(--ink); position: relative; overflow: hidden; }
.tier--pro::before {
  content: ""; position: absolute; top: -40%; right: -30%; width: 70%; height: 120%;
  background: radial-gradient(circle, rgba(255,215,0,0.10), transparent 65%);
}
.tier__name { font-family: "Playfair Display", serif; font-size: 1.4rem; font-weight: 600; }
.tier--pro .tier__name { color: var(--pure-gold); }
.tier__price { margin-top: 0.35rem; font-size: 2.4rem; font-family: "Playfair Display", serif; font-weight: 600; }
.tier__price small { font-size: 0.95rem; font-family: "DM Sans", sans-serif; font-weight: 400; color: var(--muted); }
.tier--pro .tier__price small { color: var(--ghost); }
.tier__note { font-size: 0.85rem; color: var(--muted); }
.tier--pro .tier__note { color: var(--ghost); }
.tier ul { list-style: none; padding: 0; margin-top: 1.4rem; display: grid; gap: 0.7rem; }
.tier li { display: flex; gap: 0.65rem; align-items: flex-start; font-size: 1rem; }
.tier li::before { content: "✦"; color: var(--gold); flex: none; transform: translateY(1px); }
.tier--pro li::before { color: var(--pure-gold); }
@media (max-width: 620px) { .tiers { grid-template-columns: 1fr; } }

/* =========================================================================
   CTA band
   ========================================================================= */
.cta-band { background: var(--ink); color: var(--cream); text-align: center; }
.cta-band h2 { font-family: "Playfair Display", serif; font-weight: 600; font-size: clamp(2rem, 5vw, 3rem); color: var(--paper); }
.cta-band h2 .serif-italic { color: var(--pure-gold); font-weight: 400; }
.cta-band p { margin: 1rem auto 2rem; max-width: 34rem; color: var(--ghost); }
.cta-band .badges { justify-content: center; }
.cta-band .rule::before, .cta-band .rule::after { background: rgba(212,201,184,0.25); }

/* =========================================================================
   Footer / colophon
   ========================================================================= */
.colophon { background: var(--cream); border-top: 1px solid var(--border); padding-block: 3rem; }
.colophon__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.colophon__brand .brand { margin-bottom: 0.9rem; }
.colophon__brand p { color: var(--muted); font-size: 0.95rem; max-width: 24rem; }
.colophon h4 { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 0.9rem; }
.colophon ul { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.colophon a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.colophon a:hover { color: var(--gold-text); text-decoration: underline; }
.colophon__base {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem;
  font-size: 0.82rem; color: var(--muted);
}
@media (max-width: 720px) { .colophon__grid { grid-template-columns: 1fr 1fr; } .colophon__brand { grid-column: 1 / -1; } }

/* =========================================================================
   Document pages (privacy / support / terms)
   ========================================================================= */
.doc { max-width: var(--measure); margin-inline: auto; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.doc__head { text-align: center; margin-bottom: 2.5rem; }
.doc__head h1 { font-family: "Playfair Display", serif; font-weight: 600; font-size: clamp(2.2rem, 5vw, 3.2rem); margin-top: 0.8rem; }
.doc__meta { margin-top: 1rem; font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.doc__body { font-size: 1.08rem; color: #2a2010; }
.doc__body h2 {
  font-family: "Playfair Display", serif; font-weight: 600; font-size: 1.5rem;
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.doc__body h3 { font-family: "Playfair Display", serif; font-weight: 600; font-size: 1.18rem; margin-top: 1.75rem; color: var(--ink); }
.doc__body p, .doc__body ul, .doc__body ol { margin-top: 1rem; }
.doc__body ul, .doc__body ol { padding-left: 1.3rem; }
.doc__body li { margin-top: 0.5rem; }
.doc__body strong { color: var(--ink); }
.doc__body .lead { font-size: 1.2rem; color: var(--ink-soft); }
/* drop cap on first lead paragraph */
.doc__body .lead::first-letter {
  font-family: "Playfair Display", serif; font-weight: 700; color: var(--gold-text);
  font-size: 3.4rem; line-height: 0.8; float: left; margin: 0.35rem 0.6rem 0 0;
}
.callout {
  background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--gold);
  border-radius: 0.6rem; padding: 1.1rem 1.3rem; margin-top: 1.5rem; font-size: 1rem; color: var(--ink-soft);
}
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 0.9rem; text-decoration: none; margin-top: 2.5rem; }

/* =========================================================================
   Entrance animation
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(16px); animation: rise 0.8s var(--ease) forwards; }
.reveal.d1 { animation-delay: 0.08s; }
.reveal.d2 { animation-delay: 0.16s; }
.reveal.d3 { animation-delay: 0.24s; }
.reveal.d4 { animation-delay: 0.32s; }
@keyframes rise { to { opacity: 1; transform: none; } }
