/* =========================
   3toed — Global Styles
   ========================= */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: black;
  color: #e0e0e0;
  font-family: 'Major Mono Display', monospace;
  text-align: center;
  overflow-x: hidden;
}

body {
  transition: opacity 0.8s ease-in-out;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

@supports (height: 100dvh) {
  body {
    min-height: 100dvh;
  }
}

/* only hide when JS is active */
.js body {
  opacity: 0;
}

.js body.fade-in {
  opacity: 1;
}


/* =========================
   Header: Logo + Nav
   ========================= */
.logo {
  position: fixed;
  top: 20px;
  left: 30px;
  font-size: 48px;
  color: #e0e0e0;
  text-decoration: none;
  z-index: 20;
  animation: fadeLogo 6s ease-in-out infinite;
}

@keyframes fadeLogo {

  0%,
  100% {
    opacity: 0.9;
  }

  50% {
    opacity: 0.6;
  }
}

nav {
  position: fixed;
  top: 30px;
  right: 30px;
  z-index: 10;
}

nav a {
  color: #e0e0e0;
  margin-left: 20px;
  text-decoration: none;
  font-size: 16px;
}

/* =========================
   Mobile Menu Toggle (Hamburger)
   ========================= */
.menu-toggle {
  display: none;
  /* Hidden on desktop */
  position: fixed;
  top: 25px;
  right: 20px;
  z-index: 100;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 24px;
  height: 2px;
  background: #e0e0e0;
  transition: all 0.3s ease;
}

.menu-icon {
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  content: '';
  position: absolute;
  left: 0;
}

.menu-icon::before {
  top: -8px;
}

.menu-icon::after {
  top: 8px;
}

/* Animate to X when open */
.menu-toggle.open .menu-icon {
  background: transparent;
}

.menu-toggle.open .menu-icon::before {
  transform: rotate(45deg);
  top: 0;
}

.menu-toggle.open .menu-icon::after {
  transform: rotate(-45deg);
  top: 0;
}

/* =========================
   Main Content
   ========================= */
.content {
  font-size: 24px;
  line-height: 1.6;
  z-index: 5;
  padding: 100px 20px 120px;
  /* space above + footer padding */
  flex: 1;
  /* pushes footer down */
}

/* =========================
   Homepage-only special centering
   ========================= */
body.index .content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* vertical centering */
  align-items: center;
  /* horizontal centering */
  padding: 0 20px;
  /* reset padding for centered layout */
}

.content h1 {
  animation: fadeLogo 6s ease-in-out infinite;
  animation-delay: 3s;
}

/* =========================
   Custom Audio Player
   ========================= */
.audio-player {
  margin-top: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.play-button {
  position: relative;
  z-index: 50;
}

.play-button {
  cursor: pointer;
  opacity: 0.8;
  transition: transform 0.3s ease, opacity 0.3s ease;
  animation: fadeLogo 6s ease-in-out infinite;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-button:hover {
  transform: scale(1.2);
  opacity: 1;
}

.play-button::before {
  content: "▶";
  font-size: 72px;
  line-height: 1;
  color: #e0e0e0;
}

.playing::before {
  content: "❚❚";
  font-size: 48px;
  letter-spacing: 8px;
}

.progress-container {
  width: 300px;
  height: 6px;
  background: #222;
  cursor: pointer;
  border-radius: 3px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: #e0e0e0;
  width: 0%;
}

.time {
  font-size: 14px;
  opacity: 0.7;
}

.track-name {
  font-size: 14px;
  color: #e0e0e0;
  letter-spacing: 0.02em;
  margin-top: 6px;
  animation: fadeBreath 8s ease-in-out infinite;
  animation-delay: 1.5s;
}

@keyframes fadeBreath {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }
}

/* =========================
   Glitch Video — single random-position playback
   ========================= */
.glitch-video {
  position: fixed;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  width: clamp(200px, 30vw, 400px);
  height: auto;
  object-fit: cover;

  /* ── Blending ────────────────────────────
     • screen mode: black pixels vanish against the black bg.
     • wide multi-stop radial mask: tiny solid core, long fade
       across most of the frame — no visible boundary.
     • subtle blur softens any remaining pixel-level edges.
     ──────────────────────────────────────── */
  mix-blend-mode: screen;
  filter: blur(1.5px) brightness(1.1);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at center,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.7) 15%,
      rgba(0, 0, 0, 0.35) 35%,
      rgba(0, 0, 0, 0.1) 55%,
      transparent 70%);
  mask-image: radial-gradient(ellipse 70% 70% at center,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.7) 15%,
      rgba(0, 0, 0, 0.35) 35%,
      rgba(0, 0, 0, 0.1) 55%,
      transparent 70%);
}

/* =========================
   Portfolio: Tracks
   ========================= */
.track {
  margin: 80px auto;
  width: 80%;
  max-width: 800px;
  text-align: center;
  z-index: 5;
}

.track h2 {
  margin-bottom: 15px;
  font-size: 20px;
}

.track iframe {
  width: 100%;
  height: 120px;
  border: none;
}

/* Bandcamp grid for large embeds */
.bc-grid {
  width: 90%;
  max-width: 1100px;
  margin: 40px auto 120px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  z-index: 5;
  /* above videos */
}

.bc-card {
  flex: 0 1 350px;
  max-width: 350px;
  width: 100%;
}

.bc-card iframe {
  width: 100% !important;
  max-width: 350px;
  height: 442px !important;
  /* large embed height */
  border: 0;
}

/* Reuse the non-home readability veil for Bandcamp cards */
body:not(.index) .bc-card {
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 5;
}

/* Mobile: single column vertical layout */
@media (max-width: 768px) {
  .bc-grid {
    width: 92%;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 140px;
  }

  .bc-card {
    flex: 0 0 auto;
    width: 100%;
    max-width: 350px;
    min-width: 170px;
    /* Bandcamp's minimum embed width */
  }

  .bc-card iframe {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    aspect-ratio: 350 / 442;
    /* maintain large embed proportions */
    min-height: 220px;
    /* ensure playable on very small screens */
  }
}


/* =========================
   Contact: Form
   ========================= */
form {
  max-width: 500px;
  margin: 30px auto;
  display: flex;
  flex-direction: column;
}

input,
textarea {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  background: #111;
  border: 1px solid #333;
  color: #e0e0e0;
  font-size: 14px;
}

button {
  background: #e0e0e0;
  color: black;
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

/* =========================
   Footer
   ========================= */
footer {
  text-align: center;
  padding: 20px;
  font-size: 14px;
  opacity: 0.6;
  z-index: 5;
  margin-top: auto;
  /* keep footer at the bottom in flex layout */
}

footer a {
  color: #e0e0e0;
  text-decoration: none;
}

footer a:hover {
  opacity: 1;
}

/* =========================
   Mobile (≤ 768px): 2 big vids flanking the title
   ========================= */
@media (max-width: 768px) {
  .logo {
    font-size: 32px;
  }

  /* Show hamburger on mobile */
  .menu-toggle {
    display: block;
  }

  /* Mobile nav dropdown */
  nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 80px 20px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 50;
  }

  nav.open {
    transform: translateY(0);
  }

  nav a {
    font-size: 20px;
    margin-left: 0;
    padding: 10px 20px;
  }

  /* Center the homepage stack and give it breathing room */
  body.index .content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* vertical centering */
    align-items: center;
    /* horizontal centering */
    gap: clamp(10px, 3vh, 24px);
    padding: 0 20px;
    /* header/footer spacing handled by centering */
  }

  .content h1 {
    font-size: clamp(22px, 6vw, 36px);
    margin: 0;
  }

  /* Custom player sizing on phones */
  .progress-container {
    width: clamp(240px, 70vw, 320px);
  }

  .play-button {
    width: 64px;
    height: 64px;
  }

  .play-button::before {
    font-size: 64px;
  }

  /* Glitch video — smaller on mobile */
  .glitch-video {
    width: clamp(160px, 50vw, 300px);
  }

  /* Keep existing small-page tweaks */
  .track {
    margin: 40px auto;
    width: 90%;
  }

  form {
    margin: 30px auto;
    width: 90%;
  }
}

/* =========================
   Readability panels — apply on non-home pages only
   ========================= */
body:not(.index) .track,
body:not(.index) form {
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  /* subtle black veil */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px 20px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  /* Safari */
  z-index: 5;
  /* above videos */
}

body:not(.index) .track h2 {
  margin: 0 0 12px;
}

body:not(.index) .track iframe {
  border-radius: 8px;
  overflow: hidden;
}

/* Contact: fix consent checkbox layout */
.policy {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: center;
  /* or flex-start if you prefer left align */
  text-align: left;
  margin-top: 10px;
}

/* stop the checkbox from expanding to 100% width */
.policy input[type="checkbox"] {
  width: auto !important;
  height: auto;
  flex: 0 0 auto;
  margin-top: 3px;
  /* align with first line of text */
  appearance: auto;
  /* ensure native checkbox appearance */
  cursor: pointer;
}

/* let the text take the remaining width */
.policy span {
  flex: 1 1 auto;
  line-height: 1.4;
  cursor: pointer;
  /* shows it’s clickable (label toggles the box) */
}


/* =========================
   Portfolio sections + breathing titles
   ========================= */
.pf-section {
  margin: 32px auto 64px;
  width: 100%;
}

.section-title {
  font-size: 18px;
  margin: 0 0 16px;
  opacity: 0.85;
  letter-spacing: 0.02em;

  /* breathe like the main h1 */
  animation: fadeLogo 6s ease-in-out infinite;
  animation-delay: 1.5s;
  /* out of phase with page title */
}

/* subtle stagger if you have multiple sections */
.pf-section:nth-of-type(1) .section-title {
  animation-delay: 1.2s;
}

.pf-section:nth-of-type(2) .section-title {
  animation-delay: 2.1s;
}

.pf-section:nth-of-type(3) .section-title {
  animation-delay: 2.8s;
}

@media (max-width: 768px) {
  .pf-section {
    margin: 24px auto 56px;
  }

  .section-title {
    margin-bottom: 12px;
  }
}

/* =========================
   404 — Lost page
   ========================= */
body.error .content.error-hero {
  /* center the block vertically like the home hero, but on its own page */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 3vh, 24px);
  padding: 0 20px;
  min-height: calc(100vh - 160px);
  /* header + footer breathing room */
  position: relative;
  z-index: 5;
  /* above any background elements */
}

/* big, soft face video that fades in */
.error-video {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  /* behind the titles */
  opacity: 0;
  transition: opacity 900ms ease-in-out;
  mix-blend-mode: normal;
  /* keep it subtle; try 'screen' if you want punch */
}

.error-video video {
  width: min(70vmin, 720px);
  max-width: 90vw;
  opacity: 0.55;
  /* ambient, not overpowering */
  filter: contrast(1.1) brightness(0.9);
}

/* when JS flips the switch, reveal the video */
.error-video-ready .error-video {
  opacity: 1;
}

/* message styling */
.error-title {
  margin: 0;
  font-size: clamp(28px, 8vw, 56px);
  letter-spacing: 0.06em;
  animation: fadeLogo 6s ease-in-out infinite;
  /* same breathing as home */
}

.error-copy {
  margin: 0;
  font-size: clamp(14px, 2.8vw, 18px);
  opacity: 0.8;
}

.error-link {
  color: #e0e0e0;
  text-decoration: none;
  border-bottom: 1px solid rgba(224, 224, 224, 0.4);
}

.error-link:hover {
  opacity: 1;
}

/* mobile tweaks */
@media (max-width: 768px) {
  .error-video video {
    width: min(78vmin, 520px);
    opacity: 0.5;
  }

  body.error .content.error-hero {
    min-height: calc(100dvh - 160px);
  }
}

/* reduced motion: keep stills */
@media (prefers-reduced-motion: reduce) {
  .error-video {
    transition: none;
    opacity: 0.4;
  }

  .error-title {
    animation: none !important;
  }
}

/* Match 404 letter-spacing (without uppercase) on the home H1 */
body.index .content h1 {
  letter-spacing: 0.06em;
  /* same as 404 */
  text-shadow:
    0 0 12px rgba(0, 0, 0, 0.35),
    /* keeps it crisp over video */
    0 0 2px rgba(0, 0, 0, 0.5);
  -webkit-font-smoothing: antialiased;
  /* nice rendering */
  -moz-osx-font-smoothing: grayscale;
}

/* =========================
   Body Text: Sora (complementary to Major Mono Display)
   ========================= */
.prose,
.prose p,
.prose li,
.prose blockquote {
  font-family: 'Sora', sans-serif;
  font-weight: 300;
}

/* =========================
   Link Styles (inside prose / long-form content)
   ========================= */
.prose a {
  color: #8ecae6;
  text-decoration: underline;
  text-decoration-color: rgba(142, 202, 230, 0.35);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease,
    text-shadow 0.2s ease;
}

.prose a:hover,
.prose a:focus {
  color: #b8dff0;
  text-decoration-color: #b8dff0;
  text-shadow: 0 0 8px rgba(142, 202, 230, 0.25);
}

/* =========================
   Prose Container — readable body text
   ========================= */
.prose {
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
  font-size: 16px;
  line-height: 1.75;
  color: #d0d0d0;
}

.prose h1,
.prose h2,
.prose h3 {
  font-family: 'Major Mono Display', monospace;
  color: #e0e0e0;
  text-align: left;
}

.prose h2 {
  font-size: 22px;
  margin: 48px 0 16px;
  letter-spacing: 0.04em;
}

.prose h3 {
  font-size: 18px;
  margin: 32px 0 12px;
  opacity: 0.9;
}

.prose p {
  margin: 0 0 20px;
}

/* =========================
   Mixes: Mixcloud embeds
   ========================= */
.mix-embed {
  margin-top: 32px;
  margin-bottom: 28px;
}

.mix-embed:last-child {
  margin-bottom: 0;
}

.prose blockquote {
  border-left: 3px solid rgba(142, 202, 230, 0.4);
  margin: 24px 0;
  padding: 12px 20px;
  color: #bbb;
  font-style: italic;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 24px 0;
  display: block;
}

.prose figure {
  margin: 32px 0;
  padding: 0;
  text-align: center;
}

.prose figure img {
  margin: 0 auto 12px;
}

.prose figcaption {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: #888;
  font-style: italic;
  line-height: 1.5;
}

.prose ul,
.prose ol {
  padding-left: 24px;
  margin: 0 0 20px;
}

.prose li {
  margin-bottom: 8px;
}

/* =========================
   Blog Layout — main + sidebar grid
   ========================= */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  max-width: 1060px;
  margin: 0 auto;
  text-align: left;
  align-items: start;
}

/* Post metadata (author · date) */
.post-meta {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: #888;
  margin: 8px 0 32px;
  letter-spacing: 0.02em;
}

.post-meta span {
  margin: 0 6px;
  opacity: 0.5;
}

/* =========================
   Sidebar
   ========================= */
.sidebar {
  position: sticky;
  top: 100px;
}

.sidebar h3 {
  font-family: 'Major Mono Display', monospace;
  font-size: 14px;
  color: #e0e0e0;
  margin: 0 0 16px;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.sidebar-post {
  display: block;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.sidebar-post:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(142, 202, 230, 0.3);
}

.sidebar-post .sp-title {
  display: block;
  font-family: 'Major Mono Display', monospace;
  font-size: 13px;
  color: #e0e0e0;
  margin-bottom: 4px;
}

.sidebar-post .sp-date {
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  color: #666;
}

/* =========================
   About Page — text + image sections
   ========================= */
.about-section {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  margin: 48px auto;
  max-width: 860px;
}

.about-section:nth-child(even) {
  flex-direction: row-reverse;
}

.about-img {
  flex: 0 0 280px;
  max-width: 280px;
  border-radius: 12px;
  overflow: hidden;
}

.about-img img {
  width: 100%;
  height: auto;
  display: block;
  filter: contrast(1.05) brightness(0.95);
}

.about-text {
  flex: 1;
}

/* =========================
   Readability panels for blog & about pages
   ========================= */
body:not(.index) .blog-layout,
body:not(.index) .prose-panel {
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 5;
}

/* =========================
   Mobile — blog & about responsive
   ========================= */
@media (max-width: 768px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 20px 16px;
  }

  .sidebar {
    position: static;
  }

  .about-section,
  .about-section:nth-child(even) {
    flex-direction: column;
    gap: 24px;
  }

  .about-img {
    flex: 0 0 auto;
    max-width: 100%;
  }

  .prose {
    font-size: 15px;
  }
}

/* =========================
   Post Listing Page — card grid
   ========================= */
.post-listing {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

body:not(.index) .post-listing {
  position: relative;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 5;
}

.post-card {
  display: block;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease,
    transform 0.15s ease;
}

.post-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(142, 202, 230, 0.3);
  transform: translateY(-2px);
}

.post-card-title {
  font-family: 'Major Mono Display', monospace;
  font-size: 18px;
  color: #e0e0e0;
  margin: 0 0 8px;
  letter-spacing: 0.03em;
}

.post-card-meta {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  color: #888;
  margin: 0 0 12px;
  letter-spacing: 0.02em;
}

.post-card-meta span {
  margin: 0 6px;
  opacity: 0.5;
}

.post-card-excerpt {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: #aaa;
  line-height: 1.6;
  margin: 0;
}

/* Back link on individual posts */
.post-back {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.post-back a {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  color: #8ecae6;
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-back a:hover {
  color: #b8dff0;
}

@media (max-width: 768px) {
  .post-listing {
    padding: 20px 16px;
  }

  .post-card {
    padding: 18px;
  }

  .post-card-title {
    font-size: 16px;
  }
}