:root {
  --bg: #121212;
  --bg-2: #191919;
  --red: #c4453c;
  --red-dim: #8f322c;
  --ink: #f2ece6;
  --muted: #9a938b;
  --line: rgba(196, 69, 60, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Manrope, system-ui, sans-serif;
  min-height: 100%;
}

body {
  overflow-x: hidden;
}

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

#grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.scan {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(196, 69, 60, 0.06) 50%,
    transparent 100%
  );
  background-size: 100% 220%;
  animation: scan 7s linear infinite;
  mix-blend-mode: screen;
}

.orbs {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.orbs i {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.22;
  background: radial-gradient(circle, #c4453c, transparent 68%);
  animation: drift 18s ease-in-out infinite;
}

.orbs i:nth-child(1) {
  width: 42vw;
  height: 42vw;
  top: -12%;
  left: -8%;
}

.orbs i:nth-child(2) {
  width: 28vw;
  height: 28vw;
  right: -6%;
  top: 38%;
  animation-duration: 22s;
  animation-delay: -6s;
}

.orbs i:nth-child(3) {
  width: 34vw;
  height: 34vw;
  left: 28%;
  bottom: -18%;
  animation-duration: 26s;
  animation-delay: -11s;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: #0c0c0c;
  clip-path: inset(0 0 0 0);
  animation: boot-out 0.85s var(--ease) 1.25s forwards;
}

.boot-word {
  display: block;
  width: min(72vw, 560px);
  height: auto;
  animation: boot-in 0.7s var(--ease) both, glitch 0.8s steps(2) 0.7s 2;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 40;
  background: var(--red);
}

.cursor,
.cursor-dot {
  display: none;
}

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 6vw;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.92), rgba(18, 18, 18, 0));
}

.nav-logo {
  display: flex;
  align-items: center;
  width: min(42vw, 168px);
}

.nav-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.nav-logo:hover {
  animation: glitch 0.35s steps(2);
}

.nav nav {
  display: flex;
  gap: 28px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav nav a {
  position: relative;
}

.nav nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.nav nav a:hover::after {
  transform: scaleX(1);
}

main,
footer {
  position: relative;
  z-index: 3;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18vh 6vw 12vh;
  gap: 28px;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: var(--gy, 42%);
  left: var(--gx, 48%);
  width: 56vw;
  height: 56vw;
  max-width: 720px;
  max-height: 720px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(196, 69, 60, 0.22), transparent 68%);
  transform: translate(-50%, -50%);
  filter: blur(18px);
  z-index: 0;
  transition: top 0.4s linear, left 0.4s linear;
}

.hero .kicker,
.hero .wordmark,
.hero .hero-line,
.hero .lede,
.hero .hero-actions {
  position: relative;
  z-index: 1;
}

.kicker {
  color: var(--red);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 600;
}

.wordmark {
  display: flex;
  align-items: stretch;
  width: min(94vw, 1080px);
  height: calc(min(94vw, 1080px) * 133 / 1024);
}

.wordmark .letter {
  flex: var(--w) 0 0;
  overflow: hidden;
  height: 100%;
  animation: rise 0.95s var(--ease) both;
  animation-delay: calc(1.32s + var(--i) * 0.08s);
}

.wordmark .letter b {
  display: block;
  width: calc(1024 / var(--w) * 100%);
  height: 100%;
  margin-left: calc(var(--x) / var(--w) * -100%);
  will-change: transform;
}

.wordmark .letter img {
  display: block;
  width: 100%;
  height: 100%;
}

.wordmark:hover .letter img {
  filter: drop-shadow(0 0 18px rgba(196, 69, 60, 0.55));
}

.hero-line {
  width: min(94vw, 1080px);
  height: 1px;
  background: linear-gradient(90deg, var(--red), transparent 92%);
  transform-origin: left;
  animation: draw 1.1s var(--ease) 2.15s both;
}

.lede {
  max-width: 640px;
  font-size: clamp(18px, 2.2vw, 26px);
  line-height: 1.45;
  color: var(--ink);
  font-weight: 500;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  background: var(--red);
  color: var(--ink);
  font-family: Syne, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
  will-change: transform;
}

.btn:hover {
  background: #d3544b;
  box-shadow: 0 0 28px rgba(196, 69, 60, 0.35);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(242, 236, 230, 0.28);
}

.btn.ghost:hover {
  background: rgba(196, 69, 60, 0.12);
}

.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 16px 0;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-track {
  display: flex;
  align-items: center;
  gap: 48px;
  width: max-content;
  animation: ticker 28s linear infinite;
  font-family: Syne, sans-serif;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--red);
}

.marquee-logo img {
  display: block;
  height: 12px;
  width: auto;
}

.studio,
.work,
.contact {
  padding: 18vh 6vw;
}

