/* =========================================================================
   Susurr — shared stylesheet
   Warm dark-academia / cozy-bookstore aesthetic
   Fraunces (display serif) + Hanken Grotesk (body sans)
   ========================================================================= */

:root {
  /* Paper & ink */
  --paper:      #F4ECDC;
  --paper-deep: #EBE0CB;
  --paper-card: #F7F0E2;
  --ink:        #2A211A;
  --cocoa:      #4A3526;
  --espresso:   #2F231A;
  --muted:      #6B5D4F;
  --ember:      #9C5A3C;
  --ember-soft: #B5754F;
  --line:       rgba(42, 33, 26, 0.12);
  --line-soft:  rgba(42, 33, 26, 0.07);

  /* Type */
  --serif: "Fraunces", "Georgia", "Times New Roman", serif;
  --sans:  "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Rhythm */
  --maxw: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 18px;
  --shadow: 0 22px 48px -28px rgba(42, 33, 26, 0.45);
  --shadow-sm: 0 8px 22px -16px rgba(42, 33, 26, 0.5);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1rem, 0.55vw + 0.9rem, 1.075rem);
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  /* layered paper texture */
  background-image:
    radial-gradient(circle at 18% 12%, rgba(181, 117, 79, 0.06), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(74, 53, 38, 0.05), transparent 38%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }

/* ---------- Typography ---------- */
h1, h2, h3 {
  font-family: var(--serif);
  color: var(--espresso);
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 80, "SOFT" 30, "WONK" 0;
}
.display {
  font-size: clamp(2.6rem, 6vw + 1rem, 5.1rem);
  font-weight: 460;
}
.display em { font-style: italic; color: var(--ember); font-variation-settings: "opsz" 90, "SOFT" 60; }
h2 { font-size: clamp(1.9rem, 3vw + 0.8rem, 3rem); }
h3 { font-size: clamp(1.3rem, 1.4vw + 0.9rem, 1.65rem); }
p { margin: 0 0 1.1em; }
.lead {
  font-size: clamp(1.1rem, 0.8vw + 1rem, 1.35rem);
  color: var(--cocoa);
  line-height: 1.6;
}
.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 1rem;
}
.muted { color: var(--muted); }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.center { text-align: center; }
.measure { max-width: 56ch; }
.measure-narrow { max-width: 44ch; }
.center .measure, .center .measure-narrow { margin-inline: auto; }

.rule {
  border: 0;
  height: 1px;
  background: var(--line);
  max-width: var(--maxw);
  margin-inline: auto;
}
.divider-mark {
  display: flex; align-items: center; justify-content: center;
  gap: 0.9rem; color: var(--ember); margin: 0 auto;
}
.divider-mark::before, .divider-mark::after {
  content: ""; height: 1px; width: min(28vw, 220px); background: var(--line);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  padding: 0.95rem 1.6rem; border-radius: 999px; border: 1.5px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  will-change: transform;
}
.btn--primary { background: var(--ember); color: var(--paper); box-shadow: var(--shadow-sm); }
.btn--primary:hover { transform: translateY(-2px); background: #8a4d31; box-shadow: 0 16px 30px -18px rgba(156,90,60,0.9); }
.btn--ghost { background: transparent; color: var(--cocoa); border-color: rgba(42,33,26,0.25); }
.btn--ghost:hover { transform: translateY(-2px); border-color: var(--cocoa); background: rgba(74,53,38,0.05); }

/* App Store button (custom — not the trademarked Apple badge) */
.appstore {
  display: inline-flex; align-items: center; gap: 0.85rem;
  background: var(--espresso); color: var(--paper);
  padding: 0.7rem 1.4rem 0.7rem 1.2rem; border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.appstore:hover { transform: translateY(-2px); box-shadow: 0 18px 32px -18px rgba(47,35,26,0.8); }
.appstore svg { width: 26px; height: 26px; flex: none; }
.appstore .as-text { display: flex; flex-direction: column; line-height: 1.15; }
.appstore .as-small { font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.78; }
.appstore .as-big { font-family: var(--serif); font-size: 1.2rem; font-style: italic; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 236, 220, 0.82);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--serif); font-size: 1.5rem; color: var(--espresso); }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--espresso);
  color: var(--paper); display: grid; place-items: center; font-style: italic; font-size: 1.05rem;
}
.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  display: block;
  flex: none;
}
.brand b { font-weight: 500; letter-spacing: 0.01em; }
.nav-links { display: flex; align-items: center; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  padding: 0.5rem 0.85rem; border-radius: 999px; font-size: 0.96rem; font-weight: 500;
  color: var(--cocoa); transition: background 0.16s ease, color 0.16s ease;
}
.nav-links a:hover { background: rgba(74,53,38,0.07); }
.nav-links a.active { color: var(--espresso); background: rgba(74,53,38,0.09); }
.nav-cta { margin-left: 0.4rem; }

