/* ==========================================================================
   Janne Poikolainen – kotisivu
   One stylesheet for every page. Light + dark, mobile first, no framework.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #eceff1;
  --ink: #16212b;
  --muted: #5b6a76;
  --line: #dde2e6;
  --accent: #c2410c;          /* ember, from the bonfire photo */
  --accent-ink: #ffffff;
  --focus: #1a6fd6;

  --radius: 1.1rem;
  --maxw: 72rem;
  --shadow: 0 1px 2px rgb(22 33 43 / .06), 0 14px 34px rgb(22 33 43 / .09);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d141a;
    --surface: #151f27;
    --surface-2: #1d2a34;
    --ink: #e8edf1;
    --muted: #9aa9b5;
    --line: #26343f;
    --accent: #ff8f57;
    --accent-ink: #1a0f08;
    --focus: #7db3ff;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 14px 34px rgb(0 0 0 / .35);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--bg)) 0, var(--bg) 26rem);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
}
main { flex: 1 0 auto; min-width: 0; }

img { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 1rem; text-wrap: pretty; }
ul, ol { padding: 0; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: .4rem;
}
@media (prefers-reduced-motion: no-preference) {
  a, .link, .chip, .btn, .cat a { transition: color .15s ease, background-color .15s ease, border-color .15s ease, transform .2s ease, box-shadow .2s ease; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -999px; top: 0; z-index: 100;
  padding: .7rem 1.1rem; background: var(--ink); color: var(--bg); font-weight: 650;
  border-radius: 0 0 .6rem 0; text-decoration: none;
}
.skip:focus { left: 0; }

/* ---- Header -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}
.bar {
  max-width: var(--maxw); margin-inline: auto;
  padding: .55rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .1rem 1.5rem;
}
.brand {
  padding: .5rem 0;
  font-size: .82rem; font-weight: 650; letter-spacing: .22em; text-transform: uppercase;
  text-decoration: none; color: var(--ink);
}
.brand:hover { color: var(--accent); }
.nav ul { display: flex; flex-wrap: wrap; gap: .15rem; margin: 0; list-style: none; }
.nav a {
  display: block; padding: .55rem .8rem; border-radius: 999px;
  font-size: .92rem; font-weight: 560; text-decoration: none; color: var(--muted);
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current] { background: var(--ink); color: var(--bg); }

/* ---- Layout -------------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding: 1rem 1rem 4.5rem; }

.crumbs { margin: .75rem 0 1.5rem; font-size: .88rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .1rem .4rem; margin: 0; list-style: none; }
.crumbs li + li::before { content: "›"; margin-right: .4rem; opacity: .6; }
.crumbs a { display: inline-block; padding: .3rem 0; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

h1, h2, h3 { text-wrap: balance; }
h1 {
  margin: 0 0 1.75rem;
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  line-height: 1.08; font-weight: 300; letter-spacing: .01em;
}
h1::after {
  content: ""; display: block; width: 3rem; height: 3px; margin-top: .8rem;
  background: var(--accent); border-radius: 2px;
}
.eyebrow {
  display: flex; align-items: center; gap: 1rem;
  margin: 2.5rem 0 1rem;
  font-size: .78rem; font-weight: 650; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.content > .eyebrow:first-of-type { margin-top: 0; }
.lead { font-size: 1.1rem; max-width: 60ch; }

/* ---- Home hero ----------------------------------------------------------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  width: calc(100% - 2rem); max-width: var(--maxw); margin: 1rem auto 0;
  min-height: clamp(17rem, 44vw, 30rem);
  display: flex; align-items: flex-end;
  border-radius: 1.5rem; color: #fff; background: #26384a;
  box-shadow: var(--shadow);
}
.hero-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgb(8 16 24 / .12) 0, rgb(8 16 24 / 0) 38%, rgb(8 16 24 / .74) 100%);
}
.hero-inner { padding: clamp(1.25rem, 4vw, 3rem); }
.hero h1 {
  margin: 0; color: #fff; font-weight: 300;
  font-size: clamp(2.15rem, 1.1rem + 5.4vw, 4.75rem);
  letter-spacing: .035em; line-height: 1.02;
  text-shadow: 0 2px 26px rgb(0 0 0 / .4);
}
.hero h1::after { display: none; }
.hero p {
  margin: .8rem 0 0; font-size: .8rem; font-weight: 650;
  letter-spacing: .34em; text-transform: uppercase; opacity: .93;
}

.home-grid { display: grid; gap: 2rem; margin-top: 1.75rem; }
.portrait {
  margin: 0; overflow: hidden; border-radius: 1.25rem; box-shadow: var(--shadow);
  aspect-ratio: 16 / 10; background: var(--surface-2);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; }

.menu-list { display: grid; gap: .85rem; margin: 0; list-style: none; }
.menu-item details {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  scroll-margin-top: 5.5rem;
}
.menu-item summary {
  display: grid; grid-template-columns: 4.75rem minmax(0, 1fr) auto; align-items: center; gap: 1rem;
  padding: .7rem 1.1rem .7rem .7rem; cursor: pointer; list-style: none;
  border-radius: var(--radius); -webkit-user-select: none; user-select: none;
}
.menu-item summary::-webkit-details-marker { display: none; }
.menu-item img { width: 4.75rem; height: 4.75rem; object-fit: cover; border-radius: .8rem; }
.menu-item .txt { display: grid; gap: .1rem; min-width: 0; }
.menu-item .t { font-size: 1.3rem; font-weight: 620; letter-spacing: .005em; line-height: 1.2; }
.menu-item .d { color: var(--muted); font-size: .95rem; line-height: 1.35; }
.menu-item .arrow {
  width: .7rem; height: .7rem; margin: 0 .35rem .3rem;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .25s ease, border-color .15s ease;
}
.menu-item details:hover { border-color: var(--accent); }
.menu-item summary:hover .arrow { border-color: var(--accent); }
.menu-item details[open] { border-color: var(--accent); box-shadow: var(--shadow); }
.menu-item details[open] .arrow { transform: rotate(225deg); margin-bottom: -.2rem; border-color: var(--accent); }
.menu-item summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.panel { padding: .35rem 1rem 1rem; border-top: 1px solid var(--line); margin: 0 .7rem; padding-inline: 0; }
.panel .links { margin: .75rem 0 .25rem; }
.panel .link { background: var(--bg); }
.panel .eyebrow { margin: 1.4rem 0 .6rem; }
.panel .eyebrow:first-child { margin-top: 1rem; }
@media (prefers-reduced-motion: no-preference) {
  .menu-item details[open] .panel { animation: panel-in .25s ease; }
  @keyframes panel-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}

/* ---- Photo + content split ---------------------------------------------- */
.split { display: grid; gap: 1.75rem; }
.photo {
  margin: 0; overflow: hidden; border-radius: 1.25rem; box-shadow: var(--shadow);
  aspect-ratio: 16 / 10; background: var(--surface-2);
}
.photo img { width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }

/* ---- Link rows ----------------------------------------------------------- */
.links { display: grid; gap: .65rem; margin: 0 0 1rem; list-style: none; }
.link {
  display: grid; gap: .1rem; position: relative;
  padding: .85rem 3rem .85rem 1.15rem;
  text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.link .t { font-weight: 620; font-size: 1.05rem; line-height: 1.3; }
.link .d { color: var(--muted); font-size: .93rem; line-height: 1.4; }
a.link::after {
  content: "→"; position: absolute; right: 1.15rem; top: 50%; translate: 0 -50%;
  color: var(--muted); font-size: 1.15rem;
}
a.link.ext::after { content: "↗"; }
a.link:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
a.link:hover::after { color: var(--accent); }
.link.static { padding-right: 1.15rem; }
.link.multi { padding-right: 1.15rem; gap: .4rem; }
.link.multi .chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .35rem; }

.chip, .btn {
  display: inline-flex; align-items: center; gap: .35em; min-height: 2.5rem; padding: .35rem .95rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: .92rem; font-weight: 580; text-decoration: none; color: var(--ink);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.ext::after { content: "↗"; font-size: .85em; opacity: .7; }
.btn {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650;
}
.btn:hover { color: var(--accent-ink); filter: brightness(1.08); transform: translateY(-1px); }
.btn.ext::after { content: "↗"; font-size: .9em; }

.note { color: var(--muted); font-size: .92rem; }
.page-note { margin-top: 1.5rem; }

/* ---- Link page grid ------------------------------------------------------ */
.linkgrid { display: grid; gap: 1rem 2.5rem; }
.linkcol .eyebrow { margin-top: 1.25rem; }

/* ---- Playlist index / categories ---------------------------------------- */
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: .7rem; margin: 0 0 1.25rem; list-style: none; }
.cat a, .cat.soon {
  display: grid; gap: .1rem; height: 100%; padding: .85rem 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit;
}
.cat .t { font-weight: 620; line-height: 1.3; }
.cat .d { color: var(--muted); font-size: .88rem; }
.cat a:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.cat.soon { background: transparent; border-style: dashed; color: var(--muted); }
.cat.wide { grid-column: 1 / -1; }
.cat.wide a { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cat.wide a .d { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.cat.wide a:hover { border-color: var(--accent); }

/* ---- Playlists ----------------------------------------------------------- */
.jump { margin: -.5rem 0 1.75rem; }
.jump ul { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; list-style: none; }
.jump a {
  display: inline-flex; align-items: center; min-height: 2.25rem; padding: .2rem .8rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: .85rem; font-weight: 580; text-decoration: none; font-variant-numeric: tabular-nums;
}
.jump a:hover { border-color: var(--accent); color: var(--accent); }

.plist, .album {
  margin: 0 0 1.5rem;
}
.plist {
  padding: 1.25rem 1.25rem 1.5rem; scroll-margin-top: 5.5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 1.25rem;
}
.plist-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; }
.plist-title { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; }
.plist h2 { margin: 0; font-size: 1.35rem; font-weight: 620; line-height: 1.25; }
.tag {
  padding: .1rem .7rem; border-radius: 999px; background: var(--surface-2);
  color: var(--muted); font-size: .82rem; font-weight: 600;
}

.tracks { margin: 1rem 0 0; list-style: none; counter-reset: n; columns: 2 19rem; column-gap: 2.5rem; }
.tracks li {
  position: relative; break-inside: avoid; counter-increment: n;
  padding: .45rem 0 .45rem 2.4rem; border-bottom: 1px dashed var(--line); line-height: 1.45;
}
.tracks li::before {
  content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: .5rem;
  color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; letter-spacing: .04em;
}
.tracks li.note { counter-increment: none; color: var(--muted); font-size: .88rem; font-style: italic; padding-block: .2rem; border-bottom: 0; }
.tracks li.note::before { content: ""; }
.tracks .a { color: var(--muted); }
.tracks .sep { color: var(--muted); }
.tracks .s { font-weight: 560; }
.tracks .x { color: var(--muted); font-size: .86em; }
.plist .note { margin: .75rem 0 0; }

.disc-sec { margin-top: 2.5rem; }
.disc-sec h2 { margin: 0 0 1rem; font-size: 1.3rem; font-weight: 620; }
.album { padding: 1rem 1.25rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.album h3 { margin: 0; font-size: 1.05rem; font-weight: 620; line-height: 1.35; }
.album .year {
  display: inline-block; margin-left: .35rem; padding: .05rem .6rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-size: .78rem; font-weight: 650; vertical-align: .08em;
}
.album .note { margin: .25rem 0 0; }
.album .tracks { margin-top: .5rem; columns: 1; }

/* ---- Footer -------------------------------------------------------------- */
.site-footer { padding: 2rem 1rem calc(2rem + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: .85rem; }
.site-footer p { margin: 0; }

/* ---- Wider screens ------------------------------------------------------- */
@media (min-width: 40rem) {
  .linkgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 52rem) {
  .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); gap: 3.5rem; align-items: start; margin-top: 2.5rem; }
  .menu-list { order: 1; }
  .portrait { order: 2; aspect-ratio: 4 / 5; position: sticky; top: 5.5rem; }
  .portrait img { object-position: 50% 50%; }
  .menu-item .t { font-size: 1.45rem; }

  .split { grid-template-columns: minmax(0, 21rem) minmax(0, 1fr); gap: 3.5rem; align-items: start; }
  .split .photo { aspect-ratio: var(--ratio, 4 / 5); position: sticky; top: 5.5rem; }
  .links { max-width: 40rem; }
  .linkgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .linkgrid .links { max-width: none; }
  .plist { padding: 1.5rem 1.75rem 1.75rem; }
}
@media (max-width: 40rem) {
  .menu-item details { scroll-margin-top: 9rem; }
}
@media (max-width: 26rem) {
  .nav a { padding: .5rem .65rem; font-size: .88rem; }
  .menu-item summary { grid-template-columns: 4rem minmax(0, 1fr) auto; gap: .8rem; }
  .panel { margin: 0 .55rem; }
  .menu-item img { width: 4rem; height: 4rem; }
}

/* ---- Print --------------------------------------------------------------- */
@media print {
  body { background: #fff; color: #000; display: block; font-size: 11pt; }
  .site-header, .skip, .jump, .hero, .photo, .portrait, .btn { display: none !important; }
  .plist, .album, .link { border-color: #999; box-shadow: none; break-inside: avoid; }
  a { color: #000; }
}
