/* =========================================================
   WAW — band site
   Palette: black ground, four neon tile colors, off-white text
   Type: Anton (display, matches the logo), Space Mono (UI/body)
   ========================================================= */
:root {
  --bg: #000000;
  --ink: #0A0A0A;          /* text on neon tiles */
  --paper: #F4F4F0;        /* text on black */
  --muted: #B9B9B2;
  --pink: #FF2E88;
  --cyan: #00E5FF;
  --yellow: #FFE600;
  --orange: #FF5A1F;

  --hdr: 96px;
  --gap: 12px;
  --strip: 48px;           /* collapsed tile height */
  --word: clamp(56px, 6vw, 100px); /* open section's title */
  --tiles: 4;              /* number of sections: change this when adding one */
  --tile-h: max(110px, calc((var(--screen) - var(--hdr) - var(--gap) * var(--tiles)) / var(--tiles)));
  /* Open section: what's left under the stacked strips, then under its title */
  --open-h: max(360px, calc(var(--screen) - var(--hdr) - (var(--strip) + 8px) * (var(--tiles) - 1) - var(--gap)));
  --panel-h: calc(var(--open-h) - 72px - var(--word) * .84);
  --ease: cubic-bezier(.75, 0, .2, 1);
  --screen: 100vh;
}
@supports (height: 100dvh) { :root { --screen: 100dvh; } }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--paper); }
html { overflow-anchor: none; }
body { font-family: 'Space Mono', ui-monospace, monospace; min-height: var(--screen); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
img, video { display: block; }

/* ---------- Intro ---------- */
.intro {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  transition: background-color .7s ease .15s, opacity .35s ease .65s;
}
.no-intro .intro { display: none; }
.intro-logo { padding: 0; border: 0; background: none; cursor: pointer; }
.intro-logo:focus-visible { outline: 2px solid var(--paper); outline-offset: 4px; }
.intro video {
  width: min(80vmin, 600px); height: auto;
  transform-origin: 50% 50%;
  transition: transform .8s var(--ease);
}
.intro.shrink { background-color: rgba(0, 0, 0, 0); opacity: 0; pointer-events: none; }
/* --tx/--ty/--s are measured in main.js so the video lands exactly on the header logo */
.intro.shrink video { transform: translate(var(--tx, 0px), var(--ty, -40vh)) scale(var(--s, .16)); }
.intro.gone { display: none; }

/* ---------- Header ---------- */
.hdr { height: var(--hdr); display: flex; align-items: center; justify-content: center; }
.logo { padding: 8px; opacity: 0; transform: translateY(-6px); transition: opacity .4s ease, transform .4s ease; }
.logo img { height: 44px; width: auto; }
.ready .logo { opacity: 1; transform: none; }
.logo:focus-visible { outline: 2px solid var(--paper); outline-offset: 4px; }

/* ---------- Tiles ---------- */
.tiles {
  display: flex; flex-wrap: wrap; gap: var(--gap); padding: 0 var(--gap) var(--gap);
  opacity: 0; transform: translateY(24px);
  transition: opacity .5s ease .1s, transform .6s cubic-bezier(.2, .7, .2, 1) .1s;
}
.ready .tiles { opacity: 1; transform: none; }

.tile {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  flex: 1 1 100%;
  height: var(--tile-h); min-height: 110px;
  background: var(--c); color: var(--ink);
  container-type: inline-size;   /* lets the word scale with the tile's width */
  transition: height .55s var(--ease), min-height .55s var(--ease), flex-basis .55s var(--ease);
}
.tile-btn {
  flex: 1; width: 100%; min-height: 44px;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  background: none; border: 0; padding: 24px 28px; text-align: left; cursor: pointer;
}
.tile-btn:focus-visible { outline: 4px solid var(--ink); outline-offset: -10px; }
.word {
  display: block; font-family: 'Anton', Impact, sans-serif; font-weight: 400;
  text-transform: uppercase; line-height: .84; letter-spacing: -.01em;
  font-size: clamp(48px, min(19cqi, var(--tile-h) * .7), 200px);  /* sized so INSTAGRAM always fits its tile */
  transition: font-size .55s var(--ease), transform .25s ease;
}
@media (hover: hover) { /* touch screens would keep this stuck on after a tap */
  .tile:not(.is-active) .tile-btn:hover .word { transform: translateX(10px) skewX(-6deg); }
}

/* Collapsed: inactive tiles shrink into equal full-width strips stacked above the open section */
.tiles.has-active { gap: 8px; }
.has-active .tile { height: var(--strip); min-height: var(--strip); }
.has-active .tile-btn { flex-direction: row; align-items: center; justify-content: flex-start; padding: 0 20px; }
.has-active .word { font-size: 34px; }

/* Expanded: active tile drops below the strips and fills the screen */
.has-active .tile.is-active { order: 9; height: var(--open-h); min-height: 0; }
.has-active .tile.is-active .tile-btn { flex: 0 0 auto; align-items: flex-end; padding: 20px 96px 10px 28px; cursor: default; }
.has-active .tile.is-active .word { font-size: var(--word); }

.close {
  display: none; position: absolute; top: 20px; right: 20px; width: 52px; height: 52px;
  align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper); border: 0; cursor: pointer; transition: transform .25s ease;
}
.tile.is-active .close { display: flex; }
.close:hover { transform: rotate(90deg); }

