@font-face {
  font-family: "Road Rage";
  src: url("fonts/road_rage/Road_Rage.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat/Montserrat-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

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

@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat/Montserrat-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat/Montserrat-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat/Montserrat-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --abyss: #060916;
  --abyss-deep: #040610;
  --kyogre-blue-light: #67a8ff;
  --kyogre-blue: #3a6fe0;
  --kyogre-red: #e8283a;
  --crimson: #ff2636;
  --crimson-soft: rgba(255, 38, 54, 0.42);
  --crimson-glow: rgba(255, 32, 48, 0.24);
  --blue-glow: rgba(58, 111, 224, 0.26);
  --ink: #eef3ff;
  --ink-secondary: rgba(230, 238, 255, 0.86);
  --ink-muted: rgba(196, 211, 242, 0.68);
  --hairline: rgba(196, 211, 242, 0.2);
}

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

html,
body {
  height: 100%;
  background-color: var(--abyss);
  color: var(--ink);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

::selection {
  background: rgba(255, 38, 54, 0.35);
  color: #ffffff;
}

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

a:focus-visible {
  outline: 1.5px solid var(--kyogre-blue-light);
  outline-offset: 4px;
}

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--abyss);
}

/* Full-bleed artwork and atmospheric lighting */
.backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.backdrop-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 64% 48%;
  transform: scale(1.03);
  filter: saturate(1.08) contrast(1.04);
  animation: drift 26s ease-in-out infinite alternate;
  will-change: transform;
}

.backdrop-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      95deg,
      rgba(5, 8, 20, 0.92) 0%,
      rgba(6, 10, 24, 0.78) 28%,
      rgba(7, 11, 26, 0.36) 54%,
      rgba(7, 11, 26, 0.08) 78%,
      rgba(5, 8, 20, 0.28) 100%
    ),
    radial-gradient(
      ellipse 56% 52% at 18% 54%,
      rgba(255, 32, 48, 0.09) 0%,
      transparent 72%
    );
}

.backdrop-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(4, 6, 16, 0.62) 0%,
      transparent 20%,
      transparent 74%,
      rgba(4, 6, 16, 0.84) 100%
    );
}

.backdrop-grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: radial-gradient(rgba(255, 255, 255, 0.8) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
}

/* Viewport frame */
.frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(1.5rem, 3.6vw, 3rem) clamp(1.75rem, 5vw, 4.75rem);
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  transition: opacity 0.2s ease;
}

.brand-tag:hover {
  opacity: 0.92;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--crimson);
  box-shadow: 0 0 12px var(--crimson), 0 0 24px var(--crimson-soft);
  animation: pulseGlow 3.2s ease-in-out infinite;
}

.brand-tag .sep {
  color: rgba(255, 38, 54, 0.65);
  font-weight: 400;
}

.brand-tag .muted {
  color: var(--ink-muted);
  font-weight: 500;
}

.targets {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
}

.targets .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 38, 54, 0.6);
}

