:root {
  --bg: #050505;
  --fg: #eceae6;
  --fg-dim: #8a8782;
  --fg-mute: #4a4844;
  --accent: #ff3b1f;
  --line: rgba(236, 234, 230, 0.12);
  --pad: clamp(20px, 3vw, 40px);
}

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

html,
body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    Helvetica, Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  letter-spacing: -0.01em;
}

body {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  isolation: isolate;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: -3;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 80% 60% at 50% 50%,
      transparent 0%,
      rgba(0, 0, 0, 0.55) 70%,
      rgba(0, 0, 0, 0.9) 100%
    );
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ───── topbar ───── */
.topbar,
.bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--pad);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  font-weight: 500;
  opacity: 0;
  animation: rise 1.4s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.topbar {
  padding-top: max(var(--pad), env(safe-area-inset-top));
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}

.bottombar {
  padding-bottom: max(var(--pad), env(safe-area-inset-bottom));
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}

.mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
}

.mark .dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
}

.wordmark {
  letter-spacing: 0.22em;
  font-weight: 600;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #62d68a;
  box-shadow: 0 0 0 0 rgba(98, 214, 138, 0.6);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(98, 214, 138, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(98, 214, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(98, 214, 138, 0); }
}

/* ───── stage ───── */
.stage {
  padding: 0 var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(20px, 2.6vw, 32px);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
  font-weight: 500;
  opacity: 0;
  animation: rise 1.2s 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.eyebrow .line {
  height: 1px;
  width: 40px;
  background: var(--fg-mute);
}

.headline {
  font-size: clamp(40px, 7.4vw, 116px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 500;
  max-width: 18ch;
  color: var(--fg);
}

.headline .word {
  display: block;
  opacity: 0;
  transform: translateY(28px);
  animation: rise 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  will-change: opacity, transform;
}

.headline .word:nth-child(1) { animation-delay: 0.35s; }
.headline .word:nth-child(2) { animation-delay: 0.5s; }
.headline .word:nth-child(3) { animation-delay: 0.65s; }
.headline .word:nth-child(4) { animation-delay: 0.8s; }

.headline .italic {
  font-style: italic;
  font-weight: 400;
  color: var(--fg-dim);
}

.sub {
  max-width: 50ch;
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.55;
  color: var(--fg-dim);
  opacity: 0;
  animation: rise 1.4s 1.05s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  margin-top: 8px;
  padding: 14px 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--fg);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.04em;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.4s ease, background 0.4s ease, transform 0.4s ease,
    gap 0.4s ease;
  opacity: 0;
  animation: rise 1.4s 1.25s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.cta:hover {
  border-color: rgba(236, 234, 230, 0.35);
  background: rgba(255, 255, 255, 0.05);
  gap: 14px;
}

.cta svg {
  transition: transform 0.4s ease;
}

.cta:hover svg {
  transform: translateX(2px);
}

/* ───── contact overlay ───── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.overlay[aria-hidden="false"] {
  pointer-events: auto;
  opacity: 1;
}

.overlay__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.panel {
  position: relative;
  width: min(560px, calc(100% - 32px));
  margin: 16px;
  padding: clamp(28px, 4vw, 44px);
  background: rgba(12, 12, 14, 0.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

.overlay[aria-hidden="false"] .panel {
  transform: translateY(0);
  opacity: 1;
}

@media (min-width: 720px) {
  .overlay {
    align-items: center;
  }
  .panel {
    margin: 0;
  }
}

.panel__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg-dim);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.panel__close:hover {
  color: var(--fg);
  border-color: rgba(236, 234, 230, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

.panel__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.panel__head .eyebrow {
  opacity: 1;
  animation: none;
}

.panel__title {
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 500;
  color: var(--fg);
}

.panel__sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-dim);
  max-width: 44ch;
}

/* ───── form ───── */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  font-weight: 500;
}

.field .optional {
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-mute);
  font-weight: 400;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  font: inherit;
  /* 16px on mobile prevents iOS Safari from zooming on focus. */
  font-size: 16px;
  letter-spacing: -0.005em;
  transition: border-color 0.25s ease, background 0.25s ease;
  resize: vertical;
}

@media (min-width: 720px) {
  .field input,
  .field textarea {
    font-size: 15px;
  }
}

.field textarea {
  min-height: 96px;
  font-family: inherit;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(236, 234, 230, 0.4);
  background: rgba(255, 255, 255, 0.04);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--fg-mute);
}

