/* Layout concept: every page is a field survey sheet — the brand's 16 px station grid is the ground,
   figures carry map-sheet captions, and data sits in a mono "readings" voice beside a Geologica text voice. */
:root {
  --paper: #F3F0E8;      /* sheet */
  --surface: #FBFAF6;    /* raised panels, form fields */
  --ink: #22201C;        /* text, dots, rules */
  --stone: #6A6255;      /* secondary text */
  --line: #DCD5C6;       /* hairlines */
  --dot: #D3CAB8;        /* survey grid stations */
  --ochre: #A6781F;      /* the peak reading: one accent */
  --ochre-text: #84600F; /* ochre that passes 4.5:1 for small text on paper */
  --band: #22201C;       /* dark bands */
  --band-fg: #F3F0E8;
  --band-sub: #B5AE9F;
  --band-line: #3A362F;
  --band-ochre: #D9A441;
  --data-cu: #A6781F;
  --data-mag: #3D6A85;
  --data-alt: #9A4B72;
  --focus: #3D6A85;

  --f-text: "Geologica", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-data: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --s-1: 0.8125rem;  /* 13 */
  --s0: 1rem;        /* 16 */
  --s1: 1.1875rem;   /* 19 */
  --s2: 1.5rem;      /* 24 */
  --s3: 2rem;        /* 32 */
  --s4: 2.75rem;     /* 44 */
  --s5: clamp(2.5rem, 5.4vw, 4.25rem);

  --wrap: 1200px;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #171612; --surface: #1F1D19; --ink: #EEE9DE; --stone: #B3AB9B; --line: #34302A; --dot: #3B372F;
    --ochre: #D9A441; --ochre-text: #E2B25A; --band: #0F0E0B; --band-fg: #EEE9DE; --band-sub: #A9A190;
    --band-line: #2E2A24; --band-ochre: #D9A441; --data-cu: #D9A441; --data-mag: #7FB0CC; --data-alt: #D58CB1;
    --focus: #7FB0CC; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #171612; --surface: #1F1D19; --ink: #EEE9DE; --stone: #B3AB9B; --line: #34302A; --dot: #3B372F;
  --ochre: #D9A441; --ochre-text: #E2B25A; --band: #0F0E0B; --band-fg: #EEE9DE; --band-sub: #A9A190;
  --band-line: #2E2A24; --band-ochre: #D9A441; --data-cu: #D9A441; --data-mag: #7FB0CC; --data-alt: #D58CB1;
  --focus: #7FB0CC; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-text); font-size: var(--s0); line-height: 1.6; font-weight: 340;
  text-rendering: optimizeLegibility;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--paper); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ochre-text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--ochre); color: var(--paper); }
h1, h2, h3, h4 { font-weight: 500; line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
h1 { font-size: var(--s5); font-weight: 520; letter-spacing: -0.025em; }
h2 { font-size: var(--s4); }
h3 { font-size: var(--s2); letter-spacing: -0.01em; }
h4 { font-size: var(--s1); }
p { margin: 0; text-wrap: pretty; }
.lede { font-size: var(--s1); color: var(--stone); max-width: 38em; font-weight: 320; }
.measure { max-width: 40em; }
.data, .mono { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.sub { color: var(--stone); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 16px; }

.wrap { max-width: calc(var(--wrap) + 40px); margin-inline: auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }

/* the station grid, 16 px lattice like the logo field */
.grid-ground {
  background-image: radial-gradient(circle at 8px 8px, var(--dot) 0.9px, transparent 1.3px);
  background-size: 16px 16px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 14px; }
.brand { display: flex; align-items: center; color: var(--ink); text-decoration: none; flex: none; }
.brand .logo-svg { height: 34px; width: auto; }
.logo-svg .pk, .mark-svg .pk { fill: var(--ochre); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: 4px; font-size: 0.9375rem; font-weight: 420; color: var(--ink); }
.nav a:hover { color: var(--ochre-text); }
.nav a[aria-current="page"] { color: var(--ochre-text); box-shadow: inset 0 -2px 0 var(--ochre); border-radius: 0; }
.nav .btn { margin-left: 10px; }
.nav a.btn { color: var(--paper); padding: 10px 18px; border-radius: 4px; }
.nav a.btn:hover { color: var(--paper); }
.nav a.btn[aria-current="page"] { box-shadow: none; color: var(--paper); }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); font: inherit; font-size: 0.875rem; padding: 8px 12px; cursor: pointer; }
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0;
         background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px var(--gutter-r) 16px var(--gutter); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"] { box-shadow: none; }
  .nav .btn { margin: 12px 0 0; text-align: center; justify-content: center; }
  .brand .logo-svg { height: 30px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 18px;
  border-radius: 4px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font: 500 0.9375rem/1 var(--f-text); text-decoration: none; cursor: pointer; transition: background .15s, color .15s;
}
.btn:hover { background: var(--ochre); border-color: var(--ochre); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn .arrow { font-family: var(--f-data); }
.band .btn { background: var(--band-fg); color: var(--band); border-color: var(--band-fg); }
.band .btn:hover { background: var(--band-ochre); border-color: var(--band-ochre); color: var(--band); }
.band .btn.ghost { background: transparent; color: var(--band-fg); }

/* ---------- sections ---------- */
.section { padding-block: clamp(64px, 9vw, 120px); }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 56px; align-items: end; margin-bottom: 48px; }
.section-head .lede { justify-self: start; }
@media (max-width: 820px) { .section-head { grid-template-columns: minmax(0, 1fr); } }

