/* ============================================================
   Terra Incognita Data Labs — lander
   Warm chart paper, brand green ink, a slate-blue dot-matrix sea behind (bg.js).
   ============================================================ */

:root {
  --bg:          #fcf9f4;   /* warm chart paper */
  --ink:         #133320;   /* brand green */
  --ink-dim:     #43584b;
  --ink-faint:   #7f9488;
  --rule:        #133320;
  --accent:      #1f6474;   /* deep water */
  /* braille field (bg.js): dot colour runs lo → hi with the water's value,
     each mixed toward the ground by the matching --dot-* strength */
  --water-lo:    #7a8ca3;   /* slate: kept off the green ink */
  --water-hi:    #34507a;
  --dot-base:    0.04;      /* idle lattice */
  --dot-lo:      0.18;
  --dot-hi:      0.38;
  /* old-chart background (bg-map.js, enabled with ?bg=map): ink and route
     colours, each mixed toward the ground by its -k strength */
  --map-ink:     #34507a;
  --map-ink-k:   0.42;
  --map-route:   #9b4a36;   /* rust: the traveller's dashed route */
  --map-route-k: 0.75;

  --font-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans:  "Montserrat", ui-sans-serif, system-ui, "Helvetica Neue", Arial, sans-serif;

  --lede-size: clamp(1.75rem, 1.05rem + 3vw, 3.35rem);
  --body-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem);
  --page-max: 60rem;
  --logo-w: clamp(190px, 24vw, 280px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--body-size);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block;
  filter: blur(2px); }
#bg.map { filter: blur(4px); }   /* the old chart (bg-map.js) takes a heavier blur */

/* ---------- layout ---------- */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vh, 6rem) clamp(1.25rem, 6vw, 5rem) 2.5rem;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  gap: clamp(2.5rem, 7vh, 5rem);
}

/* ---------- masthead ---------- */
/* The masthead rule belongs to the lockup: it starts at the I of INCOGNITA
   and sits level with the tip of the compass ring's lower-right arc, so it
   reads as running out from behind the compass. Fractions are measured on
   assets/web/compass-lockup.svg (943.951 × 351.042):
     I left edge   x = 374.66  → 0.39690 of the logo's width (rule starts a hair earlier, at 0.3869)
     arc tip       y = 222.99  → 0.23623 of the logo's width */
.masthead { position: relative; }
.masthead::after {
  content: "";
  position: absolute;
  left: calc(var(--logo-w) * 0.3869);
  right: 0;
  top: calc(var(--logo-w) * 0.23623 + 2.5px);
  border-bottom: 4px double var(--rule);
}
.logo-wrap { margin: 0; line-height: 0; }
.logo { display: block; width: var(--logo-w); height: auto; color: var(--ink); }
.logo-wrap a { display: inline-block; }

/* ---------- statement ---------- */
.statement > * { max-width: 46rem; }
.statement p { margin: 0 0 1.15em; }
.statement .lede {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: var(--lede-size);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.4em;
  text-wrap: balance;
}
/* the lede is a call and answer: the old charts on the left, today on the right */
.statement .now { text-align: right; margin-left: auto; }  /* hangs off the page's right edge, under the end of the masthead rule */
.statement .lede em { font-style: italic; font-weight: 400; color: var(--accent); }
.statement .turn {
  font-weight: 600;
  font-size: calc(var(--body-size) * 1.1);
  margin-bottom: 0.9em;
}
.statement .detail { color: var(--ink-dim); max-width: 40rem; text-wrap: pretty; }
/* each question opens on its interrogative, set in the serif italic */
.statement .detail em { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.12em; letter-spacing: -0.005em; }

/* text sits over the chart: a soft halo of paper keeps it legible */
.statement, .section-blurb, .project, .foot { text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg); }

/* ---------- projects ---------- */
.projects { margin-top: auto; }
.section-blurb {
  font-size: var(--body-size);
  font-weight: 400;
  color: var(--ink-dim);
  margin: 0 0 1.25rem;
}
.project-list { list-style: none; margin: 0; padding: 0; border-top: 3px double var(--rule); }
.project-list li:last-child .project { border-bottom: 3px double var(--rule); }
/* A tile is a packed row of fixed-width segments, the link cell pushed to the end:
     [question + pitch]                     [logo / url]
   On hover (or keyboard focus) it colours up and a window opens after the
   description onto a wall of screenshots that tiles.js pans and zooms:
     [question + pitch] [screenshot window ·····] [logo / url]
   The window takes all the free space between the two, less the gaps.         */
