/* =========================================================
   Groundtruth, LLC — survey-document design system
   Palette derives from nautical/topographic charts:
   chart-ink text, cool survey-paper ground, one magenta
   overlay accent (the color charts use for key overlays).
   ========================================================= */

:root {
  --ink:          #14242E;   /* chart ink — primary text & structure */
  --ink-soft:     #46565F;   /* secondary text */
  --ink-faint:    #738088;   /* captions */
  --paper:        #E8ECE6;   /* cool survey paper — page ground */
  --paper-2:      #DFE4DC;   /* recessed panel */
  --paper-3:      #F1F3EE;   /* lifted card */
  --graticule:    #9DAAA3;   /* grid hairlines */
  --graticule-2:  rgba(157, 170, 163, 0.34);
  --magenta:      #C01F6E;   /* chart-overlay accent */
  --magenta-deep: #931451;

  --maxw: 1120px;
  --gutter: clamp(1.25rem, 5vw, 4rem);

  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.16, 0.84, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* faint full-page graticule wash */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--graticule-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--graticule-2) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.38;
  pointer-events: none;
  z-index: 0;
}

main, .masthead, .footer { position: relative; z-index: 1; }

/* ---------- neatline (map border + corner ticks) ---------- */
.neatline {
  position: fixed;
  inset: 14px;
  border: 1px solid var(--graticule);
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: multiply;
}
.tick { position: absolute; width: 12px; height: 12px; }
.tick::before, .tick::after {
  content: ""; position: absolute; background: var(--ink);
}
.tick::before { width: 12px; height: 1.5px; top: 0; }
.tick::after  { width: 1.5px; height: 12px; left: 0; }
.tick--tl { top: -1px; left: -1px; }
.tick--tr { top: -1px; right: -1px; }
.tick--tr::after { left: auto; right: 0; }
.tick--bl { bottom: -1px; left: -1px; }
.tick--bl::before { top: auto; bottom: 0; }
.tick--br { bottom: -1px; right: -1px; }
.tick--br::before { top: auto; bottom: 0; }
.tick--br::after  { left: auto; right: 0; }

@media (max-width: 640px) { .neatline { inset: 8px; } }

