/* ──────────────────────────────────────────────────────────────
   Gambtt landing — "Intelligence: the art that expresses the
   science of logic." A single full-bleed atmospheric hero on the
   forest ground, ported from the Gambtt brand system (Cover style).
   Bone type + one brass note over a forest → moss → brass gradient.
   ────────────────────────────────────────────────────────────── */
:root {
  --color-forest: #1E3B2C;                 /* brand surface */
  --color-forest-deep: #142A1F;            /* gradient base, depth */
  --color-bone: #EBE2C5;                    /* primary light ink */
  --color-bone-warm: #F1E9D2;               /* elevated light ink */
  --color-moss: #4A6B58;                    /* quiet tertiary */
  --color-brass: #B89456;                   /* the one warm note */

  --font-display: "Fraunces", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Fluid display size — 40px on small screens up to 64px at desktop. */
  --display-size: clamp(2.5rem, 5.8vw, 4rem);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100svh;
  color: var(--color-bone);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* The atmospheric plate — a warm brass glow low-left, a mossy light
     top-right, over a forest → forest-deep field. */
  background-color: var(--color-forest-deep);
  background-image:
    radial-gradient(130% 130% at 10% 94%, rgba(184, 148, 86, 0.42) 0%, rgba(184, 148, 86, 0) 46%),
    radial-gradient(115% 115% at 90% 6%, rgba(122, 150, 124, 0.55) 0%, rgba(74, 107, 88, 0) 58%),
    linear-gradient(145deg, #1E3B2C 0%, #142A1F 64%, #24302A 100%);
  background-repeat: no-repeat;
}

/* ── Page frame: nav / hero / footer stacked inside a gutter ── */
.page {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 3.4vw, 44px) clamp(24px, 3.4vw, 48px);
}

/* ── Top nav ── */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: var(--color-bone);
}
.brand-word {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--color-bone-warm);
}

.doorway {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--color-bone);
}
.doorway .enter {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-brass);
  opacity: 0;                        /* hidden until hover/focus */
}
.doorway:hover .enter,
.doorway:focus-visible .enter { opacity: 1; }
.rook { width: 26px; height: 26px; display: block; }

/* ── Hero: quote left, mark centred against it on the right ── */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-block: clamp(24px, 3vw, 40px) clamp(20px, 2.6vw, 36px);
}

/* Just the two display lines — the mark centres against this block via the
   hero's align-items: center. */
.quote {
  display: flex;
  flex-direction: column;
  max-width: clamp(18rem, 48vw, 720px);
}
.quote-lines { margin: 0; display: flex; flex-direction: column; gap: 2px; }

.q-lead,
.q-clause {
  font-family: var(--font-display);
  font-size: var(--display-size);
  letter-spacing: -0.015em;
}
.q-lead {
  font-weight: 300;
  line-height: 1.1;
  color: var(--color-bone-warm);
}
.q-clause {
  font-weight: 400;
  font-style: italic;
  line-height: 1.12;
  color: var(--color-brass);
}

.hero-mark {
  flex-shrink: 0;
  width: clamp(150px, 20vw, 264px);
  height: auto;
  color: var(--color-bone);          /* drives currentColor for the mark */
  margin-inline-end: clamp(0px, 9vw, 150px);
}

/* ── Footer ── */
.footer { flex-shrink: 0; }
.footer a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(235, 226, 197, 0.75);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer a:hover { color: var(--color-brass); }

/* Doorway hover: "Enter" slides out leftward from the rook, and the rook lifts. */
@media (prefers-reduced-motion: no-preference) {
  .doorway .enter {
    transform: translateX(8px);      /* tucked toward the rook… */
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .doorway:hover .enter,
  .doorway:focus-visible .enter { transform: translateX(0); }   /* …slides out leftward */
  .rook { transition: transform 0.2s ease, color 0.2s ease; }
  .doorway:hover .rook,
  .doorway:focus-visible .rook { transform: translateY(-2px); }
}
.doorway:hover { color: var(--color-brass); }
.doorway:focus-visible {
  outline: 1.5px solid var(--color-brass);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ── Gentle entrance — the quote rises in on load (the mark builds out below) ── */
@media (prefers-reduced-motion: no-preference) {
  .quote {
    animation: rise-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  @keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ──────────────────────────────────────────────────────────────
   The mark build-out. The resting state (below) is the finished
   mark, so reduced-motion / no-JS visitors see it whole. When
   `.building` is present AND motion is allowed it draws the six
   edges, pops the eight outer nodes in on top, then lands the king
   last. A click on the mark replays it (see index.html).
   ────────────────────────────────────────────────────────────── */
.hero-mark .edge { stroke-dasharray: 1; stroke-dashoffset: 0; }
.hero-mark .node { transform-box: fill-box; transform-origin: center; }

@keyframes edge-draw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}
@keyframes node-pop {
  0%   { opacity: 0; transform: scale(0); }
  70%  { opacity: 1; transform: scale(1.18); }
  100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: no-preference) {
  /* 1 — draw the six edges, lightly staggered. */
  .hero-mark.building .edge { animation: edge-draw 0.55s ease both; }
  .hero-mark.building .edge:nth-child(1) { animation-delay: 0.00s; }
  .hero-mark.building .edge:nth-child(2) { animation-delay: 0.09s; }
  .hero-mark.building .edge:nth-child(3) { animation-delay: 0.18s; }
  .hero-mark.building .edge:nth-child(4) { animation-delay: 0.27s; }
  .hero-mark.building .edge:nth-child(5) { animation-delay: 0.36s; }
  .hero-mark.building .edge:nth-child(6) { animation-delay: 0.45s; }

  /* 2 — pop the eight outer nodes once the lattice is mostly drawn. */
  .hero-mark.building .node { animation: node-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
  .hero-mark.building .node:nth-child(1) { animation-delay: 0.70s; }
  .hero-mark.building .node:nth-child(2) { animation-delay: 0.78s; }
  .hero-mark.building .node:nth-child(3) { animation-delay: 0.86s; }
  .hero-mark.building .node:nth-child(4) { animation-delay: 0.94s; }
  .hero-mark.building .node:nth-child(5) { animation-delay: 1.02s; }
  .hero-mark.building .node:nth-child(6) { animation-delay: 1.10s; }
  .hero-mark.building .node:nth-child(7) { animation-delay: 1.18s; }
  .hero-mark.building .node:nth-child(8) { animation-delay: 1.26s; }

  /* 3 — the king lands last (same ink as the rest of the mark). */
  .hero-mark.building .king {
    animation: node-pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: 1.5s;
  }
}

/* ── Narrow screens: stack the mark above the quote, attribution back in flow ── */
@media (max-width: 760px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: clamp(1.75rem, 7vw, 2.75rem);
  }
  .quote { max-width: 100%; }
  .hero-mark {
    order: -1;                         /* mark leads, above the quote */
    width: clamp(84px, 22vw, 132px);
    margin-inline-end: 0;
  }
}

@media (max-width: 400px) {
  .brand-word { font-size: 22px; }
}
