/* Tonecast — a late-night recording studio: warm black, paper-white type, one on-air orange. */
:root {
  --bg: #14110f;
  --bg-2: #1b1714;
  --panel: #211c18;
  --panel-2: #2a231e;
  --line: #3a312a;
  --ink: #f3ead8;
  --muted: #b3a690;
  --faint: #7d7163;
  --signal: #ff6a2b;
  --signal-soft: #ff6a2b22;
  --amber: #f2c46d;
  --ok: #9bd88a;
  --display: 'Instrument Serif', Georgia, serif;
  --body: 'Hanken Grotesk', 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--body);
  background-image: radial-gradient(1200px 600px at 80% -10%, #ff6a2b14, transparent 60%), radial-gradient(900px 500px at -10% 30%, #f2c46d0d, transparent 60%);
  background-attachment: fixed;
}
body::before { /* film grain */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration-color: var(--signal); text-underline-offset: 3px; }
a:hover { color: var(--signal); }
code, .mono { font-family: var(--mono); font-size: .82em; }
code { background: var(--panel-2); padding: .1em .4em; border-radius: 5px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.mono { letter-spacing: .02em; color: var(--muted); }

/* Header & footer */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; max-width: 1240px; margin: auto; padding: 16px 28px; background: #14110fd9; backdrop-filter: blur(10px); border-bottom: 1px solid #3a312a80; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 400 26px/1 var(--display); text-decoration: none; letter-spacing: -.01em; }
.brand-lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px var(--signal-soft), 0 0 18px var(--signal); }
.top nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
.cta { font-size: 14px; font-weight: 600; text-decoration: none; padding: 8px 14px; border: 1px solid var(--signal); border-radius: 999px; color: var(--signal); }
.cta:hover { background: var(--signal); color: var(--bg); }
.foot { max-width: 1240px; margin: 80px auto 0; padding: 40px 28px 48px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 2fr; gap: 24px; color: var(--muted); font-size: 15px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 22px; align-content: start; justify-content: end; }
.foot nav a { text-decoration: none; }
.foot p { margin: 8px 0 0; }
.fine { grid-column: 1 / -1; font-size: 13px; color: var(--faint); }

/* Hero */
.home { max-width: 1240px; margin: auto; padding: 0 28px; }
.hero { padding: 48px 0 24px; position: relative; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); display: flex; align-items: center; gap: 10px; margin: 0 0 22px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
h1 { font: 400 clamp(44px, 5.6vw, 80px)/.98 var(--display); letter-spacing: -.025em; margin: 0 0 20px; max-width: 20ch; }
h1 em { color: var(--signal); font-style: italic; }
.lede { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 640px; margin: 0; }
.wave { display: flex; align-items: center; gap: 4px; height: 52px; margin-top: 28px; --amp: 1; --speed: 1.1s; }
.wave i { flex: 1; min-width: 2px; height: 100%; border-radius: 3px; background: linear-gradient(var(--signal), var(--amber)); transform: scaleY(calc(var(--h) * var(--amp) * .6)); transform-origin: center; opacity: .85; animation: talk var(--speed) ease-in-out var(--d) infinite alternate; }
@keyframes talk { from { transform: scaleY(calc(var(--h) * var(--amp) * .25)); } to { transform: scaleY(calc(var(--h) * var(--amp))); } }
.wave[data-mood='whispering'], .wave[data-mood='softvoice'] { --amp: .3; --speed: 1.8s; }
.wave[data-mood='sad'], .wave[data-mood='regretful'], .wave[data-mood='saddisappointed'], .wave[data-mood='reflective'], .wave[data-mood='nostalgic'] { --amp: .5; --speed: 1.6s; }
.wave[data-mood='shouting'], .wave[data-mood='angry'] { --amp: 1.15; --speed: .38s; }
.wave[data-mood='excited'], .wave[data-mood='joyful'], .wave[data-mood='happy'], .wave[data-mood='surprised'] { --amp: 1; --speed: .55s; }
.wave[data-mood='fearful'], .wave[data-mood='confused'], .wave[data-mood='embarrassed'] { --amp: .7; --speed: .7s; }

