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

/* ===== Font Face ===== */
@font-face {
  font-family: 'Montserrat';
  src: url('../assets/Montserrat/Montserrat-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Montserrat';
  src: url('../assets/Montserrat/Montserrat-Italic-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'TheBewlay';
  src: url('../assets/TheBewlay-Br1.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===== Custom Properties ===== */
:root {
  --bg: #060606;
  --bg-subtle: #0c0c0c;
  --text: #f5f5f5;
  --text-muted: #bbb;
  --text-dim: #888;
  --border: #1a1a1a;
  --accent: #6dbfb0;
  --accent-hover: #8fd4c7;
  --accent-warm: #d4a574;
  --accent-warm-hover: #e0bb94;

  --gradient-bg1: #050810;
  --gradient-bg2: #070d14;
  --color1: 0, 140, 110;
  --color2: 0, 95, 120;
  --color3: 20, 100, 80;
  --color4: 140, 70, 30;
  --color5: 30, 90, 70;
  --color-interactive: 0, 160, 140;
  --circle-size: 180%;
  --blending: screen;
  --gradient-opacity: 0.8;

  --font-display: 'TheBewlay', 'Georgia', serif;
  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --space-xs: 0.35rem;
  --space-sm: 0.75rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  --max-width: 48rem;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f1ea;
    --bg-subtle: #ece8e0;
    --text: #181a18;
    --text-muted: #3c423c;
    --text-dim: #5e655e;
    --border: #d8d3ca;
    --accent: #18685e;
    --accent-hover: #12504a;
    --accent-warm: #c07030;
    --accent-warm-hover: #a05c22;

    --gradient-bg1: #f3efe8;
    --gradient-bg2: #f0ece4;
    --color1: 60, 170, 150;
    --color2: 50, 130, 190;
    --color3: 100, 175, 130;
    --color4: 240, 130, 20;
    --color5: 40, 145, 175;
    --color-interactive: 70, 165, 155;
    --blending: normal;
    --gradient-opacity: 0.3;
  }
}

[data-theme="light"] {
  --bg: #f5f1ea;
  --bg-subtle: #ece8e0;
  --text: #181a18;
  --text-muted: #3c423c;
  --text-dim: #5e655e;
  --border: #d8d3ca;
  --accent: #18685e;
  --accent-hover: #12504a;
  --accent-warm: #c07030;
  --accent-warm-hover: #a05c22;

  --gradient-bg1: #f3efe8;
  --gradient-bg2: #f0ece4;
  --color1: 60, 170, 150;
  --color2: 50, 130, 190;
  --color3: 100, 175, 130;
  --color4: 240, 130, 20;
  --color5: 40, 145, 175;
  --color-interactive: 70, 165, 155;
  --blending: normal;
  --gradient-opacity: 0.3;
}

/* ===== Typography ===== */
html {
  background-color: var(--bg);
  overflow-x: hidden;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-weight: 480;
  color: var(--text);
  background-color: var(--bg);
  overscroll-behavior: none;
  line-height: 1.6;
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  position: relative;
}

h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }

p {
  max-width: 38rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

/* ===== Skip Link ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-md);
  color: var(--text);
}

/* ===== Gradient Background ===== */
.gradient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(40deg, var(--gradient-bg1), var(--gradient-bg2));
}

.gradients-container {
  width: 100%;
  height: 100%;
  opacity: var(--gradient-opacity);
}

.gradient-bg .g1,
.gradient-bg .g2,
.gradient-bg .g3,
.gradient-bg .g4,
.gradient-bg .g5,
.gradient-bg .interactive {
  position: absolute;
  mix-blend-mode: var(--blending);
  width: var(--circle-size);
  height: var(--circle-size);
  top: calc(50% - var(--circle-size) / 2);
  left: calc(50% - var(--circle-size) / 2);
}

.gradient-bg .g1 {
  background: radial-gradient(circle at center, rgba(var(--color1), 0.7) 0%, rgba(var(--color1), 0.3) 25%, rgba(var(--color1), 0) 55%) no-repeat;
  transform-origin: center center;
  animation: moveVertical 60s ease infinite;
}

.gradient-bg .g2 {
  background: radial-gradient(circle at center, rgba(var(--color2), 0.6) 0%, rgba(var(--color2), 0.25) 25%, rgba(var(--color2), 0) 55%) no-repeat;
  transform-origin: calc(50% - 400px);
  animation: moveInCircle 50s reverse infinite;
}

.gradient-bg .g3 {
  background: radial-gradient(circle at center, rgba(var(--color3), 0.6) 0%, rgba(var(--color3), 0.25) 25%, rgba(var(--color3), 0) 55%) no-repeat;
  transform-origin: calc(50% + 400px);
  animation: moveInCircle 80s linear infinite;
}

.gradient-bg .g4 {
  background: radial-gradient(circle at center, rgba(var(--color4), 0.6) 0%, rgba(var(--color4), 0.25) 25%, rgba(var(--color4), 0) 55%) no-repeat;
  transform-origin: calc(50% - 200px);
  animation: moveHorizontal 70s ease infinite;
}

.gradient-bg .g5 {
  background: radial-gradient(circle at center, rgba(var(--color5), 0.5) 0%, rgba(var(--color5), 0.2) 25%, rgba(var(--color5), 0) 55%) no-repeat;
  width: calc(var(--circle-size) * 1.5);
  height: calc(var(--circle-size) * 1.5);
  top: calc(50% - var(--circle-size) * 0.75);
  left: calc(50% - var(--circle-size) * 0.75);
  transform-origin: calc(50% - 800px) calc(50% + 200px);
  animation: moveInCircle 90s linear infinite;
}

.gradient-bg .interactive {
  background: radial-gradient(circle at center, rgba(var(--color-interactive), 0.35) 0%, rgba(var(--color-interactive), 0.15) 25%, rgba(var(--color-interactive), 0) 55%) no-repeat;
  top: 0;
  left: 0;
  margin-top: calc(-1 * var(--circle-size) / 2);
  margin-left: calc(-1 * var(--circle-size) / 2);
}

@keyframes moveInCircle {
  0%   { transform: rotate(0deg); }
  50%  { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

@keyframes moveVertical {
  0%   { transform: translateY(-50%); }
  50%  { transform: translateY(50%); }
  100% { transform: translateY(-50%); }
}

@keyframes moveHorizontal {
  0%   { transform: translateX(-50%) translateY(-10%); }
  50%  { transform: translateX(50%) translateY(10%); }
  100% { transform: translateX(-50%) translateY(-10%); }
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  position: relative;
  z-index: 2;
}

/* ===== Page Layout (logo sidebar + content) ===== */
main {
  display: flex;
  gap: var(--space-lg);
  max-width: calc(var(--max-width) + 10rem);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md) 0 calc(var(--space-lg) + var(--space-md));
}

.page-logo {
  flex-shrink: 0;
  position: sticky;
  top: var(--space-xl);
  align-self: flex-start;
  z-index: 100;
  padding-top: 0.65rem;
}

.page-content {
  flex: 1;
  min-width: 0;
}

.corner-logo img {
  width: 6rem;
  height: auto;
  display: block;
}

/* !important needed to prevent Safari from showing both logo variants */
.corner-logo-light { display: none !important; }
.corner-logo-dark { display: block !important; }

@media (prefers-color-scheme: light) {
  .corner-logo-dark { display: none !important; }
  .corner-logo-light { display: block !important; }
}
[data-theme="light"] .corner-logo-dark { display: none !important; }
[data-theme="light"] .corner-logo-light { display: block !important; }
[data-theme="dark"] .corner-logo-dark { display: block !important; }
[data-theme="dark"] .corner-logo-light { display: none !important; }

/* ===== Section Titles ===== */
.section-title,
.archive-content h1 {
  font-family: var(--font-display);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: clamp(2rem, 5vw, 3rem);
}

.section-title {
  margin-top: 0;
  margin-bottom: var(--space-md);
}

/* ===== Next Up ===== */
.next-up {
  padding: 0 0 var(--space-xl);
}

.event-date {
  display: block;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 600;
}

.event-times {
  color: var(--text-muted);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}

.event-venue {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: var(--space-sm);
}

.event-venue a {
  font-weight: 500;
}

.event-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-md) 0;
  flex-wrap: wrap;
}

.ticket-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bg);
  background-color: var(--accent-warm);
  border: none;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.25s ease, transform 0.15s ease;
  cursor: pointer;
}