.band { background: var(--band); color: var(--band-fg); }
.band .sub, .band .lede { color: var(--band-sub); }
.band a:hover { color: var(--band-ochre); }
.band .grid-ground { background-image: radial-gradient(circle at 8px 8px, var(--band-line) 0.9px, transparent 1.3px); }

/* ---------- hero (home): the survey grid is the ground ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; padding-block: clamp(56px, 9vw, 120px) clamp(48px, 7vw, 96px); pointer-events: none; }
.hero-copy { display: flex; flex-direction: column; gap: 28px; pointer-events: auto; max-width: 44rem; }
.hero-copy h1 { max-width: 13em; }
.hero-copy .lede { color: var(--stone); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.sheet-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-family: var(--f-data); font-size: 0.75rem; letter-spacing: 0.02em; color: var(--stone); }
.sheet-meta b { font-weight: 500; color: var(--ink); }
.probe {
  position: absolute; z-index: 2; pointer-events: none; font-family: var(--f-data); font-size: 0.75rem; line-height: 1.35;
  background: var(--surface); border: 1px solid var(--line); padding: 6px 9px; border-radius: 3px; white-space: nowrap;
  transform: translate(14px, -50%); box-shadow: 0 6px 18px -10px rgba(0,0,0,.35);
}
.probe b { font-weight: 500; color: var(--ochre-text); }
.hero-legend { position: relative; margin-top: auto; align-self: end; justify-self: end; pointer-events: auto;
  font-family: var(--f-data); font-size: 0.75rem; color: var(--stone); background: color-mix(in srgb, var(--paper) 88%, transparent);
  border: 1px solid var(--line); padding: 10px 12px; border-radius: 3px; display: grid; gap: 4px; }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-top: 40px; padding-bottom: 330px; }
  .hero-legend { position: absolute; left: var(--gutter); right: var(--gutter-r); bottom: 16px; }
}

/* ---------- service register (rows, not cards) ---------- */
.register { display: grid; border-top: 1px solid var(--ink); }
.register-row {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 3fr); gap: 16px 40px;
  padding-block: 26px; border-bottom: 1px solid var(--line); align-items: start; text-decoration: none; color: inherit;
}
a.register-row:hover h3 { color: var(--ochre-text); }
.register-row h3 { font-size: var(--s1); font-weight: 500; }
.register-row .out { font-family: var(--f-data); font-size: 0.8125rem; color: var(--stone); line-height: 1.5; }
@media (max-width: 820px) { .register-row { grid-template-columns: minmax(0, 1fr); gap: 8px; } }

