/* cxgholdings.com: Christensen Exploration Group, LLC
   Survey-map palette, one serif family (CXG Serif, from Lora, OFL), zero JavaScript.
   Light and dark themes follow the visitor's system setting. */

@font-face {
  font-family: "CXG Serif";
  src: url("/assets/fonts/cxg-serif-var.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Brand palette */
  --spruce: #13312c;
  --chalk: #eef1ec;
  --paper: #f8faf7;
  --slate: #4a5e59;
  --contour: #9db0a6;
  --contour-index: #7e958b;
  --brass: #a27b1f;
  --brass-deep: #7a5c10;
  --brass-light: #d6b45a;
  --mist: #c5d3cc;

  /* Roles (light theme). Use these in rules, not the brand values above. */
  --bg: var(--chalk);
  --ink: var(--spruce);
  --muted: var(--slate);
  --surface: var(--paper);
  --rule: var(--mist);
  --line: var(--contour);
  --line-strong: var(--contour-index);
  --area: rgba(197, 211, 204, 0.38);
  --accent: var(--brass);              /* non-text: underlines, focus, markers */
  --accent-text: var(--brass-deep);    /* small text in the accent color */
  --button-bg: var(--spruce);
  --button-ink: var(--chalk);
  --button-hover: #0c2420;
  --band: var(--spruce);               /* contact band and footer */
  --band-ink: var(--chalk);
  --band-muted: var(--mist);
  --band-accent: var(--brass-light);
  --band-rule: rgba(197, 211, 204, 0.22);
  --texture: url("/assets/img/contours.svg");          /* for dark grounds (band) */
  --page-texture: url("/assets/img/contours-ink.svg"); /* for the page background */

  --serif: "CXG Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Type scale, ratio 1.25 on an 18px body */
  --t-sm: 0.875rem;
  --t-base: 1.125rem;
  --t-md: 1.4rem;
  --t-lg: 1.75rem;
  --t-xl: 2.2rem;
  --t-2xl: clamp(2.2rem, 1.4rem + 3.2vw, 3.45rem);

  --measure: 66ch;
  --wrap: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4rem, 9vw, 7.5rem);
}

/* Dark theme: the same map at night. Deep spruce ground, chalk ink, brighter brass. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f2420;
    --ink: #e4ebe5;
    --muted: #a9bbb4;
    --surface: #132c27;
    --rule: #284440;
    --line: #3b5952;
    --line-strong: #557a71;
    --area: rgba(59, 89, 82, 0.45);
    --accent: #d4b057;
    --accent-text: #d4b057;
    --button-bg: #e4ebe5;
    --button-ink: #0f2420;
    --button-hover: #ffffff;
    --band: #091714;
    --band-ink: #e4ebe5;
    --band-muted: #a9bbb4;
    --band-accent: #d4b057;
    --band-rule: rgba(169, 187, 180, 0.16);
    --page-texture: url("/assets/img/contours.svg");
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--t-base);
  line-height: 1.65;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
  font-variant-numeric: lining-nums;
}

p { margin: 0 0 1.1em; max-width: var(--measure); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 2.5px; }

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

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.6rem 1rem;
  background: var(--button-bg);
  color: var(--button-ink);
  font-family: var(--sans);
  font-size: var(--t-sm);
  z-index: 10;
}
.skip-link:focus { top: 0.75rem; }

[id] { scroll-margin-top: 1rem; }

/* ---------- Header ---------- */
.site-header { padding-block: 1.4rem; }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.005em;
  line-height: 1.2;
}
.brand svg { width: 30px; height: 30px; flex: none; }
.brand polygon { fill: var(--accent); }

.site-nav ul {
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: var(--t-sm);
}
.site-nav a { text-decoration-color: transparent; }
.site-nav a:hover { text-decoration-color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2rem, 6vw, 4.5rem) clamp(3rem, 6vw, 4.5rem); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero h1 {
  font-size: var(--t-2xl);
  letter-spacing: -0.012em;
  max-width: 15ch;
}
.hero-lede {
  margin-top: 1.6rem;
  font-size: var(--t-md);
  line-height: 1.55;
  color: var(--muted);
  max-width: 34ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2.25rem;
  font-family: var(--sans);
  font-size: 1rem;
}
.button {
  display: inline-block;
  padding: 0.85rem 1.4rem;
  background: var(--button-bg);
  color: var(--button-ink);
  text-decoration: none;
  border-radius: 2px;
  font-weight: 600;
}
.button:hover { background: var(--button-hover); }

