* {
  box-sizing: border-box;
}

:root {
  --color-text: #0f0f0f;
  --color-muted: #5d5d5d;
  --color-line: #d8d8d8;
  --color-bg-soft: #fbfaf7;
  --color-red: #cd2424;
  --max-width: 1000px;

  /* Spacing scale — every gap/padding on the page derives from these. */
  --gutter: 32px;
  --space-2xs: 8px;
  --space-xs: 12px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-block: clamp(24px, 3.5vw, 40px);
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 1px 1px, rgba(15, 15, 15, 0.11) 1.15px, transparent 1.35px),
    linear-gradient(var(--color-bg-soft), var(--color-bg-soft));
  background-size: 22px 22px, auto;
  color: var(--color-text);
  font-family: "Archivo", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

@keyframes enter-soft {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes enter-visual {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes draw-divider {
  from {
    border-top-color: transparent;
  }

  to {
    border-top-color: var(--color-line);
  }
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

a:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 4px;
}

.site-header {
  width: 100%;
  background: transparent;
  animation: enter-soft 480ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: min(100% - var(--gutter), var(--max-width));
  margin: 0 auto;
  padding: var(--space-sm) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  display: block;
  width: 104px;
  height: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  color: var(--color-text);
}

.nav-links a:hover {
  color: var(--color-red);
}

.nav-icon {
  display: block;
  width: 22px;
  height: 22px;
  background-color: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}

.nav-icon-desktop {
  -webkit-mask-image: url("art/computer.svg");
  mask-image: url("art/computer.svg");
}

.nav-icon-youtube {
  -webkit-mask-image: url("art/puzzle.svg");
  mask-image: url("art/puzzle.svg");
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: var(--space-sm);
  font-size: clamp(42px, 6vw, 78px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: var(--space-sm);
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100% - var(--gutter), var(--max-width));
  margin: 0 auto;
  padding: calc(var(--space-block) * 1.5) 0 var(--space-block);
  text-align: center;
}

/* Cinnabar glow pool that warms the dot grid behind the mark. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 44%;
  width: min(820px, 94vw);
  aspect-ratio: 1.35 / 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    closest-side,
    rgba(205, 36, 36, 0.22),
    rgba(205, 36, 36, 0.1) 48%,
    rgba(205, 36, 36, 0) 76%
  );
  pointer-events: none;
  animation: hero-glow 7s ease-in-out infinite alternate;
}

@keyframes hero-glow {
  from {
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0.8;
  }

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

.hero-mark {
  width: clamp(84px, 11vw, 120px);
  height: auto;
  margin-bottom: var(--space-md);
  animation: enter-visual 640ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero h1 {
  max-width: 18ch;
  margin-bottom: 0;
  animation: enter-soft 560ms cubic-bezier(0.2, 0.8, 0.2, 1) 90ms both;
}

.product-intro p,
.product-download {
  color: var(--color-muted);
}

.store-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--color-text);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.download-link-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  filter: brightness(0) invert(1);
}

.download-link {
  border-color: var(--color-red);
  background: var(--color-red);
  color: #ffffff;
}

.download-link:hover {
  background: var(--color-text);
  border-color: var(--color-text);
  color: #ffffff;
}

.beat {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: var(--space-block);
}

.beat-visual {
  position: relative;
  margin: 0;
  width: 100%;
  border: 1px solid var(--color-line);
  border-radius: 16px;
  overflow: hidden;
}

.beat-visual img {
  display: block;
  width: 100%;
}

.beat-visual figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: clamp(36px, 6vw, 64px) clamp(16px, 2.5vw, 26px) clamp(14px, 2vw, 20px);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.34) 42%, rgba(0, 0, 0, 0) 100%);
  color: #ffffff;
  font-size: clamp(15px, 1.6vw, 19px);
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}

/* Carousel
   --------------------------------------------------------------- */
.carousel {
  --carousel-interval: 5s;
  width: 100%;
  margin-top: var(--space-block);
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  margin-top: 0;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-block);
}

.carousel-dots {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  background: #ffffff;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  box-shadow: 0 6px 18px -10px rgba(15, 15, 15, 0.25);
}

.carousel-dot {
  position: relative;
  width: 26px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--color-line);
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.carousel-dot-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--color-text);
  transform: scaleX(0);
  transform-origin: left center;
}

.carousel-dot[data-active] .carousel-dot-fill {
  transform: scaleX(1);
}

.carousel.is-playing .carousel-dot[data-active] .carousel-dot-fill {
  animation: dot-fill var(--carousel-interval) linear forwards;
}

@keyframes dot-fill {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.carousel button:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .carousel.is-playing .carousel-dot[data-active] .carousel-dot-fill {
    animation: none;
  }

  .carousel-track {
    scroll-behavior: auto;
  }
}

.product-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100% - var(--gutter), 860px);
  margin: 0 auto;
  border-top: 1px solid var(--color-line);
  padding: var(--space-block) 0;
  scroll-margin-top: var(--space-md);
  text-align: center;
  animation: draw-divider 500ms ease both;
}

.policy-page {
  width: min(100% - var(--gutter), 820px);
  margin: 0 auto;
  border-top: 1px solid var(--color-line);
  padding: var(--space-block) 0;
  animation: draw-divider 500ms ease both;
}

.policy-updated {
  margin-bottom: var(--space-block);
  color: var(--color-muted);
  font-weight: 600;
}

.policy-section {
  border-top: 1px solid var(--color-line);
  padding: var(--space-md) 0 0;
  animation: enter-soft 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.policy-section + .policy-section {
  margin-top: var(--space-md);
}

.policy-section h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.policy-section p {
  color: var(--color-muted);
}

.policy-list {
  display: grid;
  gap: var(--space-xs);
  margin: var(--space-sm) 0 0;
  padding-left: var(--space-md);
  color: var(--color-muted);
}

.policy-list strong {
  color: var(--color-text);
}

.product-intro {
  max-width: 620px;
  animation: enter-soft 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.product-intro p {
  margin: 0;
}

.product-intro .hl {
  color: var(--color-red);
  font-weight: 600;
}

.product-download {
  justify-content: center;
  margin-top: var(--space-block);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: min(100% - var(--gutter), var(--max-width));
  margin: auto auto 0;
  border-top: 1px solid var(--color-line);
  padding: var(--space-sm) 0;
  color: var(--color-muted);
  font-size: 13px;
  animation: enter-soft 520ms cubic-bezier(0.2, 0.8, 0.2, 1) 440ms both;
}

.site-footer p {
  margin: 0;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  color: var(--color-muted);
}

.site-footer a,
.footer-links a {
  color: var(--color-text);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.site-footer a:hover,
.footer-links a:hover {
  color: var(--color-red);
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .carousel {
      opacity: 0;
      animation: enter-visual 1ms linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 20%;
    }
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 24px;
  }

  .download-link {
    width: 100%;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-xs);
  }

  .footer-links {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-2xs);
  }

  .footer-links span {
    display: none;
  }

  .site-footer a,
  .footer-links a {
    text-align: left;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