/* ---------- figures with map-sheet captions ---------- */
figure { margin: 0; }
.fig { display: grid; gap: 10px; align-content: start; }
.fig .frame { border: 1px solid var(--ink); padding: 5px; background: var(--surface); }
.fig .frame img { width: 100%; aspect-ratio: var(--ar, 16 / 10); object-fit: cover; }
.fig .frame.chart { background: #fff; }
.fig .frame.chart img { object-fit: contain; }
.legend-keys { display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--f-data); font-size: 0.75rem; color: var(--stone); }
.legend-keys i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.fig figcaption { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: var(--s-1); color: var(--stone); line-height: 1.45; }
.fig figcaption .fid { font-family: var(--f-data); font-weight: 500; color: var(--ink); }
.fig figcaption .src { grid-column: 2; font-family: var(--f-data); font-size: 0.75rem; }

/* ---------- split feature ---------- */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px 64px; align-items: start; }
.feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature.flip > :first-child { order: 2; }
.feature .stack { display: grid; gap: 22px; align-content: start; }
@media (max-width: 900px) { .feature, .feature.flip { grid-template-columns: minmax(0, 1fr); } .feature.flip > :first-child { order: 0; } }

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 900px) { .trio { grid-template-columns: minmax(0, 1fr); } }

/* key/value readings */
.readings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.readings > div { padding: 16px 16px 0 0; display: grid; gap: 4px; align-content: start; }
.readings dt { font-family: var(--f-data); font-size: 0.75rem; color: var(--stone); }
.readings dd { margin: 0; font-size: var(--s1); font-weight: 450; }
.readings dd small { display: block; font-size: var(--s-1); color: var(--stone); font-weight: 340; }
@media (max-width: 640px) { .readings { grid-template-columns: minmax(0, 1fr); } }

/* lists */
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 22px; }
.ticks li::before { content: ""; position: absolute; left: 3px; top: 0.62em; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.ticks li.pk::before { background: var(--ochre); }
.band .ticks li::before { background: var(--band-fg); }

/* sequence (a real process: numbered) */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--ink); counter-reset: s; }
.steps li { counter-increment: s; padding: 18px 20px 0 0; display: grid; gap: 8px; align-content: start; }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--f-data); font-size: 0.8125rem; color: var(--ochre-text); }
.steps h4 { font-size: 1.0625rem; font-weight: 500; }
.steps p { font-size: 0.9375rem; color: var(--stone); }
@media (max-width: 1000px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; } }
@media (max-width: 560px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* tables */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; min-width: 640px; }
th, td { text-align: left; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--f-data); font-size: 0.75rem; font-weight: 500; color: var(--stone); }
td.num, th.num { text-align: right; font-family: var(--f-data); font-variant-numeric: tabular-nums; }

/* page head for inner pages */
.page-head { border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-block: clamp(48px, 8vw, 104px) clamp(40px, 6vw, 72px); display: grid; gap: 24px; }
.page-head h1 { max-width: 15em; }

/* service detail blocks */
.svc { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px 64px; padding-block: 56px; border-top: 1px solid var(--line); }
.svc:first-of-type { border-top: 1px solid var(--ink); }
.svc .meta { display: grid; gap: 14px; align-content: start; position: sticky; top: 96px; }
.svc .meta .code { font-family: var(--f-data); font-size: 0.75rem; color: var(--stone); }
.svc .body { display: grid; gap: 22px; }
.svc .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; }
.svc .cols h4 { margin-bottom: 10px; font-size: 1rem; }
@media (max-width: 900px) { .svc { grid-template-columns: minmax(0, 1fr); } .svc .meta { position: static; } }
@media (max-width: 600px) { .svc .cols { grid-template-columns: minmax(0, 1fr); } }

