/* ============================================================
 * Alcedo Trading — alcedotrading.com
 *
 * An engraved plate, not a terminal. The page is a single sheet:
 * a hairline frame, a masthead line, a vignette of the kingfisher
 * cut in guilloché, a title block, and two ruled entries. Rules and
 * whitespace do the structural work — there are no filled cards.
 *
 * The display face (Bodoni Moda) appears exactly twice, always large.
 * Everything under ~28px is Spectral. Mono survives in two places
 * only: the take() motif and the line where the server answers.
 * ============================================================ */

/* ── reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, p, dl, dd, figure, figcaption { margin: 0; }
dl { padding: 0; }
img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
  position: relative;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-text);
  font-weight: 300;
  font-size: var(--fs-body);
  line-height: 1.7;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* The stage is never flat black: two very faint pools of the accent,
 * as if light fell across dark paper. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 720px at 16% 4%, rgba(152, 128, 206, 0.070), transparent 66%),
    radial-gradient(900px 640px at 96% 98%, rgba(152, 128, 206, 0.038), transparent 70%);
}

::selection { background: var(--purple-wash-strong); color: var(--cream); }

/* ── the mat: one hairline framing the whole sheet ─────────── */
.plate {
  position: absolute;
  inset: var(--mat);
  border: 1px solid var(--line-hair);
  pointer-events: none;
  z-index: 4;
}

/* ── the stage: one network across the whole head of the page ──
 * The field is a single structure running behind the masthead line, the
 * kingfisher and the wordmark alike — the head reads as one thing, not as a
 * patch per region. It is held inside the mat, so the hairline still reads as
 * the edge of the sheet. Its height is set by field.js: the stage ends at the
 * foot of whatever data-stage-to names. */
