/* TrailAR homepage — topo-map vernacular: map paper, brown contours, blue grid, orange route. */

@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('/fonts/barlow-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url('/fonts/barlow-semi-condensed-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url('/fonts/barlow-semi-condensed-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --paper: #e8ede6;
  --paper-deep: #dde5da;
  --ink: #1e2a26;
  --ink-soft: #46544e;
  --contour: #a8794f;
  --grid: #5c84ae;
  --track: #ff7a00;
  --off: #d4351c;
  --measure: 62ch;
  --display: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;
  --text: 'Barlow', system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.125rem/1.6 var(--text); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--grid); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--track); }
:focus-visible { outline: 3px solid var(--grid); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.6rem, 6.2vw, 4.9rem); letter-spacing: -0.02em; max-width: 13ch; }
h2 { font-size: clamp(2rem, 3.6vw, 2.8rem); margin-bottom: 0.4em; }
h3 { font-size: 1.4rem; font-weight: 600; line-height: 1.2; margin-bottom: 0.35em; }
p { margin: 0 0 1em; max-width: var(--measure); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 10px;
  font: 600 1.05rem/1 var(--text); text-decoration: none; white-space: nowrap; }
.btn-go { background: var(--track); color: var(--ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.btn-go:hover { background: #ff8c22; }
.btn-quiet { color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-quiet:hover { background: rgba(30, 42, 38, 0.06); }

/* ---------- Header ---------- */
.top { display: flex; align-items: center; gap: 28px; padding: 18px var(--gutter); }
.brand img { width: 152px; }
.top nav { display: flex; gap: 24px; margin-left: auto; font-weight: 500; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; text-decoration-color: var(--track); }
.top .btn { min-height: 42px; padding: 0 16px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); gap: clamp(28px, 5vw, 72px); align-items: center;
  padding: clamp(24px, 5vw, 56px) var(--gutter) clamp(48px, 7vw, 96px); }
.lede { font-size: 1.3rem; line-height: 1.5; margin-top: 0.9em; max-width: 34ch; color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6em 0 1.2em; }
.fine { font-size: 0.95rem; color: var(--ink-soft); max-width: 46ch; }

.hero-map { margin: 0; border-radius: 8px; box-shadow: 0 0 0 1px rgba(30, 42, 38, 0.18), 0 18px 40px -24px rgba(30, 42, 38, 0.5); background: #edf1ea; }
.hero-map svg { display: block; width: 100%; height: auto; border-radius: 8px; }
.hero-map .paper { fill: #edf1ea; }
.hero-map .c { fill: none; stroke: var(--contour); stroke-opacity: 0.55; stroke-width: 1; }
.hero-map .ci { fill: none; stroke: var(--contour); stroke-opacity: 0.85; stroke-width: 1.8; }
.hero-map .creek { fill: none; stroke: #3d7cc2; stroke-width: 2.4; stroke-linecap: round; opacity: 0.8; }
.hero-map .g { stroke: var(--grid); stroke-opacity: 0.35; stroke-width: 1; }
.hero-map .gl { fill: var(--grid); font: 600 11px var(--text); }
.hero-map .track-shadow { fill: none; stroke: #fff; stroke-opacity: 0.7; stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; }
.hero-map .track { fill: none; stroke: var(--track); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.hero-map .trig { fill: var(--ink); }
.hero-map .halo { fill: #0a84ff; fill-opacity: 0.18; }
.hero-map .dot { fill: #0a84ff; stroke: #fff; stroke-width: 3; }
.hero-map .viewfinder path { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.hero-map .sign rect { fill: var(--track); stroke: #fff; stroke-width: 2.5; }
.hero-map .sign path { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }

/* The one moment: the route draws itself up the spur, then the AR frame snaps around it. */
@media (prefers-reduced-motion: no-preference) {
  .hero-map .track, .hero-map .track-shadow { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(.45, .05, .3, 1) .3s forwards; }
  .hero-map .trig, .hero-map .sign { opacity: 0; animation: appear .4s ease-out 2.6s forwards; }
  .hero-map .viewfinder { opacity: 0; transform-origin: 310px 314px; transform: scale(1.25); animation: snap .45s cubic-bezier(.2, .9, .3, 1.2) 2.85s forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }
@keyframes snap { to { opacity: 1; transform: scale(1); } }

/* ---------- Sections ---------- */
main > section { padding: clamp(48px, 7vw, 96px) var(--gutter); }
.section-lede { color: var(--ink-soft); margin-bottom: 2em; }

/* Legend: like the key in the margin of a topo sheet */
.legend { background: var(--paper-deep); border-top: 1px solid rgba(30, 42, 38, 0.15); border-bottom: 1px solid rgba(30, 42, 38, 0.15); }
.legend dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 56px; margin: 0; max-width: 1100px; }
.legend dl > div { display: grid; grid-template-columns: 72px 1fr; column-gap: 18px; align-items: start; }
.legend dt { grid-column: 1 / -1; display: contents; font: 600 1.2rem/1.25 var(--display); }
.legend dt svg { grid-row: 1 / span 2; width: 64px; height: 32px; margin-top: 2px; }
.legend dd { grid-column: 2; margin: 4px 0 0; color: var(--ink-soft); }
.sym-track { fill: none; stroke: var(--track); stroke-width: 5; stroke-linecap: round; }
.sym-sign { fill: var(--track); }
.sym-sign-arrow { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sym-off { fill: none; stroke: var(--off); stroke-width: 2.5; stroke-dasharray: 4 3; }
.sym-you { fill: #0a84ff; stroke: #fff; stroke-width: 2; }
.sym-profile { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.sym-you-line { stroke: var(--track); stroke-width: 3; }
.sym-box { fill: var(--ink); }
.sym-box-line { stroke: var(--paper); stroke-width: 3; stroke-linecap: round; }
.sym-grid { stroke: var(--grid); stroke-width: 1.5; stroke-opacity: .7; fill: none; }
.sym-contour { fill: none; stroke: var(--contour); stroke-width: 2.5; stroke-linecap: round; }

/* How it works */
.how { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 24px 64px; align-items: start; }
.how h2 { grid-column: 1 / -1; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 26px 64px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -4px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font: 700 1.35rem/1 var(--display); background: var(--ink); color: var(--paper); }
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 21px; top: 46px; bottom: 6px; border-left: 2px dashed var(--track); }
.screens { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 0; }
.screens figure { margin: 0; }
.screens img { border-radius: 22px; border: 6px solid var(--ink); background: var(--ink); box-shadow: 0 16px 30px -22px rgba(30, 42, 38, .7); }
.screens figcaption { font-size: 0.92rem; color: var(--ink-soft); margin-top: 10px; line-height: 1.35; }

/* Leaders */
.leaders { border-top: 1px solid rgba(30, 42, 38, 0.15); }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; max-width: 1200px; }
.cols p { font-size: 1.05rem; }

/* Safety: the one dark band */
.safety { background: var(--ink); color: var(--paper); }
.safety-inner { max-width: 760px; }
.safety p { color: #c9d3cb; }
.safety ul { margin: 0 0 1.4em; padding-left: 1.2em; max-width: var(--measure); }
.safety li { margin-bottom: 0.55em; }
.safety li::marker { color: var(--track); }
.safety .emergency { display: inline-block; color: var(--paper); border-left: 4px solid var(--off); padding: 6px 0 6px 14px; margin: 0; }

/* Support table */
.support table { border-collapse: collapse; width: 100%; max-width: 900px; font-size: 1.02rem; }
.support th, .support td { text-align: left; padding: 12px 14px; border-bottom: 1px solid rgba(30, 42, 38, 0.18); vertical-align: top; }
.support thead th { font: 600 1rem/1.3 var(--display); color: var(--ink-soft); border-bottom: 2px solid var(--ink); }
.support tbody th { font-weight: 600; }

/* Footer */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; background: #16201d; color: #c9d3cb; padding: 36px var(--gutter); }
.foot img { width: 132px; }
.foot p { margin: 0; font-size: 0.95rem; }
.foot .credits { flex-basis: 100%; order: 3; font-size: 0.85rem; color: #93a199; }
.foot .btn { margin-left: auto; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
  .top nav { display: none; }
  .top .btn { margin-left: auto; }
  .hero { grid-template-columns: 1fr; }
  .hero-map { max-width: 560px; }
  .legend dl, .cols { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 1.05rem; }
  .screens { grid-template-columns: repeat(3, 70%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
  .screens figure { scroll-snap-align: start; }
  .support th, .support td { padding: 10px 8px; font-size: 0.95rem; }
  .foot .btn { margin-left: 0; }
}
