/* jingle landing page. Two colors only: ink on paper. Every other shade is
   ink at an opacity. Sizes follow the Figma frame (1440 wide, 32px gutters). */

:root {
  --ink: #302f2c;
  --paper: #efede3;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, monospace;

  --gutter: 32px;
  --display: clamp(56px, 6.67vw, 96px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img,
svg {
  display: block;
}

h1,
h2,
p,
figure,
pre,
ul {
  margin: 0;
}

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

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
  border-radius: 8px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Hidden until GSAP reveals them (see the inline script in <head>). */
.js .js-anim {
  visibility: hidden;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
}

/* ========== 1. Nav ========== */

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: var(--gutter);
}

.nav__logo {
  justify-self: start;
  border-radius: 12px;
}

.nav__logo img {
  width: 64px;
  height: 64px;
  transform-origin: 50% 50%;
}

.nav__logo:hover img {
  animation: logo-pulse 0.5s var(--ease-out);
}

/* One beat, like a level meter: squash, then settle. */
@keyframes logo-pulse {
  0% { transform: scale(1, 1); }
  35% { transform: scale(1.06, 0.84); }
  100% { transform: scale(1, 1); }
}

.nav__link {
  font-size: 24px;
  line-height: normal;
  position: relative;
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 3px;
  background: var(--ink);
  border-radius: 3px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}

.nav__link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav__end {
  justify-self: end;
}

.nav__github {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  padding: 8px;
  border-radius: 64px;
  background: var(--ink);
  transition: transform 0.35s var(--ease-out);
}

.nav__github:hover {
  transform: rotate(-8deg) scale(1.08);
}

.nav__github img {
  width: 29px;
  height: 29px;
}

/* ========== 2. Hero ========== */

.hero {
  display: grid;
  /* 832 : 512 at 1440, as in the Figma frame. */
  grid-template-columns: minmax(0, 832fr) minmax(340px, 512fr);
  gap: var(--gutter);
  padding: var(--gutter);
}

.hero__media {
  align-self: start;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--ink);
}

.hero__media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
  min-width: 0;
}

.hero__intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.hero__title {
  font-size: var(--display);
  line-height: 0.948; /* 91px at 96px */
  letter-spacing: -0.02em;
}

/* SplitText masks (direct children once split) clip with overflow:hidden.
   At this tight line-height, descenders (y, p) hang below the line box, so
   give the masks room underneath without moving anything. */
.hero__title > *,
.plays__title > * {
  padding-bottom: 0.18em;
  margin-bottom: -0.18em;
}

.hero__sub {
  font-size: clamp(18px, 1.67vw, 24px);
  line-height: normal;
  letter-spacing: -0.02em;
  opacity: 0.7;
  text-wrap: pretty;
}

/* Command names read as part of the sentence, not as a code block. */
.hero__sub code {
  font: inherit;
  white-space: nowrap;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.codecard {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border-radius: 24px;
  background: var(--ink);
}

.codecard__body {
  width: 100%;
  padding: 8px 16px;
  border-radius: 16px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(15px, 1.39vw, 20px);
  line-height: 1.6;
  letter-spacing: -0.04em;
  overflow-x: auto;
}

.codecard__body code {
  font: inherit;
}

.codecard__copy {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: var(--paper);
  transition: transform 0.25s var(--ease-out);
}

.codecard__copy:hover {
  transform: scale(1.08);
}

.codecard__copy:active {
  transform: scale(0.92);
}

.codecard__copy:focus-visible {
  outline-color: var(--paper);
  outline-offset: 2px;
}

.codecard__copy > * {
  grid-area: 1 / 1;
}

.icon-copy,
.icon-check {
  transition: opacity 0.25s var(--ease-out), transform 0.45s var(--ease-out);
}

.icon-check {
  opacity: 0;
  transform: scale(0.4) rotate(-20deg);
}

.is-copied .icon-copy {
  opacity: 0;
  transform: scale(0.4) rotate(20deg);
}

.is-copied .icon-check {
  opacity: 1;
  transform: none;
}

.divider {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 16px;
}

.divider__rule {
  flex: 1 1 0;
  height: 4px;
  background: var(--ink);
  opacity: 0.7;
}

.divider__or {
  font-size: 32px;
  line-height: normal;
  opacity: 0.7;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 24px;
  border-radius: 64px;
  font-size: 24px;
  line-height: normal;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.btn--ink {
  background: var(--ink);
  color: var(--paper);
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px -12px var(--ink);
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

.btn img {
  width: 24px;
  height: 24px;
}

.hero__note {
  width: 100%;
  font-size: 16px;
  line-height: normal;
  letter-spacing: -0.02em;
  text-align: center;
  opacity: 0.7; /* Figma has 0.5, which fails WCAG AA contrast (2.8:1) at 16px */
}

/* ========== 3. Plays on ========== */

.plays {
  padding: var(--gutter);
}

.plays__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  min-height: max(560px, min(832px, calc(100svh - 64px)));
  padding: 64px var(--gutter);
  background: var(--ink);
  color: var(--paper);
  transform-origin: 50% 0%;
}

.plays__title {
  font-size: var(--display);
  line-height: 0.948;
  letter-spacing: -0.02em;
  text-align: center;
  white-space: nowrap;
}

.plays__list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 0;
  list-style: none;
}

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  border-radius: 64px;
  background: var(--paper);
  color: var(--ink);
  font-size: 32px;
  line-height: normal;
  white-space: nowrap;
  transition: transform 0.35s var(--ease-out);
}

.pill:hover {
  transform: translateX(6px);
}

.pill:active {
  transform: translateX(6px) scale(0.97);
}

.pill.is-playing {
  transform: translateX(6px) scale(1.04);
}

.pill:focus-visible {
  outline-color: var(--paper);
}

.pill__icon {
  width: 32px;
  height: 32px;
  flex: none;
}

/* Pulse rings, added by JS while a sound plays. */
.pill__ring {
  position: absolute;
  inset: 0;
  border: 3px solid var(--paper);
  border-radius: inherit;
  pointer-events: none;
}

/* ========== Responsive ========== */

@media (max-width: 899px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero__media {
    aspect-ratio: 4 / 3;
  }

  .hero__content {
    align-items: stretch;
    justify-content: flex-start;
    max-width: 640px;
  }

  .hero__actions {
    align-items: center;
  }
}

@media (max-width: 767px) {
  .plays__panel {
    flex-direction: column;
    gap: 32px;
    min-height: 0;
    padding: 96px var(--gutter);
  }

  .plays__list {
    align-items: center;
  }

  .pill {
    font-size: 22px;
    padding: 8px 20px;
  }

  .pill__icon {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 599px) {
  :root {
    --gutter: 16px;
    --display: clamp(48px, 14vw, 64px);
  }

  .nav__logo img {
    width: 48px;
    height: 48px;
  }

  .nav__link {
    font-size: 20px;
  }

  .hero__media {
    aspect-ratio: 1;
  }

  .codecard__body {
    padding: 8px 12px;
  }

  .divider__or {
    font-size: 24px;
  }

  .btn {
    font-size: 20px;
  }
}

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