/* ---------- shared type ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 0.7rem;
}

.section-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem var(--gutter);
  max-width: var(--maxw);
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark {
  width: 26px; height: 26px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  flex: none;
}
.brand__mark circle:last-of-type { fill: var(--magenta); stroke: none; }
.brand__mark--sm { width: 20px; height: 20px; }
.brand__word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.01em;
}
.brand__llc { color: var(--ink-faint); font-weight: 500; }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }
.nav a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav__cta {
  color: var(--magenta) !important;
  border: 1px solid var(--magenta);
  padding: 0.45rem 0.85rem;
  border-radius: 2px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.nav__cta:hover { background: var(--magenta); color: var(--paper) !important; }
@media (max-width: 760px) {
  .nav a:not(.nav__cta) { display: none; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.8rem 1.4rem;
  border-radius: 2px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.btn--solid { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); }
.btn--solid:hover { background: var(--magenta); border-color: var(--magenta); transform: translateY(-2px); }
.btn--ghost { color: var(--ink); border: 1px solid var(--graticule); }
.btn--ghost:hover { border-color: var(--ink); transform: translateY(-2px); }

/* ---------- section frame ---------- */
.work, .deep, .studio, .contact, .datum {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5.5rem) var(--gutter) clamp(3rem, 8vw, 6rem);
  min-height: 72vh;
  display: flex;
  align-items: center;
}
.hero__grid {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.graticule { width: 100%; height: 100%; opacity: 0.9; }
.graticule__lines line {
  stroke: var(--graticule);
  stroke-width: 1;
  opacity: 0;
  animation: gridIn 0.9s var(--ease) forwards;
}
.graticule__lines line:nth-child(odd) { animation-delay: 0.05s; }
.graticule__lines line:nth-child(even) { animation-delay: 0.18s; }

/* the period at the end of the headline is the located point */
.endpoint { position: relative; display: inline-block; }
.endpoint__dot { color: var(--magenta); }
.pin-wrap {
  position: absolute;
  left: 50%;
  bottom: -0.04em;
  transform: translateX(-50%);
  pointer-events: none;
}
.pin-drop {
  display: block;
  height: 0.92em;
  width: auto;
  transform-origin: center bottom;
  animation: pinDrop 0.72s var(--ease) 0.75s both;
}
.pin__body { fill: none; stroke: var(--magenta); stroke-width: 2.5; }
.pin__dot  { fill: var(--magenta); }
.endpoint__ping {
  position: absolute;
  left: 50%;
  bottom: 0.06em;
  width: 0.42em;
  height: 0.42em;
  border: 1.5px solid var(--magenta);
  border-radius: 50%;
  transform: translate(-50%, 50%) scale(0.4);
  opacity: 0;
  pointer-events: none;
  animation: ping 2.8s ease-out 1.5s infinite;
}
@keyframes gridIn { to { opacity: 0.55; } }
@keyframes pinDrop {
  0%   { opacity: 0; transform: translateY(-46px); }
  60%  { opacity: 1; transform: translateY(4px); }
  80%  { transform: translateY(-2px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes ping {
  0%   { opacity: 0.55; transform: translate(-50%, 50%) scale(0.4); }
  70%  { opacity: 0; transform: translate(-50%, 50%) scale(3.2); }
  100% { opacity: 0; transform: translate(-50%, 50%) scale(3.2); }
}

.hero__body { position: relative; max-width: 40rem; }
.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 1.1rem 0 1.4rem;
}
.hero__title em {
  font-style: normal;
  color: var(--magenta);
}
.hero__lede {
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  color: var(--ink-soft);
  max-width: 32rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

/* ---------- DATUM definition strip ---------- */
.datum {
  border-top: 1px solid var(--graticule);
  border-bottom: 1px solid var(--graticule);
  padding-top: clamp(2rem, 5vw, 3rem);
  padding-bottom: clamp(2rem, 5vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 14rem) 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
}
.datum__label {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--magenta);
}
.datum__pos { color: var(--ink-faint); }
.datum__def {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 2.6vw, 1.65rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.datum__def strong { color: var(--magenta); font-weight: 700; }
@media (max-width: 680px) { .datum { grid-template-columns: 1fr; } }

/* ---------- WORK / cards ---------- */
.work { padding-top: clamp(4rem, 9vw, 7rem); padding-bottom: clamp(2rem, 5vw, 4rem); }
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--graticule);
  border: 1px solid var(--graticule);
}
.card {
  background: var(--paper-3);
  padding: clamp(1.5rem, 3vw, 2.2rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  outline: none;
  transition: background 0.25s var(--ease);
}
.card:hover, .card:focus-visible { background: var(--paper); }
.card__mark {
  width: 22px; height: 22px;
  position: relative;
  display: inline-block;
}
.card__mark::before, .card__mark::after {
  content: ""; position: absolute; background: var(--ink);
  transition: background 0.25s var(--ease);
}
.card__mark::before { left: 50%; top: 0; width: 1.5px; height: 100%; transform: translateX(-50%); }
.card__mark::after  { top: 50%; left: 0; height: 1.5px; width: 100%; transform: translateY(-50%); }
.card:hover .card__mark::before,
.card:hover .card__mark::after,
.card:focus-visible .card__mark::before,
.card:focus-visible .card__mark::after { background: var(--magenta); }
.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.card__body { color: var(--ink-soft); font-size: 0.98rem; }
.card__list {
  list-style: none;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--graticule-2);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.card__list li {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  padding-left: 1rem;
  position: relative;
}
.card__list li::before {
  content: "+"; position: absolute; left: 0; color: var(--magenta);
}
@media (max-width: 820px) { .cards { grid-template-columns: 1fr; } }

/* ---------- DEEP specialization ---------- */
.deep { padding-top: clamp(4rem, 9vw, 7rem); padding-bottom: clamp(2rem, 5vw, 4rem); }
.deep__intro { max-width: 40rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.deep__lede { margin-top: 1.2rem; color: var(--ink-soft); font-size: 1.08rem; }
.deep__pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--graticule);
  border: 1px solid var(--graticule);
}
.domain {
  background: var(--paper-3);
  padding: clamp(1.5rem, 3vw, 2.4rem);
}
.domain__viz { width: 100%; height: 96px; display: block; margin-bottom: 1.2rem; }
.wave {
  fill: none; stroke: var(--magenta); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round;
}
.contour { fill: none; stroke: var(--ink); stroke-width: 1.4; opacity: 0.7; }
.bench { fill: var(--magenta); }
.domain__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
}
.domain__body { color: var(--ink-soft); margin-top: 0.5rem; font-size: 0.98rem; }
.domain__caps {
  list-style: none;
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--graticule-2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 1rem;
}
.domain__caps li {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  padding-left: 1rem;
  position: relative;
  line-height: 1.3;
}
.domain__caps li::before {
  content: "+"; position: absolute; left: 0; color: var(--magenta);
}
@media (max-width: 460px) { .domain__caps { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .deep__pair { grid-template-columns: 1fr; } }

/* ---------- PROJECTS register ---------- */
.projects { padding-top: clamp(4rem, 9vw, 7rem); padding-bottom: clamp(2rem, 5vw, 4rem); }
.register { list-style: none; border-top: 1px solid var(--graticule); }
.entry {
  border-bottom: 1px solid var(--graticule);
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.6rem, 3.2vw, 2.4rem) 0.4rem;
  transition: background 0.25s var(--ease);
}
.entry:hover { background: var(--paper-3); }
.entry__head { display: flex; flex-direction: column; gap: 0.7rem; }
.entry__pin svg { width: 15px; height: auto; display: block; }
.entry__tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.entry__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  letter-spacing: -0.015em;
  line-height: 1.05;
}
.entry__desc { color: var(--ink-soft); margin-top: 0.6rem; max-width: 46rem; font-size: 1.02rem; }
.entry__tech { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.2rem; }
.entry__tech li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  border: 1px solid var(--graticule);
  border-radius: 2px;
  padding: 0.32rem 0.62rem;
  transition: border-color 0.2s var(--ease);
}
.entry:hover .entry__tech li { border-color: var(--ink-faint); }
@media (max-width: 720px) {
  .entry { grid-template-columns: 1fr; gap: 0.9rem; }
  .entry__head { flex-direction: row; align-items: center; gap: 0.6rem; }
}