.stage {
  position: absolute;
  top: var(--mat);
  left: var(--mat);
  right: var(--mat);
  height: 58vh;            /* until field.js measures the real foot */
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.stage-field {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* The scrim is what makes the field legible to sit under: nothing is kept
 * clear on the canvas itself. A light veil over the masthead line, a wash
 * under the title block on the right, and a dissolve into the page at the
 * foot so the field never cuts against the states band. */
.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(84% 58% at 66% 50%,
      rgba(12, 10, 18, 0.62) 0%,
      rgba(12, 10, 18, 0.40) 38%,
      rgba(12, 10, 18, 0.10) 72%,
      rgba(12, 10, 18, 0) 90%),
    linear-gradient(to bottom,
      rgba(12, 10, 18, 0.28) 0%,
      rgba(12, 10, 18, 0.13) 11%,
      rgba(12, 10, 18, 0) 25%,
      rgba(12, 10, 18, 0) 74%,
      var(--ink) 100%);
}

/* Stacked, the title block drops below the bird, so the desktop wash — aimed
 * at the right-hand column — lands on open ground and leaves the type in the
 * field. One vertical wash instead: the bird keeps clear air, the wordmark and
 * the lede get quiet ground under them. */
@media (max-width: 700px) {
  .stage::after {
    background: linear-gradient(to bottom,
      rgba(12, 10, 18, 0.30) 0%,
      rgba(12, 10, 18, 0.12) 10%,
      rgba(12, 10, 18, 0.04) 24%,
      rgba(12, 10, 18, 0.24) 50%,
      rgba(12, 10, 18, 0.62) 64%,
      rgba(12, 10, 18, 0.70) 86%,
      var(--ink) 100%);
  }
}

.sheet {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.sheet > main { flex: 1; }

/* ── shared micro type ─────────────────────────────────────── */
.micro,
.masthead-name,
.masthead-note,
.vignette-cap,
.standing-title,
.field-label,
.ledger-row dt,
.states-legend span,
.colophon {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: var(--fs-micro);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  line-height: 1.2;
}

/* ── masthead ──────────────────────────────────────────────── */
.masthead {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.75rem, 3.2vw, 2.75rem) 0 1.1rem;
  border-bottom: 1px solid var(--line-soft);
}
.masthead-name { color: rgba(242, 238, 227, 0.62); }
.masthead-note { color: var(--mute); text-align: right; }

/* ── frontispiece: vignette + title block ──────────────────── */
.frontispiece {
  display: grid;
  grid-template-columns: minmax(0, clamp(19rem, 30vw, 27rem)) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(2rem, 4vw, 4rem);
  padding: clamp(3.25rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
}

.vignette { position: relative; width: 100%; }

/* The field runs under the mark like everything else, but the kingfisher is
 * the one thing on the page that has to stay unambiguous. This is a local
 * scrim tied to the mark itself, so it follows it across both layouts: at
 * least half the field's contrast goes where the two overlap, and none of it
 * anywhere else. */
.vignette::before {
  content: "";
  position: absolute;
  inset: -14% -8%;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side at 50% 46%,
    rgba(12, 10, 18, 0.94) 0%,
    rgba(12, 10, 18, 0.92) 64%,
    rgba(12, 10, 18, 0.62) 85%,
    rgba(12, 10, 18, 0) 100%);
}

/* The mark stands plain — cream body, purple beak and eye, no ornament.
 * A quiet inset keeps it from touching the caption's hairline rhythm. */
.vignette-mark {
  width: 100%;
  height: auto;
  padding: 4% 8%;
  object-fit: contain;
}

.vignette-cap {
  margin-top: 0.35rem;
  text-align: center;
  color: var(--mute);
  font-style: normal;
}

.titleblock { min-width: 0; }

.wordmark {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
  font-weight: 500;
  font-size: var(--fs-wordmark);
  line-height: 1.04;
  letter-spacing: 0.005em;
  color: var(--cream);
}

/* engraver's double rule */
.wordmark-rule {
  width: 68px;
  height: 3px;
  border: 0;
  border-top: 1px solid rgba(242, 238, 227, 0.24);
  border-bottom: 1px solid rgba(242, 238, 227, 0.09);
  margin: clamp(1.35rem, 2.4vw, 1.9rem) 0 clamp(1.35rem, 2.4vw, 1.75rem);
}

.thesis {
  font-size: var(--fs-lede);
  font-weight: 300;
  line-height: 1.62;
  color: var(--dim);
  max-width: 30rem;
}
.thesis em { font-style: italic; color: var(--cream); }

.motif {
  margin-top: clamp(1.5rem, 2.6vw, 2rem);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 400;
  letter-spacing: var(--track-mono);
  color: var(--mute);
}
.motif-sep { color: var(--purple); }

/* ── the engraved band: strategy states ────────────────────── */
.states { padding-bottom: clamp(3rem, 6vw, 5.5rem); }

.states-plot {
  position: relative;
  height: clamp(92px, 12vw, 148px);
  border-bottom: 1px solid var(--line-hair);
}
.states-trace { width: 100%; height: 100%; }
.states-trace path {
  fill: none;
  stroke: rgba(242, 238, 227, 0.40);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.states-cut {
  position: absolute;
  top: 22%;
  bottom: 0;
  width: 1px;
  background: var(--line-soft);
}
.states-cut-a { left: 40%; }
.states-cut-b { left: 72%; }

.states-take {
  position: absolute;
  top: 14%;
  bottom: 0;
  left: 80%;
  width: 1px;
  background: linear-gradient(to bottom, rgba(152, 128, 206, 0), rgba(152, 128, 206, 0.42) 34%, rgba(152, 128, 206, 0.42));
}
.states-take::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 15.5%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--purple);
  transform: translate(-50%, -50%);
}

.states-legend {
  display: grid;
  grid-template-columns: 40% 32% minmax(0, 1fr);
  padding-top: 0.95rem;
  color: var(--mute);
}
.states-legend-take { color: rgba(242, 238, 227, 0.72); }

/* ── entries (method, contact) ─────────────────────────────── */
.entry {
  display: grid;
  grid-template-columns: var(--standing) minmax(0, 1fr);
  column-gap: var(--gutter);
  padding-top: var(--section);
  padding-bottom: 0;
  border-top: 1px solid var(--line-soft);
}

.standing-title { color: var(--mute); }
.standing-note {
  margin-top: 1.15rem;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--mute);
  max-width: 22ch;
}

.entry-body { max-width: 40rem; min-width: 0; }

.display-line {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 40;
  font-weight: 450;
  font-size: var(--fs-display);
  line-height: 1.42;
  letter-spacing: 0.002em;
  color: var(--cream);
  max-width: 26ch;
  padding-bottom: clamp(2.25rem, 4vw, 3.25rem);
}
.display-line em { font-style: italic; }

.ledger-row {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  column-gap: 1.75rem;
  padding: clamp(1rem, 1.8vw, 1.35rem) 0;
  border-top: 1px solid var(--line-soft);
}
.ledger-row:last-child { border-bottom: 1px solid var(--line-soft); }
.ledger-row dt {
  color: rgba(242, 238, 227, 0.80);
  padding-top: 0.42em;
}
.ledger-row dd {
  font-size: var(--fs-small);
  line-height: 1.72;
  color: rgba(242, 238, 227, 0.72);
}

