/* =================================================================
   EDMOND FAVRE
   Private study: near-black warm slate, bone text, worn brass.
   Depth is carried by elevation, not by light and dark bands.
   Type: EB Garamond (display) + Inter (body).
   Sized generously throughout for an audience that is mostly 55 to 70.
   ================================================================= */

:root {
  /* ---- Grounds ---- */
  --base:         #15191B;
  --surface:      #1C2123;
  --surface-high: #232A2C;
  --contrast:     #0F1213;

  /* ---- Text: warm bone, never pure white ---- */
  --text:       #E8E3D9;
  --text-soft:  #A29C90;
  --text-faint: #8C867B;
  --text-bright: #F5F1E9;

  /* ---- Accent: worn brass ---- */
  --brass:      #B5985E;
  --brass-deep: #8A7145;

  /* ---- Lines ---- */
  --line:      #2A3134;
  --line-soft: #222829;

  /* ---- Radius: nothing sharp left ---- */
  --radius-sm:  8px;
  --radius:    10px;
  --radius-btn: 12px;
  --radius-lg: 14px;

  --maxw: 1120px;
  --font-display: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ---- Legacy aliases: calc.css and older markup still name these ---- */
  --paper: var(--base);
  --ink: var(--text);
  --ink-soft: var(--text-soft);
  --ink-faint: var(--text-faint);
  --ink-deep: var(--contrast);
  --stone: var(--surface);
  --stone-deep: var(--surface-high);
  --slate: var(--surface-high);
  --slate-deep: var(--contrast);
  --on-dark: var(--text);
  --on-dark-soft: var(--text-soft);
  --on-dark-line: var(--line);
  --brass-light: var(--brass);
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--base);
}

body {
  margin: 0;
  background-color: var(--base);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-locked { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
/* <picture> is inline by default, which breaks it as a grid or flex item.
   Every image on the site is served WebP-first with a JPEG fallback. */
picture { display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.14;
  margin: 0;
  color: var(--text);
}

h1 { font-size: clamp(2.3rem, 5vw, 3.7rem); line-height: 1.08; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--text); }

::selection { background: var(--brass-deep); color: var(--text-bright); }

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

/* =================================================================
   LAYOUT
   ================================================================= */

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 30px; }
.wrap-narrow { max-width: 700px; }
.wrap-mid { max-width: 900px; }

.section { padding: 96px 0; }
.section-sm { padding: 54px 0; }

/* Elevation instead of light/dark alternation. --surface lifts,
   --contrast recesses, bare .section sits on the page ground. */
.section--surface { background: var(--surface); }
.section--stone { background: var(--surface); }
.section--dark { background: var(--contrast); }

.center { text-align: center; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
}

.rule {
  width: 46px;
  height: 1px;
  background: var(--brass-deep);
  border: 0;
  margin: 28px 0;
}
.rule-center { margin-left: auto; margin-right: auto; }

.lead {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--text-soft);
}

.prose p { color: var(--text-soft); }
.prose h2 { margin: 52px 0 18px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 34px 0 12px; font-family: var(--font-body); font-size: 1rem; font-weight: 600; letter-spacing: 0.01em; color: var(--text); }
.prose ul { color: var(--text-soft); padding-left: 22px; margin: 0 0 1.15em; }
.prose li { margin-bottom: 8px; }

.pull {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  line-height: 1.32;
  color: var(--text);
  margin: 0;
}

.signature {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-faint);
  margin-top: 30px;
}

