/* default resets — bare minimum. */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

body {
  min-height: 100vh;
  background: #feaaf8;
  color: #111;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  mix-blend-mode: multiply;
}

@keyframes tone-intro {
  from { background-color: #99dbfe; }
  to { background-color: #feaaf8; }
}

@keyframes tone-ember {
  from { background-color: #fe4d4d; }
  to { background-color: #ffa2a8; }
}

@keyframes tone-contact {
  from { background-color: #9eee9e; }
  to { background-color: #afb110; }
}

body[data-tone="intro"] {
  animation: tone-intro 9s ease-in-out infinite alternate;
}

body[data-tone="offer"] {
  animation: tone-ember 9s ease-in-out infinite alternate;
}

body[data-tone="finale"] {
  animation: tone-contact 9s ease-in-out infinite alternate;
}

@media (prefers-reduced-motion: reduce) {
  body[data-tone="intro"] {
    animation: none;
    background-color: #99dbfe;
  }

  body[data-tone="offer"] {
    animation: none;
    background-color: #fe9d9d;
  }

  body[data-tone="finale"] {
    animation: none;
    background-color: #fe7d7d;
  }
}

canvas.lighting {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.section {
  display: none;
}

.section.active {
  display: grid;
}

.section.active.arrive-rise {
  animation: section-rise 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.section.active.arrive-zoom {
  animation: section-zoom 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.section.active.arrive-drift {
  animation: section-drift 7s ease-in-out infinite alternate;
}

@keyframes section-drift {
  to {
    transform: translateY(-9px);
  }
}

@keyframes section-rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
}

@keyframes section-zoom {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
}

#intro.active,
#offer.active,
#finale.active {
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  text-align: center;
  row-gap: 2rem;
  min-height: 100vh;
  min-height: 100dvh;
}

#quadrants.active {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, 100vh);
  grid-template-rows: repeat(2, 100dvh);
}

.quadrant {
  position: relative;
  padding: 3rem;
  cursor: pointer;
  transition: filter 0.25s ease;
}

.quadrant > canvas.object {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle 240px at var(--light-x, -9999px) var(--light-y, -9999px), #000 30%, transparent 100%);
  mask-image: radial-gradient(circle 240px at var(--light-x, -9999px) var(--light-y, -9999px), #000 30%, transparent 100%);
}

.quadrant > h3,
.quadrant > p {
  position: relative;
}

@media (hover: hover) {
  .quadrant:hover {
    filter: brightness(1.06);
  }
}

.quadrant:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

.quadrant p + p {
  margin-top: 1.25rem;
}

.quadrant.ink {
  background: #161616;
  color: #f2efe7;
}

.quadrant.paper {
  --card-bg: #e2572b;
  --card-fg: #141414;
}

.quadrant.flame {
  --card-bg: #0c7268;
  --card-fg: #f2efe7;
}

.quadrant.leaf {
  --card-bg: #8a4fbf;
  --card-fg: #f2efe7;
}

.quadrant.paper,
.quadrant.flame,
.quadrant.leaf {
  background: var(--card-bg);
  color: var(--card-fg);
  transition: background-color 0.6s ease, color 0.6s ease;
}

#offer h1 {
  font-size: clamp(1.6rem, 4vw, 3.2rem);
}

h1 {
  font-size: clamp(1.6rem, 4vw, 3.2rem);
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.1rem;
  font-weight: 400;
}

h2 {
  font-size: 1.5rem;
  font-weight: 500;
}

.quadrant h3 {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
}

h1,
h2,
h3,
p {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.3 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(currentColor, currentColor);
  background-size: 300px 300px;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.quadrant p {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 52ch;
}

.quadrant p.subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}

.topbar {
  display: contents;
}

.lang-switch {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  gap: 0.4rem;
}

.lang-switch button {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  background: #f2efe7;
  border: 1px solid #111111;
  color: #111111;
  cursor: pointer;
}

.lang-switch button.active {
  background: #141414;
  color: #f2efe7;
}

.dots {
  position: fixed;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  z-index: 2;
}

.dots button {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  background: #f2efe7;
  border: 1px solid #141414;
  color: #141414;
  cursor: pointer;
}

.dots button.on {
  background: #141414;
  color: #f2efe7;
}

.playback {
  position: fixed;
  bottom: 1.2rem;
  right: 1rem;
  z-index: 2;
  display: flex;
  gap: 0.4rem;
}

.playback button {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  background: #f2efe7;
  border: 1px solid #141414;
  color: #141414;
  cursor: pointer;
}

body.paused *,
body.paused *::before,
body.paused *::after {
  animation-play-state: paused !important;
}

.finale-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.finale-actions.revealed {
  opacity: 1;
  transform: none;
}

.finale-actions a,
.finale-actions button {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
  background: transparent;
  border: 1px solid currentColor;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

@media (max-width: 760px) {
  html {
    scroll-snap-type: y mandatory;
  }

  #quadrants.active {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 100vh);
    grid-template-rows: repeat(4, 100dvh);
  }

  .quadrant {
    padding: 6.5rem 1.25rem 1.5rem;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
  }

  .lang-switch {
    top: 0.8rem;
    left: 0.8rem;
    right: auto;
  }

  .playback {
    top: 0.8rem;
    right: 0.8rem;
    bottom: auto;
    gap: 0.3rem;
  }

  .quadrant h3 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
  }

  .quadrant p {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .dots {
    width: max-content;
    max-width: calc(100vw - 1.6rem);
  }

  .dots button,
  .lang-switch button,
  .playback button {
    font-size: 0.85rem;
    padding: 0.45rem 0.85rem;
  }

  .finale-actions {
    flex-direction: column;
    align-items: stretch;
  }

  h3 {
    overflow-wrap: anywhere;
  }

  #intro.active,
  #offer.active,
  #finale.active {
    row-gap: 1.25rem;
    padding: 1rem;
  }
}

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 0.08em;
  background: currentColor;
  vertical-align: -0.12em;
  visibility: hidden;
  opacity: 0.75;
}

.cursor.visible {
  visibility: visible;
}

.cursor.visible:not(.active) {
  animation: blink 1.1s infinite;
}

[data-target].pulsing {
  animation: pulse 0.45s ease-in-out;
}

@keyframes pulse {
  50% {
    transform: scale(1.06);
  }
}

[data-target].jolting {
  animation: jolt 0.32s linear;
}

@keyframes jolt {
  25% {
    transform: translate(-2px, 1px);
    text-shadow: 2px 0 rgba(242, 239, 231, 0.7), -2px 0 rgba(17, 17, 17, 0.5);
  }
  75% {
    transform: translate(2px, -1px);
    text-shadow: -2px 0 rgba(242, 239, 231, 0.7), 2px 0 rgba(17, 17, 17, 0.5);
  }
}

@keyframes blink {
  0%,
  49% {
    opacity: 0.75;
  }
  50%,
  100% {
    opacity: 0;
  }
}