.ticket-btn:hover {
  background-color: var(--accent-warm-hover);
  color: var(--bg);
  transform: translateY(-1px);
}

.ticket-btn:active {
  transform: translateY(0);
}

.ticket-btn svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.cal-link {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.45em 1em;
  border: 1px solid var(--accent);
  border-radius: 4px;
  text-decoration: none;
  color: var(--accent);
  transition: background 0.2s, color 0.2s;
}

.cal-link:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ===== Artists ===== */
.artists {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.artist h3 {
  margin-bottom: 0.3rem;
}

.artist p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.artist-tags {
  display: inline;
}

.artist-tags span {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-style: italic;
  letter-spacing: 0.02em;
}

.artist-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.artist-link:hover {
  border-bottom-color: currentColor;
}

/* ===== Instagram CTA ===== */
.instagram-cta {
  margin-top: var(--space-lg);
  padding: var(--space-sm) 0;
}

.instagram-cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.instagram-cta a:hover {
  color: var(--accent);
}

.instagram-cta svg {
  width: 1.8em;
  height: 1.8em;
  fill: var(--accent-warm);
  flex-shrink: 0;
}

/* ===== About ===== */
.about {
  padding: var(--space-xl) 0;
}

.about p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-sm);
  line-height: 1.7;
}

.about p:last-child {
  margin-bottom: 0;
}

