/* Sound95 site layout: the app's arrangement (library tree, main pane, player bar,
   taskbar) holding a landing page. Text sizes are multiples of 11px where they can
   be, because that's where the pixel font stays crisp. */

[hidden] { display: none !important; }

.skip { position: fixed; left: -9999px; top: 4px; z-index: 100; }
.skip:focus { left: 4px; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#desktop { flex: 1; min-height: 0; position: relative; display: flex; justify-content: center; }
#main-window { flex: 1; min-width: 0; max-width: 1600px; position: relative; z-index: 1; }

/* Desktop icons sit behind the window, and show when it's closed or there's room. */
.desk-icons { position: absolute; top: 12px; left: 8px; width: 76px; display: grid; gap: 18px; color: var(--hilite); }
.desk-icon {
  all: unset; box-sizing: border-box;
  display: grid; justify-items: center; gap: 4px; padding: 2px;
  text-align: center; cursor: default;
}
.desk-icon span { padding: 0 2px; }
.desk-icon:hover span, .desk-icon:focus-visible span { background: var(--select); outline: 1px dotted var(--tooltip); outline-offset: -1px; }

@media (min-width: 1280px) and (min-height: 700px) {
  #desktop { padding: 12px 12px 12px 92px; }
  .maximized #desktop { padding: 0; }
  .maximized #main-window { max-width: none; }
}
@media (max-width: 1279px) { #win-max { display: none; } }

/* Toolbar */
.toolbar {
  display: flex; align-items: center; gap: 2px;
  height: 30px; flex: none; padding: 2px 3px;
  box-shadow: inset 0 1px var(--shadow), inset 0 2px var(--hilite);
}
.tool-sep { width: 2px; height: 20px; margin: 0 4px; box-shadow: inset 1px 0 var(--shadow), inset -1px 0 var(--hilite); flex: none; }
.address { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 80px; max-width: 460px; }
.address-field { flex: 1; min-width: 0; height: 21px; padding: 4px 5px; line-height: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account { margin-left: auto; min-width: 0; padding: 0 8px; }
.account:active { padding: 1px 7px 0 9px; }

/* Panes */
.workspace {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 3px;
  padding: 2px 0 3px;
}
.sidebar { min-height: 0; overflow-y: auto; padding: 4px 2px 4px 4px; }
.tree-head { display: flex; align-items: center; gap: 4px; height: 20px; padding: 0 2px; font-weight: 700; margin-top: 6px; }
.tree-head:first-child { margin-top: 0; }
.tree-item {
  display: flex; align-items: center; gap: 4px;
  height: 18px; padding-left: 8px; margin-left: 10px;
  border-left: 1px dotted var(--shadow);
  white-space: nowrap; overflow: hidden;
  color: inherit; text-decoration: none;
}
.tree-item > span { padding: 1px 2px; overflow: hidden; text-overflow: ellipsis; }
.tree-item:hover > span { text-decoration: underline; }
.tree-item.selected > span { background: var(--select); color: var(--select-text); outline: 1px dotted var(--tooltip); outline-offset: -1px; }

.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.content {
  flex: 1; min-height: 0;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
  font-size: 16.5px; line-height: 1.4;
}
.content:focus { outline: none; }
.content:focus-visible { outline: 1px dotted var(--dark); outline-offset: -4px; }
.content a:not(.button) { color: var(--select); }

/* Page sections */
.band { padding: 44px 22px; }
.band.face { background: var(--face); }
.band + .band:not(.face, .navy) { box-shadow: var(--etched); }
.band.navy { background: var(--select); color: var(--select-text); text-align: center; }
.inner { max-width: 1012px; margin: 0 auto; }
.narrow { max-width: 760px; }

h1, h2, h3, p { margin: 0; }
h1 { font-size: 44px; line-height: 1.15; }
h2 { font-size: 33px; line-height: 1.15; }
h3 { font-size: 16.5px; line-height: 1.3; }
.head { display: grid; gap: 11px; margin-bottom: 22px; justify-items: start; }
.head p { max-width: 640px; }
.tag { display: inline-block; font-size: 11px; line-height: 16px; padding: 0 4px; font-weight: 700; }

/* Hero */
.hero { background: var(--select); color: var(--select-text); padding: 44px 22px 0; text-align: center; }
.hero .tag { margin-bottom: 11px; }
.hero h1 span { display: block; }
.hero-lead { max-width: 640px; margin: 16px auto 0; }
.hero-version { margin-top: 16px; font-size: 11px; color: var(--light); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.button.big { min-height: 33px; padding: 0 16px; min-width: 176px; font-size: 16.5px; }
.button.big:active { padding: 1px 15px 0 17px; }
.hero-shot {
  max-width: 1012px; margin: 33px auto -110px; position: relative;
  box-shadow: 0 0 0 1px var(--dark), 6px 6px 0 rgba(0, 0, 0, .4);
}
.hero-shot img { width: 100%; height: auto; }
.after-hero { padding-top: 154px; }
.hero.small { padding-bottom: 33px; }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 33px; align-items: start; }

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 33px; }
.group { padding: 16px; display: grid; gap: 8px; align-content: start; box-shadow: inset 0 0 0 1px var(--shadow), inset 1px 1px 0 1px var(--hilite); }

/* Demo windows */
.demo-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 33px; align-items: center; }
.demo-split.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.demo-text { display: grid; gap: 11px; justify-items: start; }
.demo { font-size: 11px; line-height: 1.25; box-shadow: var(--raised), 6px 6px 0 rgba(0, 0, 0, .3); }
.demo-modes { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px 0; }
.demo-modes button { min-width: 0; flex: 1; padding: 0 6px; }
.demo-modes button[aria-pressed="true"] { box-shadow: var(--pressed); background: var(--checker); font-weight: 700; }
.demo-body { height: 300px; display: flex; box-shadow: var(--sunken); padding: 2px; background: #000; }
.viz-canvas { flex: 1; min-width: 0; min-height: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.demo .statusbar { height: auto; align-items: stretch; }
.demo .status-cell { display: flex; align-items: center; }
.demo-play { min-width: 62px; }

/* Karaoke: blue screen, white words, yellow where you are. */
.k-stage {
  --k-size: 33px; --k-sung: #ffff00; --k-wait: #ffffff;
  flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column;
  background: var(--select); color: var(--k-wait);
}
.k-lines { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 12px 16px; text-align: center; }
.k-strip { flex: none; display: block; width: 100%; height: 34px; background: #000; image-rendering: pixelated; }
.k-line { font-size: calc(var(--k-size) * 0.5); line-height: 1.2; opacity: .6; overflow-wrap: anywhere; }
.k-line.current { font-size: var(--k-size); font-weight: 700; opacity: 1; }
.k-line.past .k-word { --fill: 100%; }
.k-word {
  --fill: 0%;
  white-space: pre-wrap;
  background: linear-gradient(90deg, var(--k-sung) var(--fill), var(--k-wait) var(--fill));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* Details list */
.list { width: 100%; border-collapse: collapse; background: var(--hilite); }
.list th {
  height: 22px; padding: 0 6px; text-align: left; font-weight: 400; font-size: 11px;
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hilite), inset -2px -2px var(--shadow);
}
.list td { padding: 7px 6px; vertical-align: top; overflow-wrap: anywhere; }
.list tbody tr:hover td { background: #e4e4f4; }
.list .icon-cell { width: 28px; padding-right: 0; }
.list .name-cell { width: 208px; font-weight: 700; }
.list-frame { padding: 2px; box-shadow: var(--sunken); background: var(--hilite); }
.hash { font: 12px/1.35 "Courier New", monospace; word-break: break-all; }

/* FAQ, drawn as a tree */
.faq { display: grid; }
.faq summary {
  display: flex; align-items: center; gap: 8px; padding: 6px 0; font-weight: 700;
  list-style: none; cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+"; flex: none; width: 13px; height: 13px;
  display: grid; place-items: center;
  font: 700 11px/1 "Courier New", monospace;
  background: var(--hilite); box-shadow: inset 0 0 0 1px var(--shadow);
}
.faq details[open] summary::before { content: "-"; }
.faq p { margin: 0 0 8px 6px; padding: 0 0 4px 14px; border-left: 1px dotted var(--shadow); }

.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.site-foot { padding: 16px 22px; font-size: 11px; line-height: 1.5; background: var(--face); box-shadow: var(--etched); }
.site-foot .inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 22px; }

/* Download page */
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.dl-card { scroll-margin-top: 16px; }
.title-h { font: inherit; display: inline; }
.dl-body { padding: 16px; display: grid; gap: 12px; line-height: 1.4; font-size: 16.5px; }
.dl-who { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: center; }
.dl-file { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.dl-body ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.dl-more { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-body .button { width: fit-content; max-width: 100%; }
.command { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.command code {
  display: block; padding: 6px 8px; min-width: 0;
  overflow-x: auto; white-space: pre; user-select: all; -webkit-user-select: all;
  font: 13px/1.3 "Courier New", monospace;
}
.notice { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px; background: var(--tooltip); color: var(--dark); box-shadow: inset 0 0 0 1px var(--dark); margin-bottom: 22px; text-align: left; }

/* Player bar */
.playerbar {
  flex: none; height: 62px;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(240px, 1.5fr) minmax(150px, 1fr);
  gap: 10px; align-items: center;
  padding: 3px 6px;
  box-shadow: var(--raised-thin);
}
.np { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; align-items: center; min-width: 0; }
.np-art { width: 48px; height: 48px; padding: 2px; background: var(--face); display: grid; place-items: center; }
.np-text { min-width: 0; display: grid; gap: 3px; }
.np-text > * { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.np-title { font-weight: 700; }
.np-artist { color: var(--muted); }
.transport { display: grid; justify-items: center; gap: 1px; min-width: 0; }
.transport-buttons { display: flex; gap: 2px; align-items: center; }
button.tool-play { width: 34px; }
.seek-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; gap: 6px; align-items: center; width: 100%; }
.seek-row input { width: 100%; }
.time { text-align: center; font-variant-numeric: tabular-nums; }
.np-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.np-right input { width: 90px; min-width: 40px; }
.mini-viz { width: 80px; height: 36px; flex: none; background: #000; box-shadow: var(--sunken); padding: 2px; image-rendering: pixelated; }

/* Taskbar */
.taskbar {
  flex: none; height: 28px; position: relative; z-index: 20;
  display: flex; align-items: center; gap: 3px;
  padding: 2px;
  background: var(--face);
  box-shadow: inset 0 1px var(--light), inset 0 2px var(--hilite);
}
button.start { min-width: 0; height: 22px; min-height: 22px; gap: 3px; padding: 0 5px 0 3px; font-weight: 700; flex: none; }
button.start:active:not(:disabled), button.start[aria-expanded="true"] { box-shadow: var(--pressed); padding: 1px 4px 0 4px; }
.task-sep { width: 2px; height: 20px; box-shadow: inset 1px 0 var(--shadow), inset -1px 0 var(--hilite); flex: none; }
button.task {
  flex: 0 1 240px; min-width: 60px; height: 22px; min-height: 22px;
  justify-content: flex-start; padding: 0 6px;
  overflow: hidden; white-space: nowrap;
}
button.task.pressed { box-shadow: var(--pressed); background: var(--checker); font-weight: 700; }
button.task:active:not(:disabled) { padding: 0 6px; }
.task span { overflow: hidden; text-overflow: ellipsis; }
.tray { margin-left: auto; height: 22px; display: flex; align-items: center; gap: 6px; padding: 0 8px 0 4px; flex: none; white-space: nowrap; }

/* Start menu */
.start-menu { display: grid; grid-template-columns: 22px 1fr; left: 2px; bottom: 100%; min-width: 190px; }
.start-banner { background: var(--shadow); color: var(--face); writing-mode: vertical-rl; transform: rotate(180deg); padding: 6px 0; line-height: 22px; font-size: 18px; font-weight: 700; text-align: left; }
.start-banner b { color: var(--hilite); }
.start-menu .menu-item { grid-template-columns: 26px 1fr; min-height: 28px; padding-right: 16px; }
button.start-menu-item:active:not(:disabled) { padding-right: 16px; }

/* Blue screen for pages that don't exist */
.bsod {
  position: fixed; inset: 0; overflow: auto;
  display: grid; place-items: center; padding: 22px;
  background: #0000aa; color: var(--hilite);
  font: 16.5px/1.5 "Pixelated MS Sans Serif", "MS Sans Serif", Arial, sans-serif;
}
.bsod-box { max-width: 640px; display: grid; gap: 16px; }
.bsod h1 { justify-self: center; font-size: 16.5px; padding: 0 8px; background: var(--face); color: #0000aa; }
.bsod a { color: var(--hilite); }

/* Tablets and small windows fold the way the app does. */
@media (max-width: 1100px) {
  .workspace { grid-template-columns: 170px minmax(0, 1fr); }
  .demo-split, .demo-split.flip { grid-template-columns: minmax(0, 1fr); }
  .demo-split.flip .demo { order: 1; }
  .demo-body { height: 260px; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .mini-viz { display: none; }
  .playerbar { grid-template-columns: minmax(0, 1fr) minmax(190px, 1.4fr) auto; gap: 6px; }
}
@media (max-width: 760px) {
  .band { padding: 33px 16px; }
  .hero { padding: 33px 16px 0; }
  h1 { font-size: 33px; }
  h2 { font-size: 27.5px; }
  .hero-shot { margin: 22px auto -44px; }
  .after-hero { padding-top: 77px; }
  .split, .trio, .dl-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .trio { margin-top: 22px; }
  .list thead { display: none; }
  .list, .list tbody { display: block; }
  .list tr { display: grid; grid-template-columns: 28px minmax(0, 1fr); padding: 6px 0; }
  .list tr + tr { box-shadow: 0 -1px var(--light); }
  .list td { display: block; padding: 2px 6px; }
  .list .icon-cell { grid-row: span 2; width: auto; padding-right: 0; }
  .list .name-cell { width: auto; }
  .files tr { grid-template-columns: minmax(0, 1fr); }
  .k-stage { --k-size: 22px; }
  .account span, .address > span:first-child { display: none; }
  .toolbar, .menubar, #main-window > .statusbar, .playerbar { display: none; }
}
@media (max-width: 400px) {
  h1 { font-size: 27.5px; }
  h2 { font-size: 22px; }
  .button.big { width: 100%; }
}
@media (max-height: 560px) {
  #main-window > .statusbar, .playerbar { display: none; }
}
@media (max-height: 440px) {
  .toolbar, .menubar, .taskbar { display: none; }
  .hero { padding-top: 22px; }
}

/* Touch screens: same parts, big enough to hit. */
@media (pointer: coarse) {
  .titlebar, .menubar, .toolbar, .tabs, .playerbar, .statusbar, .taskbar { zoom: 1.5; }
  .tab { height: 22px; padding: 0 16px; }
  .tab.selected { height: 25px; }
  .menu-item { min-height: 26px; }
  .faq summary { padding: 11px 0; }
  .button.big { min-height: 44px; }
  .demo-modes button { min-height: 33px; }
  .demo-play { min-height: 33px; }
}

@media print {
  html, body { overflow: visible; background: #fff; }
  #app { position: static; display: block; }
  .titlebar, .menubar, .toolbar, .tabs, .sidebar, .playerbar, .statusbar, .taskbar, .desk-icons { display: none; }
  .workspace { display: block; }
  .content { overflow: visible; box-shadow: none; }
}
