/* ============================================================================
   FRETWALK — site stylesheet
   ----------------------------------------------------------------------------
   Design language: warm, tactile, guitar-world — rosewood ink on maple paper,
   a brass accent. Deliberately independent of any brand palette; the PDF's
   per-section colors are random-by-spec and unrelated to these site colors.
   Fonts are system stacks so the site runs fully standalone with no CDN.
   ============================================================================ */

:root {
  --ink: #26201b;          /* rosewood */
  --ink-soft: #5c5248;
  --paper: #f4efe6;        /* maple */
  --paper-raised: #fbf8f1;
  --line: #ddd3c2;
  --brass: #b07d2b;        /* accent */
  --brass-deep: #8a5f1c;
  --shell: #6e4a35;        /* tortoiseshell secondary */
  --ok: #3e6b3f;
  --warn: #9a4a1e;
  --radius: 10px;
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
}

a { color: var(--brass-deep); }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ---- header / footer ---- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.site-header .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}
.logo {
  font-family: var(--serif); font-weight: 700; font-size: 1.45rem;
  letter-spacing: 0.01em; color: var(--ink); text-decoration: none;
}
.logo .tail { color: var(--brass); }
.site-header nav a {
  margin-left: 18px; text-decoration: none; color: var(--ink-soft); font-size: 0.95rem;
}
.site-header nav a:hover { color: var(--ink); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 72px; padding: 28px 0 44px;
  color: var(--ink-soft); font-size: 0.85rem;
}
.site-footer p { margin: 6px 0; }

/* ---- landing ---- */
.hero { padding: 72px 0 30px; }
.hero h1 {
  font-family: var(--serif); font-size: clamp(2.1rem, 5.5vw, 3.2rem);
  line-height: 1.12; margin: 0 0 18px; max-width: 15em;
}
.hero h1 em { font-style: normal; color: var(--brass-deep); }
.hero .lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 34em; margin: 0 0 26px; }

.cta-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  padding: 13px 26px; border-radius: var(--radius);
  transition: transform 0.06s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper-raised); }
.btn-primary:hover { background: #382f27; }
.btn-brass { background: var(--brass); color: #fff; }
.btn-brass:hover { background: var(--brass-deep); }
.btn-quiet {
  background: transparent; color: var(--ink); border: 1.5px solid var(--line);
}
.btn-quiet:hover { border-color: var(--ink-soft); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.price-tag {
  font-family: var(--serif); font-size: 1.05rem; color: var(--ink-soft);
}
.price-tag strong { color: var(--ink); font-size: 1.25rem; }

.how { padding: 34px 0 0; }
.how h2, .philosophy h2 {
  font-family: var(--serif); font-size: 1.6rem; margin: 0 0 8px;
}
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 18px; }
.step {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 20px 16px;
}
.step .num {
  font-family: var(--serif); color: var(--brass); font-size: 1.5rem; font-weight: 700;
  display: block; margin-bottom: 6px;
}
.step h3 { margin: 0 0 6px; font-size: 1.02rem; }
.step p { margin: 0; color: var(--ink-soft); font-size: 0.93rem; }

.philosophy { padding: 52px 0 0; }
.philosophy p { max-width: 38em; color: var(--ink-soft); }
.philosophy blockquote {
  margin: 22px 0; padding: 16px 22px;
  border-left: 3px solid var(--brass);
  background: var(--paper-raised); border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--serif); font-size: 1.08rem; color: var(--ink);
}

.trust { padding: 44px 0 0; font-size: 0.9rem; color: var(--ink-soft); max-width: 40em; }
.trust h2 { font-size: 1.05rem; color: var(--ink); margin-bottom: 6px; font-family: var(--sans); }

/* ---- builder layout ---- */
.builder-main { padding: 34px 0 0; }
.builder-main h1 { font-family: var(--serif); font-size: 1.7rem; margin: 0 0 4px; }
.builder-sub { color: var(--ink-soft); margin: 0 0 26px; font-size: 0.97rem; }

.panel {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: 22px;
}
.panel h2 { margin: 0 0 12px; font-size: 1.15rem; font-family: var(--serif); }

.field-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.02em; }
.field input[type="text"], .field input[type="number"] {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 8px;
  padding: 9px 12px; min-width: 0;
}
.field input:focus { outline: 2px solid var(--brass); outline-offset: 1px; border-color: var(--brass); }
.field input[type="number"] { width: 90px; }
.field input[type="text"] { width: 240px; max-width: 100%; }

