/* SoundCircle design system
   ----------------------------------------------------------------------------
   Original layout and components, with a copper / phosphor colour palette.
   System fonts only. Fluid type, responsive to 320px. */

:root {
  --bg: #f6f1e6;
  --bg-alt: #efe6d4;
  --bg-sunken: #e6dcc8;
  --surface: #fffaf0;
  --border: #ddd2bb;
  --border-strong: #c4b496;
  --text: #1a1610;
  --text-muted: #5c5346;
  --text-soft: #7a7163;
  --accent: #9a5b12;
  --accent-hover: #7a470c;
  --accent-soft: rgba(154, 91, 18, .12);
  --accent-contrast: #fff8ea;
  --focus: #0e7a72;
  --danger: #b3261e;
  --ok: #1a7f4b;

  --ink: #0c0d12;
  --gold: #c9892e;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(60, 40, 10, .06), 0 1px 3px rgba(60, 40, 10, .05);
  --shadow-md: 0 10px 28px rgba(40, 24, 8, .12), 0 2px 6px rgba(40, 24, 8, .06);
  --shadow-lg: 0 22px 56px rgba(40, 24, 8, .16);

  --maxw: 1120px;
  --gap: clamp(1rem, 2.5vw, 1.75rem);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  --display: "Iowan Old Style", Palatino, "Palatino Linotype", "Book Antiqua",
    "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07080c;
    --bg-alt: #0e1118;
    --bg-sunken: #161b26;
    --surface: #12161f;
    --border: #232a39;
    --border-strong: #3a4458;
    --text: #f4efe4;
    --text-muted: #b7b0a0;
    --text-soft: #8d8678;
    --accent: #e4b15a;
    --accent-hover: #f0c574;
    --accent-soft: rgba(228, 177, 90, .14);
    --accent-contrast: #140f08;
    --focus: #7ee8d6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(90rem 40rem at 108% -12%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 54%),
    radial-gradient(56rem 30rem at -14% 6%, color-mix(in srgb, var(--focus) 10%, transparent), transparent 48%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

::selection {
  background: color-mix(in srgb, var(--accent) 36%, transparent);
  color: var(--text);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: .07;
  background-image: url("../img/grain.svg");
  background-size: 180px 180px;
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  body::after { opacity: .16; mix-blend-mode: overlay; }
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; color: var(--text); font-weight: 700; }
h1 {
  font-family: var(--display);
  font-size: clamp(2.15rem, 5.4vw, 3.7rem);
  letter-spacing: -.035em;
  margin: 0 0 .5rem;
  font-weight: 600;
}
h2 {
  font-family: var(--display);
  font-size: clamp(1.45rem, 3.1vw, 2.05rem);
  letter-spacing: -.02em;
  margin: 2rem 0 .75rem;
  font-weight: 600;
}
h3 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; }
p { margin: 0 0 1rem; }

code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--bg-sunken);
  padding: .12em .38em;
  border-radius: 6px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--accent); color: var(--accent-contrast);
  padding: .6rem 1rem; border-radius: var(--radius-sm); transition: top .15s;
}
.skip-link:focus { top: 8px; text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }

/* --- Header ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 0;
}
.site-header::after {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--focus) 38%, transparent 86%);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-name {
  font-family: var(--display);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -.03em;
}

.primary-nav { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.primary-nav ul { list-style: none; display: flex; gap: .35rem; margin: 0; padding: 0; }
.primary-nav a {
  display: inline-block; color: var(--text-muted); font-weight: 600; font-size: .96rem;
  padding: .45rem .6rem; border-radius: var(--radius-sm);
}
.primary-nav a:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.primary-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.nav-search { display: flex; align-items: center; background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: 999px; padding: .1rem .1rem .1rem .75rem; }
.nav-search input { border: 0; background: transparent; color: var(--text); padding: .4rem .25rem; width: 9rem; font: inherit; }
.nav-search input:focus { outline: none; }
.nav-search button { display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: var(--accent); color: var(--accent-contrast);
  width: 34px; height: 34px; border-radius: 999px; cursor: pointer; }
.nav-search button:hover { background: var(--accent-hover); }

.nav-toggle { display: none; margin-left: auto; flex-direction: column; gap: 5px;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  width: 44px; height: 40px; align-items: center; justify-content: center; cursor: pointer; }
.nav-toggle-bar { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .primary-nav {
    position: fixed; inset: 64px 0 auto 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 1rem;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 1rem clamp(1rem, 4vw, 2rem) 1.5rem;
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .primary-nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .primary-nav ul { flex-direction: column; gap: .15rem; }
  .primary-nav a { padding: .7rem .6rem; font-size: 1.05rem; }
  .nav-search { width: 100%; }
  .nav-search input { width: 100%; }
}

/* --- Layout helpers -------------------------------------------------------- */
section { scroll-margin-top: 80px; }
.section { padding: clamp(2.6rem, 6.4vw, 5rem) 0; }
.section-alt {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bg-alt)), var(--bg-alt));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--accent) 18%, transparent);
}
.section-head { max-width: 60ch; margin-bottom: 1.75rem; }
.section-head p { color: var(--text-muted); margin: 0; font-size: 1.05rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 .45rem;
}
.section-link { font-weight: 600; }

.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }

/* --- Buttons & tags -------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; font-size: 1rem;
  padding: .7rem 1.2rem; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  transition: background .15s, border-color .15s, transform .2s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-alt); text-decoration: none; }
.btn-block { width: 100%; justify-content: center; }

.tag,
.kicker {
  display: block;
  width: fit-content;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  padding: 0;
  border-radius: 0;
}
.tag::after,
.kicker::after {
  content: "";
  display: block;
  width: 1.35rem;
  height: 1px;
  margin-top: .38rem;
  background: currentColor;
  opacity: .5;
}
.pill { display: inline-block; font-size: .85rem; color: var(--text-muted);
  background: var(--bg-alt); border: 1px solid var(--border); padding: .3rem .7rem; border-radius: 999px; }
.pill:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.pill[aria-current="true"] {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
}
.pill-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* --- Cards ----------------------------------------------------------------- */
.card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 70%, var(--accent));
  border-radius: var(--radius); padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow-sm);
  transition: transform .28s ease, box-shadow .28s ease, border-color .2s;
  position: relative;
  overflow: hidden;
}
.card:not(.card-photo) {
  background-image:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 38%),
    url("../img/grain.svg");
  background-size: auto, 160px 160px;
}
a.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong));
  text-decoration: none;
}
.card h3 { margin: .35rem 0 .4rem; font-size: 1.15rem; }
.card p { color: var(--text-muted); margin: 0; font-size: .97rem; }
.card .card-meta { margin-top: auto; padding-top: .9rem; color: var(--text-soft); font-size: .84rem; }
.card-title-link { color: var(--text); }

.card-photo { padding: 0; }
.card-media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-sunken);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  transition: transform .8s ease;
}
a.card-photo:hover .card-media img { transform: scale(1.09); }
.card-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.1rem 1.2rem 1.25rem;
}

/* --- Hero ------------------------------------------------------------------ */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem); background:
    radial-gradient(1200px 500px at 80% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(900px 400px at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 55%); }
