@import url("tokens/colors.css");
@import url("tokens/typography.css?v=20260618-cleanup-v5");
@import url("tokens/spacing.css");

:root {
  /* The hero is intentionally monochrome (#000 on #fff). The teal brand palette
     in tokens/colors.css is reserved for future surfaces, not wired here. */
  --canvas: #fff;
  --ink: #000;
  --current: #000;
  --cycle-slot: clamp(5rem, 8.5vw, 8.4rem);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--canvas);
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
}

body {
  min-height: 100%;
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
}

body::selection {
  background: var(--current-100);
  color: var(--ink);
}

video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 0;
  /* Fallback for browsers without color-mix(); the next line overrides it. */
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.38);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--current) 38%, transparent);
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 16px;
  left: 16px;
  padding: 10px 14px;
  border: 1px solid #000;
  border-radius: 6px;
  background: var(--canvas);
  color: #000;
  transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.betta-scroll {
  position: relative;
}

.betta-stage {
  position: fixed;
  z-index: 4;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  align-content: center;
  justify-items: center;
  overflow: hidden;
  padding: clamp(28px, 5vh, 52px) clamp(28px, 6vw, 80px);
  background: #fff;
  pointer-events: none;
}

.fish-loop {
  width: min(58vw, 600px);
  aspect-ratio: 1;
  max-height: 36vh;
  max-height: 36svh;
  object-fit: contain;
  opacity: 0.92;
  mix-blend-mode: multiply;
  transform: none;
}

.copy-stack {
  display: grid;
  justify-items: center;
  width: min(760px, 100%);
  margin-top: clamp(12px, 2.8vh, 28px);
  text-align: center;
  grid-template-rows: auto auto var(--cycle-slot);
}

.brand-line {
  margin: 0 0 clamp(16px, 2vw, 24px);
  color: var(--current);
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.2vw, 0.92rem);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  line-height: 1.3;
  text-transform: uppercase;
}

h1 {
  max-width: 10ch;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2.85rem, 6.2vw, 5.9rem);
  font-weight: var(--weight-black);
  letter-spacing: 0;
  line-height: 0.86;
}

.cycle-line {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: var(--cycle-slot);
  width: min(100%, 72rem);
  margin: clamp(28px, 4vw, 48px) 0 0;
  overflow: hidden;
  color: var(--current);
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.6vw, 2.8rem);
  font-weight: var(--weight-bold);
  letter-spacing: 0;
  line-height: 1.05;
  text-align: center;
  pointer-events: auto;
}

.line-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: min(100%, 34ch);
  color: inherit;
  text-align: center;
  text-decoration: none;
  text-wrap: balance;
  overflow-wrap: normal;
}

.line-content.is-action-link {
  max-width: min(100%, 42ch);
  font-size: clamp(0.92rem, 2.6vw, 2.8rem);
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 8px;
}

.line-content svg {
  display: block;
  width: 0.42em;
  height: 0.42em;
  flex: 0 0 auto;
  margin-left: 0.34em;
  margin-top: 0.02em;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.cycle-line.is-transitioning .line-content {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max-content;
}

.cycle-line[data-direction="next"] .line-content.line-enter {
  animation: line-enter-next 260ms var(--ease-out) both;
}

.cycle-line[data-direction="next"] .line-content.line-exit {
  animation: line-exit-next 260ms var(--ease-out) both;
}

.cycle-line[data-direction="previous"] .line-content.line-enter {
  animation: line-enter-previous 260ms var(--ease-out) both;
}

.cycle-line[data-direction="previous"] .line-content.line-exit {
  animation: line-exit-previous 260ms var(--ease-out) both;
}

.cycle-steps {
  position: relative;
  z-index: 0;
}

.cycle-step {
  min-height: 100vh;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.cycle-controls {
  position: fixed;
  z-index: 8;
  top: 50%;
  right: clamp(14px, 3vw, 36px);
  display: grid;
  gap: 10px;
  justify-items: center;
  color: var(--current);
  transform: translateY(-50%);
}

.cycle-control,
.cycle-dot {
  -webkit-tap-highlight-color: transparent;
}

.cycle-control {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  opacity: 0.78;
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

.cycle-control:hover,
.cycle-control:focus-visible {
  opacity: 1;
}

.cycle-control:disabled {
  cursor: default;
  opacity: 0.22;
}

.cycle-control svg {
  width: 25px;
  height: 25px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.cycle-control-down.is-nudging:not(:disabled) {
  animation: control-nudge 1.8s var(--ease-out) infinite;
}

.cycle-dots {
  display: grid;
  gap: 9px;
  justify-items: center;
}

.cycle-dot {
  display: grid;
  width: 18px;
  height: 18px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  cursor: pointer;
  opacity: 0.72;
}

.cycle-dot::before {
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  content: "";
  transition:
    background-color 180ms var(--ease-out),
    transform 180ms var(--ease-out);
}

.cycle-dot[aria-current="true"] {
  opacity: 1;
}

.cycle-dot[aria-current="true"]::before {
  background: currentColor;
  transform: scale(1.25);
}

@keyframes line-enter-next {
  from {
    opacity: 0;
    transform: translate(-50%, 40%);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes line-exit-next {
  from {
    opacity: 1;
    transform: translate(-50%, -50%);
  }

  to {
    opacity: 0;
    transform: translate(-50%, -140%);
  }
}

@keyframes line-enter-previous {
  from {
    opacity: 0;
    transform: translate(-50%, -140%);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes line-exit-previous {
  from {
    opacity: 1;
    transform: translate(-50%, -50%);
  }

  to {
    opacity: 0;
    transform: translate(-50%, 40%);
  }
}

@keyframes control-nudge {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(7px);
  }
}

@media (max-width: 720px) {
  :root {
    --cycle-slot: 4rem;
  }

  .betta-stage {
    padding: 24px 18px calc(112px + env(safe-area-inset-bottom));
  }

  .fish-loop {
    width: min(86vw, 340px);
    max-height: 34vh;
    max-height: 34svh;
  }

  h1 {
    font-size: clamp(2.45rem, 12vw, 3.65rem);
  }

  .cycle-line {
    width: min(100%, 21rem);
    font-size: clamp(0.82rem, 4.3vw, 1.15rem);
  }

  .line-content {
    max-width: min(100%, 18rem);
    overflow-wrap: break-word;
  }

  .line-content.is-action-link {
    max-width: min(100%, 20rem);
    font-size: clamp(0.82rem, 4.3vw, 1.15rem);
  }

  .cycle-controls {
    top: auto;
    right: 50%;
    bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    transform: translateX(50%);
  }

  .cycle-dots {
    grid-auto-flow: column;
    gap: 5px;
  }

  .cycle-control {
    width: 40px;
    height: 40px;
  }

  .cycle-control svg {
    width: 24px;
    height: 24px;
  }

  .cycle-dot {
    width: 15px;
    height: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
