/* Creston Labs — corporate site · v2.1 editorial design system */

@import url("fonts/fonts.css?v=23");

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1f2a24;
  --ink-soft: #4c5a52;
  --ink-faint: #74827a;
  --accent: #2e6b4f;
  --accent-dark: #22503b;
  --accent-deep: #1a3d2d;
  --accent-tint: #eaf2ed;
  --border: #e3e2dc;
  --foil: #b8934a;
  --paper: #fffdf6;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --max: 1100px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

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

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

::selection {
  background: var(--accent-tint);
  color: var(--accent-deep);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(227, 226, 220, 0.8);
  background: rgba(251, 250, 247, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 16px;
  padding-bottom: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--ink);
}

.logo:hover {
  text-decoration: none;
  color: var(--ink);
}

.logo svg {
  display: block;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: none;
}

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

.hero {
  padding: 120px 0 72px;
  text-align: center;
  position: relative;
}

.hero .kicker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  padding: 0;
  border-radius: 0;
  margin-bottom: 30px;
}

.hero .kicker::before,
.hero .kicker::after {
  content: "";
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--foil));
}

.hero .kicker::after {
  background: linear-gradient(90deg, var(--foil), transparent);
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.9rem, 7vw, 5rem);
  font-weight: 330;
  font-variation-settings: "opsz" 120;
  letter-spacing: -0.015em;
  line-height: 1.06;
  max-width: 17ch;
  margin: 0 auto 26px;
}

.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent-dark);
}

.hero .tagline {
  font-size: clamp(1.02rem, 2vw, 1.18rem);
  color: var(--ink-soft);
  max-width: 54ch;
  margin: 0 auto 38px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-dark);
  color: #fff;
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  padding: 14px 30px;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 2px rgba(26, 61, 45, 0.25);
}

.btn::after {
  content: "↓";
  font-size: 0.9em;
  transition: transform 0.2s ease;
}

.btn:hover {
  background: var(--accent-deep);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(26, 61, 45, 0.22);
}

.btn:hover::after {
  transform: translateY(2px);
}

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

.section {
  padding: 104px 0;
}

.section.alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section h2 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 360;
  font-variation-settings: "opsz" 60;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 18px;
}

.section h2::after {
  content: "";
  display: block;
  width: 52px;
  height: 2px;
  margin-top: 18px;
  background: linear-gradient(90deg, var(--foil), rgba(184, 147, 74, 0));
}

.section .lede {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 58ch;
  margin-bottom: 52px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 30px 32px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(31, 42, 36, 0.09);
  border-color: #d6d4cb;
}

.section.alt .card {
  background: var(--bg);
}

.card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px rgba(46, 107, 79, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.card h3 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 420;
  letter-spacing: 0;
  margin-bottom: 12px;
}

.card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.72;
}

.about-text {
  max-width: 66ch;
}

.about-text p + p {
  margin-top: 18px;
}

.about-text p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.3em;
  line-height: 0.82;
  font-weight: 400;
  color: var(--accent-dark);
  float: left;
  padding: 6px 10px 0 0;
}

.fact-list {
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--paper);
  padding: 10px 0;
  box-shadow: 0 10px 28px rgba(31, 42, 36, 0.05);
}

.section.alt .fact-list {
  background: var(--paper);
}

.fact-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 15px 26px;
  font-size: 0.93rem;
}

.fact-list li + li {
  border-top: 1px solid var(--border);
}

.fact-list .k {
  color: var(--ink-faint);
  flex-shrink: 0;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fact-list .v {
  font-weight: 500;
  text-align: right;
}

/* ---------- Contact ---------- */

.contact-box {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 44px;
  max-width: 560px;
  box-shadow: 0 10px 28px rgba(31, 42, 36, 0.05);
}

.contact-box h3 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--accent);
}

.contact-box p {
  color: var(--ink-soft);
  font-size: 0.97rem;
}

.contact-box a {
  font-family: var(--serif);
  font-size: 1.15rem;
}

address {
  font-style: normal;
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* ---------- Interior pages (legal + pricing) — editorial sheet ---------- */

.legal {
  padding: 88px 0 112px;
}

.legal .page-header {
  text-align: center;
  margin-bottom: 56px;
}

.legal .page-header .kicker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 26px;
}

.legal .page-header .kicker::before,
.legal .page-header .kicker::after {
  content: "";
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--foil));
}

.legal .page-header .kicker::after {
  background: linear-gradient(90deg, var(--foil), transparent);
}

.legal h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 330;
  font-variation-settings: "opsz" 110;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin-bottom: 16px;
}

