/* Force black immediately so page never flashes white */
html, body { background: #000000 !important; color: #ffffff; }

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
}

html, body {
  background: #000000;
  background: var(--bg, #000000);
  color: #ffffff;
  color: var(--text, #ffffff);
}

html {
  scroll-behavior: smooth;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #9a9a9a;
  --stat: #d8d8d8;
  --border: rgba(255, 255, 255, 0.16);
  --border-soft: rgba(255, 255, 255, 0.12);

  --logo: 15.5px;
  --nav: 14px;
  --nav-h: 40px;
  --btn: 13.5px;
  --btn-h: 40px;
  --hero-btn-h: 42px;
  --h1: 48px;
  --lede: 15.5px;
  --badge: 12.5px;
  --stat-size: 13.5px;
  --header-y: 22px;
  --header-x: 40px;
  --stats-x: 72px;
  --stats-y: 36px;
  --hero-gap: 85px;
  --copy-max: 860px;
  --lede-max: 470px;

  --badge-mb: 22px;
  --badge-pad: 9px 15px;
  --nav-gap: 8px;
  --nav-pad: 0 18px;
  --btn-pad: 0 16px;
  --hero-btn-pad: 0 18px;
  --lede-mt: 18px;
  --actions-mt: 26px;
  --actions-gap: 10px;
  --stat-icon-size: 20px;
  --stat-icon-w: 38px;
  --stat-icon-h: 21px;
}

/* Grain layer */
.grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  opacity: 0.038;
  background-image: url("../images/grain.svg");
}

/* Hero photo / video layer */
.hero-photo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  animation: in-photo 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-photo video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 1;
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Page container */
.page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Header */
.header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: var(--header-y) var(--header-x) 10px;
  z-index: 50;
  position: relative;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  justify-self: start;
  font-size: var(--logo);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.logo-suffix {
  font-weight: 400;
}

/* Site Navigation */
#site-nav {
  display: flex;
  align-items: center;
  gap: var(--nav-gap);
  justify-self: center;
}

.nav-link {
  height: var(--nav-h);
  padding: var(--nav-pad);
  border-radius: 7px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(198, 198, 198, 0.55);
  background: linear-gradient(105deg, #050505 0%, #2a2a2a 48%, #4a4a4a 100%);
  color: #f3f3f3;
  font-size: var(--nav);
  font-weight: 400;
  letter-spacing: -0.01em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}

.nav-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.16) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.nav-link:hover {
  border-color: rgba(235, 235, 235, 0.9);
  background: linear-gradient(105deg, #111111 0%, #3a3a3a 45%, #6a6a6a 100%);
  box-shadow: 0 0 18px rgba(200, 210, 230, 0.18);
}

.nav-link:hover::before {
  transform: translateX(120%);
}

.header-cta {
  justify-self: end;
}

/* Buttons */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-h);
  padding: var(--btn-pad);
  border-radius: 6px;
  font-size: var(--btn);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, color 0.35s ease, filter 0.35s ease, transform 0.35s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.45) 48%, transparent 76%);
  transform: translateX(-130%);
  transition: transform 0.65s ease;
  pointer-events: none;
  z-index: 1;
}

.btn:hover::after {
  transform: translateX(130%);
}

.btn-solid {
  background: linear-gradient(180deg, #ffffff 0%, #e7e7e7 48%, #cfcfcf 100%);
  color: #111111;
  border: 1px solid #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.btn-solid:hover {
  background: linear-gradient(180deg, #ffffff 0%, #f3f6ff 42%, #d5def2 100%);
  border-color: #f2f6ff;
  box-shadow: inset 0 1px 0 #ffffff, 0 0 22px rgba(186, 208, 255, 0.35), 0 8px 18px rgba(255, 255, 255, 0.12);
}

.hero-actions .btn-solid:hover {
  box-shadow: inset 0 1px 0 #ffffff, 0 0 26px rgba(186, 208, 255, 0.4), 0 8px 18px rgba(255, 255, 255, 0.14);
}

.btn-ghost {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.45) 50%, rgba(160, 175, 200, 0.08));
  color: #ffffff;
  border: 1px solid rgba(198, 198, 198, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover {
  background: linear-gradient(135deg, rgba(210, 225, 255, 0.18), rgba(0, 0, 0, 0.35) 48%, rgba(180, 195, 220, 0.16));
  border-color: rgba(220, 230, 255, 0.75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 0 20px rgba(170, 200, 255, 0.22);
}

.btn-hero-ghost {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.5) 46%, rgba(150, 170, 200, 0.1));
  border: 1px solid rgba(198, 198, 198, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
}

.btn-hero-ghost:hover {
  border-color: rgba(220, 230, 255, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 0 24px rgba(170, 200, 255, 0.28);
}

.hero-btn {
  height: var(--hero-btn-h);
  padding: var(--hero-btn-pad);
}

/* Burger */
.header-burger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(8, 8, 8, 0.55);
  z-index: 60;
  cursor: pointer;
  padding: 0;
  place-content: center;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: border-color 0.25s ease, background 0.25s ease;
  justify-self: end;
}

.header-burger:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.05);
}