/* Company facts: a ruled row under the hero */
.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem clamp(1.5rem, 3vw, 2.5rem);
  margin: clamp(3rem, 6vw, 4.5rem) 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-strong);
}
.facts dt { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
.facts dd { margin: 0.3rem 0 0; font-size: 1.1875rem; font-weight: 600; line-height: 1.3; }

/* ---------- Contour map ---------- */
.map { margin: 0; }
.map svg { display: block; width: 100%; height: auto; overflow: visible; }

.map .c { stroke: var(--line); stroke-width: 1; }
.map .c-index { stroke: var(--line-strong); stroke-width: 1.7; }

.map-route {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stop circle { fill: var(--bg); stroke: var(--ink); stroke-width: 2.4; }
.stop-summit polygon { fill: var(--accent); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.stop-summit circle { fill: var(--ink); stroke: none; }

.stop text {
  font-family: var(--sans);
  font-size: 23px;
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 6px;
  stroke-linejoin: round;
}
.stop .stop-n { font-weight: 700; }

/* One orchestrated moment: contours settle, then the route is surveyed stop by stop. */
@media (prefers-reduced-motion: no-preference) {
  .map-contours { animation: settle 1.1s ease-out both; }
  .map-route {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: survey 2.2s cubic-bezier(.45, 0, .2, 1) 0.5s forwards;
  }
  .stop { opacity: 0; animation: arrive 0.35s ease-out forwards; }
  .stop-1 { animation-delay: 0.85s; }
  .stop-2 { animation-delay: 1.45s; }
  .stop-3 { animation-delay: 2.05s; }
  .stop-4 { animation-delay: 2.65s; }
}
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }
@keyframes survey { to { stroke-dashoffset: 0; } }
@keyframes arrive { to { opacity: 1; } }

/* ---------- Sections ---------- */
.section { padding-block: var(--section); border-top: 1px solid var(--rule); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 1.5rem clamp(2rem, 6vw, 5rem);
}
.section h2 { font-size: var(--t-xl); max-width: 16ch; }

.prose p { font-size: 1.1875rem; line-height: 1.7; }
.prose .lead { font-size: var(--t-lg); line-height: 1.35; font-weight: 500; max-width: 26ch; margin-bottom: 1.4rem; }
.prose .lead + p { color: var(--muted); }

.section-intro { margin-top: 1rem; font-size: 1.1875rem; color: var(--muted); max-width: 52ch; }

/* Elevation profile of the route, aligned to the four stage columns */
.profile { display: block; width: 100%; height: auto; margin-top: 3rem; overflow: visible; }
.prof-grid { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 6; }
.prof-area { fill: var(--area); }
.prof-line { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.prof-drop { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.prof-stop { fill: var(--bg); stroke: var(--ink); stroke-width: 2.4; }
.prof-summit { fill: var(--accent); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }

/* Stages: a real sequence, numbered to match the map */
.stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.5rem 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: stage;
}
.stages li { counter-increment: stage; border-top: 2px solid var(--ink); padding: 1.1rem clamp(1.25rem, 2.5vw, 2.25rem) 0 0; }
.stages h3 { font-size: var(--t-md); display: flex; align-items: baseline; gap: 0.6rem; }
.stages h3::before {
  content: counter(stage);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-text);
}
.stages li:last-child h3::before { content: "\25B2"; font-size: 0.8rem; color: var(--accent); }
.stages p { margin-top: 0.75rem; font-size: 1.0625rem; color: var(--muted); }

/* Principles: ruled definition list, not cards */
.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.75rem clamp(2rem, 6vw, 5rem);
  margin: 0;
}
.principles div { border-top: 1px solid var(--line-strong); padding-top: 1.1rem; }
.principles dt { font-size: var(--t-md); font-weight: 600; line-height: 1.25; }
.principles dd { margin: 0.6rem 0 0; color: var(--muted); max-width: 46ch; }

.trades {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 2.5rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
  max-width: 40rem;
}
.trades li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.trades li::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.status {
  margin-top: 2rem;
  padding-left: 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

/* ---------- Contact band ---------- */
.contact {
  background: var(--band) var(--texture) no-repeat left -14rem center / auto 150%;
  color: var(--band-ink);
  padding-block: var(--section);
}
.contact h2 { font-size: var(--t-xl); max-width: 16ch; }
.contact p { color: var(--band-muted); }
.contact .entity { margin-top: 1.5rem; font-size: 1rem; }
.contact .email {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: var(--t-lg);
  color: var(--band-ink);
  text-decoration-color: var(--band-accent);
}
.contact :focus-visible { outline-color: var(--band-accent); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--band);
  color: var(--band-muted);
  border-top: 1px solid var(--band-rule);
  padding-block: 1.75rem 2.25rem;
  font-family: var(--sans);
  font-size: var(--t-sm);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: var(--band-ink); text-decoration-color: var(--band-accent); }
.site-footer p { margin: 0; max-width: none; }
.site-footer :focus-visible { outline-color: var(--band-accent); }

/* ---------- Legal & utility pages ---------- */
.doc { padding-block: clamp(2rem, 6vw, 4rem) var(--section); }
.doc article {
  max-width: 46rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: clamp(1.5rem, 5vw, 3.5rem);
}
.doc h1 { font-size: var(--t-xl); }
.doc .updated { font-family: var(--sans); font-size: var(--t-sm); color: var(--muted); margin-top: 0.75rem; }
.doc h2 { font-size: var(--t-md); margin: 2.4rem 0 0.75rem; }
.doc ul { padding-left: 1.25rem; max-width: var(--measure); }
.doc li { margin-bottom: 0.4rem; }

.notfound {
  padding-block: var(--section);
  min-height: 60vh;
  background: var(--page-texture) no-repeat right -10rem center / auto 120%;
}
.notfound h1 { font-size: var(--t-2xl); max-width: 16ch; }
.notfound p { margin-top: 1.25rem; font-size: var(--t-md); color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: 18ch; }
  .map { max-width: 600px; }
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 2.5rem; }
  .profile { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .split { grid-template-columns: 1fr; }
  .principles { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .site-nav ul { gap: 1.25rem; }
  .stages { grid-template-columns: 1fr; }
  .trades { grid-template-columns: 1fr; }
  .contact { background-size: auto 90%; background-position: right -18rem top; }
  .notfound { background-position: right -16rem bottom; background-size: auto 70%; }
  .stop .stop-name { display: none; }
  .stop text { font-size: 30px; }
}

@media print {
  .site-nav, .skip-link, .map, .profile { display: none; }
  body { background: #fff; color: #000; }
  .contact, .site-footer { background: #fff; color: #000; }
}
