:root {
  --bg0: #0b0d12;
  --bg1: #12151e;
  --bg2: #1a1f2c;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8ecf5;
  --muted: #8b93a7;
  --accent: #5ee0b5;
  --accent2: #7aa2ff;
  --danger: #ff6b7a;
  --radius: clamp(14px, 2.2vw, 22px);
  --pad: clamp(14px, 3.5vw, 28px);
  --max: 720px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  font-synthesis: none;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  min-height: 100%;
  background: var(--bg0);
  color: var(--text);
  font-family: "Segoe UI", "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* anti-copy */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(122, 162, 255, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(94, 224, 181, 0.12), transparent 50%),
    linear-gradient(180deg, #0e1118 0%, var(--bg0) 40%, #090b10 100%);
}

.desk {
  width: min(100%, var(--max));
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(var(--safe-t) + 12px) var(--pad) calc(var(--safe-b) + 20px);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 3vw, 22px);
}

.chrome {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  background: rgba(18, 21, 30, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  backdrop-filter: blur(10px);
}

.traffic { display: flex; gap: 6px; }
.traffic i {
  width: 10px; height: 10px; border-radius: 50%;
  background: #3a3f4d; display: block;
}
.traffic i:nth-child(1) { background: #ff5f57; }
.traffic i:nth-child(2) { background: #febc2e; }
.traffic i:nth-child(3) { background: #28c840; }

.titlepill {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: clamp(12px, 2.8vw, 13px);
  color: var(--muted);
  letter-spacing: 0.02em;
  min-width: 0;
}
.titlepill span:last-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  flex: 0 0 auto;
}
.chrome-right {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.08em;
  font-weight: 600;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(18px, 4vw, 28px);
}

.hero { text-align: center; padding: 4px 2px; }
.eyebrow {
  font-size: clamp(10px, 2.5vw, 11px);
  letter-spacing: 0.16em;
  color: var(--accent2);
  margin-bottom: 10px;
  font-weight: 600;
}
h1 {
  font-size: clamp(1.55rem, 6.2vw, 2.35rem);
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.02em;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.lede {
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(0.9rem, 3.2vw, 1.02rem);
  line-height: 1.45;
}

.panel {
  background: linear-gradient(165deg, rgba(26, 31, 44, 0.96), rgba(14, 17, 24, 0.98));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 4vw, 22px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.wave {
  height: clamp(48px, 12vw, 64px);
  border-radius: 12px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(94, 224, 181, 0.15) 0 3px,
      transparent 3px 8px
    );
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.wave::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(122, 162, 255, 0.25), transparent);
  transform: translateX(-100%);
  animation: sweep 2.8s ease-in-out infinite;
}
.wave.on::after { animation-duration: 1.1s; }
@keyframes sweep {
  to { transform: translateX(100%); }
}

.time-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--muted);
}
.track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  touch-action: none;
}
.fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
}
.knob {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(94, 224, 181, 0.25);
  pointer-events: none;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(14px, 4vw, 22px);
  margin-top: 20px;
}
.play {
  width: clamp(64px, 16vw, 74px);
  height: clamp(64px, 16vw, 74px);
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #3ecf9a);
  color: #06140f;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(94, 224, 181, 0.35);
}
.play:active { transform: scale(0.97); }
.ghost {
  min-width: 52px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.hide { display: none !important; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}
.chip {
  font-size: 10px;
  letter-spacing: 0.1em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.foot {
  text-align: center;
  color: var(--muted);
  font-size: clamp(11px, 2.8vw, 12px);
  line-height: 1.5;
  padding: 0 6px;
}

/* Go to Library — end-of-desk gate */
.lib-gate {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 4px;
  align-items: center;
  margin-top: clamp(8px, 2vw, 14px);
  padding: clamp(16px, 3.5vw, 20px) clamp(18px, 4vw, 24px);
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  border: 1px solid rgba(122, 162, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(122, 162, 255, 0.14), rgba(94, 224, 181, 0.08)),
    rgba(18, 21, 30, 0.88);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.lib-gate:hover, .lib-gate:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(94, 224, 181, 0.45);
  box-shadow: 0 16px 48px rgba(94, 224, 181, 0.12);
  outline: none;
}
.lib-gate:active { transform: translateY(0); }
.lib-gate-kicker {
  grid-column: 1;
  grid-row: 1;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent2);
  font-weight: 600;
}
.lib-gate-title {
  grid-column: 1;
  grid-row: 2;
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.lib-gate-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: clamp(42px, 11vw, 48px);
  height: clamp(42px, 11vw, 48px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #06140f;
  background: linear-gradient(145deg, var(--accent), #3ecf9a);
  box-shadow: 0 8px 22px rgba(94, 224, 181, 0.3);
}

@media (max-width: 380px) {
  .chrome { grid-template-columns: auto 1fr; }
  .chrome-right { display: none; }
  .ghost { min-width: 46px; height: 40px; }
}

@media (min-width: 900px) {
  .desk { padding-top: 28px; }
  .panel { padding: 26px 28px; }
}