/* ---------- STUDIO ---------- */
.studio { padding-top: clamp(4rem, 9vw, 7rem); padding-bottom: clamp(2rem, 5vw, 4rem); }
.studio__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  font-size: 1.08rem;
  color: var(--ink-soft);
}
.studio__cols strong { color: var(--ink); }
@media (max-width: 680px) { .studio__cols { grid-template-columns: 1fr; } }

/* ---------- CONTACT ---------- */
.contact {
  padding-top: clamp(4rem, 9vw, 7rem);
  padding-bottom: clamp(4rem, 9vw, 7rem);
  text-align: center;
}
.contact__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0.7rem 0 1rem;
}
.contact__lede {
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 auto 2rem;
  font-size: 1.08rem;
}
.contact__email {
  font-family: var(--font-mono);
  font-size: clamp(1.1rem, 3.5vw, 1.9rem);
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--magenta);
  padding-bottom: 0.2rem;
  transition: color 0.2s var(--ease);
}
.contact__email:hover { color: var(--magenta); }
.contact__note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin-top: 1.4rem;
}

/* ---------- FOOTER ---------- */
.footer {
  border-top: 1px solid var(--graticule);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.6rem;
}
.footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
}
.footer__meta, .footer__fine {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}
.footer__fine { margin-top: 0.8rem; }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .graticule__lines line { opacity: 0.55; }
  .pin-drop { opacity: 1; transform: none; }
  .endpoint__ping { display: none; }
}
