/* ============================================================
   Perdura — site styles

   The layout/typography of each section lives in inline `style`
   attributes carried over verbatim from the approved design
   export, so this file deliberately does NOT restate them.
   What lives here is everything the export could not express in
   a static attribute: the reset, interaction states, reveal
   motion, and the responsive behaviour of the sticky mobile CTA.
   ============================================================ */

/* ── Reset + base (from the export's global stylesheet) ────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: #F4F1EA;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, sans-serif;
  color: #141E28;
}

::selection { background: #E2D7C7; color: #141E28; }

a { color: #141E28; text-decoration: none; }
a:hover { color: #9E5B3B; }

button, input { font-family: inherit; }
input::placeholder { color: #9C978D; }

img, svg { max-width: 100%; }

/* Visible keyboard focus everywhere — the export had none. */
:focus-visible {
  outline: 2px solid #9E5B3B;
  outline-offset: 3px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Interaction states (replacing the export's style-hover) ── */
.btn-primary:hover,
.btn-primary:focus-visible { background: #8A4E32; color: #F7F4EE; }

.link-rule:hover,
.link-rule:focus-visible { border-color: #9E5B3B; color: #141E28; }

.link-serif:hover,
.link-serif:focus-visible { color: #9E5B3B; }

.link-muted { color: #7A776F; }
.link-muted:hover,
.link-muted:focus-visible { color: #141E28; }

.btn-ghost:hover,
.btn-ghost:focus-visible { border-color: #9E5B3B; color: #9E5B3B; }

.faq-trigger:hover { color: #9E5B3B; }

.signup-input:focus { border-bottom-color: #9E5B3B; }

/* ── Reveal-on-scroll ──────────────────────────────────────── */
/* Elements start hidden only when JS is available to reveal
   them; without JS the :not(.js) guard leaves content visible. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}
.js [data-reveal][data-revealed] {
  opacity: 1;
  transform: none;
}

/* ── FAQ accordion ─────────────────────────────────────────── */
.faq-answer[hidden] { display: none; }

/* ── Sticky mobile CTA ─────────────────────────────────────── */
/* The export toggled this from JS at a 780px window width; a
   media query does the same job without a resize listener. */
.sticky-cta,
.sticky-cta-spacer { display: none; }

@media (max-width: 779px) {
  .sticky-cta {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    align-items: center;
    gap: 16px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(244, 241, 234, .94);
    backdrop-filter: saturate(1.1) blur(10px);
    -webkit-backdrop-filter: saturate(1.1) blur(10px);
    border-top: 1px solid #DED8CD;
  }
  .sticky-cta-spacer { display: block; height: 78px; }

  /* The bar's secondary link is thumb-sized (44px) without looking it —
     the underline stays hugging the text via the inner span. */
  .sticky-join {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 4px;
    font-size: 14px;
    color: #141E28;
  }
  .sticky-join span {
    border-bottom: 1px solid #C9C2B6;
    padding-bottom: 2px;
  }
  .sticky-join:hover span,
  .sticky-join:focus-visible span { border-color: #9E5B3B; }
}

/* ── Legal pages (privacy, terms) ──────────────────────────── */
/* These pages are authored here rather than carried over from the
   design export, so they use real classes instead of inline styles. */
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 44px) clamp(20px, 4vw, 40px) clamp(80px, 10vw, 130px);
}

.legal-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: clamp(48px, 7vw, 88px);
}

.legal-wordmark {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(21px, 2.2vw, 25px);
  letter-spacing: .05em;
  line-height: 1;
}

.legal-kicker {
  margin: 0 0 clamp(24px, 3vw, 34px);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #7A776F;
}

.legal h1 {
  margin: 0 0 clamp(20px, 2.4vw, 28px);
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 300;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.12;
  letter-spacing: .004em;
  text-wrap: balance;
}

.legal-updated {
  margin: 0 0 clamp(44px, 6vw, 72px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #7A776F;
}

.legal h2 {
  margin: clamp(48px, 6vw, 72px) 0 clamp(16px, 1.8vw, 22px);
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 300;
  font-size: clamp(23px, 2.6vw, 31px);
  line-height: 1.25;
  border-top: 1px solid #DED8CD;
  padding-top: clamp(26px, 3vw, 36px);
}

.legal h3 {
  margin: clamp(26px, 3vw, 34px) 0 10px;
  font-size: clamp(16px, 1.2vw, 17.5px);
  font-weight: 600;
  letter-spacing: .005em;
}

.legal p,
.legal li {
  font-size: clamp(16px, 1.15vw, 17.5px);
  line-height: 1.72;
  color: #3C4650;
  text-wrap: pretty;
}

.legal p { margin: 0 0 1.1em; }
.legal ul { margin: 0 0 1.1em; padding-left: 1.3em; }
.legal li { margin-bottom: .55em; }
.legal a { border-bottom: 1px solid #C9C2B6; padding-bottom: 1px; }
.legal a:hover { border-color: #9E5B3B; }
.legal strong { font-weight: 600; color: #141E28; }

/* Passages the reader must not skim past. */
.legal-callout {
  margin: clamp(28px, 3vw, 38px) 0;
  padding: clamp(22px, 2.6vw, 30px);
  background: #EAE5DB;
  border-left: 2px solid #9E5B3B;
}
.legal-callout p:last-child { margin-bottom: 0; }

/* Anything still needing the owner's input before publication. */
.legal-todo {
  background: #F6E4D8;
  border-bottom: 1px dashed #9E5B3B;
  padding: 1px 4px;
  font-weight: 600;
  color: #8A4E32;
}

.legal-footer {
  margin-top: clamp(64px, 8vw, 100px);
  border-top: 1px solid #DED8CD;
  padding-top: clamp(24px, 3vw, 32px);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 30px;
  font-size: 14px;
  color: #7A776F;
}

/* ── Narrow-phone fix: "Four levers" ───────────────────────── */
/* The export sets a 280px minimum on the heading/body track, which
   can't fit next to the 62px number column on a 375px screen — the
   track overruns the page gutter. Below that, take the minimum off.
   !important because the grid is declared in an inline style. */
@media (max-width: 560px) {
  .lever-body { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ── Motion preferences ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
