/* ================= DJW Audio - Design System ================= */

:root {
  --bg: #000000;
  --bg-elev: #0a0a0a;
  --bg-paper: #f0ece3;
  --ink: #f4f1ea;
  --ink-dim: #8a8680;
  --ink-faint: #3d3a36;
  --rule: #1a1a1a;
  --rule-strong: #2a2a2a;
  --teal: #2ee8b8;
  --teal-dim: #1a9d7c;
  --teal-glow: rgba(46, 232, 184, 0.18);
  --amber: #d4a84a;

  --serif: 'Instrument Serif', 'Times New Roman', serif; /* display only */
  --serif-body: 'Geist', 'Inter', -apple-system, system-ui, sans-serif;
  --sans: 'Geist', 'Inter', -apple-system, system-ui, sans-serif;
  --mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;

  --max: 1440px;
  --gutter: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

/* ---- typography tokens ---- */
.t-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 400;
}
.t-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.t-display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.95;
}
.t-italic { font-style: italic; }

.teal { color: var(--teal); }
.rule { height: 1px; background: var(--rule); width: 100%; }
.rule-strong { height: 1px; background: var(--rule-strong); }

/* ---- registration marks ---- */
.reg-mark {
  display: inline-block;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
}
.reg-anchor {
  position: relative;
}
.reg-mark-title {
  position: absolute;
  top: -0.12em;
  right: -0.64em;
  width: clamp(26px, 3.2vw, 46px);
  height: clamp(26px, 3.2vw, 46px);
  opacity: 0.32;
}
.reg-mark-section {
  width: 0.42em;
  height: 0.42em;
  margin-left: 0.24em;
  vertical-align: text-top;
  opacity: 0.28;
}

/* ---- layout ---- */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ================= Top Chrome ================= */
.chrome-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--rule);
}
.chrome-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}
.brand-logo {
  width: 88px;
  height: 31px;
  fill: var(--ink);
  display: block;
  flex: 0 0 88px;
}
.brand-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding-left: 14px;
  border-left: 1px solid var(--rule-strong);
}
.reg-mark-brand {
  width: 18px;
  height: 18px;
  opacity: 0.26;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.reg-mark-nav {
  width: 18px;
  height: 18px;
  margin-right: 12px;
  opacity: 0.34;
}
.nav-link {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 10px 18px;
  border-radius: 2px;
  transition: color 0.2s;
  position: relative;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 18px;
  right: 18px;
  height: 1px;
  background: var(--teal);
}
.nav-cta {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 10px 18px;
  color: var(--bg);
  background: var(--ink);
  border-radius: 2px;
  margin-left: 12px;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--teal); }

/* ================= Scaffold ================= */
.page {
  display: none;
  padding-top: 72px;
  animation: pg-fade 0.4s ease;
}
.page.active { display: block; }
@keyframes pg-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================= Footer ================= */
footer {
  border-top: 1px solid var(--rule);
  padding: 48px 0 32px;
  margin-top: 120px;
}
.foot-lockup {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: end;
  padding-bottom: 56px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--rule);
}
.reg-mark-foot {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(34px, 4vw, 62px);
  height: clamp(34px, 4vw, 62px);
  opacity: 0.18;
}
.foot-logo-xl {
  width: 100%;
  max-width: 900px;
  height: auto;
  fill: var(--ink);
  display: block;
}
.foot-lockup-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  padding-bottom: 16px;
}
@media (max-width: 900px) {
  .foot-lockup { grid-template-columns: 1fr; }
  .foot-lockup-side { align-items: flex-start; }
}
@media (max-width: 720px) {
  .reg-mark-nav,
  .reg-mark-brand { display: none; }
  .reg-mark-title {
    top: -18px;
    right: 0;
  }
  .chrome-top-inner {
    height: auto;
    min-height: 72px;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px 0;
    padding-top: 12px;
    padding-bottom: 10px;
  }
  .brand {
    width: 100%;
  }
  .brand-tag { display: none; }
  .brand-logo {
    width: 72px;
    height: auto;
    flex-basis: 72px;
  }
  .nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 2px 4px;
    align-items: flex-start;
  }
  .nav-link {
    flex: 0 1 auto;
    font-size: 10px;
    letter-spacing: 0.1em;
    padding: 7px 8px;
    white-space: nowrap;
  }
  .nav-link.active::after {
    left: 8px;
    right: 8px;
  }
  .page {
    padding-top: 118px;
  }
}

