@font-face {
  font-family: "Clash Grotesk";
  src: url("/assets/fonts/ClashGrotesk-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Clash Grotesk";
  src: url("/assets/fonts/ClashGrotesk-Semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button {
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  color: inherit;
}

@font-face {
  font-family: "HaettenschweilerIndus";
  src: url("/assets/fonts/haettenschweiler.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

:root {
  /* Colors */
  --bg-dark: #08080B;
  --bg-deep-purple: #08080B;
  --bg-mid-purple: #101014;
  --accent-purple: #A855F7;
  --accent-purple-soft: #C084FC;
  --text-main: #E8E8EC;
  --text-muted: #8888A0;

  /* Status colors */
  --status-success: #1bff6b;
  --status-error: #ff6b6b;
  --status-warning: #ffb86b;

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border radius tokens */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 999px;

  /* Letter spacing */
  --ls-tight: 0.02em;
  --ls-normal: 0.04em;
  --ls-wide: 0.06em;
}

body {
  min-height: 100vh;
  font-family: "Clash Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--text-main);
  background: #08080B;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Focus visible for accessibility */
button:focus-visible,
a:focus-visible,
.nav-link:focus-visible,
.primary-btn:focus-visible,
.secondary-btn:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-purple);
  color: #0D0815;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  z-index: 100;
  transition: top 0.2s ease;
}

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

/* Display headings */
.brand-name {
  font-family: "HaettenschweilerIndus", "Impact", system-ui, sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 400;
}

.section-title,
.tool-heading,
#status .section-title {
  font-family: "Clash Grotesk", system-ui, -apple-system, sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* Nav inherits Clash Grotesk from body */
nav {
  font-weight: 600;
}


/* ---------- Global layout ---------- */

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.6));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.brand-name {
  font-family: "HaettenschweilerIndus", "Impact", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.brand-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.nav-link {
  cursor: pointer;
  opacity: 0.8;
}

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

.nav-link-strong {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.8rem;
  font-weight: 600;
}

main {
  padding-top: 70px; /* header offset */
}

section {
  padding: 4.5rem 1.5rem;
}

.section-inner {
  max-width: 1040px;
  margin: 0 auto;
}

.section-title {
  font-family: "Clash Grotesk", system-ui, -apple-system, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  font-size: 1.08rem;
  margin-bottom: 0.55rem;
  opacity: 0.85;
}

.section-body {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text-main);
  opacity: 0.9;
}

.section-body p + p {
  margin-top: 0.9rem;
}

/* ---------- Hero / portal ---------- */

#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#heroGradientCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.hero-landing-logo {
  width: 560px;
  max-width: 70vw;
  height: auto;
  display: block;
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.hero-landing-logo:hover {
  transform: scale(1.05);
}

/* Portal exit animation – used when entering tools */
body.portal-exiting .hero-content {
  animation: heroExit 0.5s ease forwards;
}

body.portal-exiting #heroGradientCanvas {
  animation: heroFade 0.5s ease forwards;
}

@keyframes heroExit {
  to {
    transform: scale(1.03);
    opacity: 0;
    filter: blur(2px);
  }
}

@keyframes heroFade {
  to {
    opacity: 0;
  }
}

/* Canvas fades with the transition */
.transitioning #heroGradientCanvas {
  animation: fadeQuick 0.6s ease-out forwards;
}

.hero-buttons {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.5rem;
}

.primary-btn {
  border-radius: 999px;
  padding: 0.6rem 1.6rem;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #A855F7, #7C3AED);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
  opacity: 0.98;
}

.secondary-btn {
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
}

/* ---------- About & Status ---------- */

#about,
#status {
  background: linear-gradient(to bottom, #0A0A0F 0%, #08080B 100%);
}

#about .section-inner,
#status .section-inner {
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2.3rem 2rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.9);
}

#status {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.6rem;
  margin-top: 0.8rem;
  font-size: 0.9rem;
}

.status-card {
  padding: 1rem 1.1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.status-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.status-label {
  font-family: "Clash Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 0.3rem;
}

.status-value {
  font-size: 0.9rem;
}

.status-note {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

.episode-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.episode-thumb-link {
  display: block;
  border-radius: 0.6rem;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.5);
}

.episode-thumb-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.episode-thumb-link:hover img {
  transform: scale(1.03);
  opacity: 0.9;
}

.discord-btn {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.discord-btn:hover {
  border-color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.08);
}

/* ---------- Footer ---------- */

footer {
  padding: 2rem 1.5rem 2.4rem;
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

footer a {
  color: var(--accent-purple-soft);
}

/* ---------- Responsive tweaks ---------- */

@media (max-width: 768px) {
  header {
    padding-inline: 1rem;
  }

  .brand-name {
    display: none;
  }

  nav {
    gap: 0.8rem;
    font-size: 0.78rem;
  }

  #about .section-inner,
  #status .section-inner {
    padding: 1.6rem 1.4rem;
  }
}

/* ===== PAGE TRANSITION ===== */

html.transitioning-root,
html.transitioning-root body {
  background: #000 !important;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.transitioning {
  pointer-events: none;
}

/* Smooth scale-back with blur */
.transitioning .hero,
.transitioning .hero-content,
.transitioning .portal-title,
.transitioning .portal-subtitle,
.transitioning .portal-tagline,
.transitioning .portal-cta-row,
.transitioning .portal-enter-btn,
.transitioning .hero-logo,
.transitioning .portal-logo {
  animation: scaleBack 0.7s ease-out forwards;
}

.transitioning header,
.transitioning nav {
  animation: scaleBack 0.7s ease-out 0.05s forwards;
}

@keyframes scaleBack {
  0% {
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
  }
  100% {
    transform: scale(0.94);
    opacity: 0;
    filter: blur(4px);
  }
}

/* Background goes black */
.transitioning,
.transitioning body {
  animation: bgToDark 0.7s ease-out forwards;
  overflow: hidden;
}

@keyframes bgToDark {
  0% {
    background-color: inherit;
  }
  100% {
    background-color: #000;
  }
}

/* Any glowing backgrounds or decorative elements should fade faster */
.transitioning .hero-glow,
.transitioning .hero-bg,
.transitioning .bg-gradient,
.transitioning .portal-bg {
  animation: fadeQuick 0.6s ease-out forwards;
}

@keyframes fadeQuick {
  to { opacity: 0; }
}
