/* ============================================
   TUSTRA — Artist Website
   Dark industrial minimal aesthetic
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Bitcount+Grid+Single&display=swap');

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

:root {
  --bg: #0a0a0a;
  --bg-nav: #0a0a0a;
  --bg-mobile-menu: #111111;
  --border: #2a2a2a;
  --border-light: #1e1e1e;
  --text: #e8e8e8;
  --text-secondary: #aaaaaa;
  --text-muted: #666666;
  --accent: #55a0fb;

  --font-body: 'Open Sans', Helvetica, Arial, sans-serif;
  --font-accent: 'Bitcount Grid Single', 'Courier New', monospace;

  --nav-height: 60px;
  --max-width: 1080px;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

img {
  display: block;
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* --- Grain overlay --- */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- Navigation --- */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 40px);
}

.nav-logo {
  font-family: var(--font-accent);
  font-size: 32px;
  letter-spacing: 0.06em;
  color: var(--text);
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--text);
}

.nav-links a.active::after {
  width: 100%;
}

/* --- Hamburger (mobile) --- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* --- Main content --- */
main {
  padding-top: var(--nav-height);
}

/* --- Hero section --- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  min-height: 50vh;
  overflow: hidden;
  padding: clamp(60px, 10vw, 140px) clamp(20px, 4vw, 40px) clamp(40px, 6vw, 80px);
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero-title {
  font-family: var(--font-accent);
  font-size: clamp(64px, 12vw, 130px);
  font-weight: 400;
  line-height: 0.9;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}

.hero-sub {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- Section layout --- */
.section {
  padding: clamp(60px, 8vw, 120px) clamp(20px, 4vw, 40px);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-accent);
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 40px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* --- Music grid --- */
.music-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-top: 30px;
}

/*
  Bandcamp iframes scale their cover art to fill the width,
  but the height is fixed in the inline style, causing clipping.
  Fix: wrap each iframe in a container with the correct aspect-ratio
  and make the iframe fill it completely via absolute positioning.
  - Single tracks: 350 x 442  → aspect-ratio: 350 / 442
  - Albums:        350 x 470  → aspect-ratio: 350 / 470
*/
.music-grid .embed-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.music-grid .embed-wrap.ratio-track {
  aspect-ratio: 350 / 442;
}

.music-grid .embed-wrap.ratio-album {
  aspect-ratio: 350 / 470;
}

.music-grid .embed-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* --- About layout --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 5vw, 60px);
  align-items: start;
  margin-top: 30px;
}

.about-portrait {
  position: relative;
  overflow: hidden;
}

.about-portrait img {
  width: 100%;
  filter: grayscale(40%) contrast(1.05);
  transition: filter 0.5s ease;
}

.about-portrait:hover img {
  filter: grayscale(10%) contrast(1.0);
}

.about-text {
  max-width: 560px;
}

.about-text p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.about-text .lead {
  font-family: var(--font-accent);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 32px;
  letter-spacing: 0.02em;
}

/* --- Contact --- */
.contact-block {
  margin-top: 30px;
}

.contact-block .email-link {
  font-family: var(--font-accent);
  font-size: clamp(22px, 3vw, 36px);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  transition: border-color 0.3s ease, color 0.3s ease;
  letter-spacing: 0.02em;
}

.contact-block .email-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.contact-purpose {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 50px clamp(20px, 4vw, 40px) 40px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
}

.footer-left {}

.footer-brand {
  font-family: var(--font-accent);
  font-size: 22px;
  color: var(--text);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.footer-tagline {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}

.footer-email {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-secondary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: right;
}

.footer-links a {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  transition: color 0.3s ease;
}

.footer-links a::after {
  content: '↗';
  font-size: 11px;
  color: var(--text-muted);
  transition: color 0.3s ease, transform 0.3s ease;
}

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

.footer-links a:hover::after {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px clamp(20px, 4vw, 40px) 24px;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* --- Fade-in animation --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Mobile responsive --- */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: auto;
    bottom: 0;
    width: 240px;
    background: var(--bg-mobile-menu);
    border-right: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 40px 30px;
    gap: 28px;
    transform: translateX(-100%);
    opacity: 1;
    pointer-events: none;
    transition: transform 0.3s ease;
  }

  .nav-links.open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .nav-links a {
    font-size: 13px;
    letter-spacing: 0.15em;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .music-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: clamp(48px, 14vw, 80px);
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-links {
    text-align: left;
  }

  .footer-links a {
    justify-content: flex-start;
  }
}
