/* The palette is an amp, not an app: tweed cream, tolex brown, tube-glow
   amber, brass on the dark panels. Fraunces carries the headline voice the
   way a badge logo carries an amp face. */
:root {
  --ink: #211711;
  --muted: #7d7065;
  --line: #e6dccb;
  --accent: #c2511e;
  --accent-dark: #94380f;
  --bg: #f5efe2;
  --card: #fffcf3;
  --night: #241a13;
  --brass: #e0aa4e;
  --shadow: 0 16px 45px rgba(58, 38, 22, 0.09);
}

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fraunces-latin-397b623a.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(194, 81, 30, 0.07), transparent 26rem),
    var(--bg);
  font: 16px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 2rem 1.5rem 4.5rem;
  flex: 1;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(231, 224, 215, 0.85);
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(16px);
}

header.site .bar {
  width: min(1180px, 100%);
  min-height: 4.4rem;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.wordmark {
  flex: none;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.22rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.wordmark span { color: var(--accent); }
.wordmark:hover { text-decoration: none; }

.primary-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  font-size: 0.88rem;
  font-weight: 650;
}

.primary-nav a { color: var(--muted); }
.primary-nav a:hover { color: var(--ink); text-decoration: none; }

/* The Editor is the product's front door, so its nav link dresses like one. */
.primary-nav .editor-link {
  padding: 0.36rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent-dark);
}
.primary-nav .editor-link:hover { color: white; background: var(--accent); }

.account {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-left: auto;
  font-size: 0.86rem;
  white-space: nowrap;
}

.account .who { color: var(--muted); max-width: 9rem; overflow: hidden; text-overflow: ellipsis; }
.account .publish, .signin { font-weight: 750; }

.linkish {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--accent-dark);
  background: none;
  font: inherit;
  cursor: pointer;
}

.linkish:hover { text-decoration: underline; }

footer.site { border-top: 1px solid var(--line); background: var(--card); }
.footer-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 1.4rem 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.84rem;
}
.footer-inner p { margin: 0; }

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Display type: Fraunces, set tight but not crushed. Headlines should feel
   like an amp badge, not a billboard, so sizes stay a notch under huge. */
.page-head h1, .discovery-hero h1, .tone-hero h1, .implementation-hero h1, .download-hero h1,
.section-head h2, .detail-columns h2, .lineage-section h2, .day-one h2, .editor-cta h2,
.feature-grid article h2, .empty-state h2, .dialog h1, .dialog h2 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.page-head { max-width: 48rem; margin: 0.5rem 0 2rem; }
.page-head h1, .discovery-hero h1, .tone-hero h1, .implementation-hero h1, .download-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4.5vw, 4.2rem);
  line-height: 1.02;
}
.page-head h1 { font-size: clamp(2rem, 4vw, 3.3rem); }
.page-head p:last-child { margin: 0.75rem 0 0; font-size: 1.02rem; }
.browse-head { max-width: 54rem; }