/* ── contact form ──────────────────────────────────────────── */
.field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 3vw, 2.5rem);
}
.field { display: block; padding-bottom: clamp(1.6rem, 3vw, 2.25rem); }
.field-label {
  display: block;
  color: var(--mute);
  padding-bottom: 0.55rem;
  transition: color 160ms var(--ease);
}
.field:focus-within .field-label { color: var(--purple-soft); }

.form input,
.form textarea {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.55rem 0.15rem;
  font-family: var(--font-text);
  font-weight: 300;
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--cream);
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.form textarea { resize: vertical; min-height: 6.5rem; }
.form input:focus,
.form textarea:focus {
  outline: none;
  border-bottom-color: var(--purple);
  background: var(--purple-wash);
}
.form input:-webkit-autofill { -webkit-text-fill-color: var(--cream); }

.trap {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

.form-status {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: 0.04em;
  color: var(--mute);
  min-height: 1.2em;
}
.form-status.is-ok { color: var(--purple-soft); }
.form-status.is-error { color: var(--red); }

.send {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: var(--fs-micro);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--cream);
  background: transparent;
  border: 1px solid rgba(152, 128, 206, 0.42);
  border-radius: 2px;
  padding: 1rem 1.9rem;
  margin-left: auto;
  cursor: pointer;
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
}
.send:hover { background: var(--purple-wash); border-color: var(--purple); }
.send:focus-visible { outline: 1px solid var(--purple); outline-offset: 3px; }
.send:disabled { opacity: 0.45; cursor: default; background: transparent; border-color: var(--line); }

/* ── colophon ──────────────────────────────────────────────── */
.colophon {
  margin-top: var(--section);
  padding-top: clamp(1.5rem, 2.5vw, 2rem);
  border-top: 1px solid var(--line-soft);
  text-align: center;
  color: var(--mute);
}

/* ── 404 ───────────────────────────────────────────────────── */
.notice {
  display: grid;
  justify-items: center;
  text-align: center;
  padding: clamp(4rem, 12vw, 9rem) 0 clamp(4rem, 10vw, 7rem);
}
.notice .vignette { max-width: 15rem; }
.notice-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72;
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: 0.005em;
  color: var(--cream);
  padding-top: clamp(2rem, 4vw, 2.75rem);
}
.notice-text {
  max-width: 34ch;
  padding-top: 1.35rem;
  color: var(--dim);
  font-size: var(--fs-small);
}
.notice-link {
  margin-top: clamp(2rem, 4vw, 2.75rem);
  font-family: var(--font-text);
  font-weight: 500;
  font-size: var(--fs-micro);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid rgba(152, 128, 206, 0.5);
  padding-bottom: 0.55rem;
  transition: border-color 180ms var(--ease), color 180ms var(--ease);
}
.notice-link:hover { border-bottom-color: var(--purple); color: var(--purple-soft); }
.notice-link:focus-visible { outline: 1px solid var(--purple); outline-offset: 4px; }

/* ── reveal: one slow settle on load, nothing after ────────── */
.rise {
  opacity: 0;
  animation: rise 620ms var(--ease) forwards;
}
.rise-1 { animation-delay: 90ms; }
.rise-2 { animation-delay: 170ms; }
.rise-3 { animation-delay: 250ms; }

@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}

/* ── responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {
  .frontispiece {
    grid-template-columns: minmax(0, 1fr);
    row-gap: clamp(2.25rem, 5vw, 3rem);
    justify-items: start;
  }
  .vignette { max-width: 22rem; }
  .entry {
    grid-template-columns: minmax(0, 1fr);
    row-gap: clamp(1.75rem, 4vw, 2.5rem);
  }
  .standing-note { max-width: 34ch; }
}

@media (max-width: 620px) {
  .field-pair { grid-template-columns: minmax(0, 1fr); }
  .ledger-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.5rem;
  }
  .ledger-row dt { padding-top: 0; }
  .states-legend {
    grid-template-columns: 36% 34% minmax(0, 1fr);
    letter-spacing: 0.14em;
  }
  .form-foot { justify-content: flex-start; }
  .send { margin-left: 0; }
}

@media (max-width: 400px) {
  :root { --track-caps: 0.2em; }
  .masthead-note { display: none; }
}

/* ── motion preferences ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; animation: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
