/* Look and feel borrowed from ClipDeck: dark panels, sidebar nav, 16:9 cards, themeable accent. */
:root {
  --bg: #0e0f13; --panel: #14161c; --panel-2: #1c1f28; --border: #262a35;
  --text: #e7e9ee; --muted: #8b91a1; --accent: #6c7cff; --accent-rgb: 108 124 255;
  --accent-text: #9dbcff; --on-accent: #fff; --radius: 8px; --radius-lg: 14px;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
[data-theme="mono"] {
  --bg: #000; --panel: #070707; --panel-2: #121212; --border: #262626; --text: #f4f4f4; --muted: #8c8c8c;
  --accent: #fff; --accent-rgb: 255 255 255; --accent-text: #fff; --on-accent: #000; --radius: 3px; --radius-lg: 4px;
}
[data-theme="ember"] {
  --bg: #17110d; --panel: #201813; --panel-2: #2c2119; --border: #3b2d22; --text: #f1e4d6; --muted: #a18a76;
  --accent: #d19a66; --accent-rgb: 209 154 102; --accent-text: #e8bb8b; --on-accent: #1a120c;
}
[data-theme="light"] {
  --bg: #f4f5f8; --panel: #fff; --panel-2: #eceef3; --border: #dcdfe6; --text: #1d2030; --muted: #6a7082;
  --accent: #3b6cf6; --accent-rgb: 59 108 246; --accent-text: #2a56d4; --on-accent: #fff; color-scheme: light;
}
[data-theme="sakura"] {
  --bg: #fdf0f4; --panel: #fff8fa; --panel-2: #f9e0e8; --border: #f0cbd7; --text: #4a2a35; --muted: #96707d;
  --accent: #e0709a; --accent-rgb: 224 112 154; --accent-text: #c04e7b; --on-accent: #fff;
  --radius: 12px; --radius-lg: 18px; color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); }
a { color: var(--accent-text); }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.accent { color: var(--accent-text); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Controls */
.btn, select {
  font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 16px; cursor: pointer; text-decoration: none; display: inline-block;
  transition: border-color .12s, background .12s, transform .12s;
}
.btn:hover, select:hover { border-color: rgb(var(--accent-rgb) / .6); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* Layout */
.app { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  padding: 16px 10px; background: var(--panel); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; padding: 4px 10px 18px; color: var(--text); text-decoration: none; }
.logo {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-weight: 800;
  background: var(--accent); color: var(--on-accent);
}
.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius);
  color: var(--muted); text-decoration: none; transition: background .12s, color .12s;
}
.nav:hover { background: var(--panel-2); color: var(--text); }
.nav.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.ico { width: 18px; text-align: center; }
.badge { margin-left: auto; font-size: 11px; color: var(--muted); }
.sidebar-foot { margin-top: auto; padding: 0 10px; display: grid; gap: 6px; }
.sidebar-foot select { padding: 6px 10px; }

.content { padding: 32px clamp(16px, 4vw, 48px) 120px; min-width: 0; outline: none; }
.view { max-width: 1100px; margin: 0 auto; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view-head { margin-bottom: 22px; }
.section-title { margin: 36px 0 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; }
.panel p:last-child { margin-bottom: 0; }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; padding: 28px;
  border-radius: calc(var(--radius-lg) + 4px); border: 1px solid var(--border);
  background: radial-gradient(circle at 15% 0%, rgb(var(--accent-rgb) / .18), transparent 55%), var(--panel);
}
.hero h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -.02em; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; margin-bottom: 4px; }
.lead { color: var(--muted); font-size: 16px; max-width: 52ch; margin-bottom: 20px; }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--radius-lg); border: 1px solid var(--border); display: block; box-shadow: 0 12px 40px rgb(0 0 0 / .35); }
.hero-photo figcaption { text-align: center; color: var(--muted); font-size: 12px; margin-top: 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tile {
  display: grid; gap: 2px; padding: 18px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); color: var(--text); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile-ico { font-size: 22px; color: var(--accent-text); }

/* Cards (films, like ClipDeck's clip grid) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card { background: none; border: none; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.card-thumb {
  position: relative; aspect-ratio: 16 / 9; background: var(--panel-2); border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--border); transition: border-color .15s, transform .15s;
}
.card:hover .card-thumb { border-color: var(--accent); transform: translateY(-2px); }
.card-thumb video, .card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.play-chip {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; color: #fff;
  background: linear-gradient(transparent 50%, rgb(0 0 0 / .45)); opacity: .9;
}
.card-title { margin-top: 8px; font-weight: 600; }
.card-meta { color: var(--muted); font-size: 12px; }

/* Photos */
.photo-grid { columns: 3 240px; column-gap: 14px; }
.photo { display: block; width: 100%; margin: 0 0 14px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--panel-2); cursor: zoom-in; break-inside: avoid; transition: border-color .15s, transform .15s; }
.photo:hover { border-color: var(--accent); transform: translateY(-2px); }
.photo img { width: 100%; display: block; }