.project {
  --seg-gap: 1.25rem;
  --shot-h: 7.5rem;
  display: flex;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 30%, transparent);
  text-decoration: none;
  color: inherit;
}
.project:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.project .what { flex: none; width: 19rem; margin-right: var(--seg-gap); color: var(--ink-dim); transition: color .2s ease; text-wrap: pretty; }
.project:hover .what, .project:focus-visible .what { color: var(--ink); }
.project .what .hl {
  display: block; margin-bottom: 0.15rem;
  font-family: var(--font-serif); font-weight: 500; font-size: 1.15em; line-height: 1.25; letter-spacing: -0.01em;
  color: var(--ink);
}
.project .what .pitch { display: block; font-size: 0.95em; line-height: 1.5; }

/* the screenshot window: a wall of tiles (tiles.js) panned and zoomed behind it */
.project .shot {
  flex: 0 0 0; min-width: 0; position: relative; display: block;
  height: var(--shot-h); margin-right: 0; overflow: hidden;
  transition: flex-grow .5s cubic-bezier(.2, .7, .2, 1), margin-right .5s cubic-bezier(.2, .7, .2, 1);
}
.project:hover .shot, .project:focus-visible .shot { flex-grow: 1; margin-right: var(--seg-gap); }
.project .shot .wall { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.project .shot .wall img { position: absolute; display: block; max-width: none; border-radius: 20px; }   /* laid out 4x (tiles.js RES) */

/* the link cell: logo over the address, right-aligned. Each project supplies
   a horizontal lockup and a stacked one; <picture> swaps in the stacked one on
   narrow screens */
.project .go {
  flex: none;
  margin-left: auto;
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.35rem;
}
.project .go img {
  display: block; height: 1.3em; width: auto;
  filter: grayscale(1) contrast(1.15) brightness(0.55);
  opacity: 0.85;
  transition: filter .3s ease, opacity .3s ease;
}
.project:hover .go img, .project:focus-visible .go img { filter: none; opacity: 1; }
.project .go .url {
  font-size: 0.8rem; font-weight: 500; letter-spacing: 0.01em;
  color: var(--ink-faint); white-space: nowrap;
  transition: color .2s ease;
}
.project:hover .go .url, .project:focus-visible .go .url { color: var(--accent); }

/* the description holds its width so the opening window never nudges it;
   only where the row is genuinely too narrow may it give way */
@media (max-width: 62rem) { .project .what { flex: 0 1 19rem; min-width: 12rem; } }
/* narrow screens: the stacked logo and address on top (moved there with
   order; the markup keeps the question first), the question and pitch
   beneath; no collage */
@media (max-width: 46rem) {
  .project { flex-wrap: wrap; row-gap: 0.85rem; }
  .project .go { order: -1; margin-left: 0; align-items: flex-start; gap: 0.45rem; }
  .project .go img { height: 2.9rem; }
  .project .what { flex: 1 1 100%; width: auto; margin-right: 0; }
  .project .shot { display: none; }
}
/* touch screens have no hover: keep the collage out of the way there too,
   and show the logo in colour from the start */
@media (hover: none) {
  .project .shot { display: none; }
  .project .go img { filter: none; opacity: 1; }
}

/* ---------- footer ---------- */
.foot {
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.8;
}
.foot .contact { text-align: right; }
.foot a { text-decoration: none; color: var(--ink-dim); }
.foot a:hover { color: var(--accent); }
@media (max-width: 40rem) {
  .foot { flex-direction: column; gap: 1rem; }
  .foot .contact { order: -1; text-align: left; }
}

/* ---------- 404 ---------- */
.lost .foot { margin-top: auto; }
.lost .statement .lede { margin-bottom: 1rem; }
.lost .back { font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }
.lost .back:hover { color: var(--accent); }

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