/* ============================================================
   base.css — Rebuild Coaching v2 — Luxury Coastal Editorial
   Reset, typography, layout primitives, utilities.
   ============================================================ */

@import "./tokens.css";

/* ----------------------------------------------------------
   BOX-SIZING RESET
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ----------------------------------------------------------
   HTML / ROOT
   ---------------------------------------------------------- */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
  /* smooth scroll is handled by Lenis; CSS smooth-scroll as fallback */
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ----------------------------------------------------------
   BODY
   ---------------------------------------------------------- */
body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: 'Newsreader', Georgia, serif;
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ----------------------------------------------------------
   HEADINGS — Fraunces
   ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
}

h1 { font-size: var(--fs-display); line-height: 1.05; }
h2 { font-size: var(--fs-h2); line-height: 1.15; }
h3 { font-size: var(--fs-h3); }

/* Fraunces italic accent inside headings */
h1 em, h2 em, h3 em {
  font-style: italic;
  font-weight: 300;
}

/* ----------------------------------------------------------
   BODY TEXT
   ---------------------------------------------------------- */
p {
  max-width: 64ch;
  line-height: 1.7;
}

p + p {
  margin-top: var(--sp-3);
}

strong {
  font-weight: 500;
  color: var(--ink);
}

em {
  font-style: italic;
}

/* ----------------------------------------------------------
   LINKS
   ---------------------------------------------------------- */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
  transition: color var(--t-fast) var(--ease),
              text-decoration-color var(--t-fast) var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--gold-deep);
  text-decoration-color: var(--gold-deep);
}

/* ----------------------------------------------------------
   IMAGES — prevent broken-image icons
   ---------------------------------------------------------- */
img {
  display: block;
  max-width: 100%;
  height: auto;
  /* alt text won't ugly-splash on missing images */
  font-size: 0;
  color: transparent;
  background-color: var(--sand-deep);
  filter: saturate(0.88) contrast(0.98);
}

/* ----------------------------------------------------------
   SVG
   ---------------------------------------------------------- */
svg {
  display: block;
}

/* ----------------------------------------------------------
   LISTS
   ---------------------------------------------------------- */
ul, ol {
  padding-left: var(--sp-3);
}

li + li {
  margin-top: var(--sp-1);
}

/* ----------------------------------------------------------
   DETAILS / SUMMARY
   ---------------------------------------------------------- */
details {
  border-top: 1px solid var(--line);
  padding: var(--sp-3) 0;
}

details:last-child {
  border-bottom: 1px solid var(--line);
}

details summary {
  font-family: 'Fraunces', Georgia, serif;
  font-size: var(--fs-h3);
  font-weight: 300;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  min-height: 44px;
}

details summary::-webkit-details-marker { display: none; }

details summary::after {
  content: '+';
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.4rem;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform var(--t-fast) var(--ease);
}

details[open] summary::after {
  content: '−';
}

details .details__body {
  padding-top: var(--sp-3);
  color: var(--ink-soft);
  font-family: 'Newsreader', Georgia, serif;
  line-height: 1.75;
}

/* ----------------------------------------------------------
   HR
   ---------------------------------------------------------- */
hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: var(--sp-6) 0;
}

/* ----------------------------------------------------------
   SKIP LINK
   ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-3);
  z-index: calc(var(--z-modal) + 1);
  padding: var(--sp-1) var(--sp-3);
  background: var(--ink);
  color: var(--paper);
  font-family: 'Jost', system-ui, sans-serif;
  font-weight: 500;
  font-size: var(--fs-label);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 0 0 2px 2px;
  transition: top var(--t-fast) var(--ease);
}

.skip-link:focus {
  top: 0;
}

/* ----------------------------------------------------------
   FOCUS RING — gold, visible, accessible
   ---------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 1px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ----------------------------------------------------------
   CONTAINER
   ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--narrow {
  max-width: 760px;
}

.container--prose {
  max-width: 720px;
}

/* ----------------------------------------------------------
   SECTION RHYTHM
   ---------------------------------------------------------- */
.section {
  padding-block: var(--section-pad);
}