.nav-toggle {
  display: none; background: none; border: 0; padding: 0.4rem; border-radius: 8px;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--espresso); margin: 5px 0; transition: transform 0.25s ease, opacity 0.25s ease; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(3rem, 6vw, 5rem); padding-bottom: clamp(2rem, 5vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-copy { max-width: 36ch; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; align-items: center; }
.hero-note { font-size: 0.9rem; color: var(--muted); margin-top: 1.4rem; display: flex; align-items: center; gap: 0.5rem; }
.hero-note svg { width: 17px; height: 17px; color: var(--ember); }
.hero-visual { position: relative; display: grid; place-items: center; }
.hero-visual::before {
  content: ""; position: absolute; inset: -8% -4% -4% -4%;
  background: radial-gradient(60% 60% at 50% 40%, rgba(181,117,79,0.16), transparent 70%);
  filter: blur(6px); z-index: 0;
}
.hero-visual img { position: relative; z-index: 1; width: min(310px, 78%); filter: drop-shadow(0 30px 50px rgba(42,33,26,0.3)); }

/* staggered load-in */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.rise { opacity: 0; animation: rise 0.8s cubic-bezier(0.2,0.7,0.2,1) forwards; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.18s; }
.rise-3 { animation-delay: 0.31s; }
.rise-4 { animation-delay: 0.44s; }
.rise-5 { animation-delay: 0.57s; }

/* ---------- Philosophy strip ---------- */
.philosophy { background: var(--espresso); color: var(--paper); }
.philosophy h2 { color: var(--paper); }
.philosophy .lead { color: rgba(244,236,220,0.78); }
.pill-row { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 2rem; }
.pill {
  font-size: 0.85rem; letter-spacing: 0.04em; padding: 0.45rem 1rem; border-radius: 999px;
  border: 1px solid rgba(244,236,220,0.22); color: rgba(244,236,220,0.9);
}

/* ---------- Feature grid (home preview) ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2vw, 1.6rem); }
.f-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem 1.6rem; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.f-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(156,90,60,0.35); }
.f-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(156,90,60,0.12); color: var(--ember); margin-bottom: 1.1rem;
}
.f-icon svg { width: 24px; height: 24px; }
.f-card h3 { margin-bottom: 0.4rem; }
.f-card p { color: var(--muted); font-size: 0.98rem; margin: 0; }

/* ---------- Quote band ---------- */
.quote-band { background: var(--paper-deep); }
.pull-quote {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.5rem, 2.6vw + 0.6rem, 2.4rem);
  line-height: 1.32; color: var(--espresso); max-width: 22ch; margin: 0 auto; position: relative;
}
.pull-quote .dropcap { color: var(--ember); }

/* ---------- Detailed feature rows (features page) ---------- */
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.feature-row + .feature-row { margin-top: clamp(3.5rem, 7vw, 6rem); }
.feature-row:nth-child(even) .feature-media { order: -1; }
.feature-media { display: grid; place-items: center; position: relative; }
.feature-media::before {
  content: ""; position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(181,117,79,0.14), transparent 68%);
}
.feature-media img { position: relative; width: min(280px, 72%); filter: drop-shadow(0 24px 44px rgba(42,33,26,0.28)); }
.feature-text .num {
  font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--ember); display: block; margin-bottom: 0.5rem;
}
.feature-text ul { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.feature-text li { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.4rem 0; color: var(--cocoa); }
.feature-text li svg { width: 18px; height: 18px; color: var(--ember); flex: none; margin-top: 0.35em; }

/* ---------- Support / FAQ ---------- */
.support-grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-card {
  background: var(--espresso); color: var(--paper); border-radius: var(--radius);
  padding: 2rem 1.9rem; box-shadow: var(--shadow); position: sticky; top: 96px;
}
.contact-card h3 { color: var(--paper); }
.contact-card p { color: rgba(244,236,220,0.75); }
.contact-card a.email {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.6rem;
  font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--ember-soft);
}
.contact-card a.email:hover { color: var(--paper); }
.contact-meta { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid rgba(244,236,220,0.18); font-size: 0.9rem; }

