/* ==========================================================
   John O'Shea — shared styles for every page.
   Change a font or colour HERE and it updates the whole site.
   ========================================================== */

/* ---------- Font: IBM Plex Mono (files live in assets/fonts) ---------- */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: italic; font-weight: 400; font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('../fonts/ibm-plex-mono-latin-700-normal.woff2') format('woff2');
}

/* ---------- Settings (edit these) ---------- */
:root {
  --font: 'IBM Plex Mono', 'Courier New', Courier, monospace;   /* site font */
  --bg: #ffffff;
  --text: #000000;
  --muted: #888888;
  --line: #000000;          /* nav / footer borders */
  --line-soft: #dddddd;     /* track list dividers */
  --max-width: 1100px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
}

/* Pages with a footer pinned to the bottom (home, Selected Cues, Solo Piano) */
body.fixed-footer { padding-bottom: 4rem; }
body.fixed-footer footer { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg); }

/* ---------- Top bar ---------- */
nav {
  border-bottom: 1px solid var(--line);
  padding: 1.2rem 2rem;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
nav a { color: inherit; text-decoration: none; }
nav a:hover { text-decoration: underline; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 2rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 1rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   HOME PAGE (index.html)
   ========================================================== */
.section-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2.5rem 3rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}
.section-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  padding-bottom: 4px;
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
  transition: border-color 0.2s ease;
}
.section-links a:hover,
.section-links a:focus-visible { border-color: var(--text); }
.section-links a:nth-child(1) { animation-delay: 0.1s; }
.section-links a:nth-child(2) { animation-delay: 0.2s; }
.section-links a:nth-child(3) { animation-delay: 0.3s; }

/* About block on the home page */
.about {
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 2rem 2rem;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.7;
  opacity: 0;
  animation: fadeIn 0.6s ease 0.5s forwards;
}
.about p { text-wrap: balance; }
.about .reach-out { margin-top: 1rem; }
.about .contact {
  margin-top: 1.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.about .contact a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-soft); }
.about .contact a:hover { color: var(--text); border-color: var(--text); }

/* ==========================================================
   RE-SCORES PAGE — video grid (rescores.html)
   ========================================================== */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  padding: 2.5rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.card {
  cursor: pointer;
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }
.card:nth-child(7) { animation-delay: 0.7s; }
.card:nth-child(8) { animation-delay: 0.8s; }
.card:nth-child(n+9) { animation-delay: 0.9s; }

.card-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #111;
  position: relative;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.card:hover .card-thumb img { transform: scale(1.03); }

.card-thumb iframe,
.card-thumb video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: none;
}
.card-thumb.active iframe,
.card-thumb.active video { display: block; }
.card-thumb.active img,
.card-thumb.active .play-overlay { display: none; }

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-circle {
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(255,255,255,0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.card:hover .play-circle { opacity: 1; }
.play-circle svg { fill: #fff; margin-left: 2px; }

.card-info { padding: 0.5rem 0; }
.card-meta {
  font-size: 0.78rem;
  font-style: italic;
  color: #333;
}

@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; padding: 1.5rem; }
}
@media (max-width: 1000px) and (min-width: 701px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================
   TRACK PAGES — Selected Cues + Solo Piano
   ========================================================== */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 2rem 2rem;
}
.hero h1 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: normal;
  letter-spacing: 0.02em;
}

.now-playing {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.track-list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 2rem;
}

.track {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0 1.3rem;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  position: relative;
}
.track:hover .track-title { text-decoration: underline; }
.track.playing .track-title { font-weight: bold; }

.track-title { font-size: 0.92rem; }
.track-duration {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Progress bar: thin line under each track, taller hit area for clicking */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  cursor: pointer;
}
.progress::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 2px;
  background: var(--line-soft);
}
.progress-fill {
  position: absolute;
  left: 0;
  bottom: 4px;
  height: 2px;
  width: 0;
  background: var(--text);
}
.track:hover .progress::before,
.track:hover .progress-fill { height: 4px; }