/* sensor spectrum strip */
.spectrum { display: grid; gap: 10px; }
.spectrum .bar { position: relative; height: 44px; border: 1px solid var(--ink); background: var(--surface); }
.spectrum .bar span { position: absolute; top: 0; bottom: 0; background: var(--ink); opacity: .85; }
.spectrum .bar span.sw { background: var(--ochre); opacity: 1; }
.spectrum .row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: center; }
.spectrum .row .name { font-family: var(--f-data); font-size: 0.75rem; }
.spectrum .axis { display: flex; justify-content: space-between; margin-left: 136px; font-family: var(--f-data); font-size: 0.6875rem; color: var(--stone); }
.spectrum .zones { display: flex; margin-left: 136px; font-family: var(--f-data); font-size: 0.6875rem; color: var(--stone); }
.spectrum .zones span { border-left: 1px solid var(--line); padding: 2px 6px; }
.spectrum .feat { position: relative; height: 50px; margin-left: 136px; font-family: var(--f-data); font-size: 0.6875rem; color: var(--ochre-text); }
.spectrum .feat span { position: absolute; bottom: 0; transform: translateX(-50%); white-space: nowrap; padding-bottom: 6px; }
.spectrum .feat span::after { content: ""; position: absolute; left: 50%; bottom: -2px; height: 8px; border-left: 1px solid var(--ochre); }
.spectrum .feat span.hi { padding-bottom: 22px; }
.spectrum .feat span.hi::after { height: 24px; }
@media (max-width: 640px) { .spectrum .feat { margin-left: 0; } .spectrum .feat span { font-size: 0.625rem; } }
@media (max-width: 640px) { .spectrum .row { grid-template-columns: minmax(0, 1fr); gap: 6px; } .spectrum .axis, .spectrum .zones { margin-left: 0; } }

