/* Tray Levels — independent guide to Windows audio
   Direction: an analogue mixing console. Bone chassis paint, graphite panels,
   amber LED metering. Typeset in the operating system's own faces, because the
   subject is a Windows utility. No third-party requests, ever. */

:root {
  --ink: #151814;
  --ink-2: #474d42;
  --ink-3: #6e756a;
  --paper: #eaebe4;
  --paper-2: #f2f3ee;
  --surface: #fdfdfb;
  --chassis: #202318;
  --chassis-2: #2c3024;
  --chassis-3: #454b3a;
  --chassis-4: #6d7461;
  --signal: #d99b16;
  --signal-dim: #8a6410;
  --peak: #b8472f;
  --rule: #cccec2;
  --rule-2: #dcded3;
  --measure: 34rem;

  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system,
             "Helvetica Neue", Arial, sans-serif;
  --body: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
          "Times New Roman", serif;
  --mono: "Cascadia Mono", "Segoe UI Mono", Consolas, ui-monospace,
          "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.25, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.955rem + 0.22vw, 1.09rem);
  line-height: 1.62;
  background-color: var(--paper);
  background-image:
    radial-gradient(60rem 34rem at 78% -8%, rgba(217, 155, 22, 0.13), transparent 62%),
    radial-gradient(46rem 30rem at 4% 4%, rgba(69, 75, 58, 0.09), transparent 60%);
  background-repeat: no-repeat;
}

img, svg { max-width: 100%; }

a { color: inherit; text-decoration-color: var(--signal); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; transition: text-decoration-color 0.18s var(--ease); }
a:hover { text-decoration-color: var(--ink); }

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

.shell { width: min(74rem, 100% - 2.5rem); margin-inline: auto; }

.mono { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }

.skip { position: absolute; left: -9999px; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; z-index: 90; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Reveal on scroll (only when JS is present) ---------- */

.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0s);
}

@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.js .lede > * { animation: rise 0.8s var(--ease) both; }
.js .lede > *:nth-child(2) { animation-delay: 0.09s; }
.js .lede > *:nth-child(3) { animation-delay: 0.18s; }
.js .lede > *:nth-child(4) { animation-delay: 0.27s; }

/* ---------- Masthead ---------- */

.masthead {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--rule);
  background: rgba(234, 235, 228, 0.88);
  backdrop-filter: saturate(1.4) blur(10px);
}
.masthead .shell { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.75rem; padding-block: 0.85rem; }

.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--mono); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; }
.wordmark-meter { display: inline-flex; gap: 2px; align-items: flex-end; height: 15px; }
.wordmark-meter i { display: block; width: 3px; background: var(--signal); border-radius: 1px; transform-origin: bottom; }
.wordmark-meter i:nth-child(1) { height: 5px; }
.wordmark-meter i:nth-child(2) { height: 10px; }
.wordmark-meter i:nth-child(3) { height: 15px; }
.wordmark-meter i:nth-child(4) { height: 8px; background: var(--signal-dim); }
.wordmark-meter i:nth-child(5) { height: 4px; background: var(--signal-dim); }
.wordmark:hover .wordmark-meter i { animation: bounce 0.9s var(--ease) infinite alternate; }
.wordmark:hover .wordmark-meter i:nth-child(2) { animation-delay: 0.08s; }
.wordmark:hover .wordmark-meter i:nth-child(3) { animation-delay: 0.16s; }
.wordmark:hover .wordmark-meter i:nth-child(4) { animation-delay: 0.24s; }
.wordmark:hover .wordmark-meter i:nth-child(5) { animation-delay: 0.32s; }
@keyframes bounce { to { transform: scaleY(0.45); } }

.nav { display: flex; gap: 1.05rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; padding-block: 0.2rem; }
.nav::-webkit-scrollbar { display: none; }
.nav a { font-family: var(--mono); font-size: 0.69rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--ink-2); padding-bottom: 3px; border-bottom: 1.5px solid transparent; transition: color 0.2s var(--ease), border-color 0.2s var(--ease); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); }

/* ---------- Type ---------- */

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.07; letter-spacing: -0.022em; margin: 0; }
.hero-title { font-size: clamp(2.5rem, 1.35rem + 4.9vw, 5rem); }
.page-title { font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem); }
.section-title { font-size: clamp(1.55rem, 1.15rem + 1.7vw, 2.35rem); }

.eyebrow { color: var(--ink-3); margin: 0 0 0.9rem; display: flex; align-items: center; gap: 0.6rem; }
.eyebrow::before { content: ""; width: 1.6rem; height: 2px; background: var(--signal); flex: none; }

.dek { font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem); line-height: 1.45; color: var(--ink-2); margin: 1.1rem 0 0; max-width: 40rem; }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(2.5rem, 5vw, 5rem) clamp(2.5rem, 5vw, 4rem); }
.hero-grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); align-items: center; }
@media (min-width: 62rem) { .hero-grid { grid-template-columns: 1.02fr 0.98fr; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem 1.6rem; margin-top: 1.9rem; align-items: center; }
.hero-actions .mono { color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--ink); color: var(--paper); text-decoration: none;
  padding: 0.85rem 1.35rem; border-radius: 2px; border: 0; cursor: pointer;
  transition: background 0.22s var(--ease), transform 0.22s var(--ease);
}
.btn:hover { background: var(--chassis-2); transform: translateY(-2px); }
.btn svg { width: 14px; height: 14px; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--rule); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); }

