
@font-face { font-family: 'AmDisplay'; src: url('/fonts/display.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'AmMono'; src: url('/fonts/mono.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'AmCJK'; src: url('/fonts/cjk.woff2') format('woff2'); font-weight: 500; font-display: swap; }
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #ff5a1f; outline-offset: 2px; }

:root {
  --bg: #e5e8e1;
  --panel: #f3f4ef;
  --panel-deep: #dcdfd7;
  --oled: #101410;
  --ink: #191d19;
  --muted: #5d645c;
  --orange: #ff5a1f;
  --green: #88b836;
  --line: #c4c9be;
}
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "AmCJK", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.55; overflow-x: hidden;
}
.dk-frame { max-width: 1180px; margin: 22px auto 48px; padding: 0 16px; }
.dk-chassis {
  background: var(--panel); border: 2px solid #b8beb2; border-radius: 22px;
  box-shadow: 0 22px 54px rgba(18, 22, 18, 0.14), inset 0 2px 0 #ffffff;
  overflow: hidden;
}
.dk-bar {
  background: var(--panel-deep); border-bottom: 2px solid var(--line);
  padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.dk-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: "AmDisplay", "AmMono", monospace; font-weight: 700; font-size: 0.96rem; letter-spacing: 0.1em;
}
.dk-led { width: 10px; height: 10px; border-radius: 50%; background: #8f968a; transition: background 0.2s ease, box-shadow 0.2s ease; }
body.is-playing .dk-led { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dk-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.dk-key {
  background: #fafbf8; border: 1.5px solid #aeb4a8; border-bottom-width: 3.5px; border-radius: 8px;
  padding: 6px 14px; font-family: "AmMono", "AmCJK", monospace; font-size: 0.78rem; font-weight: 600; cursor: pointer;
}
.dk-key:hover { border-color: var(--ink); }
.dk-key[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Recessed Dark OLED Synth Master Section */
.dk-oled-wrap { padding: 24px; border-bottom: 2px solid var(--line); }
.dk-oled {
  background:
    repeating-linear-gradient(0deg, rgba(136, 184, 54, 0.04) 0 1px, transparent 1px 3px),
    var(--oled);
  color: #e6efe2; border: 4px solid #262c26; border-radius: 14px; padding: 24px 28px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 26px; align-items: center;
  box-shadow: inset 0 0 38px rgba(0, 0, 0, 0.78);
}
.dk-kicker { font-family: "AmMono", monospace; font-size: 0.72rem; color: var(--green); letter-spacing: 0.14em; display: block; margin-bottom: 8px; }
.dk-oled h1 { font-family: "AmDisplay", "AmCJK", sans-serif; font-size: clamp(1.75rem, 3.3vw, 2.65rem); margin: 0 0 10px; line-height: 1.15; color: #fff; }
.dk-oled p { margin: 0 0 18px; color: #9aaa97; font-size: 0.9rem; max-width: 48ch; }
.dk-transport { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dk-play {
  background: var(--orange); color: #fff; border: none; border-radius: 8px;
  padding: 12px 24px; font-family: "AmMono", "AmCJK", monospace; font-size: 0.88rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 0 #b8370a;
}
.dk-play:active { transform: translateY(2px); box-shadow: 0 2px 0 #b8370a; }
.dk-play.is-on { background: var(--green); color: #0e130e; box-shadow: 0 4px 0 #5b7e20; }
.dk-timer-btn {
  background: transparent; color: #b9c9b5; border: 1.5px solid #354534; border-radius: 8px;
  padding: 10px 14px; font-family: "AmMono", monospace; font-size: 0.78rem; cursor: pointer;
}
.dk-timer-btn:hover, .dk-timer-btn.is-active { border-color: var(--green); color: var(--green); }

/* Live Oscilloscope Canvas */
.dk-scope-box {
  background: #0b0f0b; border: 1.5px solid #2b3a29; border-radius: 10px; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.dk-scope-meta { display: flex; justify-content: space-between; font-family: "AmMono", monospace; font-size: 0.7rem; color: var(--green); }
#ambient-scope { width: 100%; height: 146px; display: block; border-radius: 6px; background: #070a07; }

/* 4 Atmospheric Presets Row */
.dk-sec { padding: 24px; border-bottom: 2px solid var(--line); }
.dk-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.dk-sec-head h1, .dk-sec-head h2 { margin: 0; font-family: "AmDisplay", "AmCJK", sans-serif; font-size: 1.2rem; letter-spacing: 0.03em; }
.dk-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dk-preset {
  background: #fff; border: 1.5px solid #b8beb2; border-bottom-width: 4px; border-radius: 12px;
  padding: 14px 16px; text-align: left; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; gap: 4px; transition: border-color 0.15s ease, transform 0.12s ease;
}
.dk-preset:hover { border-color: var(--ink); transform: translateY(-2px); }
.dk-preset.is-active { border-color: var(--orange); background: #fff7f3; }
.dk-preset span { font-family: "AmMono", monospace; font-size: 0.68rem; color: var(--orange); font-weight: 700; }
.dk-preset strong { font-size: 0.96rem; color: var(--ink); }
.dk-preset small { font-size: 0.76rem; color: var(--muted); }

/* 6-Channel Vertical Synth Mixer */
.dk-mixer { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.dk-ch {
  background: #ffffff; border: 1.5px solid #bfc5b9; border-bottom-width: 4px; border-radius: 12px;
  padding: 14px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.dk-ch-code { font-family: "AmMono", monospace; font-size: 0.68rem; color: var(--muted); }
.dk-ch-name { font-weight: 700; font-size: 0.9rem; text-align: center; }
.dk-ch-val { font-family: "AmMono", monospace; font-size: 0.84rem; color: var(--orange); font-weight: 700; }
.dk-slider { width: 100%; accent-color: var(--orange); cursor: pointer; }
.dk-mute {
  width: 100%; padding: 6px; border: 1.5px solid #aeb4a8; border-radius: 6px;
  background: var(--panel); font-family: "AmMono", monospace; font-size: 0.72rem; font-weight: 700; cursor: pointer;
}
.dk-mute.is-muted { background: var(--ink); color: var(--orange); border-color: var(--ink); }

/* Cards for subpages */
.dk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.dk-card { background: #fff; border: 1.5px solid #bfc5b9; border-left: 5px solid var(--green); border-radius: 10px; padding: 18px; }
.dk-card h3 { margin: 0 0 6px; font-size: 1.02rem; }
.dk-card p { margin: 0; font-size: 0.85rem; color: var(--muted); }
.dk-foot { padding: 16px 24px; background: var(--panel-deep); font-family: "AmMono", monospace; font-size: 0.74rem; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.dk-toast { position: fixed; top: 18px; right: 18px; background: var(--ink); color: var(--green); padding: 9px 16px; border-radius: 8px; font-family: "AmMono", "AmCJK", monospace; font-size: 0.8rem; z-index: 90; }

@media (max-width: 960px) {
  .dk-oled { grid-template-columns: 1fr; }
  .dk-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dk-mixer { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .dk-frame { margin: 10px auto 28px; padding: 0 10px; }
  .dk-oled-wrap, .dk-sec { padding: 14px; }
  .dk-mixer { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
