:root {
  color-scheme: dark;
  --surface: #0a0a0a;
  --surface-soft: #111010;
  --ink: #e9e5de;
  --muted: #9b9690;
  --faint: rgba(233, 229, 222, 0.12);
  --accent: #a34245;
  --mouse-x: 0;
  --mouse-y: 0;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--surface);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface);
  font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 5px;
}

.page-background {
  position: fixed;
  inset: -3%;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8, 8, 8, 0.08), rgba(8, 8, 8, 0.46) 54%, rgba(8, 8, 8, 0.8)),
    url("assets/manga-noir-bg.png") center / cover no-repeat;
  transform: translate3d(calc(var(--mouse-x) * -5px), calc(var(--mouse-y) * -5px), 0) scale(1.03);
  transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 clamp(22px, 4vw, 68px);
}

.wordmark {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.wordmark span {
  color: var(--accent);
}

.profile-nav {
  display: flex;
  align-items: center;
  gap: clamp(22px, 3vw, 48px);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.profile-nav a {
  position: relative;
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 9px 0;
  transition: color 300ms ease;
}

.profile-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-nav a:hover {
  color: var(--ink);
}

.profile-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.profile-nav span {
  color: var(--accent);
  font-size: 14px;
}

.hero {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(480px, 0.88fr);
  min-height: 100dvh;
}

.showcase {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 76px 0 0;
}

.showcase-media {
  position: relative;
  width: min(64vw, 1120px);
  aspect-ratio: 750 / 422;
  overflow: hidden;
  background: #080808;
  clip-path: polygon(0 0, 93% 0, 100% 50%, 92% 100%, 0 100%);
  transform: translate3d(calc(var(--mouse-x) * 9px), calc(var(--mouse-y) * 5px), 0);
  transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.12) brightness(0.82);
  opacity: 0;
  transform: scale(1.025);
}

body[data-ready="true"] .showcase-video {
  opacity: 0.92;
  transform: scale(1);
  transition:
    opacity 1.2s ease 180ms,
    transform 1.8s cubic-bezier(0.16, 1, 0.3, 1) 180ms;
}

.showcase-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 10, 10, 0.05) 0%, transparent 50%, rgba(10, 10, 10, 0.78) 94%),
    linear-gradient(0deg, rgba(10, 10, 10, 0.56), transparent 30%, rgba(10, 10, 10, 0.22));
}

.profile-copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 96px clamp(28px, 4.5vw, 78px) 38px 0;
  margin-left: clamp(-108px, -6vw, -54px);
}

.steam-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 6px;
}

.steam-avatar {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid rgba(233, 229, 222, 0.2);
  filter: grayscale(1) contrast(1.1);
}