@media (max-width: 430px) {
  .chrome-top-inner {
    padding-left: 20px;
    padding-right: 20px;
  }
  .nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  .nav-link {
    min-width: 0;
    padding: 6px 4px;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-align: center;
  }
  .nav-link.active::after {
    left: 12px;
    right: 12px;
  }
  .page {
    padding-top: 138px;
  }
}
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 64px;
}
.foot-col h5 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 400;
  margin-bottom: 16px;
}
.foot-col a {
  display: block;
  font-size: 14px;
  color: var(--ink);
  padding: 4px 0;
  transition: color 0.2s;
}
.foot-col a:hover { color: var(--teal); }
.foot-about p {
  font-family: var(--serif-body);
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink-dim);
  margin-top: 14px;
  max-width: 32ch;
}
.foot-about p em { color: var(--ink); font-style: italic; }
.foot-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
.foot-bar .dots {
  display: flex; gap: 6px;
}
.foot-bar .dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-faint);
}
.foot-bar .dots span:first-child { background: var(--teal); }

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 2px;
  transition: all 0.25s;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--teal); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
}
.btn-ghost:hover { border-color: var(--ink); }
.btn-teal {
  background: var(--teal);
  color: #001811;
}
.btn-teal:hover { background: #56f2c6; }
.btn-lg { padding: 18px 28px; font-size: 12px; }

.btn .arrow {
  transition: transform 0.25s;
}
.btn:hover .arrow { transform: translateX(3px); }

/* ================= Cookie Agreement ================= */
.cookie-modal[hidden] { display: none; }
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: var(--gutter);
}
.cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.cookie-modal__panel {
  position: relative;
  width: min(640px, 100%);
  background: rgba(10,10,10,0.97);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: clamp(24px, 4vw, 40px);
  box-shadow: 0 28px 90px rgba(0,0,0,0.72);
}
.cookie-modal__panel h2 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 500;
  line-height: 1.02;
  margin: 12px 0 18px;
}
.cookie-modal__panel p {
  max-width: 58ch;
  color: var(--ink-dim);
  font-size: 15px;
  line-height: 1.6;
}
.cookie-modal__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}
.cookie-modal__actions .btn {
  justify-content: center;
}
.cookie-modal__actions .btn.on {
  border-color: var(--teal);
  color: var(--ink);
}
.cookie-modal__policy {
  display: inline-flex;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.cookie-modal__policy:hover { color: var(--teal); }
.cookie-modal .btn:focus-visible,
.cookie-modal__policy:focus-visible {
  outline: 1px solid var(--teal);
  outline-offset: 3px;
}
body.cookie-modal-open { overflow: hidden; }
body.paper-mode .cookie-modal__panel {
  background: rgba(239,234,224,0.98);
}
body.paper-mode .cookie-modal__backdrop {
  background: rgba(10,10,10,0.42);
}
@media (max-width: 560px) {
  .cookie-modal {
    align-items: end;
    padding: 16px;
  }
  .cookie-modal__panel {
    padding: 22px;
  }
  .cookie-modal__actions .btn {
    width: 100%;
  }
}

/* ================= Support ================= */
.stub-page {
  padding: clamp(72px, 12vh, 132px) 0 120px;
}
.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(280px, 0.74fr);
  gap: clamp(40px, 8vw, 120px);
  align-items: start;
  margin-top: 60px;
}
.stub-head {
  max-width: 820px;
}
.stub-head h1 {
  font-size: clamp(56px, 9vw, 128px);
  margin-top: 18px;
}
.stub-body {
  max-width: 620px;
  margin-top: 30px;
  font-family: var(--serif-body);
  font-size: clamp(18px, 1.7vw, 23px);
  line-height: 1.5;
  color: var(--ink-dim);
}
.support-visual {
  position: relative;
  min-height: 420px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.support-visual .t-label {
  position: absolute;
  top: 18px;
  left: 0;
  color: var(--ink-faint);
}
.support-visual img {
  width: min(100%, 540px);
  margin-left: auto;
  filter: brightness(0) invert(1);
  opacity: 0.2;
}
.support-form {
  max-width: 820px;
  border-top: 1px solid var(--rule-strong);
  padding-top: 28px;
}
.sf-row {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}
.sf-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.sf-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.sf-field .t-label em {
  color: var(--ink-faint);
  font-style: normal;
}
.sf-field input,
.sf-field textarea {
  width: 100%;
  border: 1px solid var(--rule-strong);
  background: var(--bg);
  color: var(--ink);
  border-radius: 2px;
  padding: 14px 16px;
  font-family: var(--sans);
  font-size: 15px;
  outline: none;
}
.sf-field textarea {
  resize: vertical;
  min-height: 170px;
}
.sf-field input:focus,
.sf-field textarea:focus {
  border-color: var(--teal);
}
.sf-hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}
.sf-foot {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.sf-privacy {
  max-width: 420px;
  color: var(--ink-dim);
  font-size: 13px;
  line-height: 1.5;
}
.sf-privacy a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.sf-result {
  display: none;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--rule-strong);
  color: var(--ink-dim);
  font-size: 14px;
}
.sf-result.ok,
.sf-result.err {
  display: block;
}
.sf-result.ok {
  border-color: rgba(46,232,184,0.35);
  color: var(--ink);
}
.sf-result.err {
  border-color: rgba(255,92,61,0.45);
  color: #ff8c76;
}

@media (max-width: 900px) {
  .support-layout {
    grid-template-columns: 1fr;
    gap: 34px;
    margin-top: 42px;
  }
  .support-visual {
    min-height: 240px;
    align-items: flex-end;
  }
  .support-visual img {
    width: min(78vw, 360px);
    margin-left: 0;
  }
}
@media (max-width: 620px) {
  .sf-two {
    grid-template-columns: 1fr;
  }
  .sf-foot {
    align-items: stretch;
  }
  .sf-foot .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ================= Tweaks Panel ================= */
.tweaks {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  background: rgba(10,10,10,0.96);
  backdrop-filter: blur(10px);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 18px;
  z-index: 1000;
  display: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}
.tweaks.visible { display: block; }
.tweaks h6 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 400;
  margin-bottom: 4px;
}
.tweaks h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 16px;
  color: var(--ink);
}
.tweak-row {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}
.tweak-row:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.tweak-row label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.seg {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: 2px;
  padding: 2px;
}
.seg button {
  flex: 1;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 7px 4px;
  color: var(--ink-dim);
  border-radius: 2px;
  transition: all 0.15s;
}
.seg button.on {
  background: var(--teal);
  color: #001811;
}
.tweak-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.tweak-swatches button {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: border 0.15s;
}
.tweak-swatches button.on { border-color: var(--ink); }
