/* ==========================================================================
   Frets & Notes — global stylesheet
   See docs/style-guide.md for the color/spacing/typography reference.
   ========================================================================== */

:root {
  /* Colors — sampled directly from the brand mark (images/fretsnotes.png,
     images/fretsnotes_watermark.png): wood brown, gold, orange outline,
     and the icon's olive-green backdrop. */
  --color-bg: #faf8f5;
  --color-surface: #ffffff;
  --color-text: #1f1b16;
  --color-text-muted: #6b6258;
  --color-primary: #67351b;
  --color-primary-dark: #46230f;
  --color-accent: #ff8705;
  --color-accent-gold: #ffce03;
  --color-olive: #9caa4b;
  --color-border: #e6ded3;
  /* Not sampled from the brand mark (which only has brown/gold/orange/
     olive) — a muted teal-blue added for the 5th+ card tint so future
     topics have room to stay visually distinct from the original 4. */
  --color-slate: #4f7a86;
  /* Also not sampled from the brand mark — rust and plum give the two
     real (clickable) Pro-tier cards, Cycle of 4ths and Chord Scales:
     Rule of the Octave (Major), their own distinct, "active" looking
     tints instead of sharing the muted grey .card--locked tint with
     the true "Coming Soon" placeholder cards. */
  --color-rust: #b1502b;
  --color-plum: #6d4a86;

  /* Typography */
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --max-width: 1100px;
  --header-height: 64px;
}

/* -------------------- Reset / base -------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  margin: 0 0 1rem;
}

p {
  margin: 0 0 1rem;
}

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

a:hover,
a:focus {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.site-header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 55%, var(--color-accent-gold) 100%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  position: relative;
}

.site-title {
  display: flex;
  align-items: center;
  line-height: 0;
}

.site-title:hover,
.site-title:focus {
  text-decoration: none;
  opacity: 0.85;
}

.site-logo {
  height: 40px;
  width: auto;
  display: block;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
}

.site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: none;
}

.site-nav.is-open {
  display: block;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-nav a {
  color: var(--color-text);
  font-weight: 500;
}

.site-nav a.active {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-accent);
}

/* Desktop nav: show inline, hide the toggle */
@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    display: block;
    background: none;
    border: none;
  }

  .site-nav ul {
    flex-direction: row;
    padding: 0;
    gap: 1.5rem;
  }
}

/* -------------------- Main content -------------------- */

.site-main {
  flex: 1;
}

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

.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  min-height: 44px;
  line-height: 1.5;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover,
.btn:focus {
  text-decoration: none;
}

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

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-dark);
  color: #ffffff;
}

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

.btn-secondary:hover,
.btn-secondary:focus {
  border-color: var(--color-accent);
  color: var(--color-primary-dark);
  background-color: rgba(255, 135, 5, 0.06);
}

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

.hero {
  padding: 4rem 0 3.5rem;
}

.hero-inner {
  max-width: 820px;
}

.hero-badge {
  width: 160px;
  height: 160px;
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(31, 27, 22, 0.15);
}

.hero-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.hero-row .hero-badge {
  flex-shrink: 0;
}

.hero-row .hero-text {
  flex: 1;
  min-width: 0;
}

.hero h1 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
}

.hero-subhead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) {
  .hero {
    padding: 6rem 0 4.5rem;
  }

  .hero h1 {
    font-size: 3rem;
    white-space: nowrap;
  }

  .hero h2 {
    white-space: nowrap;
  }

  .hero-badge {
    width: 220px;
    height: 220px;
  }

  .hero-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 2.5rem;
  }
}

/* -------------------- Features / cards -------------------- */