/* ---------- Console (signature element) ---------- */

.console {
  position: relative;
  background: linear-gradient(168deg, var(--chassis-2), var(--chassis));
  border: 1px solid var(--chassis-3);
  border-radius: 4px;
  padding: 1.15rem 1.15rem 1.35rem;
  color: var(--paper);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 30px 60px -34px rgba(21, 24, 20, 0.85);
}
.console::after {
  content: ""; position: absolute; inset: 0; border-radius: 4px; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.028) 0 1px, transparent 1px 3px);
}
.console-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-bottom: 1px solid var(--chassis-3); padding-bottom: 0.75rem; margin-bottom: 0.9rem; color: #b6bca8; }

.channel { padding: 0.68rem 0; }
.channel + .channel { border-top: 1px dashed rgba(255, 255, 255, 0.09); }
.channel-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.42rem; }
.channel-name { font-family: var(--display); font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; }
.channel-val { font-family: var(--mono); font-size: 0.65rem; font-weight: 600; color: #98a086; letter-spacing: 0.08em; }

.track { position: relative; height: 4px; background: var(--chassis-2); border-radius: 2px; box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset; }
.track span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--signal-dim), var(--signal)); border-radius: 2px; }
.track::after { content: ""; position: absolute; top: 50%; left: var(--pos, 50%); width: 12px; height: 12px; transform: translate(-50%, -50%); background: var(--paper); border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.45); }

.meter { display: flex; gap: 2px; height: 7px; margin-top: 0.48rem; }
.meter i { flex: 1; background: var(--chassis-2); border-radius: 1px; }
.meter i.lit { background: var(--signal); animation: flicker 1.5s steps(2, end) infinite; }
.meter i.hot { background: var(--peak); animation: flicker 0.9s steps(2, end) infinite; }
@keyframes flicker { 0%, 58% { opacity: 1; } 59%, 100% { opacity: 0.16; } }
.meter i:nth-child(2) { animation-delay: 0.13s; }
.meter i:nth-child(3) { animation-delay: 0.31s; }
.meter i:nth-child(4) { animation-delay: 0.2s; }
.meter i:nth-child(5) { animation-delay: 0.44s; }
.meter i:nth-child(6) { animation-delay: 0.27s; }
.meter i:nth-child(7) { animation-delay: 0.52s; }
.meter i:nth-child(8) { animation-delay: 0.37s; }

.console-foot { margin: 1rem 0 0; padding-top: 0.78rem; border-top: 1px solid var(--chassis-3); color: #98a086; }

/* ---------- Figures ---------- */

.figure {
  background: linear-gradient(168deg, var(--chassis-2), var(--chassis));
  border: 1px solid var(--chassis-3); border-radius: 4px;
  padding: 1.4rem; margin: 2.2rem 0;
  box-shadow: 0 26px 50px -34px rgba(21, 24, 20, 0.8);
}
.figure svg { display: block; width: 100%; height: auto; }
.figure figcaption { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--chassis-4); margin-top: 1.1rem; padding-top: 0.8rem; border-top: 1px solid var(--chassis-3); }

.wave path { animation: drift 9s ease-in-out infinite alternate; }
.wave path:nth-child(2) { animation-duration: 12s; animation-delay: -3s; }
.wave path:nth-child(3) { animation-duration: 15s; animation-delay: -6s; }
@keyframes drift { to { transform: translateX(-40px); } }

.pulse { animation: pulse 2.6s var(--ease) infinite; }
.pulse-2 { animation-delay: 0.9s; }
@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ---------- Bands ---------- */

.band { padding-block: clamp(2.75rem, 5.5vw, 5rem); border-top: 1px solid var(--rule); }
.band-head { max-width: var(--measure); margin-bottom: clamp(1.9rem, 3vw, 2.75rem); }
.band-head p { margin: 0.9rem 0 0; color: var(--ink-2); }

.features { display: grid; gap: 1.25rem; }
@media (min-width: 42rem) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .features { grid-template-columns: repeat(3, 1fr); } }

.feature {
  background: var(--surface); border: 1px solid var(--rule-2); border-radius: 4px;
  padding: 1.5rem 1.4rem; position: relative; overflow: hidden;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
}
.feature::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--signal); transform: scaleY(0); transform-origin: top; transition: transform 0.32s var(--ease); }
.feature:hover { transform: translateY(-4px); box-shadow: 0 20px 38px -28px rgba(21, 24, 20, 0.6); border-color: var(--rule); }
.feature:hover::before { transform: scaleY(1); }
.feature-icon { width: 30px; height: 30px; color: var(--signal-dim); margin-bottom: 0.95rem; display: block; }
.feature h3 { font-size: 1.13rem; margin-bottom: 0.5rem; }
.feature p { margin: 0; color: var(--ink-2); font-size: 0.97rem; }

