/* ==========================================================================
   styles.css — Variant D "Bento"
   Home is a grid of rounded tiles of different sizes. Floating pill nav,
   Geist + Geist Mono type, violet accent.

   All colors live in the custom properties right below. Dark is the default;
   the @media block swaps them when the visitor's system is set to light mode.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #121215;
  --surface-2: #1b1b20;
  --border: #24242a;
  --text: #eeeef1;
  --muted: #8e8e99;
  --accent: #b4a0ff;       /* soft violet */
  --glow-opacity: .4;

  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
  --radius-tile: 22px;
  --wide: 980px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f7f7f8;
    --surface: #ffffff;
    --surface-2: #efeff2;
    --border: #e4e4e9;
    --text: #17171c;
    --muted: #686874;
    --accent: #5b3fd6;
    --glow-opacity: .25;
  }
}

/* ---------- Basics ---------- */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
code { font: .85em var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.muted { color: var(--muted); }

/* Small monospace caps used for tile labels, dates and counts */
.label {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 30;
  background: var(--surface-2); padding: 8px 12px; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; }

.container { width: min(var(--wide), 100% - 32px); margin-inline: auto; }

/* ---------- Floating pill nav ---------- */

.site-header { position: sticky; top: 16px; z-index: 10; display: flex; justify-content: center; padding: 0 16px; }
.pill {
  display: flex; align-items: center; gap: 2px; padding: 4px;
  border: 1px solid var(--border); border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgb(0 0 0 / .18);
}
.pill a {
  font-size: 14px; font-weight: 500; color: var(--muted);
  padding: 6px 14px; border-radius: 999px;
  transition: color .15s, background-color .15s;
}
.pill a:hover { color: var(--text); }
.pill a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.pill .pill-home { padding: 3px; }
.pill .pill-home img { border-radius: 50%; }
.pill .pill-home[aria-current="page"] { box-shadow: 0 0 0 2px var(--accent); background: transparent; }

@media (max-width: 440px) { .pill a { padding: 6px 9px; font-size: 13px; } }

/* ---------- Page transitions ---------- */

main { display: block; padding: 56px 0 80px; min-height: 70vh; }
main:focus { outline: none; }
main.is-leaving { opacity: 0; transition: opacity .15s ease; }
.view { animation: fade-up .35s var(--ease); }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* Lazy images fade in once loaded (app.js adds .is-loaded) */
img[loading="lazy"] { opacity: 0; transition: opacity .5s ease, transform .6s var(--ease); }
img.is-loaded { opacity: 1; }

/* ---------- Headings ---------- */

.page-head { margin-bottom: 40px; max-width: 620px; }
.page-head h1 { font-size: clamp(30px, 5vw, 40px); font-weight: 600; letter-spacing: -.035em; line-height: 1.1; margin: 8px 0 8px; }

.section { margin-top: 56px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }

.more {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--muted); transition: color .15s;
}
.more:hover { color: var(--accent); }
.more .icon { transition: transform .2s var(--ease); }
.more:hover .icon { transform: translateX(2px); }

.notice {
  font-size: 13px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 20px;
}

/* ---------- Bento grid (Home) ---------- */

/* Grids in this file use minmax(0, 1fr) instead of plain 1fr. Plain 1fr
   won't shrink a column below its content, so one long album or track name
   would stretch its column. minmax(0, 1fr) keeps columns equal and lets
   long names cut off with "…". */

.bento {
  display: grid; gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(176px, auto);
  grid-auto-flow: dense;
}

.tile {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 20px; border-radius: var(--radius-tile);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .2s, transform .3s var(--ease);
}
a.tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-2px); }

/* How big each tile is: columns x rows */
.tile--intro    { grid-column: span 2; grid-row: span 2; }
.tile--feature  { grid-column: span 2; grid-row: span 2; }
.tile--now      { grid-column: span 2; }
.tile--mosaic   { grid-column: span 1; }
.tile--small    { grid-column: span 1; }
.tile--projects { grid-column: span 3; }

@media (max-width: 760px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(150px, auto); }
  .tile--projects { grid-column: span 2; }
  .tile--feature { grid-row: span 1; aspect-ratio: 4 / 3; }
  .tile--hide-sm { display: none; }
}

.tile--intro { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; }
.intro-name { font-size: 22px; font-weight: 600; letter-spacing: -.025em; }
.bio { color: var(--muted); font-size: 16px; margin-top: 6px; }

.socials { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0 0 0 -8px; }
.socials a {
  display: grid; place-items: center; width: 36px; height: 36px;
  color: var(--muted); border-radius: 10px;
  transition: color .15s, background-color .15s;
}
.socials a:hover { color: var(--text); background: var(--surface-2); }

/* Photo tiles: the image fills the tile, a caption sits bottom-left */
.tile--photo { padding: 0; }
.tile--photo img, .tile--mosaic { position: absolute; inset: 0; }
.tile--photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), opacity .5s; }
.tile--photo:hover img { transform: scale(1.04); }
.tile-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  padding: 36px 16px 14px; color: #fff; font-size: 14px; font-weight: 500;
  background: linear-gradient(transparent, rgb(0 0 0 / .65));
}
.tile-caption .label { color: rgb(255 255 255 / .8); }

