/* Tommy Timber — responsive shared styles */
:root {
  color-scheme: light;
  --page: #f3f5ef;
  --surface: #ffffff;
  --ink: #263126;
  --muted: #59665a;
  --green: #477b3d;
  --green-dark: #315c2c;
  --line: #dce5d7;
  --shadow: 0 8px 24px rgba(31, 55, 29, .08);
}

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

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
           max(24px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: var(--green-dark);
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  color: var(--green);
}

.page-shell {
  width: min(100%, 1040px);
  margin-inline: auto;
}

.site-header {
  margin: 12px 0 24px;
  text-align: center;
}

.site-title {
  margin: 0;
  font-size: clamp(1.55rem, 5vw, 2.35rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.025em;
}

.site-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: clamp(.98rem, 2.8vw, 1.12rem);
}

.intro {
  max-width: 760px;
  margin: 0 auto 24px;
  text-align: center;
}

.cover-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  max-width: 700px;
  margin: 0 auto 26px;
}

.cover-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cover-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 430px;
  object-fit: contain;
  border-radius: 6px;
}

.audio-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 auto 26px;
}

.audio-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.audio-card h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 650;
}

audio {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 44px;
  margin: 0 auto;
}

.license-note {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  text-align: center;
}

.player-page {
  display: grid;
  min-height: min(70vh, 560px);
  align-content: start;
  justify-items: center;
  gap: 14px;
  padding-top: clamp(22px, 8vh, 76px);
  text-align: center;
}

.player-page .site-title {
  max-width: 22ch;
}

.player-page .player-label {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.player-panel {
  width: min(100%, 640px);
  margin-top: 10px;
  padding: clamp(18px, 4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.player-panel audio {
  height: 48px;
}

.back-link {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 4px;
  font-weight: 600;
}

@media (max-width: 640px) {
  body {
    padding-inline: max(12px, env(safe-area-inset-left))
                    max(12px, env(safe-area-inset-right));
  }

  .site-header {
    margin-top: 8px;
    margin-bottom: 18px;
  }

  .cover-grid {
    gap: 10px;
    margin-bottom: 18px;
  }

  .cover-card {
    padding: 6px;
    border-radius: 10px;
  }

  .audio-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .audio-card {
    padding: 16px;
  }

  .player-page {
    min-height: auto;
    padding-top: clamp(20px, 7vh, 48px);
  }

  .player-panel {
    padding: 18px 14px;
  }
}

@media (max-width: 360px) {
  .cover-grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 280px;
  }

  .cover-card img {
    max-height: 380px;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .player-page {
    min-height: auto;
    padding-top: 12px;
  }

  .player-panel {
    margin-top: 4px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a {
    transition: color .15s ease;
  }
}