.legal .updated {
  color: var(--ink-faint);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.legal article {
  max-width: 860px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: clamp(36px, 6vw, 68px);
  box-shadow: 0 16px 44px rgba(31, 42, 36, 0.07);
}

.legal article > p:first-of-type {
  font-size: 1.08rem;
  line-height: 1.75;
}

.legal article > p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.3em;
  line-height: 0.82;
  font-weight: 400;
  color: var(--accent-dark);
  float: left;
  padding: 6px 10px 0 0;
}

.legal h2 {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.6vw, 1.75rem);
  font-weight: 400;
  margin: 52px 0 16px;
  letter-spacing: -0.005em;
  line-height: 1.2;
}

.legal h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin-top: 12px;
  background: linear-gradient(90deg, var(--foil), rgba(184, 147, 74, 0));
}

.legal h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 26px 0 8px;
}

.legal p {
  margin-bottom: 14px;
  color: var(--ink-soft);
}

.legal ul,
.legal ol {
  margin: 0 0 14px 4px;
  padding-left: 22px;
  color: var(--ink-soft);
}

.legal li {
  margin-bottom: 9px;
  padding-left: 4px;
}

.legal ul li::marker {
  color: var(--foil);
}

.legal ol li::marker {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.9em;
}

.legal strong {
  color: var(--ink);
}

@media (max-width: 560px) {
  .legal {
    padding: 56px 0 72px;
  }

  .legal .page-header {
    margin-bottom: 36px;
  }

  .legal article {
    border-radius: 14px;
  }
}

.notice {
  background: var(--accent-tint);
  border: 1px solid #d3e4da;
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- Pricing tables ---------- */

.price-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.95rem;
}

.price-table th,
.price-table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  color: var(--ink-soft);
}

.price-table thead th {
  background: var(--accent-tint);
  color: var(--accent-deep);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.price-table tbody tr:last-child td {
  border-bottom: none;
}

.price-table td:first-child {
  color: var(--ink);
  font-weight: 600;
}

.price-table .price {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--accent-dark);
  white-space: nowrap;
}

.price-table .per {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-faint);
}

@media (max-width: 560px) {
  .price-table th:nth-child(2),
  .price-table td:nth-child(2) {
    display: none;
  }
}

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

.site-footer {
  border-top: none;
  background: var(--accent-deep);
  color: #d8e2db;
  padding: 52px 0 44px;
  margin-top: 0;
}

.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.footer-links {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(216, 226, 219, 0.18);
}

.footer-links a {
  color: #e9efe9;
  font-weight: 500;
}

.footer-links a:hover {
  color: #fff;
}

.footer-legal {
  color: #9db5a6;
  font-size: 0.85rem;
  line-height: 1.8;
}

.footer-legal a {
  color: #c9d8cd;
}

.footer-legal a:hover {
  color: #fff;
}

/* ---------- Scroll reveals (JS-gated: without .js everything is visible) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.9, 0.3, 1);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- Immersive book scrub ---------- */

.scrub {
  background: var(--bg);
}

.scrub-track {
  position: relative;
}

.scrub-sticky {
  position: static;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 0;
  overflow: hidden;
}

.scrub-active .scrub-track {
  height: 480vh;
}

.scrub-active .scrub-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 0;
}

.scrub-stage {
  position: relative;
  width: min(84vh, 92vw);
  aspect-ratio: 1 / 1;
}

.scrub-stage img,
.scrub-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scrub-stage canvas {
  position: absolute;
  inset: 0;
}

.scrub-stage [hidden] {
  display: none;
}

.scrub-caption {
  margin: 0;
  position: absolute;
  bottom: 30px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: opacity 0.45s ease;
}

.scrub-caption::after {
  content: "↓";
  margin-left: 10px;
}

.scrub-started .scrub-caption {
  opacity: 0;
}

/* chapter rail (desktop only, JS-activated) */
.scrub-chapters {
  display: none;
  position: absolute;
  left: 48px;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  gap: 26px;
  list-style: none;
}

.scrub-active .scrub-chapters {
  display: flex;
}

.scrub-chapters li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  opacity: 0.45;
  transition: opacity 0.4s ease, color 0.4s ease;
}

.scrub-chapters li .n {
  font-family: var(--serif);
  font-size: 0.85rem;
  color: var(--foil);
}

.scrub-chapters li.on {
  opacity: 1;
  color: var(--ink);
}

@media (max-width: 1240px) {
  .scrub-chapters {
    display: none !important;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .cards {
    grid-template-columns: 1fr;
  }

  .contact-box {
    padding: 32px;
  }

  .hero {
    padding: 76px 0 52px;
  }

  .section {
    padding: 64px 0;
  }
}