.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.cta--solid {
  background: var(--fg);
  color: #0a0a0a;
  border-color: var(--fg);
  margin-top: 6px;
  font-weight: 500;
  animation: none;
  opacity: 1;
}

.cta--solid:hover {
  background: #fff;
  border-color: #fff;
}

/* ── button states (idle / sending / sent) — stacked so width is stable */
.cta__label,
.cta__icon {
  display: inline-grid;
  align-items: center;
  justify-items: center;
}

.cta__label { grid-auto-flow: column; }

.cta__icon { width: 14px; height: 14px; }

.cta__text,
.cta__glyph {
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
}

.cta__text {
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cta__glyph {
  width: 14px;
  height: 14px;
  transition: opacity 0.2s ease;
}

#contact-submit[data-state="idle"]    .cta__text[data-show="idle"],
#contact-submit[data-state="sending"] .cta__text[data-show="sending"],
#contact-submit[data-state="sent"]    .cta__text[data-show="sent"] {
  opacity: 1;
  transform: translateY(0);
}

#contact-submit[data-state="idle"]    .cta__glyph[data-show="idle"],
#contact-submit[data-state="sending"] .cta__glyph[data-show="sending"],
#contact-submit[data-state="sent"]    .cta__glyph[data-show="sent"] {
  opacity: 1;
}

#contact-submit[data-state="sending"] {
  pointer-events: none;
  opacity: 0.85;
  gap: 10px;
}

#contact-submit[data-state="sent"] {
  background: rgba(98, 214, 138, 0.18);
  border-color: rgba(98, 214, 138, 0.5);
  color: #b6efc5;
  pointer-events: none;
}

.cta__spinner {
  animation: cta-spin 0.9s linear infinite;
  transform-origin: 50% 50%;
}

@keyframes cta-spin {
  to { transform: rotate(360deg); }
}

.form__msg {
  font-size: 13px;
  line-height: 1.5;
  padding: 12px 14px;
  border-radius: 10px;
  display: none;
}

.form__msg--success {
  background: rgba(98, 214, 138, 0.08);
  border: 1px solid rgba(98, 214, 138, 0.25);
  color: #9be1b3;
}

.form__msg--error {
  background: rgba(255, 89, 89, 0.07);
  border: 1px solid rgba(255, 89, 89, 0.25);
  color: #ffb3b3;
}

.form__msg.is-visible {
  display: block;
}

body.modal-open {
  overflow: hidden;
}

/* ───── bottombar ───── */
.bottombar {
  animation-delay: 1.4s;
}

.bottombar .muted {
  color: var(--fg-mute);
}

/* ───── animation ───── */
@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .status,
  .bottombar .muted {
    display: none;
  }
  html { overflow: auto; }
  body { overflow: auto; }
  html, body { overflow-x: hidden; }
  .stage {
    padding-block: 48px;
    gap: 22px;
  }
  .headline {
    /* Slightly tighter floor for narrow phones. */
    font-size: clamp(36px, 11vw, 72px);
    max-width: 14ch;
  }
  .sub { font-size: 15px; }
  .panel__close {
    width: 44px;
    height: 44px;
    top: 12px;
    right: 12px;
  }
  .panel {
    padding-bottom: calc(clamp(28px, 4vw, 44px) + env(safe-area-inset-bottom));
    border-radius: 18px 18px 14px 14px;
  }
  .cta { padding: 14px 20px; }
}

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