:root {
  --paper: #EEF0EA;
  --map: #F7F8F3;
  --surface: #FFFFFF;
  --ink: #18231E;
  --muted: #59665F;
  --line: #CDD4C8;
  --grid: #E0E5DA;
  --contour: #BCC6B3;
  --contour-index: #93A08A;
  --orange: #E8590C;
  --orange-ink: #B4410A;
  --orange-soft: rgba(232, 89, 12, .14);
  --deep: #18231E;
  --deep-ink: #EDF1EA;
  --deep-muted: #AEBAB1;
  --focus: #1F6FEB;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101714;
    --map: #131C18;
    --surface: #18221D;
    --ink: #E4EAE2;
    --muted: #9AA79F;
    --line: #2A3630;
    --grid: #1A2420;
    --contour: #2A3832;
    --contour-index: #415148;
    --orange: #FF7A2F;
    --orange-ink: #FF9452;
    --orange-soft: rgba(255, 122, 47, .16);
    --deep: #0B110E;
    --focus: #7EA6FF;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px; line-height: 1.6;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
code { font-size: .9em; background: var(--orange-soft); padding: 1px 6px; border-radius: 5px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--orange); color: #fff; padding: 10px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 12px; }
.display, h1, .section-head h2, .contact h2, .stop-panel h2 { font-family: 'Bricolage Grotesque', 'Atkinson Hyperlegible', sans-serif; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 11px 20px; border-radius: 999px; font-weight: 700; text-decoration: none; border: 1.5px solid transparent; transition: background .15s, border-color .15s, transform .15s; }
.btn.primary { background: var(--orange); color: #fff; }
.btn.primary:hover { transform: translateY(-1px); }
.btn.outline { border-color: var(--ink); }
.btn.outline:hover { background: var(--ink); color: var(--paper); }
.btn.ghost { border-color: rgba(237, 241, 234, .4); color: var(--deep-ink); }
.btn.ghost:hover { border-color: var(--deep-ink); }
.btn.soon { border: 1.5px dashed var(--line); color: var(--muted); font-weight: 400; }

/* Header */
.site { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.brand-mark { width: 22px; height: 20px; fill: var(--orange); }
.site nav { display: flex; gap: 24px; }
.site nav a { white-space: nowrap; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 16px; }
.site nav a:hover { color: var(--ink); }

/* Intro */
.intro { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 56px; align-items: end; padding-top: 72px; padding-bottom: 40px; }
h1 { font-weight: 800; font-size: clamp(42px, 6vw, 78px); line-height: .98; letter-spacing: -.035em; max-width: 15ch; }
.lede { margin-top: 26px; font-size: 20px; color: var(--muted); max-width: 54ch; }
.now { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; }
.now h2 { font-size: 15px; font-weight: 700; color: var(--orange-ink); display: flex; align-items: center; gap: 8px; }
.now h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.now dl { margin: 12px 0 0; }
.now dl div { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.now dt { color: var(--muted); font-size: 15px; }
.now dd { margin: 0; font-weight: 700; font-size: 16px; }

/* Map */
.route { padding-bottom: 96px; }
.map-card { background: var(--map); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
#map { display: block; width: 100%; height: auto; }
.noscript { padding: 40px; color: var(--muted); }
.grid line { stroke: var(--grid); stroke-width: 1; }
.grid-label { fill: var(--muted); font-size: 11px; opacity: .7; }
.contour { fill: none; stroke: var(--contour); stroke-width: 1; }
.contour.index { stroke: var(--contour-index); stroke-width: 1.6; }
.north path { fill: var(--ink); }
.north text { fill: var(--ink); font-weight: 700; font-size: 14px; }
.sheet rect { fill: var(--map); stroke: var(--ink); stroke-width: 1.2; }
.sheet-title { fill: var(--ink); font-family: 'Bricolage Grotesque', sans-serif; font-weight: 800; font-size: 17px; }
.sheet-sub { fill: var(--muted); font-size: 13px; }
.route-ahead { fill: none; stroke: var(--orange); stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; opacity: .8; }
.route-done { fill: none; stroke: var(--orange); stroke-width: 5; stroke-linecap: round; }
.route-done.draw { transition: stroke-dashoffset 1.6s cubic-bezier(.45, .05, .25, 1); }
.stop { cursor: pointer; outline: none; }
.stop .hit { fill: transparent; }
.stop .sel-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0; transition: opacity .2s; }
.stop.selected .sel-ring, .stop:focus-visible .sel-ring { opacity: 1; }
.stop:focus-visible .sel-ring { stroke: var(--focus); stroke-dasharray: none; stroke-width: 2.5; }
.stop-label { fill: var(--ink); font-weight: 700; font-size: 16px; paint-order: stroke; stroke: var(--map); stroke-width: 5px; stroke-linejoin: round; }
.stop.next .stop-label { fill: var(--muted); }
.mk { stroke-width: 2.4; stroke-linejoin: round; }
.mk.done { fill: var(--orange); stroke: var(--orange); }
.mk.current { fill: var(--orange); stroke: var(--ink); }
.mk.next { fill: var(--map); stroke: var(--orange); }
.pulse { fill: var(--orange-soft); stroke: var(--orange); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }

.profile-wrap { border-top: 1px solid var(--line); padding: 14px 24px 18px; }
.profile-label { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
#profile { display: block; width: 100%; height: 70px; }
.prof-area { fill: var(--grid); }
.prof-done { fill: var(--orange-soft); }
.prof-line { fill: none; stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.prof-tick { stroke: var(--orange); stroke-width: 3; vector-effect: non-scaling-stroke; }

.route-detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 40px; margin-top: 28px; align-items: start; }
.stop-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px 30px; min-height: 260px; }
.chip { display: inline-block; font-size: 14px; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--orange-soft); color: var(--orange-ink); }
.chip.next { background: var(--grid); color: var(--muted); }
.stop-panel h2 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-top: 14px; }
.stop-panel > p:not(.chip) { margin-top: 12px; color: var(--muted); max-width: 60ch; }
.stop-panel h3 { font-size: 15px; margin-top: 20px; }
.stop-panel ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.stop-panel li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 15px; }
.small-head { font-size: 15px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.stops { list-style: none; padding: 0; margin: 0; }
.stops button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.stops button:hover { background: var(--surface); }
.stops button[aria-pressed="true"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; }
.stops svg, .legend svg { width: 18px; height: 16px; flex: none; overflow: visible; }
.legend { list-style: none; padding: 0; margin: 16px 0 0 12px; display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }

/* Sections */
.section { padding: 96px 0; border-top: 1px solid var(--line); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 56px; align-items: start; }
.section-head { max-width: 560px; }
.workshop .section-head { margin-bottom: 40px; }
.section-head h2 { font-size: 52px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.section-head p { margin-top: 14px; color: var(--muted); font-size: 19px; }

.log { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 2px dashed var(--orange); }
.entry { position: relative; padding: 0 0 34px; }
.entry::before { content: ""; position: absolute; left: -35px; top: 6px; width: 16px; height: 14px; background: var(--orange); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.entry.more { padding-bottom: 0; color: var(--muted); }
.entry.more::before { background: var(--line); }
.entry-meta { display: flex; gap: 12px; align-items: center; font-size: 15px; color: var(--muted); }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 0 10px; font-size: 14px; }
.entry h3 { font-size: 23px; margin-top: 4px; }
.entry h3 a { text-decoration-color: var(--orange); text-underline-offset: 4px; }
.entry p { margin-top: 6px; color: var(--muted); max-width: 62ch; }

.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tool { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.tool-icon { width: 44px; height: 44px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.tool-icon .fill { fill: var(--orange); stroke: var(--orange); }
.tool.live .tool-icon { stroke: var(--orange); }
.tool h3 { font-size: 23px; }
.tool > p:not(.status) { color: var(--muted); font-size: 17px; flex: 1; }
.tool .btn { margin-top: 10px; }
.status { font-size: 14px; font-weight: 700; color: var(--muted); }
.tool.live { border: 2px solid var(--orange); }
.tool.live .status { color: var(--orange-ink); }
.tool.planned { background: transparent; border-style: dashed; }
.tool.suggest { background: transparent; border-color: transparent; justify-content: center; }

.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px; }
.rules li { position: relative; padding-left: 40px; }
.rules li::before { content: ""; position: absolute; left: 0; top: 6px; width: 20px; height: 18px; background: var(--orange); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.rules h3 { font-size: 22px; }
.rules p { margin-top: 4px; color: var(--muted); }

.contact { position: relative; background: var(--deep); color: var(--deep-ink); padding: 110px 0 96px; overflow: hidden; }
.contact-inner { position: relative; max-width: 760px; }
.contact-art { position: absolute; right: -380px; top: -60px; width: 520px; fill: none; stroke: #3A4A41; stroke-width: 2; }
.contact-art .peak { fill: var(--orange); stroke: none; }
.contact h2 { font-size: 64px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.contact-inner > p:first-of-type { margin-top: 16px; font-size: 20px; color: var(--deep-muted); max-width: 48ch; }
.contact-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.contact .btn.primary { font-size: 19px; padding: 14px 26px; }
.contact .note { margin-top: 24px; font-size: 15px; color: var(--deep-muted); }

.foot { background: var(--deep); color: var(--deep-muted); border-top: 1px solid #26332C; font-size: 15px; }
.foot-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding-top: 22px; padding-bottom: 22px; }
.foot-links { display: flex; gap: 20px; }
.foot a:hover { color: var(--deep-ink); }

.notfound { min-height: 100vh; display: grid; place-items: center; }
.notfound h1 { max-width: 14ch; }
.notfound p { margin: 18px 0 28px; color: var(--muted); font-size: 20px; }

@media (max-width: 980px) {
  .intro, .route-detail, .two-col { grid-template-columns: 1fr; gap: 32px; }
  .tools { grid-template-columns: repeat(2, 1fr); }
  .contact-art { display: none; }
}
@media (max-width: 680px) {
  body { font-size: 17px; }
  .wrap { padding: 0 18px; }
  .site nav { gap: 14px; }
  .site nav a { font-size: 15px; }
  .site nav a[href="#logbook"] { display: none; }
  .intro { padding-top: 44px; padding-bottom: 32px; }
  .stop .mk { stroke-width: 3; }
  .lede { font-size: 18px; }
  .stop-label, .grid-label, .sheet { display: none; }
  .map-card { border-radius: 16px; }
  .profile-wrap { padding: 12px 14px 14px; }
  .stop-panel { padding: 22px 20px; }
  .stop-panel h2 { font-size: 28px; }
  .section { padding: 72px 0; }
  .section-head h2 { font-size: 42px; }
  .tools { grid-template-columns: 1fr; }
  .contact { padding: 80px 0; }
  .contact h2 { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pulse { animation: none; opacity: .6; }
  * { transition: none !important; }
}