/* ---- fret grid component ---- */
.fretgrid-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px;
}
.fretgrid-window { display: flex; align-items: center; gap: 8px; }
.fg-win-label { font-family: var(--mono); font-size: 0.9rem; min-width: 92px; text-align: center; }
.fg-btn {
  font-family: var(--sans); font-size: 0.9rem; font-weight: 600;
  background: #fff; color: var(--ink); border: 1.5px solid var(--line);
  border-radius: 8px; padding: 6px 12px; cursor: pointer;
}
.fg-btn:hover { border-color: var(--ink-soft); }
.fretgrid-name {
  font-family: var(--serif); font-size: 1.15rem; color: var(--brass-deep);
  min-width: 120px; flex: 1;
}
.fretgrid-svg-wrap { overflow-x: auto; }
.fretgrid-board { width: 100%; max-width: 520px; display: block; }
.fretgrid-hint { font-size: 0.8rem; color: var(--ink-soft); margin: 8px 0 0; }

.fg-fret { stroke: #b9ad99; stroke-width: 1.5; }
.fg-nut { stroke: var(--ink); stroke-width: 6; }
.fg-string { stroke: #8c8172; }
.fg-string-label { font-family: var(--mono); font-size: 13px; fill: var(--ink-soft); }
.fg-inlay { fill: #e4dbc9; }
.fg-fretnum { font-family: var(--mono); font-size: 13px; fill: var(--ink-soft); }
.fg-cell { fill: transparent; cursor: pointer; }
.fg-cell:hover { fill: rgba(176, 125, 43, 0.10); }
.fg-dot { fill: var(--ink); cursor: pointer; }
.fg-dotgroup:hover .fg-dot { fill: var(--shell); }
.fg-status-hit { fill: transparent; cursor: pointer; }
.fg-status { cursor: pointer; }
.fg-open { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.fg-mute { stroke: #a29584; stroke-width: 2.5; stroke-linecap: round; }
.fg-status:hover .fg-open { stroke: var(--brass-deep); }
.fg-status:hover .fg-mute { stroke: var(--brass-deep); }
.fg-offwindow { font-family: var(--mono); font-size: 12px; fill: var(--brass-deep); }

@keyframes fg-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.fretgrid.shake { animation: fg-shake 0.25s ease; }

/* ---- chord chips / section list ---- */
.chord-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.section-list { display: flex; flex-direction: column; gap: 14px; }
.section-card {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-left: 4px solid var(--brass);
  border-radius: var(--radius); padding: 16px 18px;
}
.section-card.active { border-left-color: var(--ink); box-shadow: 0 1px 6px rgba(38,32,27,0.08); }
.section-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.section-card h3 { margin: 0; font-family: var(--serif); font-size: 1.08rem; }
.section-card .meta { color: var(--ink-soft); font-size: 0.83rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 4px 6px 4px 13px; font-family: var(--mono); font-size: 0.85rem;
}
.chip button {
  border: none; background: var(--line); color: var(--ink);
  width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
  font-size: 0.75rem; line-height: 1; padding: 0;
}
.chip button:hover { background: var(--shell); color: #fff; }
.section-card .card-actions { margin-top: 10px; display: flex; gap: 10px; }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--brass-deep); font-size: 0.85rem; text-decoration: underline;
}
.link-btn.danger { color: var(--warn); }

.notice {
  border: 1.5px solid var(--brass); background: #fff8ea;
  border-radius: var(--radius); padding: 12px 16px; font-size: 0.92rem; margin: 14px 0;
}
.notice.ok { border-color: var(--ok); background: #f0f6ef; }

/* ---- checkout / success ---- */
.checkout-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 18px 0 0;
}
.legal-note { font-size: 0.8rem; color: var(--ink-soft); max-width: 46em; margin-top: 14px; }

.success-main { padding: 70px 0 0; text-align: center; }
.success-main h1 { font-family: var(--serif); font-size: 2rem; margin: 0 0 10px; }
.success-main p { color: var(--ink-soft); max-width: 34em; margin: 0 auto 12px; }
.success-main .cta-row { justify-content: center; margin-top: 24px; }
.progress { font-family: var(--mono); font-size: 0.9rem; color: var(--brass-deep); min-height: 1.4em; margin-top: 16px; }

@media (max-width: 560px) {
  .hero { padding-top: 44px; }
  .panel { padding: 16px; }
}
