/* ChordAid 5 site: the App Store art's palette (rosewood on cream, the icon's red, the root dot's gold).
   Hand-written; css/new-age.min.css stays only for the emsi.eu home page. */

:root {
  --paper: #fffcf5;
  --cream: #fee8bf;
  --ink: #3d2515;
  --ink-soft: #6e5643;
  --red: #b42a12;
  --gold: #e6b300;
  --line: #ead9bb;
  --dot: #1d1d1f;
  --measure: 40rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b120b;
    --cream: #2a1c12;
    --ink: #f6e9d2;
    --ink-soft: #c9b49a;
    --red: #ff8a6b;
    --gold: #f2c230;
    --line: #3d2b1d;
    --dot: #f5f5f7;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 -apple-system, system-ui, "Helvetica Neue", Arial, sans-serif;
}
/* Inside the app's browser: follow the text size chosen in iOS Settings. */
@supports (font: -apple-system-body) {
  body { font: -apple-system-body; line-height: 1.55; }
}
img, video, svg { max-width: 100%; height: auto; }
a { color: var(--red); text-underline-offset: 0.15em; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); font-weight: 800; margin: 3rem 0 0.75rem; }
h3 { font-size: 1.15rem; font-weight: 700; margin: 1.75rem 0 0.4rem; }
p, ul, ol, dl, table { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; }
li + li { margin-top: 0.3rem; }
.soft { color: var(--ink-soft); }
.wrap { max-width: 68rem; margin: 0 auto; padding: 0 16px; }
.measure { max-width: var(--measure); }

/* Navigation */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 1.25rem; min-height: 3.5rem; }
.brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 800; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav a:not(.brand) { color: var(--ink); text-decoration: none; font-weight: 600; }
.nav a[aria-current="page"] { color: var(--red); }

/* Landing page */
.banner {
  height: clamp(120px, 26vw, 330px);
  /* The art's own fade to cream is cropped away on most widths, so finish it here. */
  background: linear-gradient(transparent 55%, var(--cream)), url(../img/header.jpg) center / cover no-repeat, #e67a5a;
}
.hero { background: var(--cream); padding: 2rem 0 2.5rem; }
.hero .wrap { display: grid; gap: 1.5rem; align-items: center; }
.hero-icon { width: 96px; height: 96px; border-radius: 22px; margin-top: calc(-48px - 2rem); box-shadow: 0 6px 20px rgb(61 37 21 / 0.25); }
.hero p.lead { font-size: 1.2rem; max-width: 34rem; margin: 0.9rem 0 1.25rem; }
.badge img { height: 52px; width: auto; }
.badge + small { display: block; margin-top: 0.5rem; color: var(--ink-soft); }

.shots {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 1.75rem 16px 1rem; margin: 0 auto; max-width: 92rem;
  scrollbar-width: thin;
}
.shots figure { flex: 0 0 auto; width: min(64vw, 260px); margin: 0; scroll-snap-align: center; }
.shots img { display: block; border-radius: 30px; border: 1px solid var(--line); box-shadow: 0 8px 24px rgb(61 37 21 / 0.12); }
.shots figcaption { color: var(--ink); font-weight: 700; text-align: center; margin-top: 0.75rem; }

.features { display: grid; gap: 0 2.5rem; }
.features h3 { margin-top: 1.5rem; }
.with-video { display: grid; gap: 2rem; align-items: start; }
.video { width: min(100%, 300px); border-radius: 22px; background: var(--cream); }
dl.tunings dt { font-weight: 700; }
dl.tunings dd { margin: 0 0 0.6rem; color: var(--ink-soft); }
@media (min-width: 600px) {
  dl.tunings { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; }
  dl.tunings dd { margin: 0; }
}

