/* ==========================================================================
   Lost Grid Labs — design system
   Paper & pine palette, Fraunces display, topographic motif.
   Committed light theme: the audience is small-business owners, and the
   palette is the identity, so every color is explicit and there is no
   dark-mode inversion.
   ========================================================================== */

:root {
  /* palette */
  --page: #FAF7F0;
  --card: #FFFDF8;
  --ink: #1B2A24;
  --muted: #5C6B62;
  --primary: #2F5D4C;
  --accent: #B4541B;
  --accent-ink: #FFFFFF;          /* 4.97:1 on --accent, passes AA */
  --contour: #A5825C;
  --line: rgba(27, 42, 36, .11);
  --line-2: rgba(27, 42, 36, .16);
  --tint: rgba(180, 84, 27, .07);

  /* the hero scrim is the page color fading out, so it has to be built from
     channels rather than a hex - themes override this one triplet */
  --page-rgb: 250, 247, 240;

  /* the contour art ships as one brown-stroked SVG; each theme tunes it to
     its own palette with a filter instead of shipping a recolored copy */
  --art-filter: none;
  --topo-opacity: .32;

  /* type */
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* layout */
  --measure: 980px;
  --gutter: 28px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg { max-width: 100%; }

h1, h2, h3, p, ol, ul, figure { margin: 0; }

a { color: var(--primary); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
}
.skip:focus { left: 8px; top: 8px; }

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

/* --------------------------------------------------------------- layout -- */

.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sec { padding-block: 60px; }

/* quiet hairline where a contour band would have been overkill */
.sec--ruled { border-top: 1px solid var(--line); }

/* ...except directly under the hero, where the terrain's own fade is the
   transition. A hairline there just re-draws the edge we softened. */
.hero + .sec--ruled { border-top: 0; }

.sec-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
  max-width: 600px;
}

/* ----------------------------------------------------------------- type -- */

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  font-variation-settings: "opsz" 96;
  text-wrap: balance;
  letter-spacing: -.015em;
}

h1 {
  font-size: clamp(2.35rem, 5.4vw, 3.9rem);
  line-height: 1.03;
  letter-spacing: -.022em;
}

.sec-head h2 {
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -.018em;
}

.sec-head p {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--muted);
}

.lede {
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.62;
  color: var(--muted);
  max-width: 56ch;
}

