/* ============================================================
   The Lauppe Family — lauppe.org
   A quiet, modern single page with scroll-driven storytelling.
   No frameworks, no libraries.
   ============================================================ */

:root {
  /* Palette — warm paper, deep pines, soft gold */
  --bg: #faf6ef;
  --bg-tint: #f1ebdf;
  --surface: #ffffff;
  --ink: #26221b;
  --ink-soft: #5d5749;
  --ink-faint: #8a8272;
  --accent: #1f3d2b;
  --accent-soft: #2c5238;
  --gold: #b08d3e;
  --line: #e3dccd;
  --shadow: 0 1px 2px rgba(38, 34, 27, 0.05), 0 8px 24px rgba(38, 34, 27, 0.07);
  --shadow-lift: 0 2px 4px rgba(38, 34, 27, 0.06), 0 16px 40px rgba(38, 34, 27, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --max: 1040px;
  --max-narrow: 640px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140f;
    --bg-tint: #1d1a13;
    --surface: #211e16;
    --ink: #f0eadd;
    --ink-soft: #b3ab99;
    --ink-faint: #837c6b;
    --accent: #8fbf9f;
    --accent-soft: #a5cdb2;
    --gold: #d3ac5c;
    --line: #322d22;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(0, 0, 0, 0.5);
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Subtle paper grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background-image: var(--noise);
  opacity: 0.035;
  mix-blend-mode: overlay;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

::selection {
  background: var(--gold);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: min(var(--max), 100% - 3rem);
  margin-inline: auto;
}

.narrow {
  max-width: var(--max-narrow);
}

section[id] {
  scroll-margin-top: 5rem;
}

/* ---------- Scroll progress ---------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 50;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom-color: var(--line);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.wordmark:hover {
  text-decoration: none;
}

.wordmark-mark {
  color: var(--gold);
  font-size: 1rem;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.site-nav a {
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration: none;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: 7rem 0 6rem;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

/* The family's view from the farm, full-bleed. It drifts slightly on
   scroll (data-parallax); the scrim keeps the headline, header, and
   section hand-off legible in both themes. */

.hero-photo {
  position: absolute;
  inset: 0;
  background-image: url("img/hero-view.jpg");
  background-size: cover;
  background-position: center;
  will-change: transform;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top,
      color-mix(in srgb, var(--bg) 62%, transparent) 0%,
      transparent 26%),
    linear-gradient(to bottom,
      color-mix(in srgb, var(--bg) 72%, transparent) 0%,
      transparent 18%),
    linear-gradient(100deg,
      color-mix(in srgb, var(--bg) 94%, transparent) 0%,
      color-mix(in srgb, var(--bg) 82%, transparent) 30%,
      color-mix(in srgb, var(--bg) 45%, transparent) 52%,
      transparent 72%);
}

.hero-grain {
  position: absolute;
  inset: 0;
  background-image: var(--noise);
  opacity: 0.05;
  mix-blend-mode: overlay;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 46rem;
  will-change: transform, opacity;
}

.hero-eyebrow {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.9rem, 8vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.hero-lede {
  margin: 0 0 2.5rem;
  font-size: 1.1875rem;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 38rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
}

/* Scroll cue */

.scroll-cue {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.scroll-cue:hover {
  text-decoration: none;
  color: var(--ink-soft);
}

.scroll-cue-line {
  width: 1px;
  height: 52px;
  background: linear-gradient(var(--ink-faint), transparent);
  animation: cue 2.4s var(--ease) infinite;
  transform-origin: top;
}

@keyframes cue {
  0% {
    transform: scaleY(0);
    opacity: 1;
  }
  55% {
    transform: scaleY(1);
    opacity: 1;
  }
  100% {
    transform: scaleY(1) translateY(0.25rem);
    opacity: 0;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: #fdfbf6;
}

.btn-primary:hover {
  background: var(--accent-soft);
  box-shadow: var(--shadow);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: var(--surface);
  box-shadow: var(--shadow);
}

.btn-ext {
  font-size: 0.85em;
  opacity: 0.8;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(4rem, 10vw, 7rem);
}

.section-tint {
  background: var(--bg-tint);
  border-block: 1px solid var(--line);
}

.section-eyebrow {
  margin: 0 0 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

.chapter-num {
  font-weight: 700;
  margin-right: 0.5rem;
  opacity: 0.85;
}

.section-title {
  margin: 0 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

.section-body {
  margin: 0;
  color: var(--ink-soft);
}

.section-head-center {
  text-align: center;
  margin-bottom: 1.5rem;
}

.section-head-center .section-body {
  margin-inline: auto;
}

/* ---------- Pills ---------- */

.pill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
  margin: 1.75rem 0 0;
  padding: 0;
}

.pill {
  padding: 0.4375rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
  box-shadow: var(--shadow);
}

/* ---------- Parallax dividers ---------- */

.divider {
  position: relative;
  height: 190px;
  overflow: hidden;
  pointer-events: none;
  color: var(--accent);
}

.divider-svg {
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 135%;
  will-change: transform;
}

.d-sun {
  fill: var(--gold);
  opacity: 0.4;
}

.d-hill-back {
  fill: var(--accent);
  opacity: 0.1;
}

.d-hill-front {
  fill: var(--accent);
  opacity: 0.2;
}

.d-tree {
  fill: var(--accent);
  opacity: 0.28;
}

.d-birds {
  color: var(--accent);
  opacity: 0.4;
}

/* ---------- Work: sticky scrollytelling layout ---------- */

.work-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.work-aside-sticky {
  position: sticky;
  top: 6.5rem;
}

.work-progress {
  margin-top: 2.25rem;
  height: 42vh;
  min-height: 180px;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.work-progress-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(var(--gold), var(--accent));
  transform: scaleY(0);
  transform-origin: top;
}

.work-cards {
  display: grid;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .work-layout {
    grid-template-columns: 1fr;
  }
  .work-aside-sticky {
    position: static;
  }
  .work-progress {
    display: none;
  }
  /* The angled desktop scrim doesn't reach the full width on narrow
     screens; use a full-width vertical fade instead. */
  .hero-scrim {
    background: linear-gradient(to bottom,
      color-mix(in srgb, var(--bg) 88%, transparent) 0%,
      color-mix(in srgb, var(--bg) 70%, transparent) 42%,
      color-mix(in srgb, var(--bg) 82%, transparent) 100%);
  }
}

/* ---------- Cards ---------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--gold) 45%, var(--line));
}

.card--featured {
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 10%, var(--surface)), var(--surface) 55%);
  border-color: color-mix(in srgb, var(--gold) 35%, var(--line));
}

/* Desktop-browser previews: each card shows the site's top viewport,
   captured full-width at 16:9 and shrunk to a 16:9 box. The ratio
   lives on the wrapper (aspect-ratio on the <img> itself is ignored
   in favor of its intrinsic height), and the image fills it — the
   capture and box share the same ratio, so nothing is cropped. */

.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 0.875rem;
}

.card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-num {
  position: absolute;
  right: 0.5rem;
  bottom: -0.9rem;
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 600;
  line-height: 1;
  color: color-mix(in srgb, var(--ink) 7%, transparent);
  pointer-events: none;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.625rem;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}

.card-icon svg {
  width: 1.375rem;
  height: 1.375rem;
}

.card-ext {
  font-size: 1.125rem;
  color: var(--ink-faint);
  transition: transform 0.18s ease, color 0.18s ease;
}

.card:hover .card-ext {
  transform: translate(2px, -2px);
  color: var(--gold);
}

.card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3125rem;
  letter-spacing: -0.005em;
}

.card-desc {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.card-url {
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--gold);
}

/* ---------- Faith ---------- */

.section-faith {
  position: relative;
  overflow: hidden;
  text-align: center;
}

.section-faith .section-body {
  margin-inline: auto;
}

.faith-figure {
  margin: 2.5rem auto 0;
  max-width: 420px;
}

/* Same wrapper pattern as the card previews: the ratio lives on the
   box, the image fills it. */

.faith-photo-box {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  overflow: hidden;
}

.faith-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.faith-caption {
  margin-top: 0.625rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--ink-faint);
}

.faith-caption a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--ink-faint) 50%, transparent);
}

