:root {
  --bg: #07080d;
  --bg-2: #0c1018;
  --ink: #f4f7fb;
  --muted: #8b93a7;
  --line: rgba(255, 255, 255, 0.1);
  --card: rgba(10, 14, 24, 0.72);
  --amber: #f0b43a;
  --blue: #3d7bff;
  --radius: 18px;
  --header-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  touch-action: pan-y;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
}

.skip:focus {
  top: 12px;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(61, 123, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(240, 180, 58, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
}

.rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}

.top {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
  padding: calc(10px + var(--safe-t)) 22px 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}

.brand-mark {
  color: var(--amber);
  display: grid;
  place-items: center;
}

.brand-name {
  opacity: 0.92;
}

.top-nav {
  display: none;
  gap: 22px;
  margin-left: auto;
  font-size: 14px;
  color: var(--muted);
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--ink);
}

.cta {
  margin-left: 10px;
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.03);
}

.cta:hover,
.cta:focus-visible {
  border-color: rgba(240, 180, 58, 0.45);
}

.music-toggle {
  margin-left: auto;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--amber);
  background: rgba(7, 8, 13, 0.72);
  border: 1px solid rgba(240, 180, 58, 0.4);
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
}

.music-toggle:hover,
.music-toggle:focus-visible {
  border-color: rgba(61, 123, 255, 0.65);
  color: var(--ink);
}

.music-toggle[aria-pressed="true"] {
  color: #9eb6ff;
  border-color: rgba(61, 123, 255, 0.7);
  box-shadow: 0 0 16px rgba(61, 123, 255, 0.28);
}

.music-toggle[aria-pressed="true"] .music-off {
  display: none;
}

.music-toggle[aria-pressed="false"] .music-wave {
  display: none;
}

.stage-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--header-h) - 72px);
  padding: 8px 18px 24px;
}

.stage {
  position: relative;
  flex: 0 0 auto;
  height: min(36vh, 360px);
  min-height: 180px;
  touch-action: pan-y;
}

.cube-canvas,
.cube-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.cube-canvas {
  z-index: 1;
  touch-action: none;
}

.cube-canvas.is-kick {
  box-shadow: inset 0 0 72px rgba(240, 180, 58, 0.16);
}

.cube-fallback {
  display: grid;
  place-items: center;
}

.cube-fallback[hidden] {
  display: none;
}

.css-cube {
  width: min(46vw, 200px);
  aspect-ratio: 1;
  border-radius: 12%;
  background:
    linear-gradient(90deg, rgba(7, 8, 13, 0.35) 1px, transparent 1px),
    linear-gradient(rgba(7, 8, 13, 0.35) 1px, transparent 1px),
    linear-gradient(135deg, #f0b43a 0%, #1a1c24 48%, #3d7bff 100%);
  background-size: 12% 12%, 12% 12%, 100% 100%;
  box-shadow:
    0 0 40px rgba(240, 180, 58, 0.28),
    0 0 80px rgba(61, 123, 255, 0.22);
  transform: rotateX(16deg) rotateZ(16deg);
  transition: background 0.7s ease, box-shadow 0.7s ease, filter 0.7s ease;
}

body[data-music="riff"] .css-cube {
  background:
    linear-gradient(90deg, rgba(7, 8, 13, 0.35) 1px, transparent 1px),
    linear-gradient(rgba(7, 8, 13, 0.35) 1px, transparent 1px),
    linear-gradient(135deg, #8c1e14 0%, #1a100e 48%, #f0b43a 100%);
  box-shadow:
    0 0 48px rgba(180, 36, 18, 0.4),
    0 0 72px rgba(240, 140, 40, 0.22);
}

body[data-music="big"] .css-cube {
  background:
    linear-gradient(90deg, rgba(7, 8, 13, 0.35) 1px, transparent 1px),
    linear-gradient(rgba(7, 8, 13, 0.35) 1px, transparent 1px),
    linear-gradient(135deg, #f0b43a 0%, #c43b8a 46%, #3d7bff 100%);
  animation: music-cycle 1.8s linear infinite;
}

body[data-music="break"] .css-cube {
  background:
    linear-gradient(90deg, rgba(7, 8, 13, 0.35) 1px, transparent 1px),
    linear-gradient(rgba(7, 8, 13, 0.35) 1px, transparent 1px),
    linear-gradient(135deg, #1a4a9a 0%, #0c1424 50%, #8ec0ff 100%);
  box-shadow:
    0 0 40px rgba(70, 130, 255, 0.38),
    0 0 80px rgba(40, 80, 180, 0.25);
}

@keyframes music-cycle {
  50% { filter: saturate(1.35) hue-rotate(16deg); }
}

@media (prefers-reduced-motion: reduce) {
  body[data-music="big"] .css-cube { animation: none; }
}

.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  z-index: 4;
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  pointer-events: none;
}

.wordmark {
  position: relative;
  z-index: 5;
  text-align: left;
  padding: 4px 2px 12px;
  /* GPU canvases promote to their own layer; isolate so type stays above. */
  isolation: isolate;
  pointer-events: none;
}

.wordmark::before {
  content: "";
  position: absolute;
  inset: -18% -8% -28%;
  background: radial-gradient(
    ellipse at 50% 55%,
    rgba(7, 8, 13, 0.94) 0%,
    rgba(7, 8, 13, 0.62) 48%,
    transparent 74%
  );
  z-index: -1;
  pointer-events: none;
}

.wordmark h1,
.wordmark .tagline {
  pointer-events: auto;
}

.wordmark h1 {
  margin: 0;
  font-size: clamp(2.4rem, 11vw, 4.2rem);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(7, 8, 13, 0.92), 0 2px 16px rgba(7, 8, 13, 0.75);
}

.wm-media {
  display: block;
  /* Opaque fill — a clipped gradient is see-through and lets voxels hide the word. */
  color: #f2c56a;
}

.tagline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  text-shadow: 0 0 18px rgba(7, 8, 13, 0.9);
}

.orbits {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.tiles {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  touch-action: pan-y;
}

.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  touch-action: manipulation;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tile:hover,
.tile:focus-visible {
  border-color: rgba(240, 180, 58, 0.35);
  background: rgba(16, 20, 32, 0.82);
}

.tile-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--amber);
  background: rgba(240, 180, 58, 0.08);
  border: 1px solid rgba(240, 180, 58, 0.16);
}

.tile:nth-child(2) .tile-icon,
.tile:nth-child(3) .tile-icon,
.tile:nth-child(4) .tile-icon {
  color: #9ec0ff;
  background: rgba(61, 123, 255, 0.1);
  border-color: rgba(61, 123, 255, 0.18);
}

.tile-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tile-title {
  font-weight: 600;
  font-size: 15px;
}

.tile-sub {
  color: var(--muted);
  font-size: 13px;
}

.tile-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 16px;
}

