/* Creativity Engineered — site styles
   Layout: full-bleed painted-lab hero with a centred title, then quiet paper pages
   (cream sampled from the hero's corner) framed by night-navy header/footer bands.
   Diagrams and printables always sit on light paper; navy is reserved for the frame
   and for the square illustration tiles. */
/* Self-hosted fonts (SIL Open Font License; licences in assets/fonts) */
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/outfit-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/outfit-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/outfit-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/outfit-latin-600-normal.woff2") format("woff2"); }

:root {
  --night: #13212c;      /* hero shadows / frame */
  --night-2: #1d3040;    /* raised navy (hover, active tab) */
  --paper: #f4efe2;      /* page ground: lightened hero-corner cream */
  --paper-2: #ebe3cc;    /* tinted band, the hero corner itself */
  --ink: #1b2833;        /* text on paper, navy-tinted */
  --ink-soft: #4b5864;   /* secondary text on paper */
  --cream: #ede4c6;      /* text on navy */
  --cream-soft: #b9b4a2; /* secondary text on navy */
  --brass: #c9a45c;      /* the cover's gold: rules, buttons, root notes */
  --brass-deep: #7a5a20; /* gold dark enough for links on paper */
  --olive: #2e321f;      /* stripe ink from the hero's key pattern */
  --rule: rgba(27, 40, 51, .16);

  --display: "EB Garamond", "Garamond", "Iowan Old Style", Georgia, serif;
  --body: "Outfit", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  --step--1: .9375rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem);
  --step-3: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  --step-4: clamp(2.3rem, 1.4rem + 4vw, 4rem);

  --wrap: 1160px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
img { height: auto; }
[hidden] { display: none !important; }
a { color: var(--brass-deep); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p { margin: 0; max-width: 66ch; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 64px);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
@media (min-width: 720px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }

/* ---------- header ---------- */
.site-header {
  position: relative; z-index: 5; background: var(--night);
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid rgba(237,228,198,.12);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding-block: 22px; }
.brand { display: block; line-height: 0; }
.brand img { height: 40px; width: auto; }
.brand .mark { height: 46px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 28px; }
.site-nav a {
  color: var(--cream); text-decoration: none; font-size: 1rem; letter-spacing: .01em;
  padding-block: 6px; border-bottom: 1.5px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--brass); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid; place-items: center;
  min-height: clamp(560px, 56.25vw, 880px);
  padding: 80px var(--gutter-r) 88px var(--gutter-l);
  background-color: var(--night);
  background-image: url("img/hero-lab.webp");
  background-size: cover; background-position: 58% center;
  color: var(--cream); text-align: center;
  isolation: isolate;
}
@media (max-width: 760px) { .hero { background-image: url("img/hero-lab-960.webp"); background-position: 64% center; } }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse 52% 46% at 50% 52%, rgba(19,33,44,.78) 0%, rgba(19,33,44,.5) 55%, rgba(19,33,44,0) 100%);
}
.hero--short { min-height: clamp(360px, 32vw, 460px); padding-bottom: 72px; }
.hero__inner { display: grid; justify-items: center; gap: 24px; max-width: 760px; }
.hero__logo { width: min(680px, 88vw); height: auto; filter: drop-shadow(0 2px 18px rgba(0,0,0,.45)); }
.hero__tagline { font-size: var(--step-1); color: var(--cream); font-weight: 300; max-width: 34ch; text-shadow: 0 1px 12px rgba(0,0,0,.6); }
.hero__title { font-size: var(--step-4); text-shadow: 0 2px 24px rgba(0,0,0,.55); }
.hero__sub { font-size: var(--step-1); font-weight: 300; text-shadow: 0 1px 12px rgba(0,0,0,.6); }

/* the book title, set like the cover */
.cover-title { display: grid; justify-items: center; gap: .02em; font-size: clamp(2.6rem, 1.6rem + 4.6vw, 5.2rem); line-height: 1.02; text-shadow: 0 2px 28px rgba(0,0,0,.6); }
.cover-title .big { font-size: 1.42em; color: var(--brass); line-height: .98; }
.cover-title + .hero__rule { width: min(320px, 60%); height: 1.5px; background: var(--brass); border: 0; margin: 6px 0 0; }

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; }
.hero .actions { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 500 1.0625rem/1 var(--body); letter-spacing: .01em;
  padding: 16px 26px; border-radius: 3px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer;
}
.btn--brass { background: var(--brass); color: var(--night); }
.btn--brass:hover { background: #d6b36e; }
.btn--night { background: var(--night); color: var(--cream); }
.btn--night:hover { background: var(--night-2); }
.btn--line { border-color: currentColor; color: inherit; background: transparent; }
.btn--line:hover { background: rgba(237,228,198,.12); }
.btn[aria-disabled="true"] { cursor: default; opacity: .8; }
.btn--brass[aria-disabled="true"]:hover { background: var(--brass); }
.btn small { font-weight: 400; font-size: .85em; opacity: .85; }
.text-link { font-weight: 500; }
.hero .text-link { color: var(--cream); }

.stores { font-size: var(--step--1); color: inherit; }
.stores summary { cursor: pointer; }
.stores ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }

/* ---------- sections ---------- */
.section { padding-block: clamp(72px, 9vw, 128px); }
.section--tint { background: var(--paper-2); }
.section__head { display: grid; gap: 14px; margin-bottom: clamp(32px, 4vw, 52px); }
.section__head p { color: var(--ink-soft); }
.stack { display: grid; gap: 20px; }
.stack-lg { display: grid; gap: 36px; }

.statement {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2rem, 1.1rem + 3.7vw, 4rem); line-height: 1.12;
  max-width: 24ch; text-wrap: balance;
}
.statement-mark { width: 72px; height: 1.5px; background: var(--brass); border: 0; margin: 0 0 32px; }
.lede { font-family: var(--display); font-size: var(--step-2); line-height: 1.25; max-width: 30ch; }