/* ===== Archive Page ===== */
.archive-content {
  padding: 0 0 var(--space-xl);
}

.archive-event {
  padding: var(--space-lg) 0;
}

.archive-event-header {
  margin-bottom: var(--space-sm);
}

.archive-date {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  font-weight: 600;
  display: block;
}

.archive-event-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.archive-event-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.archive-flyer {
  margin-bottom: var(--space-sm);
}

.archive-flyer img {
  max-width: 320px;
  width: 100%;
  height: auto;
  opacity: 0.85;
  transition: opacity 0.3s ease;
  border: 1px solid var(--border);
}

.archive-flyer img:hover {
  opacity: 1;
}

.archive-event-artists {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.archive-artist strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.archive-artist p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.archive-artist-links {
  display: flex;
  gap: var(--space-sm);
  margin-top: 0.3rem;
}

.archive-artist-links a {
  font-size: 0.8rem;
}

.archive-lineup {
  gap: 0;
}

.archive-funding {
  padding-top: var(--space-lg);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.archive-recording {
  margin-top: var(--space-sm);
}

.archive-recording iframe {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
}

.archive-recording-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

.archive-tags {
  font-size: 0.75rem;
  color: var(--accent);
  font-style: italic;
  display: block;
  margin-top: 0.2rem;
}

/* ===== Legal / Privacy Pages ===== */
.legal-content {
  padding: var(--space-lg) 0;
}

.legal-content h1 {
  margin-bottom: var(--space-lg);
}

.legal-content h2 {
  font-size: 1.3rem;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.legal-content h3 {
  font-size: 1.1rem;
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.legal-content p {
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  font-size: 0.9rem;
}

.legal-content address {
  font-style: normal;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: var(--space-sm);
  font-size: 0.9rem;
}

/* ===== Footer ===== */
.site-footer {
  padding: var(--space-lg) 0 var(--space-md);
  margin-top: var(--space-xl);
  position: relative;
  z-index: 2;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-left: var(--space-md);
}

.footer-left {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.footer-links a {
  font-size: 0.8rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-hover);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--accent);
  transition: color 0.2s ease;
}

.theme-toggle:hover {
  color: var(--accent-hover);
}

.toggle-label-dark { display: inline; }
.toggle-label-light { display: none; }

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .toggle-label-dark { display: none; }
  :root:not([data-theme="dark"]) .toggle-label-light { display: inline; }
}
[data-theme="light"] .toggle-label-dark { display: none; }
[data-theme="light"] .toggle-label-light { display: inline; }
[data-theme="dark"] .toggle-label-dark { display: inline; }
[data-theme="dark"] .toggle-label-light { display: none; }

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: 100;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, color 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  color: var(--text);
}

.back-to-top svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

/* ===== Animations ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.about,
.next-up {
  animation: fadeIn 0.5s ease-out both;
}

.next-up { animation-delay: 0.08s; }
.about { animation-delay: 0.15s; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  main {
    flex-direction: column;
    gap: var(--space-md);
    padding-left: var(--space-sm);
  }

  .page-logo {
    position: relative;
    top: auto;
    padding-left: var(--space-sm);
  }

  .container {
    padding: 0 var(--space-sm);
  }

  .archive-flyer img {
    max-width: 200px;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  .about, .next-up { animation: none; }
  .gradient-bg .g1,
  .gradient-bg .g2,
  .gradient-bg .g3,
  .gradient-bg .g4,
  .gradient-bg .g5 { animation: none; }
}
