/*
  Small Audio website: Track Mixer and Mic Enhancer.
  Follows the apps' design guide (IEM Mixer/Design/DESIGN.md):
  black, flat, tight, 2 px corners, uppercase semibold labels,
  colour only for meaning, neon glow only where something is "lit".
*/

:root {
    --bg: #000;
    --panel: rgba(255, 255, 255, 0.06);
    --subtle: rgba(255, 255, 255, 0.04);
    --outline: rgba(142, 142, 147, 0.35);
    --outline-faint: rgba(142, 142, 147, 0.25);
    --text: #fff;
    --secondary: rgba(235, 235, 245, 0.6);

    /* iOS dark-mode system colours */
    --red: #ff453a;
    --orange: #ff9f0a;
    --yellow: #ffd60a;
    --green: #30d158;
    --blue: #0a84ff;
    --purple: #bf5af2;

    --radius: 2px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

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

/* ---------- Labels & type ---------- */

.label,
.nav a,
.button,
.status {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

h1, h2, h3 {
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.01em;
    margin: 0 0 12px;
}

h1 { font-size: clamp(34px, 6vw, 56px); }
h2 { font-size: 30px; margin-top: 8px; }
h3 { font-size: 17px; }

p { margin: 0 0 14px; }

.secondary { color: var(--secondary); }

.lede {
    font-size: 20px;
    color: var(--secondary);
    max-width: 640px;
}

code, kbd, .mono {
    font-family: var(--mono);
    font-size: 0.9em;
}

kbd {
    padding: 1px 6px;
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    background: var(--panel);
    text-transform: uppercase;
    font-family: var(--font);
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
    border-bottom: 1px solid var(--outline-faint);
    position: sticky;
    top: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
}

.site-header .wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 52px;
}

.brand {
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    font-size: 15px;
    margin-right: auto;
}

.nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nav a {
    text-decoration: none;
    color: var(--secondary);
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: var(--radius);
}

.nav a:hover { color: var(--text); border-color: var(--outline); }

.nav a[aria-current="page"] {
    color: var(--text);
    background: var(--panel);
    border-color: var(--outline);
}

/* ---------- Buttons ---------- */

.buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 24px 0 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 16px;
    text-decoration: none;
    color: var(--secondary);
    background: var(--panel);
    border: 1px solid var(--outline);
    border-radius: var(--radius);
}

.button:hover { color: var(--text); }

/* State button, "on": black text on a solid colour. */
.button.on {
    color: #000;
    border-color: transparent;
}
.button.on.green { background: var(--green); }
.button.on.yellow { background: var(--yellow); }

/* Control button: text and outline in its own colour. */
.button.green:not(.on) { color: var(--green); border-color: rgba(48, 209, 88, 0.45); }
.button.yellow:not(.on) { color: var(--yellow); border-color: rgba(255, 214, 10, 0.45); }

/* ---------- Sections ---------- */

section { padding: 56px 0; }
section + section { border-top: 1px solid var(--outline-faint); }

.hero { padding: 64px 0 56px; }

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
}

@media (max-width: 800px) {
    .hero-grid { grid-template-columns: 1fr; }
}

.eyebrow {
    color: var(--secondary);
    margin-bottom: 10px;
    display: block;
}

/* ---------- Status line ---------- */

.status {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--secondary);
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    transform: translateY(-1px);
}
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.status .green { color: var(--green); }

/* Readouts like "48 kHz · 144 frames" keep their case, as in the app. */
.status .mono {
    text-transform: none;
    letter-spacing: 0;
}

/* ---------- Cards ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

.grid.two { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }

@media (max-width: 500px) {
    .grid.two { grid-template-columns: 1fr; }
}

.card {
    padding: 16px;
    background: var(--panel);
    border: 1px solid var(--outline);
    border-radius: var(--radius);
}

.card h3 { margin-bottom: 6px; }
.card p { color: var(--secondary); font-size: 15px; margin: 0; }
.card p + p { margin-top: 10px; }

/* Thin accent line along the top of a card, like the fader cap's line. */
.card[data-accent] { border-top: 2px solid var(--accent); }
[data-accent="red"] { --accent: var(--red); }
[data-accent="orange"] { --accent: var(--orange); }
[data-accent="yellow"] { --accent: var(--yellow); }
[data-accent="green"] { --accent: var(--green); }
[data-accent="blue"] { --accent: var(--blue); }
[data-accent="purple"] { --accent: var(--purple); }

a.card { text-decoration: none; display: block; }
a.card:hover { border-color: rgba(255, 255, 255, 0.6); }

.app-card h2 { font-size: 26px; margin-bottom: 8px; }
.app-card .buttons { margin-top: 18px; }

/* ---------- Segmented fader (signature element) ---------- */

.console {
    display: flex;
    gap: 18px;
    justify-content: center;
    align-items: flex-end;
    padding: 24px 20px 18px;
    background: var(--subtle);
    border: 1px solid var(--outline);
    border-radius: var(--radius);
}

