:root {
  --bg: #0a0a0b;
  --ink: #f4f3ef;
  --muted: #8d8c87;
  --line: rgba(244, 243, 239, 0.16);
  --line-strong: rgba(244, 243, 239, 0.55);
  --error: #ff8a7a;
  --ok: #b9d8b0;
  --gutter: clamp(20px, 5vw, 72px);
  --sans: "Helvetica Neue", Helvetica, "Inter", "Segoe UI", Arial, sans-serif;
  color-scheme: dark;
}

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

html { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* No scrolling on any screen tall enough to hold the page. */
@media (min-height: 600px) {
  body { height: 100vh; height: 100dvh; overflow: hidden; }
}

/* Animated word grid behind everything (see flap.js) */
.flap {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stage, .foot { position: relative; z-index: 1; }

.wordmark, .tagline, .place { width: fit-content; }

/* The brand block hugs its content so the word grid fills the space up to the form. */
.brand { justify-self: start; width: fit-content; }

.stage {
  display: grid;
  grid-template-columns: minmax(min-content, 1.25fr) minmax(280px, 400px);
  align-items: center;
  gap: clamp(32px, 8vw, 140px);
  padding: clamp(28px, 7vh, 96px) var(--edge, var(--gutter)) 0 var(--gutter); /* --edge is set by flap.js */
  min-height: 0;
}

/* --- Brand ---------------------------------------------------------------- */
.wordmark {
  margin: 0;
  font-weight: 700;
  font-size: clamp(64px, 12.5vw, 196px);
  line-height: 0.82;
  letter-spacing: -0.045em;
  margin-left: -0.04em;
}

.rule {
  width: clamp(48px, 6vw, 88px);
  height: 2px;
  margin: clamp(22px, 4vh, 40px) 0 clamp(16px, 2.6vh, 24px);
  background: var(--ink);
}

.tagline {
  margin: 0;
  font-size: clamp(15px, 1.35vw, 19px);
  letter-spacing: 0.01em;
}

.place {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* --- Contact -------------------------------------------------------------- */

/* --form-shift is set by flap.js to center the form between the word columns. */
.contact { transform: translateX(var(--form-shift, 0px)); }

.contact-title {
  margin: 0;
  font-size: clamp(30px, 2.6vw, 40px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.contact-lede {
  margin: 10px 0 clamp(18px, 3.4vh, 32px);
  max-width: 34ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.form { display: grid; gap: clamp(12px, 2.4vh, 22px); }

.field { display: grid; gap: 4px; min-width: 0; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.field label {
  color: #c9c8c3;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.field .optional { margin-left: 4px; color: var(--muted); font-size: 12px; }

.field input::placeholder,
.field textarea::placeholder { color: rgba(244, 243, 239, 0.24); }

.field input,
.field textarea {
  width: 100%;
  padding: 6px 0 9px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  transition: border-color 0.2s ease;
}

.field textarea { resize: none; height: clamp(58px, 11vh, 96px); }

.field input:focus,
.field textarea:focus { outline: none; border-bottom-color: var(--ink); }

.field [aria-invalid="true"] { border-bottom-color: var(--error); }

.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 40px var(--bg) inset;
  caret-color: var(--ink);
}

.actions { display: grid; gap: 12px; margin-top: 4px; }

.button {
  justify-self: start;
  padding: 14px 26px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.button:hover:not(:disabled) { background: transparent; color: var(--ink); }
.button:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
.button:disabled { opacity: 0.45; cursor: default; }

.status { min-height: 1.5em; margin: 0; color: var(--muted); font-size: 13px; }
.status.is-error { color: var(--error); }
.status.is-ok { color: var(--ok); }

/* --- Success: full screen, same background ------------------------------- */
.success {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: start;
  padding: 0 var(--gutter);
  animation: success-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.success[hidden], .stage[hidden] { display: none; }

.success-eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.success-title {
  margin: 0;
  font-size: clamp(48px, 8.5vw, 132px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.045em;
  outline: none;
}

.success-text {
  margin: clamp(18px, 3vh, 28px) 0 clamp(24px, 4.5vh, 40px);
  max-width: 44ch;
  color: #c9c8c3;
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.success > * { width: fit-content; max-width: 100%; }

.button-ghost {
  display: inline-block;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
}
.button-ghost:hover { background: var(--ink); color: var(--bg); }

@keyframes success-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* Honeypot: invisible to people, irresistible to bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* --- Footer --------------------------------------------------------------- */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(16px, 3.5vh, 36px) var(--gutter) max(clamp(16px, 3.5vh, 36px), env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* --- Medium screens: two columns, slightly smaller wordmark -------------- */
@media (min-width: 721px) and (max-width: 1100px) {
  .wordmark { font-size: 9.5vw; }
  .stage { gap: clamp(32px, 6vw, 72px); }
}

/* --- Small screens: stack, keep it to one screen ------------------------- */
@media (max-width: 720px) {
  body { font-size: 14px; }
  .stage {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: clamp(20px, 4.5vh, 48px);
    padding: clamp(20px, 5vh, 56px) 20px 0;
  }
  .wordmark { font-size: clamp(60px, 21vw, 120px); }
  .rule { margin: clamp(14px, 2.6vh, 24px) 0 clamp(10px, 1.8vh, 16px); }
  .contact-title { font-size: 26px; }
  .contact-lede { margin: 6px 0 clamp(10px, 2vh, 18px); font-size: 13px; }
  .field-row { gap: 12px; }
  .field label { font-size: 12px; }
  .form { gap: clamp(8px, 1.8vh, 16px); }
  .success { padding: 0 20px; }
  .field textarea { height: clamp(48px, 9vh, 80px); }
  .button { justify-self: stretch; padding: 13px 20px; }
  .foot { padding: 12px 20px max(14px, env(safe-area-inset-bottom)); font-size: 10px; }
}

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