/* case studies */
.cases { display: grid; gap: 0; border-top: 1px solid var(--ink); }
.case { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 56px; padding-block: 48px; border-bottom: 1px solid var(--line); }
.case .tags { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--f-data); font-size: 0.75rem; color: var(--stone); }
.case .stack { display: grid; gap: 16px; align-content: start; }
.case.no-fig { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
@media (max-width: 900px) { .case, .case.no-fig { grid-template-columns: minmax(0, 1fr); } }

/* dbmine demo */
.demo { display: grid; grid-template-columns: minmax(0, 1fr) 300px; border: 1px solid var(--band-line); background: var(--band); color: var(--band-fg); border-radius: 6px; overflow: hidden; }
.demo-bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 14px; border-bottom: 1px solid var(--band-line); font-family: var(--f-data); font-size: 0.75rem; color: var(--band-sub); }
.demo-bar .pname { color: var(--band-fg); font-weight: 500; }
.demo-bar .flag { margin-left: auto; border: 1px solid var(--band-line); padding: 2px 8px; border-radius: 99px; }
.demo-map { position: relative; min-width: 0; background: color-mix(in srgb, var(--band) 92%, var(--band-fg)); }
.demo-map svg { display: block; width: 100%; height: auto; }
.demo-side { border-left: 1px solid var(--band-line); display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.layers { padding: 14px; border-bottom: 1px solid var(--band-line); display: grid; gap: 4px; }
.layers h4, .inspect h4 { font-family: var(--f-data); font-size: 0.6875rem; font-weight: 500; color: var(--band-sub); letter-spacing: 0.06em; margin-bottom: 6px; }
.layer { display: grid; grid-template-columns: 18px 14px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 4px; border-radius: 4px; cursor: pointer; font-size: 0.875rem; }
.layer:hover { background: color-mix(in srgb, var(--band-fg) 7%, transparent); }
.layer input { margin: 0; accent-color: var(--band-ochre); width: 16px; height: 16px; }
.layer .sw { width: 12px; height: 12px; border-radius: 2px; }
.layer .n { font-family: var(--f-data); font-size: 0.6875rem; color: var(--band-sub); }
.inspect { padding: 14px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.inspect dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; font-size: 0.8125rem; }
.inspect dt { font-family: var(--f-data); color: var(--band-sub); font-size: 0.75rem; }
.inspect dd { margin: 0; font-family: var(--f-data); font-size: 0.8125rem; overflow-wrap: anywhere; }
.inspect .title { font-size: 1rem; font-weight: 500; }
.inspect .hint { font-size: 0.8125rem; color: var(--band-sub); }
.demo-foot { grid-column: 1 / -1; border-top: 1px solid var(--band-line); padding: 12px 14px; overflow-x: auto; }
.demo-foot table { min-width: 560px; font-size: 0.8125rem; }
.demo-foot th { color: var(--band-sub); }
.demo-foot th, .demo-foot td { border-color: var(--band-line); padding: 7px 14px 7px 0; }
.demo-foot tr[aria-selected="true"] td { color: var(--band-ochre); }
.demo-foot tbody tr { cursor: pointer; }
.demo svg .topo-minor path { fill: none; stroke: var(--band-line); stroke-width: 0.8; }
.demo svg .topo-index path { fill: none; stroke: var(--band-sub); stroke-opacity: .45; stroke-width: 1; }
.demo svg .lease { fill: none; stroke: var(--band-fg); stroke-width: 1.4; stroke-dasharray: 7 4; }
.demo svg .alt path { fill: var(--data-alt); fill-opacity: .14; stroke: var(--data-alt); stroke-width: 1.2; }
.demo svg .alt path.core { fill-opacity: .26; }
.demo svg .mag line { stroke: var(--data-mag); stroke-opacity: .5; stroke-width: 1; }
.demo svg .mag circle { fill: var(--data-mag); }
.demo svg .soil circle { stroke: var(--band); stroke-width: 0.8; cursor: pointer; }
.demo svg .holes line { stroke: var(--band-fg); stroke-width: 1.6; }
.demo svg .holes circle { fill: var(--band); stroke: var(--band-fg); stroke-width: 2; cursor: pointer; }
.demo svg .sel { stroke: var(--band-ochre) !important; stroke-width: 2.4 !important; }
.demo svg text { font-family: var(--f-data); font-size: 11px; fill: var(--band-sub); }
.demo svg .hit { fill: transparent; cursor: pointer; }
@media (max-width: 980px) { .demo { grid-template-columns: minmax(0, 1fr); } .demo-side { border-left: 0; border-top: 1px solid var(--band-line); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto; } .layers { border-bottom: 0; border-right: 1px solid var(--band-line); } }
@media (max-width: 600px) { .demo-side { grid-template-columns: minmax(0, 1fr); } .layers { border-right: 0; border-bottom: 1px solid var(--band-line); } }

.minimap { border: 1px solid var(--band-line); border-radius: 6px; overflow: hidden; display: grid; }
.minimap svg { display: block; width: 100%; height: auto; background: color-mix(in srgb, var(--band) 92%, var(--band-fg)); }
.minimap .cap { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 14px; border-top: 1px solid var(--band-line); font-family: var(--f-data); font-size: 0.75rem; color: var(--band-sub); }

/* modules */
.modules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.modules > div { padding: 24px 28px 28px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }
.modules > div:not(:nth-child(3n)) { border-right: 1px solid var(--line); }
.modules > div:not(:nth-child(3n+1)) { padding-left: 28px; }
.modules h3 { font-size: var(--s1); }
.modules p { color: var(--stone); font-size: 0.9375rem; }
@media (max-width: 900px) {
  .modules { grid-template-columns: minmax(0, 1fr); }
  .modules > div { border-right: 0 !important; padding-left: 0 !important; }
}
.formats { display: flex; flex-wrap: wrap; gap: 8px; }
.formats span { font-family: var(--f-data); font-size: 0.75rem; border: 1px solid var(--line); padding: 4px 9px; border-radius: 3px; background: var(--surface); }

/* forms */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field label, .field legend { font-size: 0.875rem; font-weight: 450; }
.field .opt { color: var(--stone); font-weight: 340; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-bottom-color: var(--stone); border-radius: 3px; padding: 11px 12px; width: 100%; min-height: 44px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 8px 12px; border-radius: 3px; font-size: 0.875rem; cursor: pointer; background: var(--surface); }
.checks input { accent-color: var(--ochre); width: 16px; height: 16px; margin: 0; }
.err { color: #B3261E; font-size: 0.8125rem; }
:root[data-theme="dark"] .err { color: #F2A29B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .err { color: #F2A29B; } }
.outbox { border: 1px solid var(--ink); background: var(--surface); padding: 20px; display: grid; gap: 14px; }
.outbox pre { margin: 0; white-space: pre-wrap; font-family: var(--f-data); font-size: 0.8125rem; background: var(--paper); border: 1px solid var(--line); padding: 14px; max-height: 320px; overflow: auto; }
.outbox .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 640px) { .form { grid-template-columns: minmax(0, 1fr); } }

.contact-lines { display: grid; border-top: 1px solid var(--ink); }
.contact-lines > div { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding-block: 16px; border-bottom: 1px solid var(--line); }
.contact-lines .k { font-family: var(--f-data); font-size: 0.75rem; color: var(--stone); }
.contact-lines .v { font-size: var(--s1); overflow-wrap: anywhere; }
.copy { font: 500 0.8125rem/1 var(--f-text); background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 3px; padding: 8px 10px; cursor: pointer; min-height: 36px; }
.copy:hover { border-color: var(--ink); }
@media (max-width: 560px) { .contact-lines > div { grid-template-columns: minmax(0, 1fr) auto; } .contact-lines .k { grid-column: 1 / -1; } }

/* closing call to action */
.cta { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px 56px; align-items: end; }
.cta .actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
@media (max-width: 820px) { .cta { grid-template-columns: minmax(0, 1fr); } .cta .actions { justify-content: flex-start; } }

/* footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-block: 40px 48px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); gap: 32px; font-size: 0.875rem; }
.site-footer .logo-svg { height: 30px; width: auto; color: var(--ink); }
.site-footer nav { display: grid; gap: 6px; align-content: start; }
.site-footer nav a { text-decoration: none; color: var(--stone); }
.site-footer nav a:hover { color: var(--ochre-text); }
.site-footer .sheet { font-family: var(--f-data); font-size: 0.75rem; color: var(--stone); display: grid; gap: 4px; align-content: start; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: minmax(0, 1fr); } }

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

/* License map viewer */
.fig .frame.contain img { object-fit: contain; }
.mapview { display: grid; gap: 16px; }
.mv-tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--ink); }
.mv-tabs button { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 12px 18px 12px 0; margin-right: 22px; font: inherit; font-size: var(--s-1); color: var(--stone); cursor: pointer; display: inline-flex; gap: 10px; align-items: baseline; }
.mv-tabs button .mono { font-size: 0.75rem; }
.mv-tabs button:hover { color: var(--ink); }
.mv-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ochre); }
.mv-tabs button:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }
.mv-pic { position: relative; display: grid; }
.mv-stage { position: relative; display: grid; border: 1px solid var(--ink); background: var(--surface); padding: clamp(8px, 2vw, 20px); }
.mv-layer { grid-area: 1 / 1; width: 100%; height: auto; opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility 0s linear .35s; }
.mv-layer.on { opacity: 1; visibility: visible; transition: opacity .35s ease; }
.mv-key { position: absolute; top: clamp(12px, 3vw, 28px); right: clamp(12px, 2.5vw, 28px); width: min(36%, 300px); display: grid; gap: 12px; justify-items: end; color: var(--ink); }
.mv-north { display: grid; justify-items: center; gap: 2px; font-family: var(--f-data); font-size: 0.75rem; color: var(--stone); }
.mv-key .mv-legend { width: 100%; display: none; border-top: 1px solid var(--ink); padding-top: 10px; }
.mv-key .mv-legend.on { display: grid; gap: 8px; }
.mv-key h4 { font-size: 0.8125rem; font-weight: 500; }
.mv-key ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.8125rem; color: var(--stone); }
.mv-key li { display: flex; align-items: center; gap: 10px; }
.mv-key li i { width: 14px; height: 10px; flex: none; }
.mv-key li i.ln { height: 2px; }
.mv-key .ramp { height: 10px; background: linear-gradient(90deg, #6a176e, #bc3754, #f98e09, #fcffa4); }
.mv-key .ramp-ends { display: flex; justify-content: space-between; font-family: var(--f-data); font-size: 0.6875rem; color: var(--stone); }
.mv-scale { position: absolute; left: 1%; bottom: 1%; width: 12.63%; min-width: 0; display: grid; gap: 4px; }
.mv-scale .bar { height: 6px; border: 1px solid var(--stone); background: repeating-linear-gradient(90deg, var(--stone) 0 20%, transparent 20% 40%); }
.mv-scale .lbl { display: flex; justify-content: space-between; font-family: var(--f-data); font-size: 0.6875rem; color: var(--stone); }
.mv-notes p { display: none; max-width: 68ch; font-size: var(--s-1); color: var(--stone); }
.mv-notes p.on { display: block; }
.mv-notes b { color: var(--ink); font-weight: 500; }
@media (max-width: 760px) {
  .mv-key { position: static; width: auto; justify-items: start; padding-top: 14px; }
  .mv-north { display: none; }
  .mv-scale .lbl { justify-content: flex-start; white-space: nowrap; }
  .mv-scale .lbl span:first-child { display: none; }
  .mv-tabs button { margin-right: 14px; }
}