.hero-photo {
  min-height: min(86vh, 720px);
  display: flex;
  align-items: flex-end;
  padding: clamp(5rem, 13vw, 8.5rem) 0 clamp(3rem, 6vw, 4.6rem);
  background: #0a0a0c;
}
.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  animation: hero-drift 28s ease-in-out infinite alternate;
}
.hero-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(7,8,12,.28) 0%, rgba(7,8,12,.55) 46%, rgba(7,8,12,.88) 100%),
    linear-gradient(90deg, rgba(7,8,12,.5), transparent 55%);
}
.hero-inner { max-width: 46rem; position: relative; z-index: 1; }
.hero-photo .hero-inner { color: #f4efe4; }
.hero-photo h1 { color: #f7f1e6; text-shadow: 0 16px 48px rgba(0,0,0,.5); max-width: 16ch; }
.hero-photo .lead { color: #d8d0c0; max-width: 42ch; }
.hero-photo .eyebrow { color: #e4b15a; }
.hero-photo .btn-primary { box-shadow: 0 10px 30px rgba(228, 177, 90, .28); }
.hero-photo .btn-ghost { color: #f4efe4; border-color: rgba(244,239,228,.4); }
.hero-photo .wavebar span { background: #e4b15a; }
.hero p.lead { font-size: clamp(1.1rem, 2.4vw, 1.35rem); color: var(--text-muted); margin: .5rem 0 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

@keyframes hero-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.1) translate3d(-1.5%, -1%, 0); }
}

/* Photo tiles */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr));
  gap: .75rem;
}
.tile-grid-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 26%, transparent), var(--shadow-sm);
}
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform .7s ease;
}
.tile:nth-child(2n) img { object-position: 72% 40%; }
.tile:nth-child(3n) img { object-position: 28% 70%; }
.tile:nth-child(4n) img { object-position: 50% 20%; }
.tile-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(8,8,10,.82) 100%);
}
.tile-label {
  position: absolute; left: .8rem; right: .7rem; bottom: .75rem;
  color: #f6f1e6;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -.02em;
}
.tile:hover { text-decoration: none; }
.tile:hover img { transform: scale(1.1); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.split-panel {
  position: relative;
  display: block;
  min-height: 340px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: #f4efe4;
  box-shadow: var(--shadow-md);
}
.split-panel img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s ease;
}
.split-panel:hover { text-decoration: none; color: #f4efe4; }
.split-panel:hover img { transform: scale(1.06); }
.split-copy {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 340px;
  padding: 1.6rem 1.5rem;
  background: linear-gradient(180deg, transparent 20%, rgba(7,8,12,.82) 100%);
}
.split-copy h2 { color: #f6f1e6; margin: .2rem 0 .5rem; }
.split-copy p { color: #d5cdbe; }
.split-copy .section-link { color: #e4b15a; }

.masthead,
.page-hero {
  margin-top: 1rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 21 / 8;
  min-height: 180px;
  position: relative;
  box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.page-hero { margin: 0 0 1.75rem; max-height: 280px; }
.masthead img,
.page-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.page-hero::after,
.masthead::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 48%, rgba(7,8,12,.28) 100%);
}

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .masthead,
  .page-hero { aspect-ratio: 16 / 8; }
}

/* --- Waveform accent (decorative, CSS only) -------------------------------- */
.wavebar { display: flex; align-items: flex-end; gap: 3px; height: 34px; margin-top: 2rem; }
.wavebar span {
  width: 5px; background: var(--accent); border-radius: 3px; opacity: .55; height: 50%;
  transform-origin: bottom;
  animation: wave 1.35s ease-in-out infinite;
}
.wavebar span:nth-child(odd) { animation-duration: 1.15s; }
.wavebar span:nth-child(3n) { animation-delay: .12s; }

@keyframes wave {
  0%, 100% { transform: scaleY(.45); }
  50% { transform: scaleY(1); }
}
.wavebar span:nth-child(1) { height: 40%; }
.wavebar span:nth-child(2) { height: 70%; }
.wavebar span:nth-child(3) { height: 55%; }
.wavebar span:nth-child(4) { height: 90%; }
.wavebar span:nth-child(5) { height: 60%; }
.wavebar span:nth-child(6) { height: 100%; }
.wavebar span:nth-child(7) { height: 45%; }
.wavebar span:nth-child(8) { height: 75%; }
.wavebar span:nth-child(9) { height: 50%; }
.wavebar span:nth-child(10) { height: 85%; }
.wavebar span:nth-child(11) { height: 35%; }
.wavebar span:nth-child(12) { height: 65%; }
.wavebar span:nth-child(13) { height: 95%; }
.wavebar span:nth-child(14) { height: 55%; }
.wavebar span:nth-child(15) { height: 70%; }

/* --- Definition / detail pages --------------------------------------------- */
.breadcrumbs { font-size: .85rem; color: var(--text-soft); padding: 1.25rem 0 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.breadcrumbs li::after { content: "/"; margin-left: .4rem; color: var(--border-strong); }
.breadcrumbs li:last-child::after { content: ""; }

.article { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.article-body { min-width: 0; max-width: 68ch; }
.article-body h2 { border-top: 1px solid var(--border); padding-top: 1.5rem; }
.article-body h2:first-of-type { border-top: 0; padding-top: 0; }
.article-body ul, .article-body ol { padding-left: 1.3rem; }
.article-body li { margin: .35rem 0; }
.article-lead {
  font-family: var(--display);
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  line-height: 1.5;
  color: var(--text-muted);
}

.aside { position: sticky; top: 84px; display: grid; gap: 1.25rem; }
.aside .box { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.aside h2 { font-size: .95rem; margin: 0 0 .6rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-soft); }
.aside ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.aside a { font-size: .95rem; }

@media (max-width: 860px) {
  .article { grid-template-columns: 1fr; }
  .aside { position: static; }
}

.callout { background: var(--accent-soft); border-left: 4px solid var(--accent);
  padding: .9rem 1.1rem; border-radius: var(--radius-sm); margin: 1.25rem 0; color: var(--text); }
.note-block { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .9rem 1.1rem; color: var(--text-muted); font-size: .95rem; }

.formula { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .85rem 1rem; margin: .75rem 0; }
.formula code { background: transparent; padding: 0; font-size: 1rem; color: var(--text); }
.formula-note { display: block; color: var(--text-soft); font-size: .88rem; margin-top: .35rem; }
.steps { counter-reset: step; }

/* --- Definition list / key-value ------------------------------------------- */
.kv { display: grid; gap: .75rem; margin: 1rem 0; }
.kv > div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.kv dt { font-weight: 700; margin-bottom: .2rem; }
.kv dd { margin: 0; color: var(--text-muted); }

/* --- Glossary index -------------------------------------------------------- */
.alpha-nav { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1rem 0 2rem; }
.alpha-nav a { display: inline-flex; width: 2.1rem; height: 2.1rem; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 999px; font-weight: 700; color: var(--text-muted); }
.alpha-nav a:hover { background: var(--accent); color: var(--accent-contrast); border-color: transparent; text-decoration: none; }
.letter-group { margin-bottom: 2rem; }
.letter-group h2 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  color: var(--accent);
  line-height: 1;
}

/* --- Tools ----------------------------------------------------------------- */
.tool-shell { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: clamp(1.5rem,4vw,3rem); align-items: start; }
@media (max-width: 860px) { .tool-shell { grid-template-columns: 1fr; } }
.tool-panel { background: var(--surface); border: 1px solid color-mix(in srgb, var(--border) 70%, var(--accent));
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: var(--shadow-md), inset 0 1px 0 color-mix(in srgb, var(--accent) 16%, transparent); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; }
.field .hint { color: var(--text-soft); font-size: .85rem; font-weight: 400; }
.field input, .field select {
  width: 100%; padding: .65rem .8rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }

.result-display {
  text-align: center; padding: 1.6rem 1rem;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 62%),
    var(--bg-alt);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: var(--radius); margin-bottom: 1.25rem;
}
.result-display .big { font-size: clamp(2.4rem, 9vw, 3.6rem); font-weight: 800; letter-spacing: -.03em; color: var(--accent); line-height: 1; }
.result-display .big small { font-size: .35em; color: var(--text-soft); font-weight: 600; letter-spacing: 0; }
.result-display .sub { color: var(--text-muted); margin-top: .4rem; }

.tap-target { width: 100%; padding: 2rem 1rem; font-size: 1.3rem; font-weight: 700; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }

.result-table { width: 100%; border-collapse: collapse; margin-top: .5rem; font-variant-numeric: tabular-nums; }
.result-table caption { text-align: left; color: var(--text-soft); font-size: .88rem; margin-bottom: .5rem; }
.result-table th, .result-table td { text-align: right; padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
.result-table th:first-child, .result-table td:first-child { text-align: left; }
.result-table thead th { color: var(--text-soft); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }

.error-text { color: var(--danger); font-size: .9rem; margin-top: .35rem; }
[hidden] { display: none !important; }

/* --- Timelines ------------------------------------------------------------- */
.timeline { list-style: none; margin: 1.5rem 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 1.5rem 2.2rem; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px;
  background: var(--accent); border: 3px solid var(--bg); border-radius: 50%; }
.timeline .period { font-weight: 700; display: block; }
.timeline .event-text { color: var(--text-muted); }

/* --- Footer ---------------------------------------------------------------- */
.site-footer {
  background:
    radial-gradient(60rem 24rem at 90% 0%, rgba(228,177,90,.12), transparent 55%),
    var(--ink);
  border-top: 2px solid color-mix(in srgb, #e4b15a 58%, transparent);
  padding: clamp(2.8rem,5vw,4rem) 0 2rem;
  margin-top: 3.5rem;
  color: #d8d0c0;
}
.site-footer .brand-name,
.site-footer .footer-tagline { color: #f4efe4; }
.site-footer .footer-note { color: #9c9484; }
.site-footer .footer-col h2 { color: #e4b15a; }
.site-footer .footer-col a { color: #b7b0a0; }
.site-footer .footer-col a:hover { color: #e4b15a; }
.site-footer .footer-bottom { color: #8d8678; border-color: #23232c; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 2rem; }
.footer-tagline { font-weight: 600; margin: .75rem 0 .5rem; }
.footer-note { color: var(--text-soft); font-size: .88rem; max-width: 32ch; }
.footer-col h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); margin: 0 0 .75rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-col a { color: var(--text-muted); font-size: .93rem; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1.5rem; color: var(--text-soft); font-size: .87rem; }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }

/* --- Search ---------------------------------------------------------------- */
.search-form-lg { display: flex; gap: .6rem; margin: 1.5rem 0 2rem; max-width: 40rem; }
.search-form-lg input { flex: 1; padding: .8rem 1rem; font: inherit; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
.search-form-lg input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.result-item { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.result-item h3 { margin: 0 0 .25rem; }
.result-item .kind { font-size: .78rem; }
.result-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 70%, var(--accent));
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}
.result-card:hover {
  text-decoration: none;
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong));
}
.result-media { display: block; min-height: 100%; background: var(--bg-sunken); }
.result-media img { width: 100%; height: 100%; object-fit: cover; }
.result-copy { padding: 1rem 1.1rem 1.1rem; }
.result-copy h3 { margin: .2rem 0 .35rem; font-size: 1.12rem; }
.result-copy p { margin: 0; color: var(--text-muted); font-size: .95rem; }
@media (max-width: 560px) {
  .result-card { grid-template-columns: 96px minmax(0, 1fr); }
}

/* --- Misc ------------------------------------------------------------------ */
.lead-list { columns: 2; column-gap: 2rem; }
@media (max-width: 560px) { .lead-list { columns: 1; } }
.center { text-align: center; }
.actions-center { justify-content: center; }
.text-center-block { text-align: center; margin: .75rem 0; }
.result-display .big.big-sm { font-size: clamp(1.6rem, 6vw, 2.2rem); }
.textarea { width: 100%; padding: .65rem .8rem; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.muted { color: var(--text-muted); }
.mt-2 { margin-top: 2rem; }
.stack > * + * { margin-top: 1rem; }
.faq { display: grid; gap: .15rem; }
.faq dt {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.12rem;
  margin-top: 1.15rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}
.faq dt:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.faq dd { margin: .3rem 0 0; color: var(--text-muted); }
.subgenre-list { list-style: none; padding: 0; display: grid; gap: .75rem; }
.subgenre-list strong { display: block; }
.subgenre-list span { color: var(--text-muted); font-size: .95rem; }