/* Middle view container */
.views {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

/* Hero & component views */
.hero {
  width: 100%;
  max-width: min(34rem, 100%);
  min-width: 0;
  padding-bottom: clamp(0.5rem, 3vh, 2.25rem);
}

.component-view {
  max-width: min(36rem, 100%);
}

.view[hidden] {
  display: none;
}

.view.is-entering {
  animation: viewEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.view-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-bottom: 1.25rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #ff4f5c;
  padding: 0.25rem 0;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: #ff8089;
}

.back-arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.back-link:hover .back-arrow {
  transform: translateX(-3px);
}

.view-index {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.title {
  position: relative;
  z-index: 1;
  display: inline-block;
  max-width: 100%;
  font-family: "Road Rage", sans-serif;
  font-weight: 400;
  font-size: clamp(4.75rem, 11.5vw, 9.6rem);
  line-height: 0.94;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(
    180deg,
    var(--kyogre-blue-light) 0%,
    var(--kyogre-blue) 42%,
    var(--kyogre-red) 84%,
    var(--crimson) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 4px 24px rgba(4, 6, 16, 0.82))
    drop-shadow(0 -2px 26px var(--blue-glow))
    drop-shadow(0 6px 34px var(--crimson-glow));
  padding: 0.08em 0.12em 0.1em 0.02em;
  margin: 0 0 clamp(0.95rem, 2.4vh, 1.55rem) -0.02em;
}

.title--component {
  font-size: clamp(2.5rem, 6.8vw, 5.4rem);
  line-height: 0.96;
  margin-bottom: clamp(0.9rem, 2.1vh, 1.4rem);
}

.title--long {
  font-size: clamp(2rem, 6.2vw, 5rem);
}

.lede {
  font-size: clamp(0.98rem, 1.3vw, 1.12rem);
  font-weight: 400;
  line-height: 1.68;
  letter-spacing: 0.012em;
  color: var(--ink-secondary);
  text-shadow: 0 1px 18px rgba(4, 6, 16, 0.9);
  max-width: 30rem;
  margin-bottom: clamp(1.5rem, 3.2vh, 2.25rem);
}

.component-view .lede {
  max-width: 34rem;
  font-size: clamp(0.94rem, 1.18vw, 1.05rem);
  margin-bottom: clamp(1.35rem, 2.8vh, 2rem);
}

.lede code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: #dbe8ff;
  background: rgba(14, 24, 52, 0.72);
  border: 1px solid rgba(92, 157, 255, 0.24);
  padding: 0.08em 0.36em;
}

.dialects {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.dialects li {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(218, 228, 248, 0.76);
  padding: 0.42rem 0.78rem;
  border: 1px solid var(--hairline);
  background: rgba(8, 13, 30, 0.52);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dialects li.accent {
  color: #ffd8dc;
  border-color: rgba(255, 38, 54, 0.46);
  background: rgba(255, 38, 54, 0.12);
  box-shadow: inset 0 0 18px rgba(255, 38, 54, 0.08);
}

/* Bottom bar */
.bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(196, 211, 242, 0.12);
}

.copyright {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  white-space: nowrap;
}

.sharkmark {
  display: block;
  width: 21px;
  height: auto;
  opacity: 0.96;
  overflow: visible;
  filter:
    drop-shadow(0 0 6px rgba(18, 174, 245, 0.5))
    drop-shadow(0 0 14px rgba(34, 83, 182, 0.38));
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}

.copyright:hover .sharkmark {
  opacity: 1;
  transform: translateY(-1px);
  filter:
    drop-shadow(0 0 8px rgba(18, 174, 245, 0.7))
    drop-shadow(0 0 18px rgba(34, 83, 182, 0.5));
}

.pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  row-gap: 0.45rem;
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.pipeline a {
  position: relative;
  padding: 0.22rem 0.08rem;
  color: var(--ink-muted);
  transition: color 0.2s ease;
}

.pipeline a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: linear-gradient(90deg, var(--kyogre-blue-light), var(--crimson));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.pipeline a:hover {
  color: var(--ink);
}

.pipeline a:hover::after,
.pipeline a.is-active::after {
  transform: scaleX(1);
}

.pipeline a.is-active {
  color: var(--ink);
  font-weight: 600;
}

.pipeline span {
  color: rgba(255, 38, 54, 0.65);
  margin: 0 0.42rem;
  user-select: none;
}

/* Motion */
@keyframes drift {
  0% {
    transform: scale(1.03) translate3d(0, 0, 0);
  }
  100% {
    transform: scale(1.07) translate3d(-1%, -0.6%, 0);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

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

/* Responsive adjustments */
@media (max-width: 960px) {
  .backdrop-art {
    object-position: 64% 34%;
  }

  .backdrop-scrim {
    background:
      linear-gradient(
        180deg,
        rgba(5, 8, 20, 0.28) 0%,
        rgba(5, 8, 20, 0.5) 40%,
        rgba(5, 8, 20, 0.9) 70%,
        rgba(4, 6, 16, 0.97) 100%
      );
  }

  .views {
    align-items: flex-end;
  }

  .hero {
    padding-bottom: 1.5rem;
  }

  .bottombar {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .pipeline {
    justify-content: flex-start;
  }
}

@media (max-width: 540px) {
  html,
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .stage {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .frame {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .targets {
    display: none;
  }

  .title {
    font-size: clamp(3.8rem, 18vw, 5.5rem);
  }

  .title--component {
    font-size: clamp(2.15rem, 10.5vw, 3.6rem);
  }

  .title--long {
    font-size: clamp(1.75rem, 8.4vw, 3rem);
  }

  .dialects {
    gap: 0.45rem;
  }

  .dialects li {
    font-size: 0.64rem;
    padding: 0.36rem 0.64rem;
  }

  .pipeline {
    font-size: 0.62rem;
    letter-spacing: 0.13em;
  }

  .pipeline span {
    margin: 0 0.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop-art,
  .pulse,
  .view.is-entering {
    animation: none;
  }
}