.burger-bar {
  display: block;
  width: 16px;
  height: 1.5px;
  background: #ffffff;
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

body.menu-open .burger-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

body.menu-open .burger-bar:nth-child(2) {
  opacity: 0;
}

body.menu-open .burger-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Menu backdrop */
.menu-backdrop {
  display: none;
}

/* Hero section */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 24px var(--hero-gap);
  min-height: 0;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: var(--copy-max);
  width: 100%;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--badge-mb);
  padding: var(--badge-pad);
  border: 0;
  border-radius: 5px;
  background: linear-gradient(90deg, #7d7d7d 0%, #2a2a2a 52%, #0a0a0a 100%);
  color: #f2f2f2;
  font-size: var(--badge);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.badge-star {
  width: 18px;
  height: 20px;
  fill: #ffffff;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.45));
  flex-shrink: 0;
  animation: in-star 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both;
}

/* H1 */
.hero-title {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.12;
  color: #ffffff;
  font-size: var(--h1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.headline-line {
  display: block;
  overflow: hidden;
  padding: 0.06em 0.15em 0.14em;
}

.hero h1 em,
.hero-title em {
  font-family: "Instrument Serif", "Times New Roman", Times, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.08em;
  letter-spacing: -0.03em;
  color: #9a9a9a;
  display: inline-block;
  animation: in-em 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.72s both;
}

/* Lede */
.lede {
  max-width: var(--lede-max);
  margin-top: var(--lede-mt);
  color: #9a9a9a;
  font-size: var(--lede);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.015em;
}

.lede.appear {
  animation-duration: 1.25s;
}

/* Hero actions */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--actions-gap);
  margin-top: var(--actions-mt);
}

/* Stats Footer */
.stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--stats-x) var(--stats-y);
  padding-bottom: max(var(--stats-y), env(safe-area-inset-bottom));
  color: #d8d8d8;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: var(--stat-size);
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.stat-icon {
  width: var(--stat-icon-size);
  height: var(--stat-icon-size);
  color: #e8e8e8;
  flex-shrink: 0;
}

.stat-icon-wide {
  width: var(--stat-icon-w);
  height: var(--stat-icon-h);
  flex-shrink: 0;
}

/* Entrance motion system */
.appear {
  opacity: 1;
  animation-duration: 1.05s;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  animation-delay: var(--d, 0.08s);
}

.appear--scale {
  animation-name: in-scale;
}

.appear--soft {
  animation-name: in-soft;
}

.appear--mask {
  animation-name: in-mask;
  display: block;
}

.appear--pop {
  animation-name: in-pop;
}

.appear--btn {
  animation-name: in-btn;
}

.appear--side {
  animation-name: in-side;
}

.appear--stat {
  animation-name: in-stat;
}

.is-in {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
  filter: none !important;
}