.faq-section + .faq-section { margin-top: 2.6rem; }
.faq-section h3 { margin-bottom: 0.4rem; }
.faq-section > p.muted { margin-top: 0; }
details.faq {
  border-bottom: 1px solid var(--line); padding: 0.2rem 0;
}
details.faq summary {
  list-style: none; cursor: pointer; padding: 1.05rem 2.2rem 1.05rem 0; position: relative;
  font-weight: 600; color: var(--espresso); font-size: 1.04rem;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+"; position: absolute; right: 0.2rem; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; color: var(--ember); transition: transform 0.25s ease; font-weight: 400;
}
details.faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details.faq .answer { padding: 0 0 1.2rem; color: var(--muted); max-width: 64ch; }
details.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- Legal / prose pages ---------- */
.legal { max-width: 72ch; margin-inline: auto; }
.legal .placeholder-note {
  background: rgba(156,90,60,0.08); border: 1px dashed rgba(156,90,60,0.45);
  border-radius: 12px; padding: 1rem 1.2rem; color: var(--cocoa); font-size: 0.95rem; margin-bottom: 2.4rem;
}
.legal h2 { margin-top: 2.4rem; margin-bottom: 0.6rem; font-size: 1.5rem; scroll-margin-top: 90px; }
.legal h2:first-of-type { margin-top: 0; }
.legal h3 { font-family: var(--serif); color: var(--espresso); font-size: 1.2rem; margin-top: 1.8rem; margin-bottom: 0.4rem; scroll-margin-top: 90px; }
.legal p { color: var(--cocoa); }
.legal .updated { font-size: 0.85rem; letter-spacing: 0.04em; color: var(--muted); }
.legal a { color: var(--ember); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.legal a:hover { color: var(--cocoa); }
.legal ul { margin: 0.4rem 0 1.2em; padding-left: 1.3rem; color: var(--cocoa); }
.legal li { margin-bottom: 0.45rem; }
.legal li > ul { margin-top: 0.45rem; }
.legal .toc { list-style: none; padding-left: 0; }
.legal .toc li { margin-bottom: 0.55rem; }
.legal .lead-note {
  background: var(--paper-deep); border-left: 3px solid var(--ember);
  border-radius: 0 10px 10px 0; padding: 0.9rem 1.1rem; margin: 1.2rem 0;
}
.legal table { width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: 0.92rem; }
.legal th, .legal td { border: 1px solid var(--line); padding: 0.7rem 0.85rem; text-align: left; vertical-align: top; color: var(--cocoa); }
.legal th { background: var(--paper-deep); color: var(--espresso); font-family: var(--sans); font-weight: 600; }
.legal td.yn { text-align: center; font-weight: 600; color: var(--espresso); white-space: nowrap; }
.legal .back-to-top { font-size: 0.82rem; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-band .display { font-size: clamp(2rem, 4vw + 0.8rem, 3.4rem); }
.cta-band .cta-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--espresso); color: rgba(244,236,220,0.72); padding-block: clamp(2.6rem, 5vw, 4rem); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; }
.site-footer .brand { color: var(--paper); }
.site-footer .brand-logo {
  filter: none;
}
.footer-tag { max-width: 32ch; margin-top: 1rem; font-size: 0.95rem; }
.footer-col h4 { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ember-soft); margin-bottom: 1rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a { color: rgba(244,236,220,0.8); font-size: 0.96rem; }
.footer-col a:hover { color: var(--paper); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: space-between; align-items: center; margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px solid rgba(244,236,220,0.16); font-size: 0.85rem; }
.footer-bottom p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { max-width: 100%; }
  .hero .cta-row, .hero-note { justify-content: center; }
  .hero-visual { order: -1; margin-bottom: 1rem; }
  .hero-copy .eyebrow { margin-inline: auto; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .feature-row { grid-template-columns: 1fr; text-align: center; }
  .feature-row .feature-media { order: -1 !important; margin-bottom: 0.5rem; }
  .feature-text ul { display: inline-block; text-align: left; }
  .support-grid { grid-template-columns: 1fr; }
  .contact-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.2rem;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 0.8rem var(--gutter) 1.2rem;
    box-shadow: var(--shadow-sm);
    transform: translateY(-10px); opacity: 0; pointer-events: none;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }
  .nav-links a { padding: 0.8rem 0.6rem; border-radius: 10px; }
  .nav[data-open="true"] .nav-links { transform: none; opacity: 1; pointer-events: auto; }
  .nav[data-open="true"] .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav[data-open="true"] .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav[data-open="true"] .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-cta { margin: 0.4rem 0 0; }
}

@media (max-width: 520px) {
  .feature-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .divider-mark::before, .divider-mark::after { width: 22vw; }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .rise { opacity: 1; }
}
:focus-visible { outline: 2.5px solid var(--ember); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: absolute; left: 1rem; top: -3rem; background: var(--espresso); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: 8px; z-index: 100; transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }
