/* Core */
:root {
  --bg: #000;
  --panel: #0a0a0a;
  --panel-soft: #0f0f0f;
  --text: #e5e5e5;
  --muted: #9ca3af;
  --accent: #fcff00;
  --outline: #1f2937;
  --outline-strong: #2a3748;
  --tab-hover: #111827;
  --sidebar-w: 320px;
  --content-max: 1100px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
}

body {
  min-width: 320px;
}

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

a {
  color: inherit;
}

.wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}

.stage {
  grid-column: 2;
  min-width: 0;
  min-height: 100vh;
  background: var(--bg);
}

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 18px;
  background: linear-gradient(180deg, #0b0b0b, #0a0a0a);
  border-right: 1px solid var(--outline);
  overflow: hidden;
}

.title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}

.subtext {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab,
.about-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  overflow: hidden;
  padding: 10px 12px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 80ms ease;
}

.tab:hover,
.about-link:hover {
  background: linear-gradient(90deg, rgba(252, 255, 0, .12), transparent 55%), var(--tab-hover);
  border-color: rgba(252, 255, 0, .55);
  box-shadow: 0 0 24px rgba(252, 255, 0, .08);
}

.tab:active,
.about-link:active {
  transform: translateY(1px);
}

.tab.active,
.about-link.active {
  outline: 2px solid #3a3a3a;
  color: #fff;
  font-weight: 700;
}

.about-link {
  margin-top: 10px;
}

.nav-divider {
  border: 0;
  border-top: 1px solid var(--outline);
  margin: 16px 0;
}

.back-btn {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .1), transparent 55%), #3f4650;
  color: #e5e5e5;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  transition: box-shadow 150ms ease, color 150ms ease;
}

.back-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, rgba(252, 255, 0, .16), rgba(255, 164, 28, .08) 42%, transparent 72%);
  transition: opacity 180ms ease;
}

.back-btn:hover {
  color: #fffde8;
  box-shadow: 0 0 24px rgba(252, 255, 0, .08);
}

.back-btn:hover::before {
  opacity: 1;
}

.back-btn.disabled {
  background: #2f2f2f;
  color: #9ca3af;
  pointer-events: none;
  cursor: default;
}

/* Shared page pieces */
.page-intro {
  max-width: var(--content-max);
  margin: 32px auto 24px;
  padding: 0 28px;
  text-align: center;
}

.page-intro h1,
.page-title {
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  font-weight: 800;
}

.page-intro p {
  margin: 0;
  color: #d6d6d6;
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.65;
}

.sections {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 28px 48px;
}

.group {
  margin: 28px 0 44px;
}

.group-title,
.section-title {
  margin: 0 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--outline-strong);
  color: #fff;
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.25;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  overflow: hidden;
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: linear-gradient(180deg, #0b0b0b, #0a0a0a);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--outline-strong);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}

.thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #111;
}

.meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 14px;
}

.title-sm {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.tag {
  margin-left: auto;
  padding: 2px 8px;
  border: 1px solid var(--outline);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

/* Shared lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.lightbox.open {
  pointer-events: auto;
  opacity: 1;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .78);
  cursor: zoom-out;
}

.lightbox__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: min(92vw, 1200px);
  max-height: 92vh;
  overflow: hidden;
  border-radius: 8px;
  background: #0b0b0b;
  box-shadow: 0 20px 80px rgba(0, 0, 0, .6);
  transform: scale(.96);
  transition: transform 160ms ease;
}

.lightbox.open .lightbox__panel {
  transform: scale(1);
}

.lightbox__panel img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(92vh - 56px);
  object-fit: contain;
  background: #0b0b0b;
}

#lightboxCaption {
  max-height: 56px;
  padding: 10px 14px 12px;
  overflow: auto;
  border-top: 1px solid rgba(255, 255, 255, .07);
  color: #d6d6d6;
  font-size: 14px;
  line-height: 1.4;
}

.lightbox__close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: #e5e5e5;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 1px, 1px);
  white-space: nowrap;
  border: 0;
}

img.zoomable {
  cursor: zoom-in;
}

.mobile-nav-toggle,
.mobile-nav-close,
.mobile-nav-backdrop {
  display: none;
}

/* Home */
body.home .stage {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 40px 28px 56px;
}

body.home .hero-wrap {
  display: flex;
  justify-content: center;
  margin: 0;
}

body.home .hero-brand {
  position: relative;
  margin: 0;
  padding: 0 .15em;
  color: var(--text);
  font-size: clamp(32px, 8vw, 96px);
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
}

body.home .hero-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-120%) skewX(-18deg);
  mix-blend-mode: screen;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 140, 0, .95) 40%, rgba(255, 215, 0, .95) 55%, transparent 70%);
}

body.home .hero-brand .char {
  display: inline-block;
  color: var(--text);
  transition: color 220ms ease, text-shadow 220ms ease;
  transition-delay: var(--d, 0ms);
}

body.home.brand-anim .hero-brand.to-gold .char {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(255, 207, 112, .35);
}

body.home:not(.brand-anim) .hero-brand {
  opacity: 1;
}

body.home:not(.brand-anim) .hero-brand .char {
  color: var(--accent);
}

.home-intro {
  max-width: 1080px;
  margin: 20px auto 0;
  opacity: 0;
  transform: translateY(6px);
}

.home-intro p {
  margin: 0 0 18px;
  color: #e3e3e3;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.85;
}

.intro-welcome {
  color: #fff;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  line-height: 1.35;
}

.intro-cta {
  color: #d6d6d6;
}

.intro-rule {
  border: 0;
  border-top: 1px solid var(--outline);
  margin: 26px 0 18px;
}

.signature-line {
  margin-top: 22px;
  color: var(--accent);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: .04em;
  text-align: center;
}

/* Animations */
.anim-hide {
  opacity: 0;
}

body.ready .title {
  animation: fadeUp 420ms ease-out forwards;
  animation-delay: 120ms;
}

body.ready .subtext {
  animation: fadeUp 420ms ease-out forwards;
  animation-delay: 220ms;
}

body.ready .tabs .tab:nth-child(1) {
  animation: slideIn 480ms cubic-bezier(.22, .61, .36, 1) forwards;
  animation-delay: 300ms;
}

body.ready .tabs .tab:nth-child(2) {
  animation: slideIn 480ms cubic-bezier(.22, .61, .36, 1) forwards;
  animation-delay: 380ms;
}

body.ready .tabs .tab:nth-child(3) {
  animation: slideIn 480ms cubic-bezier(.22, .61, .36, 1) forwards;
  animation-delay: 460ms;
}

body.ready .tabs .tab:nth-child(4) {
  animation: slideIn 480ms cubic-bezier(.22, .61, .36, 1) forwards;
  animation-delay: 540ms;
}

body.ready .home-intro {
  animation: fadeUp 460ms ease-out forwards;
  animation-delay: 220ms;
}

body.video-edits.ready .title,
body.video-edits.ready .subtext,
body.video-edits.ready .tabs .tab,
body.about.ready .title,
body.about.ready .subtext,
body.about.ready .tabs .tab,
body.contact.ready .title,
body.contact.ready .subtext,
body.contact.ready .tabs .tab {
  opacity: 1;
  transform: none;
  animation: none;
}

body.sidebar-visible .title,
body.sidebar-visible .subtext,
body.sidebar-visible .tabs .tab,
body.sidebar-visible .about-link {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
}

body.home.home-entrance-played .title,
body.home.home-entrance-played .subtext,
body.home.home-entrance-played .tabs .tab,
body.home.home-entrance-played .home-intro {
  opacity: 1;
  transform: none;
  animation: none;
}

body.home.brand-anim .hero-brand {
  animation: brandFlash 680ms cubic-bezier(.3, .8, .2, 1) 60ms forwards;
}

body.home.brand-anim .hero-brand::after {
  animation: brandSweep 720ms ease-out 140ms forwards;
}

@keyframes brandFlash {
  0% { opacity: 0; text-shadow: none; filter: none; }
  10% { opacity: 1; }
  18% { text-shadow: 0 0 18px #ffb347; filter: brightness(1.2); }
  22% { text-shadow: 0 0 32px #ffb347, 0 0 64px #ffcc33; filter: brightness(1.5); }
  40% { text-shadow: 0 0 14px #ffb347; filter: brightness(1.2); }
  100% { opacity: 1; text-shadow: none; filter: none; }
}

@keyframes brandSweep {
  0% { transform: translateX(-120%) skewX(-18deg); opacity: 0; }
  10% { opacity: .95; }
  60% { opacity: .75; }
  100% { transform: translateX(120%) skewX(-18deg); opacity: 0; }
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-18px); }
  60% { opacity: 1; }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 900px) {
  :root {
    --sidebar-w: 260px;
  }
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 980px) {
  .wrap {
    display: block;
  }

  .stage {
    grid-column: auto;
    min-height: auto;
    padding-top: calc(22px + env(safe-area-inset-top, 0px));
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    height: 100dvh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding:
      calc(20px + env(safe-area-inset-top, 0px))
      calc(18px + env(safe-area-inset-right, 0px))
      20px
      calc(18px + env(safe-area-inset-left, 0px));
    border-right: 1px solid var(--outline);
    border-bottom: 0;
    background: linear-gradient(180deg, rgba(11, 11, 11, .98), rgba(10, 10, 10, .98));
    backdrop-filter: blur(10px);
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    transform: translateX(-102%);
    transition: transform 220ms cubic-bezier(.2, .7, .2, 1);
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  body.mobile-nav-open {
    overflow: hidden;
    touch-action: none;
  }

  .mobile-nav-toggle {
    position: fixed;
    top: calc(14px + env(safe-area-inset-top, 0px));
    left: calc(14px + env(safe-area-inset-left, 0px));
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background: rgba(10, 10, 10, .92);
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
    transition: transform 220ms cubic-bezier(.2, .7, .2, 1), border-color 150ms ease, background 150ms ease;
  }

  .mobile-nav-toggle span {
    display: block;
    width: 19px;
    height: 2px;
    margin: 0;
    border-radius: 999px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  body.mobile-nav-open .mobile-nav-toggle span:nth-child(1) {
    transform: none;
  }

  body.mobile-nav-open .mobile-nav-toggle span:nth-child(2) {
    opacity: 1;
  }

  body.mobile-nav-open .mobile-nav-toggle span:nth-child(3) {
    transform: none;
  }

  body.mobile-nav-open .mobile-nav-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .mobile-nav-close {
    position: absolute;
    top: calc(20px + env(safe-area-inset-top, 0px));
    right: calc(18px + env(safe-area-inset-right, 0px));
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--outline);
    border-radius: 8px;
    background: rgba(10, 10, 10, .92);
    color: var(--text);
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    pointer-events: auto;
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: block;
    border: 0;
    background: rgba(0, 0, 0, .58);
    cursor: default;
    opacity: 0;
    pointer-events: none;
    touch-action: none;
    transition: opacity 180ms ease;
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .title {
    display: block;
    margin: 0 0 10px;
    font-size: 18px;
  }

  .subtext {
    display: block;
    margin-bottom: 10px;
    font-size: 12px;
  }

  .tabs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tab,
  .about-link {
    flex: none;
    min-height: 38px;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    justify-content: space-between;
    text-align: left;
    white-space: normal;
  }

  .nav-divider {
    display: block;
    margin: 16px 0;
  }

  .about-link {
    display: flex;
    width: 100%;
    margin-top: 10px;
  }

  .back-btn {
    display: block;
    flex: 0 0 auto;
  }

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

  body.home .stage,
  .page-intro,
  .sections {
    padding-left: 18px;
    padding-right: 18px;
  }

  body.home .stage {
    padding-top: calc(42px + env(safe-area-inset-top, 0px));
    padding-bottom: 42px;
  }

  body.home .hero-wrap {
    margin-top: 34px;
  }

  body.home .hero-brand {
    max-width: 100%;
    font-size: clamp(28px, 11.5vw, 58px);
    line-height: 1.02;
    overflow-wrap: normal;
    word-break: keep-all;
  }

  .home-intro {
    margin-top: 18px;
  }

  .home-intro p {
    font-size: 16px;
    line-height: 1.65;
  }

  .signature-line {
    font-size: 20px;
    line-height: 1.35;
  }

  .page-intro {
    margin: 14px auto 20px;
  }

  .page-intro h1,
  .page-title {
    font-size: 32px;
  }

  .page-intro p {
    font-size: 16px;
    line-height: 1.55;
  }

  .group {
    margin: 26px 0 38px;
  }

  .meta {
    align-items: flex-start;
    flex-direction: column;
  }

  @media (orientation: landscape) and (max-height: 520px) {
    .sidebar {
      justify-content: flex-start;
      gap: 18px;
      padding-top: calc(14px + env(safe-area-inset-top, 0px));
      padding-bottom: 14px;
    }

    .mobile-nav-close {
      top: calc(14px + env(safe-area-inset-top, 0px));
    }

    .title {
      margin-bottom: 6px;
      font-size: 16px;
    }

    .subtext {
      margin-bottom: 8px;
    }

    .tabs {
      gap: 6px;
    }

    .tab,
    .about-link {
      min-height: 34px;
      padding-top: 7px;
      padding-bottom: 7px;
    }

    .nav-divider {
      margin: 10px 0;
    }

    .back-btn {
      margin-top: 2px;
    }
  }
}

@media (max-width: 420px) {
  .sidebar {
    width: min(88vw, 300px);
    padding:
      calc(18px + env(safe-area-inset-top, 0px))
      calc(16px + env(safe-area-inset-right, 0px))
      18px
      calc(16px + env(safe-area-inset-left, 0px));
  }

  .mobile-nav-close {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
  }

  .mobile-nav-toggle {
    top: calc(18px + env(safe-area-inset-top, 0px));
    left: calc(12px + env(safe-area-inset-left, 0px));
    width: 40px;
    height: 40px;
  }

  body.mobile-nav-open .mobile-nav-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .tab,
  .about-link {
    min-height: 38px;
    padding: 9px 10px;
    font-size: 13px;
  }
}

@media (min-width: 721px) and (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