/* Music */
.tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.track {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; width: 100%;
  padding: 10px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .12s, background .12s;
}
.track:hover { border-color: rgb(var(--accent-rgb) / .6); }
.track.playing { border-color: var(--accent); background: rgb(var(--accent-rgb) / .1); }
.track .tno { color: var(--muted); text-align: center; }
.track.playing .tno { color: var(--accent-text); }
.track .tmeta { color: var(--muted); font-size: 12px; }

/* Apps */
.app-card { display: grid; grid-template-columns: 96px 1fr; gap: 22px; align-items: center; padding: 24px; background: radial-gradient(circle at 0% 0%, rgb(var(--accent-rgb) / .15), transparent 60%), var(--panel); border: 1px solid var(--border); border-radius: calc(var(--radius-lg) + 4px); }
.app-card img { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 8px 24px rgb(0 0 0 / .4); }
.app-card h2 { font-size: 24px; margin: 0; }
.dl-row { margin-top: 6px; }

/* About */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.inline-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--radius); margin-top: 12px; }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.empty h2 { color: var(--text); }
.empty code { background: var(--panel-2); padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* Music player bar */
.player {
  position: fixed; left: 210px; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px clamp(16px, 4vw, 48px); background: var(--panel); border-top: 1px solid var(--border);
}
.pbtn { background: none; border: none; color: var(--text); font-size: 18px; cursor: pointer; padding: 6px 8px; border-radius: 50%; }
.pbtn:hover { background: var(--panel-2); }
.pbtn.big { background: var(--accent); color: var(--on-accent); width: 40px; height: 40px; font-size: 16px; }
.pbtn.big:hover { filter: brightness(1.1); background: var(--accent); }
.p-info { min-width: 0; width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#p-seek { flex: 1; accent-color: var(--accent); min-width: 80px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .92); display: grid; place-items: center; animation: fade .2s ease; }
.lb-stage { max-width: 92vw; max-height: 80vh; display: grid; place-items: center; }
.lb-stage img, .lb-stage video, .lb-stage iframe { max-width: 92vw; max-height: 80vh; border-radius: var(--radius); background: #000; }
.lb-stage iframe { width: min(92vw, 1100px); aspect-ratio: 16 / 9; border: 0; }
.lb-cap { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: #ddd; padding: 0 60px; }
.lb-close, .lb-nav { position: absolute; background: rgb(255 255 255 / .1); border: none; color: #fff; cursor: pointer; border-radius: 50%; width: 44px; height: 44px; font-size: 22px; }
.lb-close:hover, .lb-nav:hover { background: rgb(255 255 255 / .22); }
.lb-close { top: 16px; right: 16px; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 30px; line-height: 1; }
.lb-nav.prev { left: 16px; } .lb-nav.next { right: 16px; }

/* Narrow screens: sidebar becomes a top bar */
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; border-right: none; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .brand { padding: 0 8px; } .brand { font-size: 0; } .logo { font-size: 14px; }
  .nav-list { flex-direction: row; } .nav { padding: 6px 10px; white-space: nowrap; } .nav .ico, .badge { display: none; }
  .nav.active { box-shadow: inset 0 -3px 0 var(--accent); }
  .sidebar-foot { margin: 0 0 0 auto; } .sidebar-foot label { display: none; }
  .hero { grid-template-columns: 1fr; padding: 20px; }
  .app-card { grid-template-columns: 1fr; }
  .player { left: 0; flex-wrap: wrap; } .p-info { width: 100%; order: -1; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