/* ---------- Panels ---------- */
.panel { flex: 1; min-height: 0; overflow: auto; overflow-anchor: none; padding: 14px 28px 28px; }
.tile.is-active .panel { animation: panelIn .45s ease .3s both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.display { margin: 0; font-family: 'Anton', Impact, sans-serif; font-weight: 400; font-size: 44px; line-height: 1; text-transform: uppercase; }
.display.big { font-size: 52px; }
.meta { margin: 0; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.body { margin: 0; font-size: 15px; line-height: 1.65; max-width: 60ch; text-wrap: pretty; }
.small { font-size: 13px; }

.list { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: 16px; padding: 12px 0; border-top: 2px solid var(--ink); font-size: 15px; }
.row:last-child { border-bottom: 2px solid var(--ink); }
.row.two { grid-template-columns: 1fr auto; }

.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; background: none; border: 2px solid var(--ink); color: var(--ink); text-decoration: none; cursor: pointer; font: 700 12px/1 'Space Mono', monospace; letter-spacing: .12em; text-transform: uppercase; }
.pill:hover, .pill:focus-visible { background: var(--ink); color: var(--paper); }

/* Music: streaming logos, More button and the album list */
.listen { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.logo-btn { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: var(--ink); color: var(--c); transition: background-color .2s ease, color .2s ease; }
.logo-btn:hover, .logo-btn:focus-visible { background: var(--paper); color: var(--ink); }
.more-btn { height: 56px; }
.more-btn[hidden] { display: none; }
.more-links[hidden] { display: none; }
.albums .meta { margin-bottom: 8px; }
.album { --cover: 72px; border-top: 2px solid var(--ink); scroll-margin-top: 4px; }
.album:last-child { border-bottom: 2px solid var(--ink); }
.album summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 10px 0; list-style: none; cursor: pointer; }
.album[open] summary { grid-template-columns: minmax(0, 1fr) auto; } /* title and arrow on top, cover below */
.album[open] img { grid-column: 1 / -1; grid-row: 2; }
.album summary::-webkit-details-marker { display: none; }
.album summary:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.album img { width: var(--cover); height: var(--cover); transition: width .35s var(--ease), height .35s var(--ease); }
.album-title { display: block; font-family: 'Anton', Impact, sans-serif; font-size: 24px; line-height: 1.15; text-transform: uppercase; }
.chevron { transition: transform .25s ease; }
.album[open] .chevron { transform: rotate(180deg); }
.album-body { padding-bottom: 16px; }
/* Spotify's header is about 205px and each song about 51px, so the whole list shows with no
   scrolling inside the player. Under 352px, Spotify drops to a compact player */
.player { display: block; width: 100%; height: max(352px, calc(205px + var(--tracks) * 51px)); border: 0; border-radius: 12px; }

/* Photo carousel: swipes natively on touch, arrows and dots drive the same scroll */
.carousel { position: relative; min-width: 0; background: var(--ink); }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; scroll-snap-align: start; }
.arrow {
  position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 10, .55); color: var(--paper); border: 0; cursor: pointer; opacity: 0; transition: opacity .2s ease, background-color .2s ease;
}
.carousel:hover .arrow, .arrow:focus-visible { opacity: 1; }
.arrow:hover, .arrow:focus-visible { background: var(--ink); }
@media (hover: none) { .arrow { display: none; } } /* touch screens swipe instead */
.arrow.prev { left: 10px; }
.arrow.next { right: 10px; }
.dots { position: absolute; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; }
.dot { width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--paper); opacity: .45; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); transition: opacity .2s ease; }
.dot.on::before { opacity: 1; }