.strip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.fader {
    --level: 60%;
    position: relative;
    width: 13px;
    height: var(--meter-height);
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: var(--radius);
    box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* Unlit segments: accent at 16 %, so the scale stays visible. */
.fader::before,
.fader::after {
    content: "";
    position: absolute;
    left: 3px;
    right: 3px;
    bottom: 3px;
    border-radius: 1px;
    background: repeating-linear-gradient(
        to top,
        var(--seg) 0 2.6px,
        transparent 2.6px 4.6px
    );
}

.fader::before {
    --seg: color-mix(in srgb, var(--accent) 16%, transparent);
    top: 3px;
}

/* Lit segments: full accent with a glow. */
.fader::after {
    --seg: var(--accent);
    height: calc((100% - 6px) * var(--level) / 100%);
    filter: drop-shadow(0 0 3px var(--accent));
}

.fader .cap {
    position: absolute;
    left: 50%;
    bottom: calc(var(--level) - 10px);
    width: 38px;
    height: 20px;
    transform: translateX(-50%);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.92),
        rgba(184, 184, 184, 1) 40%,
        rgba(107, 107, 107, 1) 60%,
        rgba(173, 173, 173, 1)
    );
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.fader .cap::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28px;
    height: 2px;
    transform: translate(-50%, -50%);
    background: var(--accent);
}

.strip .value {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
}

.strip .name {
    font-size: 11px;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
}

/* Level meter: thin segments coloured by height. */
.meter {
    --level: 70%;
    width: 9px;
    height: var(--meter-height);
    position: relative;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid var(--outline-faint);
    border-radius: var(--radius);
    -webkit-mask: repeating-linear-gradient(to top, #000 0 2.6px, transparent 2.6px 4.6px);
    mask: repeating-linear-gradient(to top, #000 0 2.6px, transparent 2.6px 4.6px);
}

.meter::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--level);
    /* Colour by height of the whole meter, not of the lit part:
       green to 70 %, yellow to 85 %, orange to 94 %, red above. */
    background: linear-gradient(to top, var(--green) 0 70%, var(--yellow) 70% 85%, var(--orange) 85% 94%, var(--red) 94%);
    background-size: 100% var(--meter-height);
    background-position: bottom;
    filter: drop-shadow(0 0 2px var(--green));
}

.console { --meter-height: 240px; }

@media (max-width: 500px) {
    .console { gap: 12px; --meter-height: 180px; }
    .fader, .meter { height: var(--meter-height); }
}

/* ---------- Screenshots ---------- */

.shots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 8px;
}

.shot {
    margin: 0;
    background: var(--subtle);
    border: 1px solid var(--outline);
    border-radius: var(--radius);
    overflow: hidden;
}

.shot img { width: 100%; height: auto; }

/* Phone screenshots in portrait: four across on desktop, two on phones. */
.shots.portrait { grid-template-columns: repeat(4, 1fr); }

/* Wide landscape screenshots: the first full width, then two across. */
.shots.landscape { grid-template-columns: repeat(2, 1fr); }
.shots.landscape .shot:first-child { grid-column: 1 / -1; }

@media (max-width: 800px) {
    .shots.portrait { grid-template-columns: repeat(2, 1fr); }
    .shots.landscape { grid-template-columns: 1fr; }
}

/* Shown until a real screenshot is dropped in. */
.shot .placeholder {
    aspect-ratio: 19.5 / 9;
    display: grid;
    place-items: center;
    color: var(--secondary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    border-bottom: 1px solid var(--outline-faint);
}

.shot figcaption {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--secondary);
}

/* ---------- Signal chain ---------- */

.chain {
    display: flex;
    gap: 6px;
    align-items: stretch;
    flex-wrap: wrap;
}

.chain .step {
    flex: 1 1 150px;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--outline);
    border-radius: var(--radius);
}

.chain .step .label { display: block; margin-bottom: 4px; }
.chain .step span.secondary { font-size: 14px; }

/* ---------- Guide ---------- */

.guide {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    padding: 40px 0 72px;
}

@media (max-width: 800px) {
    .guide { grid-template-columns: 1fr; }
    .toc { position: static !important; }
}

.toc {
    position: sticky;
    top: 72px;
    align-self: start;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--outline);
    border-radius: var(--radius);
}

.toc ol { list-style: none; margin: 8px 0 0; padding: 0; }
.toc li a {
    display: block;
    padding: 4px 0;
    font-size: 14px;
    color: var(--secondary);
    text-decoration: none;
}
.toc li a:hover { color: var(--text); }

.guide article h2 {
    font-size: 24px;
    padding-top: 28px;
    margin-top: 28px;
    border-top: 1px solid var(--outline-faint);
    scroll-margin-top: 60px;
}

.guide article h2:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }

.guide article h3 { margin-top: 22px; }

.guide article ol,
.guide article ul { padding-left: 22px; margin: 0 0 14px; }
.guide article li { margin-bottom: 6px; }

.note {
    padding: 12px 14px;
    margin: 0 0 14px;
    background: var(--subtle);
    border: 1px solid var(--outline-faint);
    border-left: 2px solid var(--accent, var(--yellow));
    border-radius: var(--radius);
    font-size: 15px;
}

.note .label { display: block; margin-bottom: 2px; color: var(--accent, var(--yellow)); }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 16px;
    font-size: 15px;
}

th, td {
    text-align: left;
    padding: 8px 10px;
    border: 1px solid var(--outline-faint);
    vertical-align: top;
}

th {
    background: var(--subtle);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--secondary);
}

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--outline-faint);
    padding: 24px 0 40px;
    color: var(--secondary);
    font-size: 13px;
}

.site-footer .wrap {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.site-footer a { color: var(--secondary); }

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
    .nav a, .button, a.card { transition: color 0.15s, border-color 0.15s; }
}

/* ---------- App icons ---------- */

/* iOS-style rounded square, with a faint edge so it sits on black. */
.app-icon {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 22.5%;
    margin-bottom: 14px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 6px 18px rgba(0, 0, 0, 0.6);
}

.app-icon.large {
    width: 112px;
    height: 112px;
    margin-bottom: 18px;
}

/* Single-column text pages (privacy, support): the guide layout without contents. */
.guide.single { grid-template-columns: minmax(0, 760px); }