.features {
  padding: 3rem 0;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section-heading {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.section-subheading {
  color: var(--color-text-muted);
  max-width: 60ch;
  margin-bottom: 2rem;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

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

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

.card {
  display: block;
  position: relative;
  padding: 1.5rem;
  background-color: var(--card-tint, var(--color-bg));
  border: 1px solid var(--card-border, var(--color-border));
  border-radius: 16px;
  color: var(--color-text);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover,
.card:focus {
  text-decoration: none;
  border-color: var(--card-accent, var(--color-accent));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(31, 27, 22, 0.08);
}

/* Each card gets a tint pulled from the brand palette (see :root above)
   so the four topics read as distinct at a glance. */
.card--brown {
  --card-tint: rgba(103, 53, 27, 0.08);
  --card-border: rgba(103, 53, 27, 0.22);
  --card-accent: var(--color-primary);
}

.card--orange {
  --card-tint: rgba(255, 135, 5, 0.1);
  --card-border: rgba(255, 135, 5, 0.3);
  --card-accent: var(--color-accent);
}

.card--gold {
  --card-tint: rgba(255, 206, 3, 0.16);
  --card-border: rgba(214, 168, 3, 0.35);
  --card-accent: var(--color-accent-gold);
}

.card--olive {
  --card-tint: rgba(156, 170, 75, 0.16);
  --card-border: rgba(156, 170, 75, 0.4);
  --card-accent: var(--color-olive);
}

.card--slate {
  --card-tint: rgba(79, 122, 134, 0.12);
  --card-border: rgba(79, 122, 134, 0.35);
  --card-accent: var(--color-slate);
}

/* Real, clickable Pro-tier cards (Cycle of 4ths, Rule of the Octave
   (Major)) — distinct from the grey .card--locked tint below so they
   read as available/active rather than "not yet available". */
.card--rust {
  --card-tint: rgba(177, 80, 43, 0.1);
  --card-border: rgba(177, 80, 43, 0.32);
  --card-accent: var(--color-rust);
}

.card--plum {
  --card-tint: rgba(109, 74, 134, 0.12);
  --card-border: rgba(109, 74, 134, 0.35);
  --card-accent: var(--color-plum);
}

/* PLACEHOLDER — for previewing the future free/subscription split
   (see docs/roadmap.md "Planned: free vs. subscription cards"). Muted
   grey tint + slightly reduced opacity so not-yet-available topics
   read as visually "locked" next to the colorful free ones. */
.card--locked {
  --card-tint: rgba(31, 27, 22, 0.04);
  --card-border: rgba(31, 27, 22, 0.14);
  --card-accent: var(--color-text-muted);
  opacity: 0.75;
}

/* Non-clickable placeholder cards (a plain <div>, not a link) for
   topics that don't have a page yet — see the "Coming Soon" cards on
   the homepage. Cancels the normal .card hover lift/border/shadow so
   the card doesn't look interactive, and sets a plain cursor since a
   <div> could otherwise still inherit a pointer from a parent. */
.card--disabled {
  cursor: default;
}

.card--disabled:hover,
.card--disabled:focus {
  border-color: var(--card-border, var(--color-border));
  transform: none;
  box-shadow: none;
}

.card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  /* Reserve 2 lines' worth so titles of different lengths (e.g. the
     short existing topics vs. longer "Chord Scales: ..." placeholders)
     don't throw card heights out of sync with each other. */
  min-height: 2.8125rem;
}

/* PLACEHOLDER badge — see .card--locked note above. Sits on its own
   line above the title (rather than overlapping it) so long titles
   can wrap freely without fighting the badge for width. */
.card-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  line-height: 1.4;
}

.card-badge--free {
  background-color: rgba(255, 255, 255, 0.7);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.card-badge--pro {
  background-color: var(--color-primary);
  color: #ffffff;
}

.card-badge--soon {
  background-color: var(--color-text-muted);
  color: #ffffff;
}

.card p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
  /* Reserve room for 3 lines of caption text (0.9375rem * 1.6 line
     height * 3) so every card ends up the same height regardless of
     how long its description is or which row it lands in — a card
     alone in its own grid row (e.g. a 5th card wrapping to row 2)
     otherwise has nothing to stretch against. */
  min-height: 4.5rem;
}

/* -------------------- Rotating quotes -------------------- */

.quotes {
  padding: 4rem 0;
  text-align: center;
}

.quote-display {
  margin: 0 auto;
  max-width: 640px;
  transition: opacity 0.5s ease;
}

.quote-display.is-fading {
  opacity: 0;
}

.quote-text {
  font-size: 1.5rem;
  font-style: italic;
  color: var(--color-primary-dark);
  line-height: 1.4;
  margin: 0 0 0.75rem;
}

.quote-author {
  display: block;
  font-style: normal;
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .quote-display {
    transition: none;
  }
}

/* -------------------- Lesson pages -------------------- */

.lesson-hero {
  padding: 3rem 0 2.5rem;
  background-color: var(--hero-tint, var(--color-bg));
  border-bottom: 1px solid var(--color-border);
}

/* Each lesson page's hero picks up the same tint as its homepage card
   (see .card--brown etc. above) so the two feel connected. */
.lesson-hero--brown {
  --hero-tint: rgba(103, 53, 27, 0.08);
}

.lesson-hero--orange {
  --hero-tint: rgba(255, 135, 5, 0.1);
}

.lesson-hero--gold {
  --hero-tint: rgba(255, 206, 3, 0.16);
}

.lesson-hero--olive {
  --hero-tint: rgba(156, 170, 75, 0.16);
}

.lesson-hero--slate {
  --hero-tint: rgba(79, 122, 134, 0.12);
}

.lesson-hero--rust {
  --hero-tint: rgba(177, 80, 43, 0.1);
}

.lesson-hero--plum {
  --hero-tint: rgba(109, 74, 134, 0.12);
}

.lesson-eyebrow {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.lesson-eyebrow a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

.lesson-hero h1 {
  font-size: 2rem;
  max-width: 40ch;
}

.lesson-intro {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 65ch;
  margin-bottom: 0;
}

.lesson-intro + p {
  margin-top: 1rem;
}

.lesson-intro-list {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 65ch;
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.lesson-content {
  padding: 3rem 0;
  background-color: var(--color-surface);
}

.lesson-content ul {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.lesson-content .section-heading {
  margin-top: 3rem;
}

.lesson-content .video-block:first-child {
  margin-top: 0;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

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

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

.video-block h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.75rem;
}

.video-block.featured {
  margin-top: 3rem;
  padding: 2rem;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
}

.video-block.featured p {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
}

.video-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-embed.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg);
  border: 1px dashed var(--color-border);
  text-align: center;
  padding: 1rem;
}

.video-embed-note {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* A video paired with its own caption text, side by side at desktop
   widths (video keeps the same size as a single .video-grid column;
   text stacks underneath below the 1024px breakpoint). Boxed off with
   a soft tint so each video+caption pair reads as one unit. */
.video-row {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 16px;
}

.video-row .video-grid {
  margin-top: 0;
}

.video-row .video-notes p:last-child {
  margin-bottom: 0;
}

@media (min-width: 1024px) {
  .video-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: center;
  }

  /* Without this, the nested .video-grid also switches to its own
     3-column layout at this breakpoint, splitting the single video
     down a second time. Force it back to one column so the video
     simply fills the outer grid's first column — matching a single
     .video-grid column's width on the Learn the Notes page. */
  .video-row .video-grid {
    grid-template-columns: 1fr;
  }

  .video-row .video-notes {
    grid-column: span 2;
  }
}

.lesson-closing {
  margin-top: 3rem;
  text-align: center;
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-primary-dark);
}

/* -------------------- Lesson figures (diagrams/images) -------------------- */

.lesson-figure {
  margin: 2rem 0;
  text-align: center;
}

.lesson-figure img {
  margin: 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background-color: var(--color-surface);
}

.lesson-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.draft-note {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  background-color: var(--color-bg);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-style: italic;
}

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

.site-footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
}

.site-footer p {
  margin: 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}