/* Article index */

.posts { display: grid; }
.post-link { display: grid; gap: 0.4rem 2rem; padding: 1.6rem 0.9rem 1.6rem 0; border-top: 1px solid var(--rule); text-decoration: none; transition: background 0.25s var(--ease), padding-left 0.25s var(--ease); }
.post-link:last-of-type { border-bottom: 1px solid var(--rule); }
@media (min-width: 54rem) { .post-link { grid-template-columns: 9rem 1fr; align-items: start; } }
.post-link:hover { background: linear-gradient(90deg, rgba(253,253,251,0.95), rgba(253,253,251,0)); padding-left: 0.9rem; }
.post-link h3 { font-size: clamp(1.28rem, 1.1rem + 0.85vw, 1.75rem); }
.post-link p { margin: 0.45rem 0 0; color: var(--ink-2); max-width: var(--measure); }
.post-link .mono { color: var(--ink-3); padding-top: 0.42rem; }
.post-link h3::after { content: " \2192"; color: var(--signal); opacity: 0; transition: opacity 0.25s var(--ease); }
.post-link:hover h3::after { opacity: 1; }

/* ---------- Article ---------- */

.article { padding-block: clamp(2.25rem, 4vw, 3.5rem) 1rem; }
.article-head { max-width: 47rem; }
.prose { max-width: var(--measure); margin-top: clamp(2rem, 4vw, 3rem); }
.prose h2 { font-size: clamp(1.32rem, 1.1rem + 1vw, 1.8rem); margin: 2.5rem 0 0.75rem; }
.prose h3 { font-size: 1.12rem; margin: 1.9rem 0 0.5rem; }
.prose p { margin: 0 0 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.15rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--signal-dim); }

.callout { border-left: 3px solid var(--signal); background: var(--surface); padding: 1.15rem 1.3rem; margin: 1.9rem 0; border-radius: 0 3px 3px 0; }
.callout p:last-child { margin-bottom: 0; }
.callout .mono { display: block; color: var(--ink-3); margin-bottom: 0.5rem; }

kbd { font-family: var(--mono); font-size: 0.78em; font-weight: 600; background: var(--chassis); color: var(--paper); padding: 0.16em 0.44em; border-radius: 3px; white-space: nowrap; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 3px; }

.next { border-top: 1px solid var(--rule); margin-top: 3.2rem; padding-top: 1.6rem; max-width: var(--measure); }
.next ul { list-style: none; margin: 0.85rem 0 0; padding: 0; }
.next li { margin-bottom: 0.55rem; }

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

.site-foot { margin-top: clamp(3rem, 6vw, 5.5rem); background: var(--chassis); color: #c3c9b5; padding-block: 3rem 2.25rem; }
.site-foot h2 { color: var(--paper); font-size: 1.05rem; }
.site-foot .mono { color: var(--chassis-4); }
.site-foot a { color: #dfe3d6; }
.foot-grid { display: grid; gap: 2rem 3rem; }
@media (min-width: 54rem) { .foot-grid { grid-template-columns: 1.5fr 1fr 1fr; } }
.disclosure { margin: 0.85rem 0 0; font-size: 0.93rem; max-width: 34rem; }
.foot-links { list-style: none; margin: 0.85rem 0 0; padding: 0; }
.foot-links li { margin-bottom: 0.5rem; font-size: 0.94rem; }
.colophon { margin: 2.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--chassis-3); color: var(--chassis-4); }

/* ---------- Consent ---------- */

.consent {
  position: fixed; z-index: 60; left: 1rem; right: 1rem; bottom: 1rem;
  max-width: 34rem; background: var(--surface);
  border: 1px solid var(--rule); border-radius: 5px;
  padding: 1.3rem 1.35rem; box-shadow: 0 26px 55px -22px rgba(21, 24, 20, 0.45);
  animation: slideup 0.5s var(--ease) both 0.35s;
}
@keyframes slideup { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.consent[hidden] { display: none; }
.consent h2 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.consent p { margin: 0 0 1rem; font-size: 0.93rem; color: var(--ink-2); }
.consent-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.consent-actions .btn { padding: 0.7rem 1.05rem; font-size: 0.67rem; }

.consent-detail { border-top: 1px solid var(--rule-2); margin-top: 1.15rem; padding-top: 1.05rem; }
.consent-detail[hidden] { display: none; }
.switch { display: flex; gap: 0.85rem; align-items: flex-start; margin-bottom: 0.95rem; font-size: 0.9rem; }
.switch input { margin-top: 0.3rem; accent-color: var(--signal-dim); width: 1rem; height: 1rem; flex: none; }
.switch span { color: var(--ink-3); display: block; font-size: 0.86rem; }
.switch strong { font-family: var(--display); font-weight: 600; color: var(--ink); }

/* ---------- Motion / reduced ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
  .meter i.lit, .meter i.hot { opacity: 1; }
}