/* Keyframes */
@keyframes in-scale {
  0% {
    opacity: 0;
    transform: scale(0.84);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes in-soft {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes in-mask {
  0% {
    opacity: 0;
    transform: translateY(40%);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes in-pop {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  70% {
    opacity: 1;
    transform: scale(1.03);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes in-btn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes in-side {
  0% {
    opacity: 0;
    transform: translateX(22px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes in-stat {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes in-star {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-50deg);
  }
  65% {
    opacity: 1;
    transform: scale(1.2) rotate(8deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes in-em {
  0% {
    opacity: 0.35;
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    filter: blur(0px);
  }
}

@keyframes in-photo {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .appear, .hero-photo, .hero h1 em, .hero-title em, .badge-star {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    filter: none !important;
  }
}

/* Responsive Breakpoints */

/* 1280 to 1599 */
@media (min-width: 1280px) and (max-width: 1599px) {
  :root {
    --h1: 54px;
    --lede: 16px;
    --header-x: 48px;
    --stats-x: 80px;
    --copy-max: 900px;
  }
}

/* 901 to 1279 */
@media (min-width: 901px) and (max-width: 1279px) {
  :root {
    --logo: 15px;
    --nav: 13px;
    --nav-h: 36px;
    --btn: 13px;
    --btn-h: 38px;
    --hero-btn-h: 40px;
    --h1: 42px;
    --lede: 15px;
    --badge: 12px;
    --stat-size: 12.5px;
    --header-y: 16px;
    --header-x: 28px;
    --stats-x: 36px;
    --stats-y: 28px;
    --hero-gap: 64px;
    --copy-max: 760px;
    --lede-max: 440px;
    --nav-pad: 0 14px;
    --badge-mb: 16px;
    --lede-mt: 14px;
    --actions-mt: 20px;
  }
}

/* >= 1600 */
@media (min-width: 1600px) {
  :root {
    --logo: 17px;
    --nav: 15px;
    --nav-h: 44px;
    --btn: 15px;
    --btn-h: 44px;
    --hero-btn-h: 48px;
    --h1: 64px;
    --lede: 18px;
    --badge: 13.5px;
    --stat-size: 15px;
    --header-y: 28px;
    --header-x: 64px;
    --stats-x: 96px;
    --stats-y: 44px;
    --copy-max: 980px;
    --lede-max: 540px;
    --nav-pad: 0 20px;
    --badge-mb: 26px;
    --lede-mt: 22px;
    --actions-mt: 30px;
    --actions-gap: 12px;
    --stat-icon-size: 22px;
    --stat-icon-w: 45px;
    --stat-icon-h: 24px;
  }
}

/* >= 1920 */
@media (min-width: 1920px) {
  :root {
    --logo: 18px;
    --nav: 16px;
    --nav-h: 48px;
    --btn: 16px;
    --btn-h: 48px;
    --hero-btn-h: 52px;
    --h1: 76px;
    --lede: 20px;
    --badge: 14.5px;
    --stat-size: 16px;
    --header-y: 32px;
    --header-x: 80px;
    --stats-x: 120px;
    --stats-y: 52px;
    --copy-max: 1120px;
    --lede-max: 620px;
    --nav-gap: 10px;
    --nav-pad: 0 22px;
    --btn-pad: 0 22px;
    --hero-btn-pad: 0 22px;
    --badge-pad: 10px 15px;
    --stat-icon-w: 48px;
    --stat-icon-h: 26px;
  }
}

/* >= 2560 */
@media (min-width: 2560px) {
  :root {
    --h1: 88px;
    --lede: 22px;
    --header-x: 120px;
    --stats-x: 160px;
    --copy-max: 1280px;
    --lede-max: 680px;
  }
}

/* >=901 desktop lock */
@media (min-width: 901px) {
  html, body {
    height: 100%;
    overflow: hidden;
  }
  .page {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
}

/* >= 901 and max-height 850 */
@media (min-width: 901px) and (max-height: 850px) {
  :root {
    --header-y: 14px;
    --stats-y: 24px;
    --hero-gap: 48px;
    --h1: 40px;
    --badge-mb: 12px;
    --lede-mt: 12px;
    --actions-mt: 16px;
  }
}

/* >= 901 and max-height 720 */
@media (min-width: 901px) and (max-height: 720px) {
  :root {
    --h1: 34px;
    --lede: 14px;
    --hero-gap: 32px;
    --stats-y: 18px;
    --nav-h: 30px;
    --btn-h: 34px;
    --hero-btn-h: 36px;
    --badge-mb: 8px;
  }
}

/* <= 900 phone */
@media (max-width: 900px) {
  :root {
    --logo: 16px;
    --btn: 15px;
    --btn-h: 46px;
    --hero-btn-h: 48px;
    --h1: 36px;
    --lede: 16.5px;
    --badge: 13.5px;
    --stat-size: 15px;
    --header-y: 16px;
    --header-x: 18px;
    --stats-x: 20px;
    --stats-y: 28px;
    --hero-gap: 36px;
    --copy-max: 100%;
    --lede-max: 100%;
  }

  html, body {
    height: auto;
    overflow-y: auto;
  }

  .page {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
  }

  body.menu-open {
    overflow: hidden;
  }

  .header {
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    padding-top: max(var(--header-y), env(safe-area-inset-top));
    padding-left: max(var(--header-x), env(safe-area-inset-left));
    padding-right: max(var(--header-x), env(safe-area-inset-right));
  }

  .logo, .header-cta, .header-burger {
    z-index: 80;
  }

  .header-burger {
    display: grid;
  }

  .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(8, 8, 8, 0.42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease, backdrop-filter 0.28s ease, -webkit-backdrop-filter 0.28s ease;
  }

  body.menu-open .menu-backdrop {
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    pointer-events: auto;
  }

  #site-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: transparent;
    gap: 12px;
    padding: 96px 22px 32px;
    padding-top: max(96px, calc(env(safe-area-inset-top) + 88px));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
  }

  body.menu-open #site-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  #site-nav .nav-link {
    width: 100%;
    height: 56px;
    font-size: 19px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero {
    padding: 20px 20px 64px;
    align-items: flex-end;
  }

  .stats {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    white-space: normal;
    text-align: center;
  }

  .stat {
    white-space: normal;
    justify-content: center;
  }
}

/* <= 560 */
@media (max-width: 560px) {
  :root {
    --h1: 34px;
    --lede: 16px;
    --header-x: 16px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }
}
