:root {
  --ink: #0F1B2A;
  --slate: #16293D;
  --signal: #E8A13C;
  --signal-deep: #B5761E;
  --field: #2F7A5B;
  --chalk: #F5F3EE;
  --mist: #8FA3B8;
  --steel: #5C6B7A;
  --alert: #C0493B;
  --display: "Archivo", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--ink);
  color: var(--chalk);
  font-family: var(--body);
}

.page {
  --h: min(200px, 18vw, 30vh);
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(24px, 5.5vw, 80px);
  display: flex;
  flex-direction: column;
  gap: clamp(36px, 5vw, 72px);
}

/* Logo: proportions from the brand guide's stroke table (76 x 56 grid). */
.logo {
  margin: 0;
  display: flex;
  align-items: center;
  gap: calc(var(--h) * 0.317);
  font-family: var(--display);
  font-weight: 800;
  font-size: calc(var(--h) * 0.552);
  line-height: 0.967;
  white-space: nowrap;
}

.mark {
  position: relative;
  display: block;
  flex: none;
  height: var(--h);
  width: calc(var(--h) * 76 / 56);
}

.stroke {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--signal);
}

.s1 { left: 0;       width: 5.263%;  opacity: 0.22; }
.s2 { left: 13.158%; width: 6.579%;  opacity: 0.4;  --from: -0.1786; --time: 700ms; }
.s3 { left: 30.263%; width: 9.211%;  opacity: 0.62; --from: -0.4107; --time: 950ms; }
.s4 { left: 53.947%; width: 11.842%; opacity: 0.82; --from: -0.7321; --time: 1250ms; }
.s5 { left: 81.579%; width: 18.421%; --from: -1.1071; --time: 1600ms; }

@media (prefers-reduced-motion: no-preference) {
  .s2, .s3, .s4, .s5 {
    animation: settle var(--time) cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@keyframes settle {
  from { transform: translateX(calc(var(--h) * var(--from))); }
  to { transform: translateX(0); }
}

.wordmark {
  position: relative;
  top: calc(var(--h) * -0.036);
  display: block;
}

.slow, .the-game { display: block; }
.slow { letter-spacing: 0.225em; }
.the-game { letter-spacing: -0.014em; }

.lower {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 3.4vw, 44px);
}

hr {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid rgba(143, 163, 184, 0.22);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px 48px;
}

.intro {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.intro h2,
.panel-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.intro h2 { font-size: clamp(30px, 3.4vw, 44px); }
.panel-head h2 { font-size: clamp(26px, 3vw, 32px); }

.intro p {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.5;
  color: var(--mist);
}

.button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 32px;
  border: 0;
  border-radius: 8px;
  background: var(--signal);
  color: var(--ink);
  font: 600 17px var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease;
}

.button:hover { background: var(--signal-deep); }
.button:disabled { opacity: 0.7; cursor: progress; }

.button:focus-visible,
.button-quiet:focus-visible,
.close:focus-visible {
  outline: 2px solid var(--chalk);
  outline-offset: 2px;
}

/* Contact dialog */
dialog {
  width: min(640px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid rgba(143, 163, 184, 0.2);
  border-radius: 12px;
  background: var(--slate);
  color: var(--chalk);
}

dialog::backdrop { background: rgba(15, 27, 42, 0.8); }

.panel {
  padding: clamp(20px, 5vw, 40px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.close {
  flex: none;
  width: 44px;
  height: 44px;
  margin: -6px -10px -6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--mist);
  cursor: pointer;
}

.close:hover { color: var(--chalk); }

form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 20px;
}

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

.wide { grid-column: 1 / -1; }

label {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.optional {
  font-weight: 400;
  color: var(--mist);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--steel);
  border-radius: 8px;
  outline: 2px solid transparent;
  background: var(--ink);
  color: var(--chalk);
  font: 400 16px/1.5 var(--body);
}

input { height: 48px; padding: 0 14px; }

textarea {
  display: block;
  min-height: 128px;
  padding: 12px 14px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--chalk);
  box-shadow: 0 0 0 1px var(--chalk);
}

[aria-invalid="true"],
[aria-invalid="true"]:focus {
  border-color: var(--alert);
  box-shadow: 0 0 0 1px var(--alert);
}

.error {
  margin: 0;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.4;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23C0493B'/%3E%3Cpath d='M8 4v5M8 11.5v.5' stroke='%23F5F3EE' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 2px;
}

.error[hidden], .sent[hidden], form[hidden] { display: none; }

.form-error a { color: var(--chalk); }

/* Off-screen rather than display:none, which many bots skip. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.actions .button {
  height: 52px;
  padding: 0 28px;
  font-size: 16px;
}

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

.sent-message {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.sent-message svg { flex: none; }

.sent-message p {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.button-quiet {
  align-self: flex-end;
  height: 48px;
  padding: 0 24px;
  border: 1px solid var(--mist);
  border-radius: 8px;
  background: transparent;
  color: var(--chalk);
  font: 600 16px var(--body);
  cursor: pointer;
}

.button-quiet:hover { background: rgba(143, 163, 184, 0.14); }