/* =================================================================
   BUTTONS AND LINKS
   ================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 18px 34px;
  background-color: var(--text);
  color: var(--contrast);
  border: 1px solid var(--text);
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  text-align: center;
}
.btn:hover { background-color: var(--text-bright); border-color: var(--text-bright); color: var(--contrast); }

.btn-lg { padding: 21px 42px; font-size: 0.98rem; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-outline:hover { background: transparent; color: var(--brass); border-color: var(--brass-deep); }

.btn-light {
  background: var(--text);
  color: var(--contrast);
  border-color: var(--text);
}
.btn-light:hover { background: var(--text-bright); border-color: var(--text-bright); }

.btn:disabled,
.btn[aria-disabled="true"] {
  background: var(--surface-high);
  border-color: var(--line);
  color: var(--text-faint);
  cursor: default;
}
.btn[aria-disabled="true"]:hover { background: var(--surface-high); border-color: var(--line); color: var(--text-faint); }

.textlink {
  color: var(--text);
  border-bottom: 1px solid var(--brass-deep);
  padding-bottom: 1px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.textlink:hover { color: var(--brass); border-color: var(--brass); }

.quiet-link {
  font-size: 0.95rem;
  color: var(--text-faint);
}
.quiet-link a { border-bottom: 1px solid var(--line); }
.quiet-link a:hover { color: var(--text); border-color: var(--text-faint); }

/* =================================================================
   NAV
   ================================================================= */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 30px;
  background: rgba(21, 25, 27, 0.88);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  letter-spacing: 0.03em;
  color: var(--text);
  white-space: nowrap;
}

.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links > a {
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  transition: color 0.18s ease;
}
.nav-links > a:hover, .nav-links > a.active { color: var(--text); }

.nav-cta {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase;
  color: var(--text) !important;
  border: 1px solid var(--line);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.nav-cta:hover { background: var(--text); color: var(--contrast) !important; border-color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: none; border: 0; padding: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 1px;
  width: 24px;
  background: var(--text);
  margin-left: auto; margin-right: auto;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

@media (max-width: 860px) {
  .nav {
    padding: 16px 22px;
    /* A backdrop-filtered element becomes the containing block for its
       fixed-position children, which would trap the menu inside the bar.
       At this width the bar is opaque anyway, so drop the filter. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--base);
  }
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    inset: 0;
    background: var(--base);
    flex-direction: column;
    justify-content: center;
    gap: 30px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .nav-links > a { font-size: 1.25rem; font-family: var(--font-display); letter-spacing: 0.01em; }
  .nav-open .nav-links { opacity: 1; pointer-events: auto; }
  .nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  /* z-index needs a positioned element to take effect */
  .nav-toggle, .nav-name { position: relative; z-index: 2; }
  .nav-cta { font-size: 0.86rem !important; padding: 16px 28px; border-radius: var(--radius-btn); }
}

/* =================================================================
   HERO
   ================================================================= */

.hero {
  padding: 168px 0 96px;
  border-bottom: 1px solid var(--line-soft);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 72px;
  align-items: center;
}

.hero h1 { margin-bottom: 26px; }

.hero-sub {
  font-size: 1.16rem;
  line-height: 1.68;
  color: var(--text-soft);
  max-width: 30em;
  margin-bottom: 18px;
}

.hero-bridge {
  font-size: 1.02rem;
  color: var(--text);
  max-width: 30em;
  margin-bottom: 34px;
}

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }

.hero-note {
  font-size: 0.86rem;
  color: var(--text-faint);
  margin: 22px 0 0;
  letter-spacing: 0.01em;
}

.hero-figure { position: relative; }
.hero-figure img {
  width: 100%;
  /* The source is a tall phone portrait. Crop it to a calmer frame that
     still holds his face, the watch, and the lake. */
  aspect-ratio: 4 / 5;
  max-height: 640px;
  object-fit: cover;
  object-position: 50% 25%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  /* Pull the overcast Alpine light back so it does not glare on near-black */
  filter: saturate(0.9) brightness(0.94);
}
.hero-caption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--text-faint);
  margin-top: 14px;
  text-align: right;
}

@media (max-width: 900px) {
  .hero { padding: 128px 0 72px; }
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  /* Headline first on a phone. The portrait is recognition, not the pitch. */
  .hero-figure { max-width: 460px; }
  .hero-figure img { max-height: 420px; object-position: 50% 22%; }
  .hero-caption { text-align: left; }
}

