/* mtn.7 site layer. Loads after design-system/tokens.css and components.css; every colour, font and space comes from those tokens. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 26px; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; padding: var(--space-2) var(--space-4); background: var(--lime); color: var(--on-lime); border-radius: var(--radius-md); font-weight: 600; }
.skip:focus { top: 12px; }

/* Header + navigation. The design system hides .m7-nav under 640px; here it becomes a second row so the three pages stay one tap away. */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
.m7-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; flex-wrap: wrap;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.m7-wordmark span { letter-spacing: .2em; }
.m7-nav a { padding: var(--space-2) 0; border-bottom: 2px solid transparent; }
.m7-nav a[aria-current] { color: var(--ink); border-bottom-color: var(--lime); font-weight: 600; }
@media (max-width: 640px) {
  .m7-header { padding-block: var(--space-2) 0; row-gap: var(--space-1); }
  .m7-nav { display: flex; width: 100%; gap: 0; justify-content: space-between; font-size: 14px; }
  .m7-nav a { flex: 1; text-align: center; padding: var(--space-2) var(--space-1) 10px; }
}

/* Layout */
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.section { padding-block: var(--space-16); }
.section--tight { padding-block: var(--space-12); }
.section--cloud { background: var(--cloud); }
.section--storm { background: var(--storm); color: var(--on-storm); }
.section--storm a { color: var(--on-storm); }
.section-head { display: grid; gap: var(--space-2); margin-bottom: var(--space-8); max-width: 72ch; }
.section-head h2 { margin: 0; font: 800 clamp(36px, 5vw, 56px)/.95 var(--font-display); text-wrap: balance; }
.section-head p { margin: 0; color: var(--ink-muted); font-size: 18px; line-height: 28px; }
.section--storm .section-head p { color: rgba(255,255,255,.82); }
.eyebrow { font: 700 13px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.section--storm .eyebrow { color: var(--sky); }
h3 { font: 700 28px/1.05 var(--font-display); margin: 0; }
.prose { max-width: 70ch; }
.prose p { margin: 0 0 var(--space-4); }
.muted { color: var(--ink-muted); }
.data { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: var(--space-4); }

/* Tags and notices */
.tag { display: inline-block; font: 700 11px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; padding: 2px var(--space-2); border-radius: var(--radius-sm); background: var(--sky); color: var(--on-lime); white-space: nowrap; }
.tag--lime { background: var(--lime); }
.tag--lilac { background: var(--lilac); }
.tag--outline { background: transparent; color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.tag--storm { background: var(--storm); color: var(--on-storm); }
.notice { display: grid; gap: var(--space-1); padding: var(--space-4); border-radius: var(--radius-md); background: var(--cloud); border-left: 4px solid var(--storm-violet); font-size: 15px; line-height: 23px; }
.notice strong { font-weight: 700; }
.notice--warn { background: color-mix(in srgb, var(--surface) 72%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-left: 0; border: 1px solid rgb(255 255 255 / .7); box-shadow: 0 6px 20px rgb(20 30 50 / .14), 0 1px 3px rgb(20 30 50 / .08); }
.notice--flag { border-left-color: var(--lilac); }
.status-unconfirmed { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 700; }
.status-unconfirmed::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--caution); }

/* Source / verification line */
.src { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin: 0; font-size: 13px; line-height: 20px; color: var(--ink-muted); }
.src a { color: inherit; }
.src a:hover { color: var(--link); }
.src time { font-family: var(--font-mono); }

/* Fact list */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.facts > div { background: var(--surface); padding: var(--space-3) var(--space-4); min-width: 0; }
.facts dt { font: 700 12px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.facts dd { margin: var(--space-1) 0 0; font: 500 18px/26px var(--font-mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.facts dd small { display: block; font: 400 12px/16px var(--font-sans); color: var(--ink-muted); }

/* Elevation provenance markers */
.elev-pub, .elev-dem { white-space: nowrap; }
.elev-pub::after, .elev-dem::after { margin-left: 6px; font: 700 10px/1 var(--font-sans); letter-spacing: .06em; padding: 2px 5px; border-radius: var(--radius-sm); vertical-align: 3px; }
.elev-pub::after { content: none; }
.elev-dem::after { content: "≈ DEM"; background: var(--cloud); color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* Segmented control */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); overflow: hidden; background: var(--surface); }
.seg button { font: 600 13px/1 var(--font-sans); padding: 8px 12px; min-height: 32px; background: transparent; color: var(--ink); border: 0; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--storm); color: var(--on-storm); }

/* External link */
.ext { font-weight: 600; text-decoration: none; }
.ext:hover { text-decoration: underline; }
.ext::after { content: " ↗"; }

/* Footer */
.foot { padding-block: var(--space-12) var(--space-16); background: var(--slate); color: var(--on-slate); font-size: 14px; line-height: 22px; }
.foot a { color: var(--on-slate); }
.foot__grid { display: grid; gap: var(--space-8); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.foot h2 { margin: 0 0 var(--space-2); font: 700 13px/16px var(--font-sans); letter-spacing: .08em; text-transform: uppercase; color: var(--sky); }
.foot p { margin: 0 0 var(--space-2); color: rgba(241,243,246,.78); }
.foot ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-1); }
.foot .m7-wordmark { color: var(--on-slate); margin-bottom: var(--space-3); }
.foot .m7-wordmark span { color: rgba(241,243,246,.7); }

/* Loading / unavailable / stale states, shared by every live panel */
.state { display: flex; align-items: center; gap: var(--space-2); font: 600 13px/18px var(--font-sans); color: var(--ink-muted); }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.state--live::before { background: var(--flyable); }
.state--stale::before { background: var(--caution); }
.state--down::before { background: var(--grounded); }
.state--off::before { background: transparent; border: 2px solid var(--line-strong); }
.state--loading::before { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .state--loading::before { animation: none; } }
.skeleton { background: linear-gradient(90deg, var(--surface-sunken), var(--cloud), var(--surface-sunken)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius-sm); min-height: 1em; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* Glass buttons */
.m7-btn--primary, .m7-btn--secondary { -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid rgb(255 255 255 / .55); box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), inset 0 -1px 0 rgb(0 0 0 / .06), 0 4px 14px rgb(20 30 50 / .14); }
.m7-btn--primary { background: linear-gradient(180deg, rgb(234 240 140 / .9), rgb(221 230 79 / .72)); color: #263247; }
.m7-btn--secondary { background: linear-gradient(180deg, rgb(64 78 112 / .9), rgb(38 50 71 / .84)); color: #fff; border-color: rgb(255 255 255 / .35); }
.m7-btn--primary:hover, .m7-btn--secondary:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / .65), 0 6px 18px rgb(20 30 50 / .2); }
.m7-btn--sky { background: linear-gradient(180deg, rgb(196 222 244 / .92), rgb(158 201 232 / .82)); color: var(--on-lime); border: 1px solid rgb(255 255 255 / .7); -webkit-backdrop-filter: blur(10px) saturate(160%); backdrop-filter: blur(10px) saturate(160%); box-shadow: inset 0 1px 0 rgb(255 255 255 / .6), 0 4px 14px rgb(20 30 50 / .12); }
.m7-btn--sky:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgb(255 255 255 / .7), 0 6px 18px rgb(20 30 50 / .18); }
.m7-btn--sm { min-height: 0; padding: 4px 12px; font-size: 14px; line-height: 20px; }

/* Logo mark beside the wordmark. The mask keeps the mark one colour, set per context. */
.m7-wordmark { grid-template-columns: auto auto; column-gap: 10px; align-items: center; justify-content: start; }
.m7-wordmark::before { content: ""; grid-row: 1 / span 2; width: 46px; height: 35px; transform: translateY(-2px); background: var(--storm);
  -webkit-mask: url(../img/logo.svg) center / contain no-repeat; mask: url(../img/logo.svg) center / contain no-repeat; }
.m7-wordmark b, .m7-wordmark span { grid-column: 2; }
.foot .m7-wordmark::before { background: #DDE64F; }
:root[data-theme="dark"] .m7-wordmark::before { background: #DDE64F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .m7-wordmark::before { background: #DDE64F; } }