/* home: featured book */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.feature__cover { width: 100%; max-width: 440px; justify-self: center; box-shadow: 0 24px 50px -18px rgba(19,33,44,.55); }
.feature__body { display: grid; gap: 22px; min-width: 0; }
.feature__body h2 { font-size: var(--step-3); }
.kicker { font-size: var(--step--1); color: var(--ink-soft); }

/* book: intro */
.intro { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.intro__cover { width: 100%; max-width: 380px; box-shadow: 0 24px 50px -18px rgba(19,33,44,.55); position: sticky; top: 32px; }
.intro__body { display: grid; gap: 22px; min-width: 0; }
.intro__body h2 { font-size: var(--step-2); margin-top: 18px; }
.intro__body h3 { font-family: var(--body); font-size: var(--step-0); font-weight: 600; margin-top: 10px; }

/* book: tabs */
.tabs__list { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; border-bottom: 1.5px solid var(--rule); margin-bottom: 40px; }
.tabs__tab {
  flex: 0 0 auto; font: 500 1rem/1.2 var(--body); color: var(--ink-soft);
  background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1.5px;
  padding: 14px 16px 12px; cursor: pointer;
}
.tabs__tab:hover { color: var(--ink); }
.tabs__tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brass); }
.tabs__panel { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.tile { aspect-ratio: 1; width: 100%; max-width: 100%; border-radius: 4px; overflow: hidden; background: var(--night); }
.tile svg { width: 100%; height: 100%; }
.tabs__text { display: grid; gap: 18px; min-width: 0; }
.tabs__text .chapter { font-size: var(--step--1); color: var(--ink-soft); }

/* book: on this site */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 48px); }
.card { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 28px; align-items: center; color: inherit; text-decoration: none; }
.card h3 { font-size: var(--step-2); }
.card p { color: var(--ink-soft); margin-top: 10px; }
.card .go { display: inline-block; margin-top: 14px; color: var(--brass-deep); font-weight: 500; border-bottom: 1.5px solid currentColor; }
.card:hover .go { color: var(--ink); }
.card:hover .tile { outline: 3px solid var(--brass); outline-offset: 4px; }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 6vw, 96px); }
.split > div { display: grid; gap: 16px; align-content: start; min-width: 0; }
.split h2 { font-size: var(--step-2); }

/* closing buy band */
.band-night { background: var(--night); color: var(--cream); }
.band-night .wrap { display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; justify-content: space-between; padding-block: 56px; }
.band-night h2 { font-size: var(--step-2); }
.band-night p { color: var(--cream-soft); margin-top: 8px; }
.band-night a { color: var(--cream); }

/* resources */
.res-list { display: grid; gap: 0; }
.res { display: grid; grid-template-columns: minmax(0, 168px) minmax(0, 1fr) auto; gap: 20px 36px; align-items: center; padding-block: 32px; border-top: 1.5px solid var(--rule); }
.res:last-child { border-bottom: 1.5px solid var(--rule); }
.thumb { aspect-ratio: 1; width: 100%; max-width: 100%; object-fit: cover; background: #fff; border: 1.5px solid var(--rule); border-radius: 4px; }
.res__text { display: grid; gap: 8px; min-width: 0; }
.res__text h2 { font-size: var(--step-2); }
.res__text p { color: var(--ink-soft); }
.res__meta { font-size: var(--step--1); color: var(--ink-soft); }
.note { font-size: var(--step--1); color: var(--ink-soft); margin-top: 28px; }

/* song analyses (empty state) */
.empty { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.empty .stack { align-content: center; }

/* ---------- footer ---------- */
.keys {
  height: 26px;
  background:
    repeating-linear-gradient(104deg, var(--olive) 0 12px, var(--cream) 12px 19px, var(--olive) 19px 27px, var(--cream) 27px 33px, var(--olive) 33px 47px, var(--cream) 47px 53px);
}
.site-footer { background: var(--night); color: var(--cream-soft); font-size: var(--step--1); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px 48px; padding-block: 56px 40px; }
.site-footer img { height: 44px; width: auto; }
.site-footer h2 { font-family: var(--body); font-size: 1rem; font-weight: 600; color: var(--cream); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: var(--cream); }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid rgba(237,228,198,.16); padding-top: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .feature, .intro, .tabs__panel, .split, .empty { grid-template-columns: minmax(0, 1fr); }
  .intro__cover { position: static; max-width: 300px; }
  .feature__cover { max-width: 320px; }
  .tabs__panel .tile { max-width: 340px; }
  .empty .tile { max-width: 260px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .site-footer .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-footer .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .site-header .wrap { padding-block: 16px; }
  .brand img { height: 32px; }
  .site-nav ul { gap: 4px 18px; }
  .site-nav a { font-size: .9375rem; }
  .hero { padding-top: 64px; padding-bottom: 64px; }
  .card { grid-template-columns: minmax(0, 120px) minmax(0, 1fr); gap: 18px; }
  .res { grid-template-columns: minmax(0, 96px) minmax(0, 1fr); align-items: start; }
  .res .btn { grid-column: 1 / -1; justify-self: start; }
  .site-footer .wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.hero__author { font-family: var(--display); font-size: var(--step-1); letter-spacing: .02em; margin-top: -8px; text-shadow: 0 1px 12px rgba(0,0,0,.6); }
@media (max-width: 760px) {
  .hero::before { background: radial-gradient(ellipse 95% 62% at 50% 52%, rgba(19,33,44,.82) 0%, rgba(19,33,44,.6) 60%, rgba(19,33,44,.2) 100%); }
}