/* tracked uppercase label with a trailing hairline — always Inter */
.eyebrow {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::after {
  content: "";
  height: 1px;
  flex: 1;
  max-width: 80px;
  background: currentColor;
  opacity: .35;
}

/* small tracked caps used for marginalia throughout */
.marg {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 5px;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s ease, background-color .15s ease;
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { filter: brightness(.92); }

.btn--ghost {
  color: var(--primary);
  border-color: var(--line-2);
  background: transparent;
}
.btn--ghost:hover { background: var(--tint); }

.btn[disabled] { opacity: .55; cursor: default; filter: none; }

.link {
  font-size: 14px;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* ------------------------------------------------------------------ nav -- */

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--display);
  font-weight: 600;
  font-size: 18.5px;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
/* the o of "Lost" is a closed contour - sits in the text flow, so it scales
   with the wordmark rather than needing its own sizes */
.brand-o {
  display: inline-block;
  width: .64em;
  height: .64em;
  vertical-align: -.015em;
  margin-inline: .025em;
  color: var(--primary);
  overflow: visible;
}

.nav-links {
  display: flex;
  gap: 22px;
}
.nav-links a {
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
}
.nav-links a:hover { color: var(--ink); }

.nav .btn { font-size: 12.5px; padding: 7px 14px; }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  color: var(--ink);
  padding: 7px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

/* ----------------------------------------------------------------- hero -- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: 72px 64px;
}

/* generated contour terrain, faded out with a radial mask */
.hero-topo {
  position: absolute;
  /* exact full bleed: 100% agrees with the insets, so nothing is
     over-constrained and the terrain always reaches both window edges */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: var(--topo-opacity);
  filter: var(--art-filter);
  pointer-events: none;
  /* vertical-only fade - left and right are identical by construction */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 7%, #000 68%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 7%, #000 68%, transparent 100%);
}

/* scrim: the page color fading out to the right, so the contours run behind
   the headline instead of through it. Same hue as the page, so no visible edge. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    78% 112% at 22% 50%,
    rgba(var(--page-rgb), .82) 0%,
    rgba(var(--page-rgb), .70) 44%,
    rgba(var(--page-rgb), .28) 70%,
    rgba(var(--page-rgb), 0) 90%
  );
}

.hero-in {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  max-width: 640px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 2px;
}

/* ------------------------------------------------- services = map legend --
   A real map legend is a symbol, a name, and what it means. So: hairline
   rows, no boxes, one glyph each in the same line language as the contours.
   Not numbered — this is a menu, not a sequence.
   -------------------------------------------------------------------------- */

.legend-list { border-top: 1px solid var(--line-2); }

.legend-row {
  display: grid;
  grid-template-columns: 64px minmax(11rem, 1fr) minmax(0, 1.7fr);
  column-gap: 32px;
  align-items: start;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}

/* the h3 and p are wrapped in a div in the markup; contents promotes them to
   grid items so name and meaning sit in their own columns, legend-style */
.legend-row > div { display: contents; }
.legend-row:last-child { border-bottom-color: var(--line-2); }

.sym {
  color: var(--contour);
  padding-top: 2px;
  transition: color .15s ease;
}
.sym svg {
  display: block;
  width: 56px;
  height: 30px;
  overflow: visible;
}
.legend-row:hover .sym { color: var(--accent); }

.legend-row h3 {
  font-size: 17.5px;
  line-height: 1.3;
  letter-spacing: -.008em;
}
.legend-row p {
  font-size: 14px;
  line-height: 1.62;
  color: var(--muted);
  max-width: 54ch;
  padding-top: 2px;   /* optical baseline match with the larger display name */
}

/* ------------------------------------------------ work = survey plates --
   No card: corner registration marks, like the crop marks on a printed map
   sheet, with the art inset so the ticks read as registration.
   ------------------------------------------------------------------------ */

.work {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(252px, 1fr));
  gap: 40px 30px;
}

.proj { display: flex; flex-direction: column; }

.plate { position: relative; padding: 9px; }
.ticks { position: absolute; inset: 0; pointer-events: none; }

.plate::before,
.plate::after,
.ticks::before,
.ticks::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border: 0 solid var(--contour);
  pointer-events: none;
}
.plate::before { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.plate::after { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.ticks::before { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.ticks::after { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }

.shot {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  background: var(--tint);
  overflow: hidden;
}
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* generated plate art sits a little lighter than a real screenshot */
.shot img.is-plate { opacity: .75; filter: var(--art-filter); }

.proj .rec { margin-top: 17px; }

.proj h3 {
  font-size: 18px;
  line-height: 1.28;
  letter-spacing: -.01em;
  margin-top: 7px;
}
.proj h3 a { color: inherit; text-decoration: none; }
.proj h3 a:hover { color: var(--primary); }

.proj .desc {
  font-size: 13.8px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 9px;
}

/* tech as marginalia, not pills */
.proj .meta {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.work-empty {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  font-size: 14.5px;
  color: var(--muted);
}

/* ------------------------------------------------- process = plotted route --
   Numbered waypoints on a dashed trail, ending at the destination mark.
   A real sequence, so it IS numbered.
   ---------------------------------------------------------------------------- */

.route {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.stop { display: flex; flex-direction: column; }

/* Text is inset, but the marker row spans the full column, so the dashed
   trail runs unbroken from waypoint 1 to the destination rather than
   breaking at every column boundary. */
.stop > :not(.stop-mark) { padding-right: 34px; }

.stop-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
}

.pin {
  width: 29px;
  height: 29px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--page);      /* masks the trail passing behind */
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--body);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.trail {
  flex: 1;
  height: 0;
  border-top: 1px dashed var(--contour);
}

.dest {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--accent);
}
.dest svg { display: block; width: 100%; height: 100%; }

.stop h3 { font-size: 16.5px; line-height: 1.3; margin-top: 9px; }
.stop .desc {
  font-size: 13.8px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 8px;
}

/* -------------------------------------------------------------- contact -- */

.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: start;
}

.contact-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.contact-side h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  line-height: 1.12;
  letter-spacing: -.018em;
}
.contact-side p { font-size: 15px; line-height: 1.62; color: var(--muted); }

