/* Quiet Minds Institute — Design System v14 (Playfair headings, EB Garamond text) */

/* === Fonts ===
   Playfair Display — headings only (Google Fonts).
   EB Garamond      — body, labels, quotes (self-hosted, SIL OFL — see assets/fonts/). */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;1,400&display=swap');
@font-face { font-family: 'EB Garamond'; font-weight: 400; font-style: normal; font-display: swap; src: url('assets/fonts/EBGaramond-Regular.woff') format('woff'); }
@font-face { font-family: 'EB Garamond'; font-weight: 400; font-style: italic; font-display: swap; src: url('assets/fonts/EBGaramond-Italic.woff') format('woff'); }
@font-face { font-family: 'EB Garamond'; font-weight: 500; font-style: normal; font-display: swap; src: url('assets/fonts/EBGaramond-Medium.woff') format('woff'); }
@font-face { font-family: 'EB Garamond'; font-weight: 500; font-style: italic; font-display: swap; src: url('assets/fonts/EBGaramond-MediumItalic.woff') format('woff'); }
@font-face { font-family: 'EB Garamond'; font-weight: 600; font-style: normal; font-display: swap; src: url('assets/fonts/EBGaramond-SemiBold.woff') format('woff'); }
@font-face { font-family: 'EB Garamond'; font-weight: 700; font-style: normal; font-display: swap; src: url('assets/fonts/EBGaramond-Bold.woff') format('woff'); }

/* === CSS Variables === */
:root {
  --bg-primary: #F5F2EB;
  --bg-secondary: #E8E4DC;
  --text-primary: #1A1A18;
  --text-secondary: #5C574F;
  --text-light: #F5F2EB;
  --accent-primary: #9B4A3A;
  --accent-secondary: #6B7355;
  --border-color: #D4CFC5;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'EB Garamond', Georgia, 'Times New Roman', serif;
  /* THE LABEL VOICE — nav links, buttons, badges. Three knobs, all here:
     font, weight, and letter-spacing. Try:
       --font-label: 'Playfair Display', Georgia, serif;   (headings font in the buttons)
       --label-weight: 500 / 600 / 700;                   (Garamond has all three)
       --label-tracking: 0.06em – 0.14em;                 (bolder caps want less spacing) */
  --font-label: 'EB Garamond', Georgia, serif;
  --label-weight: 500;
  --label-tracking: 0.1em;
  --label-size: 0.95rem;

  --measure: 640px;      /* comfortable line length for body copy */
  --nav-height: 4.5rem;
}

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.6;
  font-variant-numeric: lining-nums;   /* Garamond defaults to old-style figures; prices and dates read better lining */
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

/* === Typography === */
h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  margin-bottom: 1.25rem;
}

h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  margin-bottom: 0.75rem;
}

/* No ff/fi ligatures in headings: "Geoff" sets as two plain f's. */
h1, h2, h3, .logo, .price, .testimonial-quote, .faq-question, .module-number {
  font-variant-ligatures: no-common-ligatures no-discretionary-ligatures;
  font-feature-settings: "liga" 0, "dlig" 0;
}

p {
  margin-bottom: 1.5rem;
  text-wrap: pretty;      /* browsers that support it avoid a lone word on the last line */
}

/* Short centered copy splits into even lines instead of a long line plus a stub. */
.measure,
.about-copy p,
.card-grid .card p,
.hero .subtitle {
  text-wrap: balance;
}

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

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

a:hover {
  opacity: 0.7;
}

/* === Layout === */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 6rem 0;
}

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

