@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

/* Shared elements morph between pages */
.side-left .side-title {
  view-transition-name: title-share;
}

.side-right .side-title {
  view-transition-name: title-playbook;
}

.brand {
  view-transition-name: brand;
}

/* Wave canvases are NOT snapshotted by View Transitions: the ribbons are re-laid out
   live by JS (landing panel <-> full page), which looks far smoother than a stretched image. */

::view-transition-group(*) {
  animation-duration: 0.62s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-old(root) {
  animation: vt-fade-out 0.3s ease both;
}

::view-transition-new(root) {
  animation: vt-fade-in 0.3s ease both;
}

@keyframes vt-fade-out {
  to { opacity: 0; }
}

@keyframes vt-fade-in {
  from { opacity: 0; }
}

:root {
  --bg-left: #090a0f;
  --bg-right: #070a09;
  --text: #f3f4f6;
  --text-muted: rgba(243, 244, 246, 0.52);
  --border-line: rgba(255, 255, 255, 0.08);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html,
body {
  margin: 0;
  padding: 0;
  block-size: 100%;
  overflow: hidden;
  background-color: #060709;
  color: var(--text);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Small, translucent brand label at the top center */
.brand {
  position: fixed;
  inset-block-start: max(14px, env(safe-area-inset-top), 3vh);
  inset-inline: 0;
  z-index: 10;
  text-align: center;
  pointer-events: none;
  user-select: none;
  font-size: clamp(0.7rem, 0.9vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.32em;
  line-height: 1;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.32);
  transition: opacity 0.45s ease;
}

.split {
  display: flex;
  inline-size: 100%;
  block-size: 100dvh;
}

.side {
  position: relative;
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: flex-grow 0.75s var(--ease-smooth), opacity 0.5s ease;
}

.side-left {
  background-color: var(--bg-left);
  border-inline-end: 1px solid var(--border-line);
}

.side-right {
  background-color: var(--bg-right);
}

.wave-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  inline-size: 100%;
  block-size: 100%;
  display: block;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.side-title {
  position: relative;
  z-index: 5;
  font-size: clamp(2.1rem, 3.8vw, 3.8rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.75);
  transition:
    color 0.4s ease,
    letter-spacing 0.55s var(--ease-smooth),
    transform 0.55s var(--ease-smooth);
}

.side:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: -8px;
}

/* Return transition (JS fallback) initial hidden state */
html.is-returning .brand,
html.is-returning .side-title {
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .split:hover .side {
    opacity: 0.55;
  }

  .split:hover .side:hover {
    flex-grow: 1.18;
    opacity: 1;
  }

  /* Waves rise above the global background text on hover */
  .side:hover .wave-canvas {
    z-index: 3;
  }

  .side:hover .side-title {
    color: #ffffff;
    letter-spacing: 0.12em;
    transform: scale(1.04);
  }
}

@media (max-width: 720px) {
  .split {
    flex-direction: column;
  }

  .side-left {
    border-inline-end: none;
    border-block-end: 1px solid var(--border-line);
  }

  .side:active .side-title {
    color: #ffffff;
    transform: scale(0.98);
  }
}
