:root {
  color-scheme: dark;
  --background: #171613;
  --surface: #201e1a;
  --line: #3d3830;
  --cream: #f7f0e5;
  --muted: #c2b8ab;
  --accent: #ff7948;
  --accent-hover: #ff946d;
  --paper: #f2e9db;
  --ink: #231d17;
  --paper-muted: #62584b;
  --paper-line: #cbbfae;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --shell: min(1320px, calc(100% - clamp(32px, 8vw, 144px)));
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 20px; }
body { margin: 0; background: var(--background); color: var(--cream); line-height: 1.55; }
button, input, select { font: inherit; }
a { color: inherit; }
button, select, input[type="range"], summary { cursor: pointer; }
img { display: block; max-width: 100%; }
p, figure, dl, dd { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:not(:focus) { width: 0; height: 0; }
.skip-link:focus { position: absolute; z-index: 5; top: 12px; left: 12px; padding: 10px 14px; background: var(--background); }
.shell { width: var(--shell); margin-inline: auto; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  min-height: 76px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: fit-content;
  color: var(--cream);
  font-size: 1.47rem;
  font-weight: 800;
  letter-spacing: -0.046em;
  line-height: 1;
  text-decoration: none;
}
.brand-name > span { color: var(--accent); }
.wordmark::before {
  width: 31px;
  height: 31px;
  margin-right: 9px;
  background: url("./assets/fretshift-icon.svg") center / contain no-repeat;
  content: "";
}
.site-nav, .site-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(16px, 3.1vw, 45px); }
.site-nav a, .site-footer nav a { color: var(--muted); font-size: 0.91rem; font-weight: 650; text-decoration: none; }
.site-nav a:hover, .site-footer nav a:hover { color: var(--accent); }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 20px;
  min-height: 49px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--accent);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 140ms, border-color 140ms;
}
.button:hover { background: var(--accent-hover); }
.button:disabled { opacity: 0.55; cursor: default; }
.button-small { min-height: 43px; padding: 9px 15px; font-size: 0.875rem; }
.header-cta { justify-self: end; }
.text-link { width: fit-content; font-size: 0.94rem; font-weight: 750; text-underline-offset: 0.32em; text-decoration-thickness: 1px; }
.text-link:hover { text-decoration-thickness: 2px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  align-items: center;
  gap: clamp(26px, 4.5vw, 75px);
  padding-block: clamp(40px, 4.4vw, 72px) clamp(42px, 5vw, 76px);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.eyebrow > span { width: 16px; height: 1px; background: currentColor; }
h1, h2, h3 { margin: 0; font-weight: 780; letter-spacing: -0.047em; line-height: 1.04; }
h1 { font-size: clamp(3.4rem, 6.85vw, 7.2rem); font-weight: 800; line-height: 0.94; letter-spacing: -0.055em; }
h1 em { color: var(--accent); font-style: normal; }
h2 { font-size: clamp(2.4rem, 4.5vw, 4.5rem); }
h3 { font-size: clamp(1.45rem, 2.6vw, 2.13rem); }
.hero .eyebrow { margin-bottom: clamp(13px, 1.55vw, 23px); }
.hero-lede { max-width: 43ch; margin-top: clamp(19px, 2.2vw, 30px); color: var(--muted); font-size: clamp(1rem, 1.32vw, 1.19rem); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 15px 24px; margin-top: clamp(22px, 2.5vw, 35px); }
.hero-figure { position: relative; isolation: isolate; }
.hero-figure img {
  width: 100%;
  aspect-ratio: 1.43;
  height: auto;
  border: 1px solid #674b32;
  border-radius: 12px;
  object-fit: cover;
  object-position: center 48%;
}
.hero-example {
  position: absolute;
  inset: auto 17px 17px auto;
  display: flex;
  align-items: center;
  gap: clamp(7px, 0.95vw, 14px);
  max-width: calc(100% - 28px);
  padding: 8px 12px;
  border: 1px solid #70533b;
  border-radius: 6px;
  background: #171310;
  color: #e2d1b9;
  font: 600 0.7rem/1.2 var(--mono);
  letter-spacing: 0.025em;
}
.hero-example strong { padding-left: 3px; color: var(--cream); font-size: 1rem; }
.example-fret { padding: 4px 6px; border-radius: 3px; background: var(--accent); color: var(--ink); font-weight: 800; white-space: nowrap; }

.planner-panel { color-scheme: light; padding: clamp(22px, 4.1vw, 58px); border-radius: 12px; background: var(--paper); color: var(--ink); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px 32px; margin-bottom: clamp(22px, 3vw, 38px); }
.section-heading > p { max-width: 34ch; color: var(--muted); }
.planner-heading > p, .field-hint { color: var(--paper-muted); }
.planner-heading .eyebrow { color: #914020; }
.planner-grid { display: grid; grid-template-columns: minmax(0, 0.76fr) minmax(0, 1.24fr); align-items: stretch; gap: clamp(23px, 3.85vw, 56px); }
.planner-form { display: grid; align-content: start; gap: 20px; padding-top: 6px; }
.key-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.field { display: grid; align-content: start; gap: 6px; }
.field label, .capo-field label { color: var(--ink); font-size: 0.93rem; font-weight: 750; }
.field select, .field input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid #a89a87;
  border-radius: 5px;
  background: #fbf5ec;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 650;
}
.field select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #4f4338 50%), linear-gradient(135deg, #4f4338 50%, transparent 50%);
  background-position: right 17px center, right 12px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.field select:focus-visible, .field input:focus-visible, .capo-field input:focus-visible, .rehearsal-sheet a:focus-visible { outline-color: #9c401d; }
.field-hint, .planner-error, .range-labels { font-size: 0.82rem; }
.planner-error { color: #8e2d22; font-weight: 700; }
.field input[aria-invalid="true"] { border-color: #8e2d22; }
.capo-field { padding-top: 12px; border-top: 1px solid var(--paper-line); }
.capo-field-heading, .range-labels { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.capo-field output { padding: 2px 8px; border-radius: 4px; background: #e5d2bc; color: #592b1a; font-size: 0.84rem; font-weight: 800; }
.capo-field input { display: block; width: 100%; height: 30px; margin: 3px 0 0; accent-color: #953c1a; }
.range-labels { color: var(--paper-muted); }

.arrangement { padding: clamp(17px, 2vw, 28px); border-radius: 8px; background: #231e19; color: var(--cream); }
.arrangement-heading { display: flex; justify-content: space-between; align-items: start; gap: 6px 12px; margin-bottom: 13px; }
.arrangement-heading p { font-size: 1rem; font-weight: 750; }
.arrangement-heading > span { flex-shrink: 0; padding-top: 4px; color: #c6b6a1; font: 600 0.72rem/1.2 var(--mono); letter-spacing: 0.025em; }
.fretboard-diagram { margin-bottom: 18px; }
.fret-numbers { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); margin: 0 0 4px 4px; color: #dfccb4; font: 600 0.76rem/1.2 var(--mono); text-align: center; }
.fretboard {
  --capo-position: 30.5556%;
  position: relative;
  height: 65px;
  border-top: 2px solid #794e31;
  border-bottom: 2px solid #794e31;
  border-left: 4px solid #e5d4bf;
  border-radius: 3px;
  background: repeating-linear-gradient(177deg, #563621 0 4px, #5d3b25 5px 10px, #69422a 11px 14px);
}
.fret-lines, .strings { position: absolute; inset: 0; display: grid; }
.fret-lines { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.fret-lines i { position: relative; border-right: 2px solid #b79c82; }
.fret-lines i:nth-child(odd):nth-child(n + 3)::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e0b89a;
  transform: translate(-50%, -50%);
  content: "";
}
.strings { align-content: space-evenly; }
.strings i { height: 1px; background: #e5c8a890; box-shadow: 0 1px #2d1a10; }
.strings i:nth-last-child(-n + 2) { height: 2px; }
.capo-marker {
  position: absolute;
  inset: -5px auto -5px var(--capo-position);
  width: clamp(10px, 1.2vw, 17px);
  border: 1px solid #ffbd9f;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 3px 0 0 #24171080;
  transform: translateX(-50%);
}
.capo-marker::after { position: absolute; inset: auto -3px -2px; height: 6px; border-radius: 2px; background: #ffad87; content: ""; }
.fretboard[data-capo="0"] .capo-marker { display: none; }
.chord-results { display: grid; gap: 7px; }
.chord-results > div { display: grid; grid-template-columns: minmax(116px, 0.43fr) minmax(0, 1fr); align-items: baseline; gap: 6px 12px; }
.chord-results dt { color: #d1c0aa; font-size: 0.82rem; font-weight: 650; }
.chord-results dd { display: flex; flex-wrap: wrap; gap: 5px; }
.chord-token {
  min-width: 36px;
  padding: 3px 7px;
  border: 1px solid #625547;
  border-radius: 4px;
  background: #352c24;
  color: var(--cream);
  text-align: center;
  font: 700 0.89rem/1.3 var(--mono);
}
#shape-chords .chord-token { border-color: #7d4d36; background: #452e22; color: #ffac8b; }
.planner-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.button-quiet { border-color: #776b5c; background: transparent; color: var(--cream); }
.button-quiet:hover { border-color: #a59480; background: #382f26; }
.planner-status:not(:empty), .noscript { margin-top: 10px; font-size: 0.83rem; }

.chart-section { padding-block: clamp(52px, 7vw, 107px); }
.chart-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 0.85fr); gap: 16px; }
.chart-table-wrap { align-self: start; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.capo-chart { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: center; }
.capo-chart th, .capo-chart td { padding: 9px 4px; border-bottom: 1px solid var(--line); font: 600 0.95rem/1.45 var(--mono); }
.capo-chart th:first-child { width: 17%; }
.capo-chart thead th { background: #2e2821; color: #e0cfb8; }
.capo-chart tbody th { color: var(--accent); }
.capo-chart tr:last-child :is(th, td) { border-bottom: 0; }
.capo-chart .chart-match { background: var(--accent); color: var(--ink); font-weight: 850; }
.capo-chart a { color: var(--accent); text-underline-offset: 0.2em; }
.capo-chart .chart-match a { color: inherit; }
.capo-chart .chart-match a:focus-visible { outline-color: var(--ink); }
.chart-example {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: clamp(19px, 2.8vw, 39px);
  border: 1px solid #694b39;
  border-radius: 8px;
  background: #2b211a;
}
.capo-equation { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.capo-equation > span {
  display: grid;
  min-width: 50px;
  min-height: 46px;
  place-items: center;
  padding-inline: 7px;
  border: 1px solid #745a46;
  border-radius: 5px;
  color: var(--cream);
  font: 750 1.5rem/1 var(--mono);
}
.capo-equation > span:last-child { border-color: var(--accent); color: var(--accent); }
.capo-equation > small { color: #e3c8b3; font: 750 0.74rem/1 var(--mono); }
.chart-example p { color: var(--muted); }
.chart-example .text-link { color: var(--accent); }

.guide-section { padding-block: clamp(45px, 6.25vw, 89px); border-block: 1px solid #5f4331; background: #211b16; }
.guide-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.88fr); align-items: center; gap: clamp(24px, 5vw, 78px); }
.guide-steps { display: grid; gap: 12px; margin: 24px 0 0; padding-left: 1.55em; max-width: 53ch; color: #d8c9b9; }
.guide-steps li { padding-left: 4px; }
.guide-steps li::marker { color: var(--accent); font-family: var(--mono); font-weight: 800; }
.guide-steps strong { color: var(--cream); }
.rehearsal-sheet {
  display: grid;
  gap: 12px;
  padding: clamp(19px, 3.15vw, 43px);
  border-top: 5px solid var(--accent);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
}
.sheet-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: #6e4230; font: 750 0.76rem/1.35 var(--mono); letter-spacing: 0.05em; }
.rehearsal-sheet > p { color: var(--paper-muted); }
.sheet-chords { margin-block: 2px; }
.sheet-chords > div { display: grid; grid-template-columns: minmax(106px, 0.85fr) minmax(0, 1.15fr); align-items: center; gap: 8px; padding-block: 10px; border-top: 1px solid var(--paper-line); }
.sheet-chords > div:last-child { border-bottom: 1px solid var(--paper-line); }
.sheet-chords dt { font-size: 0.87rem; font-weight: 750; }
.sheet-chords dt span { display: block; color: var(--paper-muted); font-size: 0.76rem; font-weight: 600; }
.sheet-chords dd { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); font: 750 1.03rem/1.2 var(--mono); text-align: center; }
.rehearsal-sheet .text-link { color: #863c21; }

.faq-section { display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr); gap: 25px; padding-block: clamp(45px, 7vw, 95px); }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { padding: 15px 0; border-bottom: 1px solid var(--line); }
.faq-list summary { position: relative; padding-right: 24px; color: var(--cream); font-weight: 750; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { position: absolute; top: 0; right: 3px; color: var(--accent); content: "+"; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { max-width: 63ch; margin-top: 9px; color: var(--muted); }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px 28px; padding-block: 24px; }

@media (max-width: 950px) {
  .arrangement-heading { flex-wrap: wrap; }
  .hero-actions { gap: 12px 16px; }
  .hero-figure img { aspect-ratio: 1.18; }
}

@media (max-width: 760px) {
  .header-inner { grid-template-columns: auto 1fr; gap: 16px; min-height: 65px; }
  .header-cta { display: none; }
  .site-nav { justify-content: end; }
  .hero { grid-template-columns: 1fr; gap: 26px; padding-top: 34px; }
  h1 { font-size: clamp(3.55rem, 10.6vw, 5.65rem); }
  .hero-figure img { aspect-ratio: 1.48; }
  .section-heading { flex-direction: column; align-items: start; gap: 10px; }
  .section-heading > p { max-width: 45ch; }
  .planner-grid, .chart-grid, .guide-grid, .faq-section { grid-template-columns: 1fr; }
  .capo-field { padding-top: 8px; }
  .chart-example { gap: 12px; }
}

@media (max-width: 470px) {
  .header-inner { grid-template-columns: 1fr; align-content: center; gap: 10px; min-height: 79px; padding-block: 8px; }
  .site-nav { justify-content: start; gap: 21px; }
  .site-nav a { font-size: 0.86rem; }
  .hero { gap: 22px; padding-top: 29px; padding-bottom: 34px; }
  .hero-actions .button { min-height: 44px; padding: 10px 12px; font-size: 0.85rem; }
  .hero-actions .text-link { font-size: 0.85rem; }
  .hero-example { right: 9px; bottom: 9px; padding: 6px 8px; font-size: 0.63rem; }
  .hero-example strong { font-size: 0.87rem; }
  .planner-panel { padding: 18px; }
  .arrangement { padding: 14px; }
  .arrangement-heading { margin-bottom: 10px; }
  .fretboard { height: 55px; }
  .chord-results > div { grid-template-columns: 1fr; }
  .capo-chart th, .capo-chart td { padding-inline: 2px; font-size: 0.84rem; }
  .footer-inner { align-items: start; flex-direction: column; }
}

@media (max-width: 355px) {
  h1 { font-size: clamp(2.75rem, 14vw, 3.15rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