/* Video: one column of thumbnails, each as big as fits the open section's height.
   Clicking one swaps in the player at the same size */
.videos { display: grid; grid-template-columns: min(100%, calc(var(--panel-h) * 16 / 9)); gap: 12px; }
.video { aspect-ratio: 16 / 9; background: var(--ink); }
.video-btn { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.video-btn img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .2s ease; }
.video iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-btn:hover img, .video-btn:focus-visible img { opacity: .8; }
.video-btn::before { content: ''; position: absolute; z-index: 1; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; background: var(--ink); }
.video-btn::after {
  content: ''; position: absolute; z-index: 1; top: 50%; left: 50%; width: 20px; height: 24px; margin: -12px 0 0 -8px;
  background: var(--paper); clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Instagram: 4:5 posts from the feed, with each row sized to fit the open section's height */
.posts {
  --post-h: calc(var(--panel-h) - 62px); /* leaves room for the handle row */
  display: grid; grid-template-columns: repeat(3, min(calc(var(--post-h) / 1.25), calc((100% - 24px) / 3)));
  justify-content: space-between; row-gap: 12px;
}
.posts[hidden] { display: none; }
.post { position: relative; display: block; background: var(--ink); }
.post img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; transition: opacity .2s ease; }
.post:hover img, .post:focus-visible img { opacity: .8; }
.post.video::before { content: ''; position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; background: var(--ink); } /* reel marker */
.post.video::after {
  content: ''; position: absolute; top: 18px; right: 19px; width: 14px; height: 16px;
  background: var(--paper); clip-path: polygon(0 0, 100% 50%, 0 100%);
}


/* About on desktop: the square photo fills the open section's height and the text column
   takes what's left. On short windows the photo still fits and the text scrolls.
   Music on desktop: the player is pulled up beside the cover. An open album makes the
   section grow with the page, so the album can scroll to the top of the window */
@media (min-width: 761px) {
  .has-active .tile.is-active:has(.album[open]) { height: auto; min-height: var(--open-h); }
  .tile.is-active:has(.album[open]) .panel { overflow: visible; }
  .album[open] { --cover: 352px; }
  .album[open] summary { row-gap: 10px; }
  .album-body { margin: calc(-10px - var(--cover)) 0 0 calc(var(--cover) + 16px); padding-bottom: 0; }
  .cols.about {
    --photo: min(46vw, max(240px, var(--panel-h)));
    grid-template-columns: minmax(0, 1fr) var(--photo);
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  :root { --hdr: 80px; --gap: 10px; }
  .logo img { height: 38px; }

  .tile-btn { padding: 16px 18px; }

  .has-active .tile-btn { padding: 0 18px; }
  .has-active .word { font-size: 26px; }
  .has-active .tile.is-active { height: auto; min-height: calc(var(--screen) - var(--hdr) - var(--strip) * 3 - 8px * 4); }
  .has-active .tile.is-active .tile-btn { padding: 20px 76px 0 18px; }
  .has-active .tile.is-active .word { font-size: 68px; }
  .has-active .tile.is-active[data-id="instagram"] .word { font-size: 52px; }
  .close { top: 14px; right: 14px; width: 48px; height: 48px; }

  .panel { padding: 8px 18px 22px; overflow: visible; }
  .cols { grid-template-columns: 1fr; gap: 20px; }
  .album[open] { --cover: calc(100vw - var(--gap) * 2 - 36px); } /* full panel width */
  .videos { grid-template-columns: 1fr; gap: var(--gap); }
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap); row-gap: var(--gap); }
  .cols > .carousel { order: -1; }
  .arrow { display: none; }
  .display { font-size: 34px; }
  .display.big { font-size: 38px; }
  .pills { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