/* =================================================================
   NUMBER CARDS
   ================================================================= */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-top: 46px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--brass-deep);
  border-radius: var(--radius);
  padding: 38px 34px;
}
.card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 14px;
}
.card p { color: var(--text-soft); font-size: 0.97rem; }
.card-index {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--brass);
  display: block;
  margin-bottom: 16px;
}

@media (max-width: 760px) {
  .card-grid { grid-template-columns: 1fr; gap: 20px; }
  .card { padding: 32px 26px; }
}

/* =================================================================
   EQUATION BLOCK
   ================================================================= */

.equation {
  text-align: center;
  padding: 10px 0;
}
.equation-line {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.4vw, 2.3rem);
  line-height: 1.35;
  color: var(--text);
  margin: 0 auto 30px;
  max-width: 18em;
}
.equation-note {
  font-size: 1rem;
  color: var(--text-soft);
  max-width: 34em;
  margin: 0 auto;
}

/* =================================================================
   ABOUT / PHOTO
   ================================================================= */

.photo-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 60px;
  align-items: center;
}
.photo-grid img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  filter: saturate(0.9) brightness(0.94);
}

@media (max-width: 900px) {
  .photo-grid { grid-template-columns: 1fr; gap: 36px; }
  .photo-grid picture { max-width: 420px; }
}

.disclosure {
  max-width: 760px;
}
.disclosure h2 { margin: 20px 0 24px; }
.disclosure p { color: var(--text-soft); }
.disclosure strong { color: var(--text); }

.notice-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--contrast);
  background: var(--brass);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

/* The advice line carries the same weight as Patrick's "not a licensed
   therapist" line: it is the point of the section, not fine print. */
.advice-note {
  border-left: 2px solid var(--brass);
  background: rgba(181, 152, 94, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 26px;
  margin: 30px 0;
}
.advice-note p { color: var(--text-soft); }
.advice-note p:first-child { color: var(--text); font-size: 1.06rem; }

/* =================================================================
   PRODUCTS
   ================================================================= */

.book-grid {
  display: grid;
  /* The cover is a photograph now, so the book inside it only fills part
     of the frame. It needs a little more width than a flat panel did. */
  grid-template-columns: 0.95fr 1.15fr;
  gap: 60px;
  align-items: start;
}

/* The cover is a photograph, not a typeset panel. It carries its own
   light, so it keeps full brightness where the portraits are pulled back. */
.book-cover { margin: 0; }
.book-cover img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  filter: saturate(0.96);
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
}
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brass); }

.placeholder-price {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  margin: 34px 0;
}
.placeholder-price .price-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: block;
  margin-bottom: 8px;
}
.placeholder-price .price-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text);
}
.placeholder-price .price-note {
  font-size: 0.88rem;
  color: var(--text-faint);
  margin: 8px 0 0;
}

.toc { border-top: 1px solid var(--line); margin-top: 44px; }
.toc-part {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  padding: 30px 0 12px;
}
.toc-item {
  display: flex;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 0.97rem;
}
.toc-num {
  font-family: var(--font-display);
  color: var(--text-faint);
  min-width: 2.2em;
  font-size: 1rem;
}
.toc-title { color: var(--text-soft); }

@media (max-width: 900px) {
  .book-grid { grid-template-columns: 1fr; gap: 44px; }
  .book-cover { max-width: 340px; }
}

/* =================================================================
   FOOTER
   ================================================================= */

.footer {
  background: var(--contrast);
  color: var(--text-soft);
  padding: 72px 0 40px;
  font-size: 0.92rem;
  border-top: 1px solid var(--line-soft);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 48px;
}
.footer-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 12px;
}
.footer-desc { color: var(--text-soft); max-width: 32em; font-size: 0.9rem; }
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 16px;
}
.footer-col a {
  display: block;
  color: var(--text-soft);
  margin-bottom: 10px;
  transition: color 0.18s ease;
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--line);
  margin-top: 54px;
  padding-top: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-faint);
}
.footer-bottom a { border-bottom: 1px solid var(--line); }
.footer-bottom a:hover { color: var(--text); }

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 34px; }
  .section { padding: 68px 0; }
  html { font-size: 17px; }
}

/* Respect users who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