.mail {
  font-family: var(--display);
  font-size: 19px;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 3px;
  align-self: flex-start;
}
.mail:hover { border-color: currentColor; }

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

.field { display: flex; flex-direction: column; gap: 6px; }

label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

input,
select,
textarea {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 5px;
  padding: 10px 12px;
  width: 100%;
}
textarea { resize: vertical; min-height: 88px; }

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] { border-color: var(--accent); }

/* honeypot — hidden from people, reachable by bots */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-msg {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  min-height: 1.2em;
}
.form-msg[data-state="error"] { color: var(--accent); }
.form-msg[data-state="ok"] { color: var(--primary); }

/* --------------------------------------------------------------- footer -- */

.foot {
  border-top: 1px solid var(--line);
  padding-block: 28px 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 30px;
  align-items: center;
}
.foot .brand { margin-right: 0; font-size: 15px; }

/* map-sheet marginalia */
.sheet {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet span { display: flex; align-items: center; gap: 6px; }
.sheet i {
  display: block;
  width: 16px;
  height: 0;
  border-top: 1px solid var(--contour);
}

/* ----------------------------------------------------------- responsive -- */

@media (max-width: 880px) {
  /* not enough width for three columns - name back over its meaning */
  .legend-row { grid-template-columns: 64px minmax(0, 1fr); column-gap: 22px; }
  .legend-row > div { display: block; }
  .legend-row p { max-width: 58ch; padding-top: 0; margin-top: 6px; }
}

@media (max-width: 860px) {
  .contact { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 700px) {
  /* The route rotates: a vertical trail with the pins straddling it.
     .route is inset so the straddling pins stay clear of the screen edge —
     without it the pin hangs 14px outside the gutter. */
  .route {
    grid-template-columns: 1fr;
    padding-left: 14px;
  }
  .stop {
    padding-left: 22px;
    padding-bottom: 30px;
    border-left: 1px dashed var(--contour);
  }
  .stop:last-child { border-left-color: transparent; padding-bottom: 0; }
  .stop > :not(.stop-mark) { padding-right: 0; }
  .stop-mark { margin-left: -37px; margin-bottom: 12px; }
  /* the vertical trail simply ending is the terminus here; the × would read
     as a stray mark floating beside the last pin */
  .trail,
  .dest { display: none; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }
  .sec { padding-block: 46px; }
  .hero { padding-block: 48px 44px; }

  /* text runs full width here, so the scrim needs to be even rather than raked */
  .hero::after {
    background: radial-gradient(
      130% 90% at 40% 38%,
      rgba(var(--page-rgb), .86) 0%,
      rgba(var(--page-rgb), .76) 48%,
      rgba(var(--page-rgb), .46) 80%,
      rgba(var(--page-rgb), .3) 100%
    );
  }

  .nav-toggle { display: block; }
  .nav .btn { display: none; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--card);
    border-bottom: 1px solid var(--line-2);
    padding: 6px var(--gutter) 14px;
    z-index: 20;
  }
  .nav-links[data-open="true"] { display: flex; }
  .nav-links a { padding-block: 11px; font-size: 15px; }
  .nav { position: relative; }
}

@media (max-width: 560px) {
  .legend-row { grid-template-columns: 1fr; row-gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