footer { margin-top: 4rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
footer a { color: inherit; }

/* Guide */
.guide-head { background: var(--cream); padding: 2.25rem 0 1.75rem; }
.guide-head p { max-width: var(--measure); margin: 0.75rem 0 0; }
.guide { display: grid; gap: 2rem; padding-top: 1rem; }
.toc ol { list-style: none; padding: 0; margin: 0; columns: 2 11rem; }
.toc li { margin: 0 0 0.35rem; break-inside: avoid; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--red); text-decoration: underline; }
.toc h2 { font-size: 1rem; margin: 0 0 0.6rem; }
.guide article { min-width: 0; }
.guide article > section { max-width: 46rem; }
.guide article > section > h2 { padding-top: 0.5rem; border-top: 1px solid var(--line); }
.guide article > section:first-child > h2 { border-top: 0; margin-top: 1rem; }

figure { margin: 1.25rem 0 1.5rem; }
figure.shot img { width: 270px; border-radius: 16px; border: 1px solid var(--line); display: block; }
figure.shot.wide img { width: 330px; }
figcaption { color: var(--ink-soft); font-size: 0.9rem; margin-top: 0.5rem; max-width: 22rem; }
.shot-pair { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }

table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.45rem 0.75rem 0.45rem 0; border-bottom: 1px solid var(--line); }
th { font-weight: 700; }
td:first-child { white-space: nowrap; }
.table-scroll { overflow-x: auto; }

/* The annotated chord diagrams (CA-27's core) */
.legend { display: grid; gap: 1.5rem; align-items: start; margin: 1.5rem 0 2rem; }
.legend .diagrams { display: flex; flex-wrap: wrap; gap: 1rem 2.5rem; }
.legend svg { width: 230px; color: var(--dot); }
.legend svg .grid { stroke: #9a9a9e; }
.legend svg .shape { stroke: var(--dot); fill: none; }
.legend svg .note { fill: var(--dot); }
.legend svg .root { fill: var(--gold); stroke: var(--dot); stroke-width: 1.2; }
.legend svg text { fill: var(--dot); font: 13px -apple-system, system-ui, sans-serif; text-anchor: middle; }
.legend svg .fret-no { fill: #8e8e93; font-size: 15px; text-anchor: end; }
.legend svg .call { fill: var(--red); }
.legend svg .call-no { fill: var(--paper); font-size: 11px; font-weight: 700; }
.legend ol { padding: 0; list-style: none; counter-reset: call; max-width: var(--measure); }
.legend ol li { counter-increment: call; position: relative; padding-left: 2.1rem; }
.legend ol li::before {
  content: counter(call); position: absolute; left: 0; top: 0.15em;
  width: 1.45rem; height: 1.45rem; border-radius: 50%;
  background: var(--red); color: var(--paper);
  font-size: 0.8rem; font-weight: 700; line-height: 1.45rem; text-align: center;
}
.dot-root { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; background: var(--gold); border: 1px solid var(--dot); vertical-align: -0.05em; }
.dot-note { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; background: var(--dot); vertical-align: -0.05em; }

.note { background: var(--cream); border-radius: 12px; padding: 0.85rem 1rem; max-width: var(--measure); }
.note p:last-child { margin: 0; }

details { border-bottom: 1px solid var(--line); padding: 0.6rem 0; max-width: var(--measure); }
summary { font-weight: 700; cursor: pointer; }
details p { margin: 0.5rem 0 0.25rem; }

@media (min-width: 760px) {
  .hero .wrap { grid-template-columns: auto 1fr; gap: 2rem; }
  .hero-icon { width: 128px; height: 128px; border-radius: 29px; margin-top: calc(-64px - 2rem); align-self: start; }
  .features { grid-template-columns: 1fr 1fr; }
  .with-video { grid-template-columns: 300px 1fr; }
  .shot-float { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 2rem; align-items: start; }
  .shot-float > figure { grid-column: 2; grid-row: 1 / span 20; margin-top: 0.5rem; }
  .shot-float > :not(figure) { grid-column: 1; }
}
@media (min-width: 1000px) {
  .guide { grid-template-columns: 13rem minmax(0, 1fr); gap: 3rem; }
  .toc { position: sticky; top: 4.5rem; align-self: start; max-height: calc(100vh - 5.5rem); overflow-y: auto; padding-top: 1.5rem; }
  .toc ol { columns: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