/* Body copy shouldn't run wider than a comfortable line. */
.measure {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.muted {
  color: var(--text-secondary);
}

/* === Navigation === */
nav {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  right: 0;
  min-height: var(--nav-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem 2rem;
  padding: 1rem 5rem;
  background: transparent;
  transition: background 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

nav.scrolled {
  background: rgba(245,242,235,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

nav .logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  font-weight: 600;
  text-transform: none;
  white-space: nowrap;
}

nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
}

nav a {
  font-family: var(--font-label);
  font-weight: var(--label-weight);
  color: var(--text-secondary);
  font-size: var(--label-size);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
}

/* Hover and current-page: darker text and a hairline underline, no red.
   Same behavior on every page, before and after scrolling. */
nav a:hover, nav a.active {
  color: var(--text-primary);
}
nav a.active {
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.1rem;
}

/* On pages that open with a photo hero, the nav sits on the photo before
   the user scrolls, so it needs light text. Once scrolled it gets the
   cream bar and reverts to dark text. */
body.has-hero nav:not(.scrolled) .logo,
body.has-hero nav:not(.scrolled) a {
  color: var(--text-light);
  text-shadow: 0 1px 12px rgba(0,0,0,0.45);
}

body.has-hero nav:not(.scrolled) a.active {
  color: var(--text-light);
  border-bottom: 1px solid rgba(245,242,235,0.6);
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-family: var(--font-label);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  text-align: center;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--text-light);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(155, 74, 58, 0.25);
  opacity: 1;
}

.btn-secondary {
  background: transparent;
  color: var(--accent-primary);
  border: 2px solid var(--accent-primary);
}

.btn-secondary:hover {
  background: var(--accent-primary);
  color: var(--text-light);
  opacity: 1;
}

.btn-block {
  display: block;
  width: 100%;
}

/* === Hero Sections === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: calc(var(--nav-height) + 2rem) 0 4rem;
}

.hero--short {
  min-height: 70vh;
}

/* Puts the headline in the lower third, off the subject's face and torso. */
.hero--low {
  align-items: flex-end;
  padding-bottom: 9vh;
}

/* Centered, but lifted: the block's visual center lands around 40% of the hero
   instead of 50%. Tune the number to move it. */
.hero--raised .hero-content {
  margin-bottom: 16vh;
}

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

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: grayscale(15%) contrast(1.05);
  animation: kenburns 20s ease-in-out infinite alternate;
}

@keyframes kenburns {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.08) translate(-2%, -1%); }
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(26,26,24,0.35), rgba(26,26,24,0.6));
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  padding: 2rem;
}

.hero h1 {
  color: var(--text-light);
  margin: 0 auto 1.5rem;
  max-width: 14ch;
  text-shadow: 0 2px 40px rgba(0,0,0,0.35);
}

.hero .subtitle {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: rgba(245, 242, 235, 0.9);
  max-width: 40rem;
  margin: 0 auto 2.5rem;
  text-shadow: 0 1px 20px rgba(0,0,0,0.35);
}

/* === Forms === */
.form-group {
  display: flex;
  gap: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

.field {
  margin-bottom: 1.5rem;
  text-align: left;
}

.field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
}