.studio {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 8vw;
  align-items: end;
}

.studio h2,
.work h2,
.contact h2 {
  font-family: Syne, sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 5vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 14px 0 24px;
}

.studio-copy.reveal.visible h2,
.work h2.reveal.visible,
.contact h2.reveal.visible {
  animation: mask-up 1s var(--ease) both;
}

.studio p + p {
  margin-top: 16px;
}

.studio-copy p:not(.kicker) {
  max-width: 58ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.studio-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 36px 32px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  background: linear-gradient(180deg, rgba(196, 69, 60, 0.08), transparent 55%);
  animation: pulse-border 4.5s ease-in-out infinite;
}

.studio-card::after {
  content: "";
  position: absolute;
  inset: auto -20% 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  animation: sweep 3.4s linear infinite;
}

.studio-card-label {
  color: var(--red);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 11px;
}

.studio-card strong {
  font-family: Syne, sans-serif;
  font-size: 42px;
  font-weight: 800;
}

.studio-card span:last-child {
  color: var(--muted);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 48px;
}

.card {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  padding: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  transform-style: preserve-3d;
  transition: border-color 0.5s var(--ease), background 0.5s var(--ease);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    260px circle at var(--sx, 50%) var(--sy, 40%),
    rgba(196, 69, 60, 0.2),
    transparent 58%
  );
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

.card:hover {
  border-color: var(--red);
  background: rgba(196, 69, 60, 0.08);
}

.card:hover::before {
  opacity: 1;
}

.card-index,
.card h3,
.card p {
  position: relative;
  z-index: 1;
}

.card-index {
  font-family: Syne, sans-serif;
  color: var(--red);
  letter-spacing: 0.14em;
  margin-bottom: auto;
}

.card h3 {
  font-family: Syne, sans-serif;
  font-size: 28px;
  font-weight: 700;
}

.card p {
  color: var(--muted);
  line-height: 1.6;
}

.contact {
  padding-bottom: 12vh;
}

.contact p:not(.kicker) {
  max-width: 46ch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.mail {
  display: inline-block;
  margin-top: 36px;
  font-family: Syne, sans-serif;
  font-size: clamp(28px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--red);
  background-image: linear-gradient(var(--red), var(--red));
  background-size: 0 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.5s var(--ease);
}

.mail:hover {
  background-size: 100% 2px;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 6vw 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.footer-logo {
  display: block;
  width: min(36vw, 148px);
  height: auto;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
}

.reveal.visible {
  animation: rise 0.9s var(--ease) both;
}

.hero .reveal {
  animation: rise 0.9s var(--ease) 2.05s both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(36px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes draw {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes mask-up {
  from {
    clip-path: inset(100% 0 0 0);
    transform: translateY(18px);
  }
  to {
    clip-path: inset(0 0 0 0);
    transform: none;
  }
}

@keyframes ticker {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes scan {
  from {
    background-position: 0 -120%;
  }
  to {
    background-position: 0 220%;
  }
}

@keyframes sweep {
  from {
    transform: translateX(-40%);
  }
  to {
    transform: translateX(40%);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(6%, -8%) scale(1.08);
  }
}

@keyframes glitch {
  0%,
  100% {
    transform: none;
    filter: none;
  }
  20% {
    transform: translate(-3px, 1px);
    filter: drop-shadow(3px 0 #7a1f1a);
  }
  40% {
    transform: translate(3px, -1px);
    filter: drop-shadow(-3px 0 #e07a72);
  }
  60% {
    transform: translate(-1px, 0);
  }
}

@keyframes boot-in {
  from {
    opacity: 0;
    transform: scaleX(1.14);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes boot-out {
  to {
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
  }
}

@keyframes pulse-border {
  0%,
  100% {
    box-shadow: inset 0 0 0 0 rgba(196, 69, 60, 0);
  }
  50% {
    box-shadow: inset 0 0 0 1px rgba(196, 69, 60, 0.45);
  }
}

@media (max-width: 860px) {
  .nav nav {
    display: none;
  }

  .studio,
  .cards {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 22vh;
  }

  .wordmark {
    width: min(94vw, 1080px);
  }
}

@media (hover: hover) and (pointer: fine) {
  .cursor,
  .cursor-dot {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 50;
    border-radius: 50%;
    transform: translate(-50%, -50%);
  }

  .cursor {
    width: 34px;
    height: 34px;
    border: 1px solid var(--red);
    transition: width 0.25s var(--ease), height 0.25s var(--ease),
      opacity 0.25s var(--ease);
  }

  .cursor-dot {
    width: 5px;
    height: 5px;
    background: var(--red);
  }

  .cursor.hot {
    width: 56px;
    height: 56px;
    opacity: 0.55;
  }

  body,
  a,
  button {
    cursor: none;
  }
}

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

  .boot {
    display: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