main {
  position: relative;
  z-index: 1;
  padding: 12px 18px 48px;
  display: grid;
  gap: 28px;
}

body.is-enhanced main {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

article {
  padding: 8px 2px 12px;
  border-top: 1px solid var(--line);
}

.kicker {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  letter-spacing: -0.03em;
}

h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c9d0e0;
}

article p,
article li {
  color: #c5ccda;
}

article a {
  color: #d8e6ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

article ul {
  padding-left: 1.1em;
}

.stack-grid {
  display: grid;
  gap: 18px;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 12px;
}

.contact-list li {
  display: grid;
  gap: 2px;
}

.contact-list span:first-child {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(4, 6, 10, 0.62);
  display: grid;
  place-items: end center;
  padding: 16px 16px calc(16px + var(--safe-b));
}

.panel[hidden] {
  display: none;
}

.panel-card {
  width: min(720px, 100%);
  max-height: min(82dvh, 820px);
  overflow: auto;
  background: #0d121c;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px 22px 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.panel-close {
  float: right;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.panel-body .kicker {
  margin-top: 8px;
}

.foot {
  position: relative;
  z-index: 1;
  padding: 8px 18px calc(18px + var(--safe-b));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 18px;
  color: var(--muted);
  font-size: 12px;
}

.foot p {
  margin: 0;
}

@media (max-width: 700px) and (orientation: portrait) {
  .stage-wrap {
    min-height: 0;
    padding-bottom: 10px;
  }

  .stage {
    height: min(32vh, 260px);
    min-height: 150px;
  }

  .wordmark h1 {
    font-size: clamp(2.1rem, 10vw, 3.2rem);
  }

  .tagline {
    margin-top: 6px;
    font-size: 14px;
  }

  .tile {
    padding: 11px 14px;
  }
}

/* Landscape phones / short viewports: cube left, 2×2 tiles right. */
@media (orientation: landscape) and (max-height: 700px) and (max-width: 1199px) {
  .stage-wrap {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.05fr);
    grid-template-rows: auto 1fr;
    gap: 8px 18px;
    min-height: calc(100dvh - var(--header-h) - 56px);
    padding-bottom: 8px;
  }

  .stage {
    grid-column: 1;
    grid-row: 1 / span 2;
    height: auto;
    min-height: 0;
  }

  .wordmark {
    grid-column: 2;
    grid-row: 1;
    padding: 0 0 4px;
  }

  .wordmark h1 {
    font-size: clamp(1.6rem, 5vw, 2.4rem);
  }

  .tiles {
    grid-column: 2;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: start;
  }

  .tile {
    padding: 12px;
  }

  .tile-chevron {
    display: none;
  }

  .hint {
    display: none;
  }

  .top-nav {
    display: none;
  }
}

/* Desktop: tiles orbit the cube, joined by lines. */
@media (min-width: 1100px) {
  .top-nav {
    display: flex;
  }

  .music-toggle {
    margin-left: 14px;
  }

  .cta {
    margin-left: 10px;
  }

  .stage-wrap {
    display: block;
    min-height: calc(100dvh - var(--header-h) - 64px);
    padding: 0 36px 12px;
  }

  .stage {
    position: absolute;
    inset: 0;
    height: auto;
    min-height: 0;
  }

  .wordmark {
    position: absolute;
    left: 50%;
    bottom: 5%;
    z-index: 5;
    transform: translate3d(-50%, 0, 0);
    text-align: center;
    padding: 0 12px;
    pointer-events: none;
  }

  .wordmark h1 {
    font-size: clamp(3.2rem, 6vw, 5.4rem);
  }

  .orbits {
    display: block;
  }

  .tiles {
    position: absolute;
    inset: 8% 5% 20%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr 1fr;
    pointer-events: none;
  }

  .tile {
    pointer-events: auto;
    width: min(320px, 32vw);
    min-height: 88px;
  }

  .tile:nth-child(1) {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    align-self: start;
  }

  .tile:nth-child(2) {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    align-self: start;
  }

  .tile:nth-child(3) {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    align-self: start;
  }

  .tile:nth-child(4) {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
    align-self: end;
  }

  .tile:nth-child(5) {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
    align-self: end;
  }

  .panel {
    place-items: center;
  }

  .hint {
    bottom: 16%;
    top: auto;
    opacity: 0.75;
  }
}

@media (min-width: 1100px) and (max-height: 760px) {
  .wordmark h1 {
    font-size: 2.8rem;
  }

  .tiles {
    inset: 6% 3% 16%;
  }
}