.steam-identity p {
  margin: 0;
  color: var(--ink);
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 10px;
  line-height: 1.55;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.steam-identity p span {
  color: var(--muted);
}

.name-lockup {
  position: relative;
  margin-top: clamp(18px, 3vh, 34px);
}

.kicker {
  margin: 0 0 5px 7px;
  color: var(--accent);
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(82px, 10.4vw, 162px);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.075em;
  text-shadow: 0 14px 55px rgba(0, 0, 0, 0.32);
}

.faceit-lockup {
  position: relative;
  display: grid;
  grid-template-columns: 44px auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: min(100%, 420px);
  min-height: 58px;
  margin-top: 22px;
  padding: 7px 14px 7px 7px;
  overflow: hidden;
  border: 1px solid rgba(233, 229, 222, 0.14);
  background:
    linear-gradient(90deg, rgba(12, 12, 12, 0.96), rgba(12, 12, 12, 0.78)),
    url("assets/faceit-cover.jpg") center / cover no-repeat;
  transition:
    border-color 300ms ease,
    transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.faceit-lockup:hover {
  border-color: rgba(163, 66, 69, 0.8);
  transform: translateX(4px);
}

.faceit-lockup:active {
  transform: translateX(4px) scale(0.985);
}

.faceit-avatar {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(0.6) contrast(1.05);
}

.faceit-name {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.faceit-rank {
  justify-self: end;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.faceit-arrow {
  color: var(--accent);
  font-size: 18px;
}

.quote {
  max-width: 560px;
  margin: clamp(24px, 4vh, 44px) 0 0;
  color: rgba(233, 229, 222, 0.86);
  font-size: clamp(18px, 1.55vw, 25px);
  font-weight: 400;
  line-height: 1.36;
  letter-spacing: -0.025em;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 620px);
  margin: clamp(26px, 4.5vh, 46px) 0 0;
}

.stats div {
  min-width: 0;
  padding: 12px 14px 0 0;
  border-top: 1px solid rgba(233, 229, 222, 0.18);
}

.stats div + div {
  padding-left: 18px;
}

.stats dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.stats dd {
  margin: 0;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 520;
  letter-spacing: -0.06em;
}

.stats dd span {
  margin-left: 2px;
  color: var(--accent);
  font-size: 0.55em;
}

.profile-meta {
  margin: 18px 0 0;
  color: rgba(155, 150, 144, 0.76);
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-meta span {
  margin: 0 8px;
  color: var(--accent);
}

.count-anchor {
  position: fixed;
  right: clamp(26px, 4vw, 68px);
  bottom: 21px;
  z-index: 5;
  margin: 0;
  color: rgba(233, 229, 222, 0.46);
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
}

.count-anchor span {
  color: var(--accent);
}

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

.calculation {
  position: absolute;
  color: rgba(233, 229, 222, var(--calc-opacity, 0.08));
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: var(--calc-size, 12px);
  letter-spacing: 0.08em;
  transform: translate3d(calc(var(--mouse-x) * var(--shift-x, 3px)), calc(var(--mouse-y) * var(--shift-y, 3px)), 0);
}

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

body[data-ready="true"] .reveal {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 760ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-ready="true"] .reveal-1 { transition-delay: 120ms; }
body[data-ready="true"] .reveal-2 { transition-delay: 210ms; }
body[data-ready="true"] .reveal-3 { transition-delay: 310ms; }
body[data-ready="true"] .reveal-4 { transition-delay: 410ms; }
body[data-ready="true"] .reveal-5 { transition-delay: 520ms; }
body[data-ready="true"] .reveal-6 { transition-delay: 610ms; }

.noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
}

@media (prefers-reduced-motion: no-preference) {
  .calculation {
    animation: calculation-breathe var(--duration, 10s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
  }

  @keyframes calculation-breathe {
    0%, 100% {
      opacity: 0.28;
      transform: translate3d(0, 5px, 0);
    }
    45% {
      opacity: 1;
      transform: translate3d(0, -5px, 0);
    }
    65% {
      opacity: 0.55;
    }
  }
}

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

  .profile-copy {
    margin-left: -58px;
    padding-right: 30px;
  }

  .profile-meta {
    max-width: 430px;
  }
}

@media (max-width: 820px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .topbar {
    position: absolute;
    height: 66px;
    padding: 0 20px;
  }

  .profile-nav {
    gap: 18px;
    font-size: 9px;
  }

  .hero {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100dvh;
    padding-bottom: 46px;
  }

  .showcase {
    min-height: 42vh;
    padding-top: 66px;
  }

  .showcase-media {
    width: 112vw;
    margin-left: -12vw;
    clip-path: polygon(0 0, 100% 0, 100% 88%, 48% 100%, 0 90%);
  }

  .profile-copy {
    padding: 0 20px 0;
    margin: clamp(-34px, -5vw, -18px) 0 0;
  }

  .steam-identity {
    margin-left: 0;
  }

  .name-lockup {
    margin-top: 18px;
  }

  h1 {
    font-size: clamp(76px, 24vw, 122px);
  }

  .faceit-lockup {
    width: 100%;
    max-width: 520px;
    margin-top: 18px;
  }

  .quote {
    max-width: 520px;
    margin-top: 26px;
    font-size: clamp(18px, 5vw, 23px);
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 0;
    margin-top: 30px;
  }

  .stats div:nth-child(3),
  .stats div:nth-child(4) {
    padding-top: 12px;
  }

  .stats dd {
    font-size: 28px;
  }

  .profile-meta {
    padding-right: 44px;
  }

  .count-anchor {
    position: absolute;
    right: 20px;
    bottom: 18px;
  }
}

@media (max-width: 460px) {
  .profile-nav a {
    gap: 4px;
  }

  .faceit-lockup {
    grid-template-columns: 44px 1fr auto;
  }

  .faceit-rank {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    margin-top: -10px;
  }

  .faceit-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .profile-meta span {
    margin: 0 4px;
  }
}

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

  .page-background,
  .showcase-media,
  .calculation {
    transform: none !important;
  }

  .reveal,
  .showcase-video {
    opacity: 1;
    transform: none;
  }
}