.section--sand {
  background: var(--sand);
}

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

/* ----------------------------------------------------------
   EYEBROW — Jost caps + gold rule
   ---------------------------------------------------------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: 'Jost', system-ui, sans-serif;
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-3);
}

.eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   GOLD RULE — thin decorative line
   ---------------------------------------------------------- */
.gold-rule {
  display: block;
  width: 40px;
  height: 1px;
  background: var(--gold);
  margin-bottom: var(--sp-4);
}

/* ----------------------------------------------------------
   LEAD TEXT
   ---------------------------------------------------------- */
.lead {
  font-family: 'Newsreader', Georgia, serif;
  font-size: var(--fs-lead);
  color: var(--ink-soft);
  line-height: 1.6;
  max-width: 58ch;
}

/* ----------------------------------------------------------
   PLACEHOLDER — .ph marks every TBC value
   ---------------------------------------------------------- */
.ph {
  /* dotted gold underline indicator */
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}

/* Don't double-style elements that are already links */
a.ph {
  text-decoration: underline dotted var(--gold);
}

/* ----------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: 1rem 2.125rem;      /* 16px 34px */
  font-family: 'Jost', system-ui, sans-serif;
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  min-height: 52px;
  transition: background-color var(--t-base) var(--ease),
              color var(--t-base) var(--ease),
              border-color var(--t-base) var(--ease);
  white-space: nowrap;
}

/* Primary — solid ink */
.btn--primary {
  background-color: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background-color: var(--gold-deep);
  border-color: var(--gold-deep);
  color: var(--paper);
  text-decoration: none;
}

/* Ghost — ink border */
.btn--ghost {
  background-color: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  background-color: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

/* ----------------------------------------------------------
   TEXT LINK — inline CTA style
   ---------------------------------------------------------- */
.text-link {
  font-family: 'Jost', system-ui, sans-serif;
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--line-dark);
  text-underline-offset: 3px;
  transition: color var(--t-fast) var(--ease),
              text-decoration-color var(--t-fast) var(--ease);
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--gold-deep);
  text-decoration-color: var(--gold);
}

/* ----------------------------------------------------------
   PULL QUOTE
   ---------------------------------------------------------- */
.pull-quote {
  position: relative;
  padding: var(--sp-5) var(--sp-6);
  border-left: 1px solid var(--gold);
}

.pull-quote::before {
  content: '\201C';
  position: absolute;
  top: -0.1em;
  left: -0.04em;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(5rem, 8vw, 9rem);
  font-weight: 300;
  font-style: italic;
  color: var(--gold);
  opacity: 0.25;
  line-height: 1;
  pointer-events: none;
}

.pull-quote p {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.3;
  color: var(--ink);
  max-width: none;
}

.pull-quote cite {
  display: block;
  margin-top: var(--sp-3);
  font-family: 'Jost', system-ui, sans-serif;
  font-size: var(--fs-label);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ----------------------------------------------------------
   SECTION HEADER block
   ---------------------------------------------------------- */
.section__header {
  margin-bottom: var(--sp-8);
}

.section__sub {
  font-size: var(--fs-lead);
  color: var(--ink-soft);
  max-width: 56ch;
  margin-top: var(--sp-3);
}

/* ----------------------------------------------------------
   GRID HELPERS — mobile first
   ---------------------------------------------------------- */
.grid-2,
.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}

@media (min-width: 560px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 880px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ----------------------------------------------------------
   SPLIT — 2-col editorial
   ---------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-8);
  align-items: start;
}

@media (min-width: 880px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  .split--5-7 {
    grid-template-columns: 5fr 7fr;
  }

  .split--7-5 {
    grid-template-columns: 7fr 5fr;
  }
}

/* ----------------------------------------------------------
   SCREEN READER ONLY
   ---------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------------
   REDUCED MOTION — JS adds .has-motion to <html>
   Initial-hidden states only apply when JS motion is active.
   Everything visible by default.
   ---------------------------------------------------------- */
html.has-motion [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
}

html.has-motion .hero__line {
  opacity: 0;
  transform: translateY(28px);
}