input[type="email"],
input[type="text"],
input[type="password"],
input[type="tel"],
input[type="date"],
textarea {
  flex: 1;
  padding: 1rem 1.25rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  border: 2px solid var(--border-color);
  background: rgba(245, 242, 235, 0.95);
  color: var(--text-primary);
  transition: border-color 0.3s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* === Cards === */
.card {
  background: var(--bg-secondary);
  padding: 2.5rem;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

/* A button that is a direct child of a card sits at the bottom, so a row
   of cards with different amounts of copy still lines up. */
.card > .btn {
  margin-top: auto;
}

/* A little more air between a card's badge and its title. */
.card > .badge {
  margin-bottom: 1.75rem;
}

/* Title + description float to the vertical middle of the space between the
   badge above and the price below. */
.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 0;
}
.card-body p:last-child { margin-bottom: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.card-grid .card {
  text-align: center;
}

.price {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 2.75rem;
  color: var(--accent-primary);
  margin: 1rem 0;
}

.price--small {
  font-size: 1.5rem;
  color: var(--text-primary);
}

/* Checklists inside cards: no bullets, the ✓ in the text does the work. */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  text-align: left;
  color: var(--text-secondary);
}

.feature-list li {
  margin-bottom: 0.5rem;
}

.feature-list--center {
  text-align: center;
}

/* Plain bulleted copy lists (Who This Is For, etc.) */
.copy-list {
  padding-left: 1.25rem;
  color: var(--text-secondary);
  margin-top: 1.5rem;
}

.copy-list li {
  margin-bottom: 1rem;
}

/* === Bio Photo Styling === */
.bio-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  height: auto;
  object-fit: cover;
  /* No desaturation on bio photos: the Sedona light and the warm wall are the point. */
  border: 12px solid #fff;
  box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

.bio-photo-small {
  aspect-ratio: 4 / 3;
}

/* === Testimonials === */
.testimonial-strip {
  background: var(--bg-secondary);
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.testimonial-quote {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-style: italic;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  line-height: 1.45;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto;
  text-wrap: balance;
}

.testimonial-attribution {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-wrap: balance;   /* a long attribution splits into two even lines, not a line and a stub */
}

/* === Split Layouts === */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

/* Two columns of text should line up at the top, not the middle. */
.split-section--top {
  align-items: start;
}

@media (max-width: 900px) {
  .split-section {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* Long left-aligned bio copy beside a photo: hyphenate so the right edge
   isn't so jagged. Remove this class from the column to turn it off. */
.bio-copy {
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Centered bio copy on the home page: heading, paragraphs and button all
   share one alignment. */
.about-copy {
  text-align: center;
  max-width: var(--measure);
  margin: 0 auto;
}

/* === Module List === */
.module-list {
  list-style: none;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.module-list li {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.module-list li:last-child {
  border-bottom: none;
}

.module-number {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--accent-primary);
}

.module-title {
  font-weight: 500;
}

.module-title p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.25rem;
  font-weight: 400;
}

/* === Badges === */
.badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--accent-secondary);
  color: var(--text-light);
  font-family: var(--font-label);
  font-weight: var(--label-weight);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: var(--label-tracking);
  line-height: 1.4;
}

.badge-warning {
  background: var(--accent-primary);
}

/* === FAQ Accordion === */
.faq-item {
  border-bottom: 1px solid var(--border-color);
}

.faq-question {
  padding: 1.5rem 0;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-answer {
  padding-bottom: 1.5rem;
  color: var(--text-secondary);
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

/* === Footer === */
footer {
  background: var(--bg-secondary);
  padding: 3rem 2rem;
  text-align: center;
  border-top: 1px solid var(--border-color);
}

footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.social-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* === Success Message === */
.success-message {
  background: var(--accent-secondary);
  color: var(--text-light);
  padding: 1rem 2rem;
  text-align: center;
  display: none;
}

.success-message.show {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Portal Dashboard === */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.module-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0;
  overflow: hidden;
}

.module-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  filter: grayscale(20%);
}

.module-card-content {
  padding: 1.5rem;
}

.module-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 4px;
  background: var(--border-color);
  margin-top: 1rem;
  border-radius: 2px;
}

.progress-fill {
  height: 100%;
  background: var(--accent-secondary);
  width: 0%;
}

/* === Login Form === */
.login-container {
  max-width: 400px;
  margin: 8rem auto 4rem;
  padding: 3rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.login-container h2 {
  text-align: center;
  margin-bottom: 2rem;
}

/* === Responsive === */
@media (max-width: 900px) {
  nav {
    padding: 0.75rem 1.5rem;
  }
  nav ul {
    gap: 1.25rem;
  }
  nav a {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 18px;
  }

  /* Logo on its own line, links beneath. Nothing overflows on a phone. */
  nav {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
  }
  nav .logo {
    font-size: 1.2rem;
  }
  nav ul {
    gap: 1.25rem;
  }

  .form-group {
    flex-direction: column;
  }

  section {
    padding: 4rem 0;
  }

  .container {
    padding: 0 1.25rem;
  }

  .hero {
    min-height: 90vh;
    padding-top: 7rem;
  }

  .hero h1 {
    font-size: 2.4rem;
    max-width: none;
  }

  .hero--low {
    padding-bottom: 6vh;
  }

  .card {
    padding: 1.75rem;
  }

  .bio-photo {
    border-width: 8px;
  }

  .testimonial-strip {
    padding: 2.5rem 1.25rem;
  }
}

/* === Reboot page === */
.page-intro { padding-top: calc(var(--nav-height) + 5rem); padding-bottom: 4rem; }
.page-intro h1 { font-size: clamp(2.5rem, 5vw, 3.75rem); margin-bottom: 1.5rem; }
.card.narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.player { width: 100%; }
.small { font-size: 0.9rem; }
.mt-1 { margin-top: 1rem; }
.rpm { margin-bottom: 1rem; }

/* === Portal (prototype) === */
.portal-input { width: 100%; margin-bottom: 1.5rem; }
.login-error { color: var(--accent-primary); margin-top: 1rem; display: none; }
.progress-wrap { max-width: 400px; margin: 2rem auto; text-align: left; }
.progress-labels { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.95rem; }
.progress-bar--thick { height: 8px; }
.btn-small { padding: 0.6rem 1.4rem; font-size: 0.8rem; }
.module-card.is-playable { cursor: pointer; }
/* Placeholder tile until a module has its own thumbnail: palette-toned, with the number. */
.module-thumb { width: 100%; aspect-ratio: 16 / 9; background: var(--accent-secondary); color: var(--text-light); font-family: var(--font-heading); font-size: 3rem; display: flex; align-items: center; justify-content: center; opacity: 0.85; }
.materials { margin-top: 4rem; }
.materials-links { display: flex; justify-content: center; gap: 2rem; margin-top: 1rem; flex-wrap: wrap; }
.video-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 10000; align-items: center; justify-content: center; }
.video-modal-inner { max-width: 90%; max-height: 90%; position: relative; }
.video-modal video { width: 90vw; max-width: 1000px; aspect-ratio: 16 / 9; background: #000; }
.video-close { position: absolute; top: -40px; right: 0; background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; }

/* === Utility Classes === */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mt-2 { margin-top: 2rem; }

/* Dev-only: remove at launch (see LAUNCH_CHECKLIST.md) */
.version-badge {
  position: fixed;
  bottom: 10px;
  left: 10px;
  z-index: 9998;
  background: #f7931a !important;
  color: #000 !important;
  font-size: 14px !important;
  padding: 8px 12px !important;
  border-radius: 6px;
}