/* Top-albums mosaic: four covers in a 2x2 square */
.tile--mosaic { position: relative; inset: auto; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tile--mosaic .art { width: 100%; height: 100%; border-radius: 0; aspect-ratio: auto; }

.tile--now { display: flex; align-items: center; gap: 16px; }
.now-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.now-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.is-live .now-label { color: var(--accent); }
.now-title { font-size: 17px; font-weight: 600; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tile--projects .list { margin: 0 -10px; }

.intro-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------- About ---------- */

.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.about-story { grid-column: span 2; display: flex; flex-direction: column; gap: 14px; font-size: 16px; line-height: 1.7; }
.about-story a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.about-photo { margin: 0; min-height: 280px; }
.about-timeline { grid-column: 1 / -1; }
.about-grid .tile > .label { display: block; margin-bottom: 12px; }
.about-grid .row .icon { color: var(--muted); flex-shrink: 0; }
.about-timeline .row { align-items: baseline; }
.about-timeline .row-meta { width: 40px; flex-shrink: 0; }

.facts { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.facts dt { margin-bottom: 1px; }
.facts dd { margin: 0; }

@media (max-width: 760px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .about-story { grid-column: auto; }
  .about-photo { aspect-ratio: 4 / 5; }
}

/* ---------- Lists ---------- */

.list { list-style: none; margin: 0 -10px; padding: 0; }

.row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: var(--radius);
  transition: background-color .15s;
}
a.row:hover { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.row-title { font-weight: 500; display: inline-flex; align-items: center; gap: 3px; }
.row-title .icon { color: var(--muted); transition: color .15s, transform .2s var(--ease); }
a.row:hover .row-title .icon { color: var(--accent); transform: translate(1px, -1px); }
.row-desc { color: var(--muted); }
.row-meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tags { display: flex; gap: 4px; }
.tag { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
@media (max-width: 600px) { .tags { display: none; } }

/* Projects page: rows inside one bordered panel, separated by lines */
.panel { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-tile); background: var(--surface); padding: 6px; }
.panel li + li { border-top: 1px solid var(--border); }
.panel .row { padding: 14px; border-radius: 14px; }

/* ---------- Gallery ---------- */

.album + .album { margin-top: 56px; }
.album-head { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; margin-bottom: 14px; }
.album-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.album-date { margin-left: auto; }

.photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; grid-auto-flow: dense; }
@media (max-width: 760px) { .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.photo {
  display: block; padding: 0; border: 0; overflow: hidden; cursor: zoom-in;
  aspect-ratio: 1; background: var(--surface); border-radius: 14px;
}
/* The first photo of each set is shown twice as big */
.photo:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; border-radius: var(--radius-tile); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo:hover img { transform: scale(1.04); }

/* ---------- Listening ---------- */

.art { width: var(--size); height: var(--size); border-radius: 8px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.art--empty { display: grid; place-items: center; color: var(--muted); }

.listen-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; align-items: start; }
@media (max-width: 760px) { .listen-grid { grid-template-columns: minmax(0, 1fr); } }

.tile--now-big { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 84px; }
.tile--now-big .art { border-radius: 14px; margin-bottom: 16px; box-shadow: 0 12px 30px rgb(0 0 0 / .3); }
.tile--now-big .now-title { font-size: 24px; white-space: normal; }
a.now-title:hover { color: var(--accent); }
@media (max-width: 760px) { .tile--now-big { position: relative; top: 0; } }
.now-bg {
  position: absolute; inset: -40px; z-index: -1;
  background-size: cover; background-position: center;
  filter: blur(50px) saturate(1.5); opacity: var(--glow-opacity);
}

/* Equalizer: four bars scaling up and down at slightly different speeds */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; color: var(--accent); }
.eq span {
  width: 3px; height: 100%; border-radius: 1px; background: currentColor;
  transform-origin: bottom; animation: eq 1s ease-in-out infinite;
}
.eq span:nth-child(2) { animation-duration: .8s; animation-delay: -.4s; }
.eq span:nth-child(3) { animation-duration: 1.2s; animation-delay: -.2s; }
.eq span:nth-child(4) { animation-duration: .9s; animation-delay: -.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

.track {
  display: flex; align-items: center; gap: 12px;
  padding: 7px 10px; border-radius: var(--radius);
  transition: background-color .15s;
}
a.track:hover { background: var(--surface-2); }
.track-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.track-title, .track-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-title { font-weight: 500; }
.track-artist { color: var(--muted); font-size: 14px; }
.track-when { font-family: var(--mono); color: var(--muted); font-size: 12px; white-space: nowrap; }

.album-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px 12px;
}
@media (max-width: 760px) { .album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.album-card { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.album-card .art { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; margin-bottom: 8px; transition: transform .3s var(--ease), opacity .5s; }
a.album-card:hover .art { transform: translateY(-2px); }
.album-name { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-artist { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Footer ---------- */

.site-footer .container {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding: 24px 0 48px; border-top: 1px solid var(--border);
}

/* ---------- Lightbox ---------- */

body:has(.lightbox[open]) { overflow: hidden; }

.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: #fff;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; animation: fade .2s ease; }
.lightbox::backdrop { background: rgb(0 0 0 / .9); backdrop-filter: blur(6px); }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox img {
  max-width: min(1400px, 100vw - 32px); max-height: calc(100dvh - 140px);
  width: auto; height: auto; border-radius: 16px;
}
.lightbox figcaption { font: 12px var(--mono); letter-spacing: .04em; color: rgb(255 255 255 / .7); }

.lb-btn {
  position: fixed; display: grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgb(255 255 255 / .1); color: #fff;
  transition: background-color .15s;
}
.lb-btn:hover { background: rgb(255 255 255 / .2); }
.lb-btn:focus-visible { outline-color: #fff; border-radius: 50%; }
.lb-close { top: 16px; right: 16px; }
.lb-prev, .lb-next { top: 50%; translate: 0 -50%; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
@media (max-width: 640px) {
  .lb-prev, .lb-next { top: auto; bottom: 20px; translate: none; }
  .lb-prev { left: calc(50% - 52px); }
  .lb-next { right: calc(50% - 52px); }
}

@keyframes fade { from { opacity: 0; } }

/* Respect "reduce motion" in the OS settings */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