.discovery-hero { padding: clamp(2.25rem, 4.5vw, 4rem) 0 clamp(2.5rem, 5vw, 4.25rem); }
.discovery-hero h1 { max-width: 900px; font-size: clamp(3rem, 6.5vw, 5.6rem); }
.discovery-hero > p:not(.eyebrow, .search-examples) {
  max-width: 48rem;
  margin: 1.25rem 0 1.75rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.hero-search {
  width: min(800px, 100%);
  display: flex;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.hero-search input[type="search"] {
  min-width: 0;
  flex: 1;
  padding: 0.85rem 1rem;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 1.05rem;
}
.hero-search input[type="submit"], .filters input[type="submit"],
.auth-form input[type="submit"], .tone-form input[type="submit"], .device-filter input[type="submit"] {
  border: 1px solid var(--night);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  color: white;
  background: var(--night);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.hero-search input[type="submit"] { padding-inline: 1.4rem; }
.search-examples { margin: 1rem 0 0; color: var(--muted); font-size: 0.86rem; }
.hero-editor { margin: 1.4rem 0 0; color: var(--muted); font-size: 0.95rem; }

/* Day one: the state of having no catalog yet, worn proudly rather than
   papered over with placeholder cards. */
.day-one {
  margin: 0 0 3.5rem;
  padding: clamp(2rem, 5vw, 3.5rem);
  border: 1px dashed #cec3b8;
  border-radius: 24px;
  background: var(--card);
}
.day-one h2 { margin: 0; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.05; }
.day-one > p:not(.eyebrow) { max-width: 44rem; margin: 1rem 0 0; color: var(--muted); font-size: 1.08rem; }
.day-one-actions { margin-top: 1.9rem; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.day-one .chain-demo { margin: 2rem 0 0; }

.chain-demo { margin: 0 0 4rem; }
.chain-demo figcaption { margin-top: 0.4rem; color: var(--muted); font-size: 0.84rem; }

.discovery-section { margin: 0 0 3.5rem; }
.section-head {
  margin: 0 0 1.2rem;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}
.section-head h2, .detail-columns h2, .lineage-section h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  line-height: 1.1;
}
.section-head > a { font-size: 0.9rem; font-weight: 700; }
.section-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 0.65rem; }
.section-actions .button { font-size: 0.82rem; }

.tone-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
/* A card is a record sleeve on a shelf: a small square of colour, the name,
   the context, the hardware. The sleeve colours cycle through sunbursts a
   guitar case would recognise, never a colour a spreadsheet would pick. */
.tone-card {
  min-width: 0;
  overflow: hidden;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 6px 22px rgba(58, 38, 22, 0.035);
}
.tone-card-head { display: flex; align-items: center; gap: 0.85rem; }
.tone-card-head > div { min-width: 0; }
.tone-art {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: rgba(255, 250, 240, 0.94);
  background:
    linear-gradient(135deg, rgba(194, 81, 30, 0.94), rgba(44, 26, 18, 0.97)),
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(255,255,255,.08) 12px 13px);
  text-decoration: none;
}
.tone-card .tone-art { flex: none; width: 3.4rem; aspect-ratio: 1; border-radius: 10px; }
.tone-card:nth-child(3n + 2) .tone-art { background: linear-gradient(135deg, #b8862f, #241708); }
.tone-card:nth-child(3n + 3) .tone-art { background: linear-gradient(135deg, #96352c, #200f0e); }
.tone-art span { font-family: "Fraunces", Georgia, serif; font-size: 1.1rem; font-weight: 600; letter-spacing: 0; }
.tone-art:hover { text-decoration: none; filter: saturate(1.15); }
.tone-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; letter-spacing: -0.015em; }
.tone-card h3 a { color: var(--ink); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tone-context { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.84rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tone-card-meta { margin-top: 0.8rem; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.tone-card-meta .installs { flex: none; color: var(--muted); font-size: 0.75rem; }
.device-chips, .tag-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.device-chips span, .tag {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #faf7f2;
  font-size: 0.68rem;
  font-weight: 700;
}

.split-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.link-list { border-top: 1px solid var(--line); }
.link-list > a {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink);
}
.link-list > a:hover { color: var(--accent-dark); text-decoration: none; }
.link-list span:first-child { display: flex; flex-direction: column; }
.link-list small { color: var(--muted); }
.link-list.large { max-width: 52rem; }
.link-list.large > a { padding: 1.15rem 0; }

.editor-cta {
  margin: 1rem 0 0;
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  color: white;
  background: var(--night);
}
.editor-cta h2 { margin: 0; font-size: clamp(1.9rem, 4vw, 3.1rem); line-height: 1.05; }
.editor-cta p:not(.eyebrow) { max-width: 45rem; color: #c9c0b9; }
.editor-cta .eyebrow { color: var(--brass); }
.editor-cta .button { color: var(--night); background: var(--brass); white-space: nowrap; }
.contribute-cta { margin-top: 3rem; }

.filters {
  margin: 0 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.filters input, .filters select, .device-filter select, .device-filter input {
  min-height: 2.65rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--card);
  font: inherit;
  font-size: 0.86rem;
}
.filters input[type="search"] { min-width: min(22rem, 100%); flex: 1; }
.filters select { max-width: 12rem; }
.filters :focus, .tone-form :focus, .auth-form :focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.breadcrumbs {
  margin: 0 0 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.tone-hero, .implementation-hero {
  margin: 1rem 0 4rem;
  display: grid;
  grid-template-columns: minmax(13rem, 25rem) 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.tone-art-large { aspect-ratio: 1; border-radius: 22px; box-shadow: var(--shadow); }
.tone-art-large span { font-size: clamp(3rem, 7vw, 5.5rem); }
.tone-hero h1, .implementation-hero h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); }
.part-name { margin: 0.8rem 0; color: var(--accent-dark); font-size: 1.3rem; font-weight: 800; }
.lede { max-width: 48rem; color: var(--muted); font-size: 1.16rem; }
.tag-row { margin-top: 1.25rem; }

.implementations-head { margin-top: 1rem; }
.device-filter { display: flex; gap: 0.5rem; }
.implementation-list { margin-bottom: 4rem; display: grid; gap: 0.75rem; }
.implementation-card {
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: var(--card);
}
.implementation-card h3 { margin: 0; font-size: 1.35rem; }
.implementation-card p:not(.eyebrow) { margin: 0.35rem 0 0; }

.implementation-hero { grid-template-columns: 1fr minmax(15rem, 22rem); padding: 3rem 0; }
.implementation-actions {
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}
.button {
  display: inline-block;
  padding: 0.7rem 1rem;
  border: 1px solid var(--night);
  border-radius: 10px;
  color: white;
  background: var(--night);
  font-weight: 750;
  text-align: center;
}
.button:hover { opacity: 0.9; text-decoration: none; }
.button-secondary { color: var(--ink); background: transparent; border-color: var(--line); }
.button-disabled { color: var(--muted); background: var(--line); border-color: var(--line); cursor: not-allowed; }

/* The author's doorway from "indexed elsewhere" to "hosted here": quiet
   until opened, serious once open. */
.host-file {
  margin: -1.5rem 0 3rem;
  padding: 1rem 1.25rem;
  border: 1px dashed #cec3b8;
  border-radius: 12px;
  background: rgba(255, 252, 243, 0.6);
}
.host-file summary { color: var(--accent-dark); font-weight: 700; cursor: pointer; }
.host-file p { max-width: 46rem; color: var(--muted); font-size: 0.92rem; }
.author-check { display: flex; gap: 0.55rem; align-items: baseline; font-size: 0.92rem; font-weight: 650; }
.host-file-row { margin-top: 0.9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.host-file-row input[type="submit"] {
  border: 1px solid var(--night);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  color: white;
  background: var(--night);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.chain { margin: 0 0 4rem; }
.chain-title { margin: 0 0 0.85rem; font-size: 1.25rem; letter-spacing: -0.025em; }
.chain-path { display: flex; align-items: center; overflow-x: auto; padding: 0.25rem 0 0.75rem; }
.chain-path + .chain-path { margin-top: 0.5rem; }
.chain-block {
  flex: none;
  max-width: 12rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--block-accent, var(--muted));
  border-radius: 10px;
  color: var(--ink);
  background: var(--card);
  font-size: 0.84rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The icon takes the block's own accent; the name stays ink, so the colour
   says the category and the words stay readable. */
.chain-icon { flex: none; display: flex; color: var(--block-accent, var(--muted)); }
.chain-icon svg { width: 1.05rem; height: 1.05rem; display: block; }
.chain-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain-joint { width: 1.25rem; height: 1px; flex: none; background: #c7bbb0; }
.chain-block.bypassed { opacity: 0.55; text-decoration: line-through; background: transparent; }

.detail-columns { margin-bottom: 4rem; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.55rem 1.5rem; font-size: 0.9rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
dl.facts code { font-size: 0.72rem; }
.dependency-list { margin: 1rem 0; padding: 0; list-style: none; }
.dependency-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; }
.dependency-list li span { display: flex; flex-direction: column; }
.dependency-list small { color: var(--muted); }

.audio-section, .lineage-section { margin: 0 0 4rem; }
.audio-preview { padding: 1rem 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; }
.audio-preview audio { width: min(28rem, 100%); }
.audio-preview div { display: flex; flex-direction: column; }
.audio-preview small { color: var(--muted); }

.empty-state, .legal-note {
  padding: 1.25rem;
  border: 1px dashed #cec3b8;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 253, 249, 0.55);
}
.empty-state h2, .empty-state p { margin: 0; }
.empty-state h2 + p { margin-top: 0.35rem; }

.part-grid, .feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.part-card, .feature-grid article {
  min-height: 10rem;
  padding: 1.3rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--card);
}
.part-card:hover { border-color: var(--accent); text-decoration: none; }
.part-card strong { margin-top: auto; font-size: 1.2rem; }
.part-card small { margin-top: 0.35rem; color: var(--muted); }

.download-hero { max-width: 62rem; padding: clamp(2.25rem, 4.5vw, 4rem) 0 2.75rem; }
.download-hero .lede { max-width: 46rem; }
.download-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.feature-grid { margin-bottom: 3rem; }
.feature-grid article h2 { margin: auto 0 0.4rem; line-height: 1.05; letter-spacing: -0.035em; }
.feature-grid article p:last-child { margin: 0; color: var(--muted); }

.tone-form { max-width: 58rem; }
.tone-form fieldset { margin: 0 0 2rem; padding: 1.4rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.tone-form legend { padding: 0 0.35rem; font-size: 1.1rem; font-weight: 800; }
.tone-form label { display: block; flex: 1; margin: 0 0 1.1rem; }
.tone-form label > span { display: block; margin-bottom: 0.35rem; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.tone-form label small { font-weight: 500; }
.fixed-field { min-height: 2.7rem; padding: 0.55rem 0; display: block; }
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row > label { min-width: 10rem; }
.tone-form input[type="text"], .tone-form input[type="email"], .tone-form input[type="number"],
.tone-form select, .tone-form textarea, .auth-form input[type="email"], .auth-form input[type="text"] {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: white;
  font: inherit;
}
.tone-form textarea { resize: vertical; }
.tone-form select[multiple] { min-height: 7rem; }
.tone-form input[type="file"] { max-width: 100%; }
.tone-form small.muted { display: block; margin-top: 0.4rem; }
.form-actions { margin-top: 1rem; display: flex; align-items: center; gap: 1rem; }
.form-errors { margin-bottom: 1.5rem; padding: 1rem; border: 1px solid #e3b9ad; border-radius: 10px; color: #7b2714; background: #fff2ed; }
.form-errors p { margin: 0; }
.form-errors ul { margin-bottom: 0; }
.tone-form .legal-note { margin: 0 0 1.5rem; font-size: 0.82rem; }

.auth-form { max-width: 32rem; display: flex; gap: 0.5rem; }
.sent-dialog h1 { margin: 0 0 0.75rem; font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.05; }
.sent-dialog .lede { margin: 0 0 1rem; font-size: 1.05rem; }
.sent-dialog p:last-child { margin-bottom: 0; }
.dialog { max-width: 34rem; margin: 3rem auto; padding: 2rem; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.owner-actions { margin-top: 2rem; display: flex; align-items: center; gap: 1rem; }

.flash { margin: 0 0 1.25rem; padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: 9px; }
.flash-notice { border-color: #cad9a3; background: #f4f9e8; }
.flash-alert { border-color: #e3b9ad; color: #7b2714; background: #fff2ed; }

@media (max-width: 900px) {
  /* Small screens drop the browse links but keep the Editor: it is the one
     thing the header should still sell on a phone. */
  .primary-nav > a:not(.editor-link) { display: none; }
  .tone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tone-hero { grid-template-columns: minmax(11rem, 17rem) 1fr; }
  .detail-columns { gap: 2rem; }
}

@media (max-width: 640px) {
  main { padding: 1.5rem 1rem 4rem; }
  header.site .bar { padding-inline: 1rem; gap: 0.75rem; }
  .account .who { display: none; }
  .account { gap: 0.6rem; }
  .discovery-hero { min-height: 28rem; padding-top: 3rem; }
  .hero-search { display: grid; }
  .split-sections, .tone-hero, .implementation-hero, .detail-columns, .part-grid, .feature-grid { grid-template-columns: 1fr; }
  .tone-grid { grid-template-columns: 1fr; }
  .tone-art-large { width: min(15rem, 100%); aspect-ratio: 1; }
  .tone-hero { margin-bottom: 3rem; }
  .implementation-card, .editor-cta { align-items: stretch; flex-direction: column; }
  .editor-cta .button { white-space: normal; }
  .footer-inner { padding-inline: 1rem; flex-direction: column; }
  .auth-form { flex-direction: column; }
}
