@font-face {
  font-family: "Departure Mono";
  src: url("/fonts/DepartureMono-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: #05070b;
  --input: #090c12;
  --heading: #f1f3f7;
  --text: #edf0f5;
  --body: #a8b1bf;
  --muted: #8a94a4;
  --hint: #7d8796;
  --soft: #bac2cf;
  --strong: #e3e7ee;
  --accent: #a9bfff;
  --on-accent: #05070b;
  --error: #f0a4a4;
  --card-border: #3a4560;
  --input-border: #4b5568;
  --divider: #262e3d;
  --section-border: #202734;
  --underline: #535c6a;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --pixel: "Departure Mono", SFMono-Regular, Consolas, monospace;
  --gutter: clamp(20px, 8.4vw, 120px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
}

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

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

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

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 6px;
}

[hidden] {
  display: none !important;
}

.wrap {
  width: 100%;
  max-width: calc(1200px + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Shared type */

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h2 {
  font-size: clamp(32px, 3.1vw, 44px);
  line-height: 1.08;
  font-weight: 560;
  letter-spacing: -0.035em;
  color: var(--heading);
  text-wrap: balance;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.button:hover {
  color: var(--on-accent);
  background: #c2d2ff;
}

.button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: #d9dee7;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-underline-offset: 6px;
  cursor: pointer;
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  margin-top: clamp(24px, 3vw, 44px);
}

.wordmark {
  font-family: var(--pixel);
  font-size: clamp(15px, 1.1vw, 16px);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  -webkit-font-smoothing: none;
  font-synthesis: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.8vw, 40px);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.nav-secondary {
  color: var(--soft);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: clamp(44px, 7vw, 106px);
}

.hero h1 {
  max-width: 880px;
  font-size: clamp(38px, 4.45vw, 64px);
  line-height: 1.05;
  font-weight: 560;
  letter-spacing: -0.04em;
  color: var(--heading);
  text-wrap: balance;
}

.hero-sub {
  max-width: 600px;
  margin-top: 24px;
  font-size: clamp(16px, 1.4vw, 20px);
  line-height: 1.5;
  letter-spacing: -0.012em;
  color: var(--body);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  margin-top: 32px;
}

.scene {
  position: relative;
  height: clamp(200px, 19.5vw, 420px);
  margin-top: 8px;
}

.scene img,
.footer-scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.scene img {
  object-position: 32% bottom;
  filter: brightness(0.74) contrast(1.1) saturate(0.78);
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 55%, var(--bg) 100%);
}

.twinkle-field {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.twinkle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #b7c8f3;
  opacity: 0.3;
  box-shadow: 0 0 7px rgba(169, 191, 255, 0.24);
  animation: pixel-twinkle 5.4s steps(4, end) infinite;
}

.twinkle::before,
.twinkle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #b7c8f3;
}

.twinkle::before {
  width: 1px;
  height: 9px;
}

.twinkle::after {
  width: 9px;
  height: 1px;
}

.twinkle-1 { top: 13%; left: 26%; }
.twinkle-2 { top: 20%; left: 62%; animation-delay: -3.7s; animation-duration: 6.3s; }
.twinkle-3 { top: 12%; left: 77%; animation-delay: -2.4s; animation-duration: 4.9s; }
.twinkle-4 { top: 35%; left: 88%; animation-delay: -4.6s; animation-duration: 7.1s; }
.twinkle-5 { top: 49%; left: 74%; animation-delay: -0.6s; animation-duration: 5.8s; }

@keyframes pixel-twinkle {
  0%, 100% { opacity: 0.2; }
  42% { opacity: 0.9; }
  58% { opacity: 0.4; }
}

/* Sections */

.section {
  padding-block: clamp(72px, 8.4vw, 120px);
}

.section + .section {
  border-top: 1px solid var(--section-border);
}

.work {
  padding-top: 0;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: clamp(24px, 2.8vw, 40px);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(24px, 2.5vw, 36px);
  border: 1px solid var(--card-border);
  background: linear-gradient(135deg, rgba(169, 191, 255, 0.04), rgba(0, 0, 0, 0) 46%), var(--panel);
}

.card-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.card h3 {
  font-size: clamp(21px, 1.7vw, 24px);
  line-height: 1.2;
  font-weight: 560;
  letter-spacing: -0.025em;
  color: var(--heading);
  text-wrap: balance;
}

.card p:last-child {
  font-size: clamp(15px, 1.1vw, 16px);
  line-height: 1.65;
  color: var(--body);
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 6.7vw, 96px);
}

.about-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.about-body {
  max-width: 520px;
  margin-top: 8px;
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.65;
  color: var(--body);
}

.facts {
  padding-top: 34px;
}

.facts div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-block: 14px;
  border-top: 1px solid var(--divider);
}

.facts div:last-child {
  border-bottom: 1px solid var(--divider);
}

.facts dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  font-size: 15px;
  line-height: 1.5;
  color: var(--strong);
}

/* Contact */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 6.7vw, 96px);
  align-items: start;
}

.contact-intro {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-intro h2 {
  font-size: clamp(36px, 3.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.contact-intro p:last-child {
  max-width: 480px;
  font-size: clamp(16px, 1.25vw, 18px);
  line-height: 1.55;
  color: var(--body);
}

.contact-panel {
  min-width: 0;
  padding: clamp(20px, 2.2vw, 32px);
  border: 1px solid var(--card-border);
  background: linear-gradient(135deg, rgba(169, 191, 255, 0.035), rgba(0, 0, 0, 0) 46%), var(--panel);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.field label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #98a3b2;
}

.field-hint {
  margin-top: -2px;
  font-size: 13px;
  color: var(--hint);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--input-border);
  border-radius: 0;
  background: var(--input);
  color: #e7ebf1;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  outline: 0;
  transition: border-color 0.12s linear, background-color 0.12s linear;
}

.field input {
  height: 46px;
  padding: 0 12px;
}

.field textarea {
  min-height: 150px;
  padding: 10px 12px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: #869fdc;
  background: #0b0f16;
}

.contact-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.cf-turnstile {
  min-height: 65px;
  overflow: hidden;
}

.form-error {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
  color: var(--error);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.form-note {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.contact-success {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  min-height: 280px;
  justify-content: center;
}

.contact-success h3 {
  font-size: 32px;
  line-height: 1.1;
  font-weight: 560;
  letter-spacing: -0.035em;
  color: var(--heading);
}

.contact-success p:not(.eyebrow) {
  font-size: 16px;
  color: var(--body);
}

/* Footer */

.footer-scene {
  position: relative;
  height: clamp(110px, 11vw, 200px);
  overflow: hidden;
}

.footer-scene img {
  object-position: 32% 65%;
  filter: brightness(0.6) contrast(1.1) saturate(0.7);
}

.footer-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--bg) 0%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.35) 100%);
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-block: 20px 36px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Responsive */

@media (max-width: 999px) {
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 859px) {
  .about-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .facts {
    padding-top: 0;
  }
}

@media (max-width: 759px) {
  .cards {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

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

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .hero-actions .button {
    min-height: 50px;
  }

  .hero-actions .text-link {
    align-self: center;
  }

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

  .form-actions .button {
    min-height: 50px;
  }

  .eyebrow {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }

  .twinkle {
    animation: none;
    opacity: 0.45;
  }
}

@media (max-width: 559px) {
  .contact-panel {
    padding: 0;
    border: 0;
    background: none;
  }
}