/* Studio */
.studio { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--panel); box-shadow: 0 40px 120px -40px #000, inset 0 1px #ffffff0d; scroll-margin-top: 90px; }
.deck { padding: 28px; border-right: 1px solid var(--line); min-width: 0; }
.deck-top { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.lamp { width: 9px; height: 9px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 12px var(--signal); }
.deck-meta { margin-left: auto; color: var(--amber); font-size: 11px; }
.field-label { display: block; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }
textarea { width: 100%; min-height: 170px; resize: vertical; background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; font: 400 22px/1.45 var(--display); }
textarea:focus { border-color: var(--signal); outline: none; box-shadow: 0 0 0 4px var(--signal-soft); }
.text-meta { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 22px; }
.over { color: var(--signal) !important; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; padding: 4px; }
.link-btn:hover { color: var(--ink); }
.controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; margin-bottom: 22px; }
.control-model { grid-column: 1 / -1; }
.control-model .seg { display: inline-flex; }
select { width: 100%; appearance: none; background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6' fill='%23b3a690'/%3E%3C/svg%3E") no-repeat right 14px center; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 11px 34px 11px 13px; font: 500 15px var(--body); }
.seg { display: flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); font: 600 14px var(--body); padding: 8px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.seg button small { font: 400 11px var(--mono); color: var(--faint); margin-left: 3px; }
.seg [aria-checked='true'] { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--muted); font: 500 13px var(--body); padding: 5px 11px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip[aria-checked='true'] { background: var(--signal); border-color: var(--signal); color: #1a0f08; font-weight: 600; }
.hint { min-height: 1.2em; margin: 12px 0 0; font-size: 14px; color: var(--amber); }

.output { min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 16px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.meter { border: 1px solid var(--line); border-radius: var(--r); background: repeating-linear-gradient(90deg, #ffffff06 0 1px, transparent 1px 40px), var(--bg-2); padding: 10px; }
#scope { width: 100%; height: 120px; display: block; }
.go { position: relative; border: 0; border-radius: var(--r); background: var(--signal); color: #1a0f08; font: 700 18px var(--body); padding: 18px; cursor: pointer; transition: transform .1s, box-shadow .2s; box-shadow: 0 10px 40px -10px var(--signal); }
.go:hover { transform: translateY(-1px); box-shadow: 0 16px 50px -10px var(--signal); }
.go:active { transform: translateY(1px); }
.go:disabled { cursor: progress; }
.go.soon { background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); cursor: not-allowed; transform: none; }
.go.busy span::after { content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 10px; border-radius: 50%; background: #1a0f08; animation: blink .8s steps(2) infinite; }
.status { margin: 0; min-height: 1.4em; font-size: 15px; color: var(--muted); }
.status[data-tone='ok'] { color: var(--ok); }
.status[data-tone='warn'] { color: var(--signal); }
.status[data-tone='info'] { color: var(--amber); }
.player audio { width: 100%; }
.player-actions { display: flex; gap: 10px; margin-top: 10px; }
.btn { display: inline-block; background: var(--ink); color: var(--bg); border: 0; border-radius: 10px; padding: 10px 16px; font: 600 15px var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--amber); color: var(--bg); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); margin-top: 10px; }
.ssml summary { cursor: pointer; color: var(--muted); font-size: 15px; }
.ssml summary .mono { font-size: 11px; color: var(--faint); margin-left: 6px; }
.code { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; font: 400 13px/1.65 var(--mono); color: #e9dcc3; margin: 14px 0; }
.code code { background: none; padding: 0; font-size: inherit; }
.takes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.takes li { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); }
.takes .mono { font-size: 11px; align-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.take-text { grid-column: 2; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Sections */
section { margin-top: 96px; }
.hero, .studio { margin-top: 0; }
.studio { margin-top: 8px; }
.section-head { max-width: 640px; margin-bottom: 30px; }
.kicker { font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--signal); }
h2 { font: 400 clamp(32px, 4vw, 52px)/1.02 var(--display); letter-spacing: -.015em; margin: 12px 0 14px; }
.section-head p { color: var(--muted); margin: 0; }
.band { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 28px 22px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat b { display: block; font: 400 60px/1 var(--display); color: var(--ink); }
.stat b small { font-size: 22px; color: var(--muted); }
.stat span { font-size: 14px; color: var(--muted); }
.mood-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.mood { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 18px 16px; cursor: pointer; color: var(--ink); display: flex; flex-direction: column; gap: 14px; transition: border-color .2s, transform .2s; }
.mood:hover { border-color: var(--signal); transform: translateY(-2px); }
.mood-name { font: italic 400 30px/1 var(--display); }
.mood .mono { font-size: 11px; color: var(--faint); }
.more { margin-top: 18px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.split p { color: var(--muted); }
.split b { color: var(--ink); font-weight: 600; }
.steps ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; color: var(--muted); }
.steps li::before { content: '0' counter(s); display: block; font: 400 44px/1 var(--display); color: var(--signal); margin-bottom: 14px; }
.steps b { display: block; color: var(--ink); margin-bottom: 4px; }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 0; max-width: 820px; }
.faq summary { cursor: pointer; font: 400 26px/1.25 var(--display); list-style: none; display: flex; justify-content: space-between; gap: 20px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--signal); font-family: var(--mono); }
.faq details[open] summary::after { content: '–'; }
.faq p { color: var(--muted); margin: 12px 0 0; }

/* Articles */
.article { max-width: 980px; margin: auto; padding: 64px 28px 0; }
.article h1 { font-size: clamp(42px, 6vw, 76px); max-width: 18ch; }
.article h2 { font-size: clamp(28px, 3.2vw, 40px); margin-top: 48px; }
.article p, .article li { color: #ddd1bb; max-width: 74ch; }
.article li { margin-bottom: 8px; }
.article .lede { color: var(--muted); margin-bottom: 30px; }
.source { font-size: 14px; color: var(--faint) !important; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 48px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); margin: 18px 0; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
td { padding: 12px 14px; border-bottom: 1px solid #3a312a99; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td b { display: block; }
td .mono { font-size: 11px; }
.styles span { display: inline-block; font-size: 12px; padding: 2px 8px; margin: 0 4px 4px 0; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.try { font-weight: 600; color: var(--signal); }
.filter { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; margin: 26px 0 10px; }
.filter label { width: 100%; margin: 0; }
.filter input { flex: 1; min-width: 220px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); padding: 12px 14px; font: 500 16px var(--body); }

/* Motion & responsive */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 960px) {
  .studio { grid-template-columns: 1fr; }
  .deck { border-right: 0; border-bottom: 1px solid var(--line); }
  .band { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .split, .steps ol { grid-template-columns: 1fr; }
  .top nav { display: none; }
  .cta { margin-left: auto; }
}
@media (max-width: 600px) {
  .top, .home, .article, .foot { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 36px; }
  .wave { gap: 2px; }
  .wave i:nth-child(n+41) { display: none; }
  .deck, .output { padding: 18px; }
  .controls { grid-template-columns: 1fr; }
  .control-model { grid-column: auto; }
  textarea { font-size: 19px; }
  .stat b { font-size: 44px; }
  .foot { grid-template-columns: 1fr; }
  .foot nav { justify-content: start; }
  .voices th:nth-child(3), .voices td:nth-child(3) { display: none; }
  section { margin-top: 72px; }
}
.ssml .code { white-space: pre-wrap; overflow-wrap: anywhere; }