.faith-ornament {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36rem;
  height: 36rem;
  margin: -18rem 0 0 -18rem;
  display: grid;
  place-items: center;
  font-size: 17rem;
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 7%, transparent);
  will-change: transform;
  pointer-events: none;
  user-select: none;
}

#faith .btn {
  margin-top: 2.25rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 3rem;
  text-align: center;
}

.footer-inner p {
  margin: 0.25rem 0;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.footer-small {
  font-size: 0.8125rem !important;
  color: var(--ink-faint) !important;
}

.footer-top {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.footer-top:hover {
  color: var(--ink);
}

/* ---------- Back-to-top FAB ---------- */

.to-top-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fdfbf6;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translateY(0.5rem);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.15s ease;
}

.to-top-fab.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top-fab:hover {
  background: var(--accent-soft);
}

/* ---------- Reveal animations ---------- */

/* Hidden states only apply when JS is available (a `js` class is set in
   <head>), so the page stays fully readable without JavaScript. */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

[data-reveal-words] .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.js [data-reveal-words] .wi {
  display: inline-block;
  transform: translateY(115%);
  transition: transform 0.8s var(--ease);
}

.js [data-reveal-words].is-visible .wi {
  transform: none;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  [data-reveal],
  [data-reveal-words] .wi {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .scroll-cue-line {
    animation: none;
  }
  .scroll-progress,
  .to-top-fab,
  .btn,
  .card,
  .card-ext,
  .site-header {
    transition: none;
  }
  .hero-inner,
  .hero-photo,
  .divider-svg,
  .faith-ornament {
    transform: none !important;
  }
}
