/* ==========================================================================
   Babí lom – trip page
   Seed: Czech hiking trail markers (white–red–white), forest ink, autumn amber.
   ========================================================================== */

@layer reset, tokens, base, components, sections, utilities;

/* ---------- reset ---------- */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, svg, iframe { display: block; max-width: 100%; }
  button, input { font: inherit; color: inherit; }
  button { cursor: pointer; background: none; border: 0; padding: 0; }
  ul, ol { padding: 0; list-style: none; }
  fieldset { border: 0; padding: 0; min-width: 0; }
}

/* ---------- tokens ---------- */
@layer tokens {
  :root {
    --paper: #f5f2eb;
    --paper-2: #ece7dc;
    --surface: #fffdf9;
    --ink: #142019;
    --ink-2: #33423a;
    --muted: #66726b;
    --line: #ddd6c8;
    --line-2: #e8e2d6;

    --forest: #14281d;
    --forest-2: #1d3a2a;
    --moss: #3d6b4f;
    --sage: #a9bfa9;
    --trail: #d64531;           /* KČT red */
    --trail-soft: #f6dcd6;
    --amber: #e0a23a;            /* November beech */
    --amber-soft: #f6e6c6;

    --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
    --f-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

    --step--1: clamp(.82rem, .8rem + .1vw, .88rem);
    --step-0: clamp(1rem, .96rem + .2vw, 1.0625rem);
    --step-1: clamp(1.15rem, 1.08rem + .35vw, 1.3rem);
    --step-2: clamp(1.4rem, 1.25rem + .7vw, 1.8rem);
    --step-3: clamp(1.9rem, 1.5rem + 1.8vw, 3rem);
    --step-4: clamp(2.4rem, 1.7rem + 3.2vw, 4.4rem);
    --step-hero: clamp(4.2rem, 2rem + 11vw, 11.5rem);

    --r-sm: 10px;
    --r: 18px;
    --r-lg: 28px;
    --shadow: 0 1px 2px rgb(20 32 25 / .06), 0 8px 24px -8px rgb(20 32 25 / .12);
    --shadow-lg: 0 2px 4px rgb(20 32 25 / .06), 0 24px 60px -20px rgb(20 32 25 / .3);
    --wrap: 1200px;
    --gutter: clamp(16px, 4vw, 40px);
    --section: clamp(72px, 9vw, 136px);
    --ease: cubic-bezier(.2, .7, .2, 1);
    --topbar-h: 64px;
  }
}

/* ---------- base ---------- */
@layer base {
  html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 12px); }
  @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

  body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: var(--step-0);
    line-height: 1.6;
    font-feature-settings: "ss01", "cv11";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: clip;
  }

  h1, h2, h3 {
    font-family: var(--f-display);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.025em;
    font-variation-settings: "opsz" 96;
    text-wrap: balance;
  }
  h2 { font-size: var(--step-4); }
  h3 { font-size: var(--step-1); letter-spacing: -.01em; line-height: 1.2; font-variation-settings: "opsz" 24; }
  p { text-wrap: pretty; }
  a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
  b, strong { font-weight: 600; }
  ::selection { background: var(--amber); color: var(--ink); }
  :focus-visible { outline: 2px solid var(--trail); outline-offset: 3px; border-radius: 6px; }
}

/* ---------- components ---------- */
@layer components {
  .wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
  .mono { font-family: var(--f-mono); font-feature-settings: "tnum", "zero"; letter-spacing: -.01em; }
  .muted { color: var(--muted); }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .sprite { position: absolute; }

  .skip {
    position: fixed; left: 16px; top: -60px; z-index: 100;
    background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px;
    transition: top .2s var(--ease);
  }
  .skip:focus { top: 12px; }

  .ico {
    width: 1.1em; height: 1.1em; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  }
  .ico--accent { fill: var(--amber); stroke: var(--amber); }

  /* Trail marker: white–red–white */
  .mark {
    --h: 14px;
    display: inline-block; flex: none;
    width: calc(var(--h) * 1.45); height: var(--h);
    border-radius: 2px;
    background: linear-gradient(#fff 0 33.3%, var(--trail) 33.3% 66.6%, #fff 66.6%);
    box-shadow: 0 0 0 1px rgb(20 32 25 / .14);
  }
  .mark--sm { --h: 10px; }

  .eyebrow {
    display: inline-flex; align-items: center; gap: .6em;
    font-family: var(--f-mono); font-size: var(--step--1);
    text-transform: uppercase; letter-spacing: .08em;
    color: var(--moss);
  }
  .eyebrow--light { color: rgb(255 255 255 / .85); }

  /* Buttons */
  .btn {
    --bg: var(--surface); --fg: var(--ink); --bd: var(--line);
    display: inline-flex; align-items: center; justify-content: center; gap: .55em;
    min-height: 46px; padding: .7em 1.2em;
    border-radius: 999px; border: 1px solid var(--bd);
    background: var(--bg); color: var(--fg);
    font-weight: 550; font-size: .95rem; line-height: 1; text-decoration: none; white-space: nowrap;
    transition: transform .2s var(--ease), background-color .2s, box-shadow .2s, border-color .2s;
  }
  .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
  .btn:active { transform: translateY(0); }
  .btn--primary { --bg: var(--forest); --fg: #fff; --bd: var(--forest); }
  .btn--primary:hover { --bg: var(--forest-2); }
  .btn--ghost { --bg: transparent; }
  .btn--ghost:hover { --bg: var(--surface); }
  .btn--light { --bg: #fff; --fg: var(--forest); --bd: #fff; }
  .btn--glass {
    --bg: rgb(255 255 255 / .12); --fg: #fff; --bd: rgb(255 255 255 / .3);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .btn--glass:hover { --bg: rgb(255 255 255 / .2); }
  .btn--small { min-height: 38px; padding: .55em 1em; font-size: .88rem; }
  .btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

  .chip {
    display: inline-flex; align-items: center; gap: .55em;
    padding: .45em .9em; border-radius: 999px;
    font-size: var(--step--1); font-weight: 500;
  }
  .chip--glass {
    background: rgb(255 255 255 / .14); color: #fff; border: 1px solid rgb(255 255 255 / .25);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .chip .dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--amber);
    box-shadow: 0 0 0 0 rgb(224 162 58 / .7); animation: pulse 2.4s infinite;
  }
  @keyframes pulse { 70% { box-shadow: 0 0 0 9px rgb(224 162 58 / 0); } 100% { box-shadow: 0 0 0 0 rgb(224 162 58 / 0); } }

  .tags { display: flex; flex-wrap: wrap; gap: 8px; }
  .tags li {
    padding: .35em .8em; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line);
    font-size: var(--step--1);
  }
  .tags--warm li { background: rgb(255 255 255 / .55); border-color: rgb(20 32 25 / .1); }

  .card {
    position: relative;
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg);
    padding: clamp(22px, 3vw, 32px);
    display: flex; flex-direction: column; gap: 12px;
  }
  .card h3 { font-size: var(--step-2); }
  .card__icon {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
    background: var(--paper); color: var(--moss); font-size: 1.25rem;
  }
  .card__meta { font-size: var(--step--1); color: var(--muted); }
  .card--tint { background: color-mix(in oklab, var(--sage) 18%, var(--surface)); }
  .card--dark { background: var(--forest); color: #e8efe9; border-color: var(--forest); }
  .card--dark .card__icon { background: rgb(255 255 255 / .08); color: var(--amber); }

  .fineprint { font-size: var(--step--1); color: var(--muted); }
  .minihead { font-family: var(--f-mono); font-size: var(--step--1); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

  /* Image buttons (open lightbox) */
  .shot {
    position: relative; display: block; overflow: hidden; border-radius: var(--r);
    background: var(--paper-2); text-align: left; isolation: isolate;
  }
  .shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
  .shot:hover img { transform: scale(1.04); }
  .shot > span {
    position: absolute; left: 12px; bottom: 12px; z-index: 1;
    padding: .35em .75em; border-radius: 999px; font-size: var(--step--1); font-weight: 500;
    background: rgb(20 32 25 / .55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  }
}

/* ---------- sections ---------- */
@layer sections {

  /* Top bar */
  .topbar {
    position: fixed; inset: 0 0 auto; z-index: 50; height: var(--topbar-h);
    color: #fff; transition: background-color .3s, color .3s, box-shadow .3s, backdrop-filter .3s;
  }
  .topbar.is-solid {
    background: rgb(245 242 235 / .82); color: var(--ink);
    backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
    box-shadow: 0 1px 0 var(--line);
  }
  .topbar__inner {
    height: 100%; width: min(100% - 2 * var(--gutter), 1320px); margin-inline: auto;
    display: flex; align-items: center; gap: 20px;
  }
  .brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
  .brand__date { font-family: var(--f-mono); font-weight: 400; font-size: .8rem; opacity: .7; letter-spacing: 0; }
  .nav { display: flex; gap: 2px; margin-inline: auto; }
  .nav a {
    padding: .45em .85em; border-radius: 999px; text-decoration: none; font-size: .92rem; font-weight: 500; opacity: .85;
    transition: background-color .2s, color .2s, opacity .2s;
  }
  .nav a:hover { opacity: 1; background: rgb(127 127 127 / .14); }
  .nav a.is-active { opacity: 1; background: var(--forest); color: #fff; }
  .topbar:not(.is-solid) .topbar__cta { --bg: #fff; --fg: var(--forest); --bd: #fff; }

  @media (max-width: 980px) {
    .nav { display: none; }
    .topbar__cta { margin-left: auto; }
  }
  @media (max-width: 420px) {
    .brand__date { display: none; }
  }

  /* Hero */
  .hero {
    position: relative; min-height: max(640px, 100svh);
    display: grid; color: #fff; isolation: isolate; overflow: clip;
    background: var(--forest);
  }
  .hero__media { position: absolute; inset: 0; z-index: -1; }
  .hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; transform-origin: 50% 30%; }
  .hero__media::after {
    content: ""; position: absolute; inset: 0;
    background:
      linear-gradient(180deg, rgb(10 22 15 / .55) 0%, rgb(10 22 15 / 0) 26%),
      linear-gradient(0deg, rgb(10 22 15 / .92) 0%, rgb(10 22 15 / .55) 38%, rgb(10 22 15 / 0) 68%);
  }
  @supports (animation-timeline: scroll()) {
    @media (prefers-reduced-motion: no-preference) {
      .hero__media img { animation: hero-zoom linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
      @keyframes hero-zoom { to { transform: scale(1.12) translateY(4%); } }
    }
  }
  .hero__inner {
    display: grid; grid-template-rows: auto 1fr auto; gap: 28px;
    padding-top: calc(var(--topbar-h) + 20px); padding-bottom: clamp(20px, 4vw, 40px);
  }
  .hero__top { display: flex; flex-wrap: wrap; gap: 8px; }
  .weather-chip .ico { width: 1.2em; height: 1.2em; }
  .hero__copy { align-self: end; max-width: 900px; }
  .hero__title {
    font-size: var(--step-hero); font-weight: 800; line-height: .86; letter-spacing: -.05em;
    margin: 14px 0 18px -.04em;
  }
  .hero__lead { font-size: var(--step-1); max-width: 34ch; color: rgb(255 255 255 / .88); }
  .hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
  .hero__stats {
    display: grid; grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid rgb(255 255 255 / .22); padding-top: 18px;
  }
  .hero__stats > div { padding-right: 12px; }
  .hero__stats > div + div { padding-left: clamp(12px, 2vw, 24px); border-left: 1px solid rgb(255 255 255 / .16); }
  .hero__stats dt { display: flex; align-items: center; gap: .5em; font-size: var(--step--1); color: rgb(255 255 255 / .7); }
  .hero__stats dd { font-family: var(--f-display); font-weight: 700; font-size: var(--step-3); letter-spacing: -.03em; line-height: 1.1; margin-top: 4px; }
  .hero__stats small { font-family: var(--f-body); font-size: .4em; font-weight: 500; letter-spacing: 0; color: rgb(255 255 255 / .7); }
  @media (max-width: 640px) {
    .hero__stats { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
    .hero__stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  }

  /* Generic section */
  .section { padding-block: var(--section); }
  .section__head { display: grid; gap: 16px; max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
  .section__lead { font-size: var(--step-1); color: var(--ink-2); line-height: 1.55; max-width: 60ch; }

  /* Route */
  .plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: clamp(28px, 4vw, 44px); }
  .plan {
    position: relative; display: grid; gap: 8px; cursor: pointer;
    padding: 22px 24px; border-radius: var(--r-lg);
    background: var(--surface); border: 1.5px solid var(--line);
    transition: border-color .2s, box-shadow .25s, transform .2s var(--ease);
  }
  .plan:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .plan input { position: absolute; opacity: 0; pointer-events: none; }
  .plan:has(input:checked) { border-color: var(--forest); box-shadow: 0 0 0 3px rgb(20 40 29 / .1), var(--shadow); }
  .plan:has(input:focus-visible) { outline: 2px solid var(--trail); outline-offset: 3px; }
  .plan__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-right: 40px; }
  .plan__label { font-family: var(--f-mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: .08em; color: var(--moss); }
  .plan__window { display: inline-flex; align-items: center; gap: .4em; font-family: var(--f-mono); font-size: var(--step--1); color: var(--muted); }
  .plan__name { font-family: var(--f-display); font-weight: 700; font-size: var(--step-2); letter-spacing: -.02em; line-height: 1.1; }
  .plan__desc { color: var(--ink-2); max-width: 46ch; }
  .plan__stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: var(--step--1); color: var(--muted); }
  .plan__stats b { color: var(--ink); font-family: var(--f-mono); font-weight: 500; margin-right: .2em; }
  .plan__check {
    position: absolute; top: 18px; right: 18px; width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center; border: 1.5px solid var(--line); color: transparent;
    transition: background-color .2s, color .2s, border-color .2s;
  }
  .plan:has(input:checked) .plan__check { background: var(--forest); border-color: var(--forest); color: #fff; }
  @media (max-width: 720px) { .plans { grid-template-columns: 1fr; } }

  .route__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
  @media (max-width: 1000px) { .route__grid { grid-template-columns: 1fr; } }

  /* Timeline */
  .timeline { position: relative; }
  .stop {
    position: relative;
    display: grid; grid-template-columns: 56px 36px minmax(0, 1fr) auto; gap: 0 16px;
    padding-bottom: 30px;
  }
  .stop:last-child { padding-bottom: 0; }
  .stop::before { /* dashed trail line */
    content: ""; position: absolute; left: calc(56px + 16px + 17px); top: 36px; bottom: 0; width: 2px;
    background: repeating-linear-gradient(to bottom, var(--trail) 0 7px, transparent 7px 13px);
    opacity: .55;
  }
  .stop:last-child::before { display: none; }
  .stop__time { font-family: var(--f-mono); font-size: .95rem; font-weight: 500; padding-top: 6px; text-align: right; color: var(--ink); }
  .stop__node {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); border: 2px solid var(--forest);
    font-family: var(--f-mono); font-weight: 500; font-size: .85rem; position: relative; z-index: 1;
  }
  .stop:first-child .stop__node, .stop:last-child .stop__node {
    background: var(--forest); border-color: var(--forest);
  }
  .stop:first-child .stop__node::after, .stop:last-child .stop__node::after {
    content: ""; width: 16px; height: 11px; border-radius: 2px;
    background: linear-gradient(#fff 0 33.3%, var(--trail) 33.3% 66.6%, #fff 66.6%);
  }
  #stop-rozhledna .stop__node { background: var(--trail); border-color: var(--trail); color: #fff; box-shadow: 0 0 0 5px var(--trail-soft); }
  .stop__body { display: grid; gap: 4px; padding-top: 2px; }
  .stop__leg {
    display: inline-flex; align-items: center; gap: .45em; justify-self: start;
    font-family: var(--f-mono); font-size: .78rem; color: var(--muted);
    margin-bottom: 4px;
  }
  .stop__name { font-size: var(--step-2); }
  .stop__meta { font-family: var(--f-mono); font-size: var(--step--1); color: var(--moss); }
  .stop__text { color: var(--ink-2); margin-top: 4px; max-width: 48ch; }
  .stop__img { width: 120px; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; margin-top: 6px; box-shadow: var(--shadow); }
  .stop__img img { width: 100%; height: 100%; object-fit: cover; }
  @media (min-width: 1001px) and (max-width: 1240px) { .stop__img { display: none; } }
  @media (max-width: 560px) {
    .stop { grid-template-columns: 44px 32px minmax(0, 1fr); gap: 0 12px; }
    .stop::before { left: calc(44px + 12px + 15px); top: 32px; }
    .stop__node { width: 32px; height: 32px; }
    .stop__img { display: none; }
    .stop__time { font-size: .85rem; }
  }

  /* Plan switching (pure CSS via :has) */
  .t-b, .leg-b, .link-b, .note-b, .only-b { display: none; }
  body:has(#plan-b:checked) .only-a { display: none; }
  body:has(#plan-b:checked) .only-b { display: inline; }
  body:has(#plan-b:checked) .stop[data-b="false"] { display: none; }
  body:has(#plan-b:checked) .t-a, body:has(#plan-b:checked) .stop:has(.t-b) .t-a { display: none; }
  body:has(#plan-b:checked) .t-b { display: inline; }
  body:has(#plan-b:checked) #stop-cil .leg-a, body:has(#plan-b:checked) .link-a { display: none; }
  body:has(#plan-b:checked) #stop-cil .leg-b { display: inline-flex; }
  body:has(#plan-b:checked) .link-b { display: inline-flex; }
  body:has(#plan-b:checked) .note-b { display: block; }
  body:has(#plan-b:checked) .pmark[data-b="false"] { opacity: .25; }
  body:has(#plan-b:checked) .profile .pb-zone { opacity: 1; }
  @media (prefers-reduced-motion: no-preference) {
    .stop { animation: stop-in .45s var(--ease) both; }
    @keyframes stop-in { from { opacity: 0; transform: translateY(8px); } }
  }

  /* Map card */
  .mapcard {
    position: sticky; top: calc(var(--topbar-h) + 16px);
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg);
    overflow: hidden; box-shadow: var(--shadow);
  }
  .mapcard__map { aspect-ratio: 4 / 3.2; background: var(--paper-2); }
  .mapcard__map iframe { width: 100%; height: 100%; border: 0; }
  .mapcard__profile { padding: 20px 22px 6px; color: var(--moss); }
  .mapcard__profile-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--ink); }
  .mapcard__profile-head h3 { font-size: 1.05rem; }
  .mapcard__profile-head p { font-size: .8rem; color: var(--muted); }
  .mapcard__note { font-size: var(--step--1); color: var(--muted); padding-bottom: 6px; }
  .mapcard__actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 22px 22px; }
  @media (max-width: 1000px) { .mapcard { position: relative; top: 0; } }

  .profile-wrap { margin-top: 10px; padding-bottom: 14px; }
  .profile-plot { position: relative; height: 150px; margin-inline: 12px; }
  .profile { width: 100%; height: 100%; overflow: visible; }
  .profile .line { stroke: var(--forest); stroke-width: 2.5; }
  .profile .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
  .profile .pb-zone { fill: var(--amber-soft); opacity: 0; transition: opacity .3s; }
  .pmark {
    position: absolute; left: var(--x); top: var(--y);
    translate: -50% -50%;
    width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); border: 2px solid var(--forest); color: var(--ink);
    font-family: var(--f-mono); font-size: .7rem; font-weight: 500;
    transition: opacity .3s;
  }
  .pmark--end { width: 14px; height: 14px; background: var(--forest); }
  .profile-axis { margin-inline: 12px; display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 6px; }

  /* Tower */
  .tower__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
  @media (max-width: 1000px) { .tower__grid { grid-template-columns: 1fr; } }
  .tower__media { position: relative; padding-bottom: 12%; padding-right: 14%; }
  .tower__main { border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 3 / 4; box-shadow: var(--shadow-lg); }
  .tower__main img, .tower__inset img { width: 100%; height: 100%; object-fit: cover; }
  .tower__inset {
    position: absolute; right: 0; bottom: 0; width: 42%; aspect-ratio: 3 / 4;
    border-radius: var(--r); overflow: hidden; border: 6px solid var(--paper); box-shadow: var(--shadow-lg);
  }
  .tower__badge {
    position: absolute; left: -10px; top: 28px;
    background: var(--trail); color: #fff; padding: 12px 16px; border-radius: 16px;
    font-size: .85rem; line-height: 1.45; box-shadow: var(--shadow);
    rotate: -3deg;
  }
  .tower__badge .mono { font-weight: 500; font-size: 1.05rem; }
  .tower__copy { display: grid; gap: 22px; }
  @media (min-width: 1001px) { .tower__copy { position: sticky; top: calc(var(--topbar-h) + 24px); } }

  .specs { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
  .specs > div { padding: 14px 16px; }
  .specs > div + div { border-left: 1px solid var(--line); }
  .specs dt { font-size: var(--step--1); color: var(--muted); }
  .specs dd { font-family: var(--f-display); font-weight: 700; font-size: var(--step-2); letter-spacing: -.02em; line-height: 1.15; }
  @media (max-width: 520px) {
    .specs { grid-template-columns: 1fr 1fr; }
    .specs > div:nth-child(3) { border-left: 0; }
    .specs > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  }

  .history { display: grid; gap: 0; border-left: 2px solid var(--line); margin-left: 6px; }
  .history li { position: relative; padding: 0 0 18px 22px; display: grid; gap: 2px; }
  .history li:last-child { padding-bottom: 0; }
  .history li::before {
    content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--paper); border: 2px solid var(--moss);
  }
  .history li:last-child::before { background: var(--trail); border-color: var(--trail); }
  .history__year { font-size: .82rem; font-weight: 500; color: var(--moss); }
  .history p { color: var(--ink-2); font-size: .97rem; }

  .panorama { margin-top: clamp(48px, 7vw, 96px); display: grid; gap: 22px; }
  .panorama__head { display: grid; grid-template-columns: auto 1fr; gap: 16px 32px; align-items: center; }
  .panorama__head h3 { font-size: var(--step-2); }
  @media (max-width: 760px) { .panorama__head { grid-template-columns: 1fr; } }

  .scroller {
    display: grid; grid-auto-flow: column; grid-auto-columns: clamp(260px, 32vw, 420px); gap: 14px;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    padding-bottom: 12px; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
    margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter);
  }
  .scroller .shot { aspect-ratio: 4 / 3; scroll-snap-align: start; }
  .scroller .shot--wide { grid-column: span 1; }
  @media (min-width: 900px) {
    .scroller { grid-auto-columns: 1fr; grid-template-columns: 2fr 1fr 1fr; grid-auto-flow: row; overflow: visible; margin-inline: 0; padding-inline: 0; }
    .scroller { grid-template-columns: 1.6fr 1fr 1fr; }
    .scroller .shot--wide { grid-row: span 2; aspect-ratio: auto; }
  }

  /* Ridge (dark) */
  .ridge { background: var(--forest); color: #e7eee9; position: relative; overflow: clip; }
  .ridge::before { /* contour lines */
    content: ""; position: absolute; inset: 0; opacity: .09; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600' viewBox='0 0 600 600' fill='none' stroke='%23fff' stroke-width='1.2'%3E%3Cpath d='M-20 420C80 360 140 400 220 340S360 220 460 250 600 200 640 160'/%3E%3Cpath d='M-20 460C90 400 150 440 240 380S370 260 470 290 600 240 640 200'/%3E%3Cpath d='M-20 500C100 440 160 480 260 420S380 300 480 330 600 280 640 240'/%3E%3Cpath d='M-20 540C110 480 170 520 280 460S390 340 490 370 600 320 640 280'/%3E%3Cpath d='M-20 380C70 320 130 360 200 300S350 180 450 210 600 160 640 120'/%3E%3Cpath d='M-20 340C60 280 120 320 180 260S340 140 440 170 600 120 640 80'/%3E%3Cellipse cx='420' cy='120' rx='60' ry='26'/%3E%3Cellipse cx='420' cy='120' rx='32' ry='12'/%3E%3C/svg%3E");
    background-size: 600px;
  }
  .ridge h2 { color: #fff; }
  .ridge .section__lead { color: rgb(231 238 233 / .85); }
  .ridge__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
  @media (max-width: 1000px) { .ridge__grid { grid-template-columns: 1fr; } }
  .ridge__copy { display: grid; gap: 22px; }
  .bullets { display: grid; gap: 14px; margin-top: 6px; }
  .bullets li { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
  .bullets .ico { margin-top: 3px; width: 22px; height: 22px; color: var(--amber); }
  .bullets b { color: #fff; }
  .ridge__mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 12px; }
  .ridge__mosaic .m1 { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
  .ridge__mosaic .m2, .ridge__mosaic .m3 { aspect-ratio: 4 / 3; }

  /* Bistro */
  .bistro { background: linear-gradient(180deg, var(--amber-soft), color-mix(in oklab, var(--amber-soft) 40%, var(--paper))); }
  .bistro__head { display: flex; align-items: center; gap: 20px; margin-bottom: clamp(28px, 4vw, 48px); }
  .bistro__head > div { display: grid; gap: 12px; }
  .bistro__logo { width: clamp(72px, 9vw, 104px); height: auto; aspect-ratio: 1; border-radius: 50%; box-shadow: var(--shadow); flex: none; }
  .bistro__grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
  @media (max-width: 1000px) { .bistro__grid { grid-template-columns: 1fr; } }
  .bistro__info { display: grid; gap: 22px; }
  .hours { display: grid; background: rgb(255 255 255 / .7); border: 1px solid rgb(20 32 25 / .08); border-radius: var(--r); overflow: hidden; }
  .hours__row { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 16px 18px; align-items: start; }
  .hours__row + .hours__row { border-top: 1px solid rgb(20 32 25 / .08); }
  .hours__row .ico { width: 22px; height: 22px; margin-top: 2px; color: var(--moss); }
  .hours__main { font-size: var(--step-1); }
  .hours__main b { font-family: var(--f-mono); font-weight: 500; }
  .hours__sub { font-size: var(--step--1); color: var(--muted); }
  .bistro__links { display: flex; flex-wrap: wrap; gap: 8px; }

  .food { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: clamp(70px, 9vw, 118px); gap: 10px; }
  .food__item { grid-column: span 2; grid-row: span 2; }
  .food .f0 { grid-column: span 4; grid-row: span 3; }
  .food .f1 { grid-column: span 2; grid-row: span 3; }
  .food .f5, .food .f6 { grid-column: span 3; grid-row: span 2; }
  .credit-line { margin-top: 16px; font-size: .78rem; color: var(--muted); text-align: right; }

  /* Way back */
  .duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  @media (max-width: 760px) { .duo { grid-template-columns: 1fr; } }

  /* Facts bento */
  .facts { background: var(--paper-2); }
  .bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .fact {
    display: flex; flex-direction: column; gap: 8px; min-height: 220px;
    padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2);
    transition: transform .25s var(--ease), box-shadow .25s;
  }
  .fact:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
  .fact--wide { grid-column: span 2; }
  .fact--dark { background: var(--forest); color: #e7eee9; border-color: var(--forest); }
  .fact__label { font-family: var(--f-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
  .fact--dark .fact__label { color: var(--sage); }
  .fact__big { font-family: var(--f-display); font-weight: 800; font-size: var(--step-4); letter-spacing: -.045em; line-height: 1; margin-top: auto; color: var(--trail); }
  .fact:not(.fact--wide) .fact__big { font-size: var(--step-3); }
  .fact--dark .fact__big { color: var(--amber); }
  .fact__text { color: var(--ink-2); font-size: .95rem; }
  .fact--wide .fact__text { max-width: 46ch; }
  .fact--dark .fact__text { color: rgb(231 238 233 / .85); }
  @media (max-width: 1000px) { .bento { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 560px) { .bento { grid-template-columns: 1fr; } .fact--wide { grid-column: auto; } .fact { min-height: 0; } }

  /* Around */
  .tips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
  @media (max-width: 1100px) { .tips { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 600px) { .tips { grid-template-columns: 1fr; } }
  .tip { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
  .tip__img { aspect-ratio: 3 / 2; overflow: hidden; }
  .tip__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
  .tip:hover .tip__img img { transform: scale(1.05); }
  .tip__body { padding: 18px 20px 22px; display: grid; gap: 8px; align-content: start; }
  .tip__where { display: inline-flex; align-items: center; gap: .4em; font-size: .78rem; color: var(--moss); }
  .tip p:not(.tip__where) { color: var(--ink-2); font-size: .95rem; }

  /* Info */
  .info__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  @media (max-width: 860px) { .info__grid { grid-template-columns: 1fr; } }
  .big-time { font-family: var(--f-display); font-weight: 700; font-size: var(--step-2); letter-spacing: -.02em; }
  .big-time .mono { font-family: var(--f-display); color: var(--trail); }
  .coords { font-size: .82rem; color: var(--muted); }
  .card .btn-row { margin-top: auto; padding-top: 6px; }

  .weather__body { display: grid; gap: 14px; }
  .weather__now { display: flex; align-items: center; gap: 16px; }
  .weather__now .ico { width: 54px; height: 54px; stroke-width: 1.4; color: var(--moss); }
  .weather__temp { font-family: var(--f-display); font-weight: 800; font-size: var(--step-4); letter-spacing: -.04em; line-height: 1; }
  .weather__desc { color: var(--ink-2); }
  .weather__hours { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
  .weather__hours li { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: var(--paper); font-size: .82rem; }
  .weather__hours .ico { width: 22px; height: 22px; color: var(--moss); }
  .weather__hours b { font-family: var(--f-mono); font-weight: 500; }
  .weather__hours small { color: var(--muted); font-family: var(--f-mono); }
  .weather__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .88rem; color: var(--ink-2); }
  .weather__meta span { display: inline-flex; align-items: center; gap: .4em; }

  .checklist ul { display: grid; gap: 4px; }
  .checklist label { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 8px 6px; border-radius: 12px; cursor: pointer; transition: background-color .2s; }
  .checklist label:hover { background: var(--paper); }
  .checklist input { position: absolute; opacity: 0; }
  .checklist .box {
    width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--line); display: grid; place-items: center;
    color: transparent; transition: background-color .2s, border-color .2s, color .2s;
  }
  .checklist .box .ico { width: 15px; height: 15px; stroke-width: 2.6; }
  .checklist input:checked + .box { background: var(--moss); border-color: var(--moss); color: #fff; }
  .checklist input:checked ~ span:last-child { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
  .checklist input:focus-visible + .box { outline: 2px solid var(--trail); outline-offset: 2px; }

  .kv { display: grid; }
  .kv li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid rgb(255 255 255 / .1); }
  .kv li:last-child { border-bottom: 0; }
  .kv span { color: rgb(231 238 233 / .65); }
  .kv b { font-weight: 500; text-align: right; }

  /* Footer */
  .footer { background: var(--forest); color: rgb(231 238 233 / .75); padding-block: 48px; font-size: .92rem; }
  .footer__grid { display: grid; grid-template-columns: auto 1fr; gap: 24px 64px; align-items: start; }
  @media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; } }
  .brand--footer { color: #fff; margin-bottom: 8px; }
  .footer .muted { color: rgb(231 238 233 / .6); }
  .credits summary { cursor: pointer; color: #fff; font-weight: 500; list-style: none; display: inline-flex; gap: .5em; align-items: center; }
  .credits summary::before { content: "+"; font-family: var(--f-mono); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgb(255 255 255 / .3); font-size: .8rem; }
  .credits[open] summary::before { content: "–"; }
  .credits summary::-webkit-details-marker { display: none; }
  .credits ul { margin-top: 14px; display: grid; gap: 4px; font-size: .8rem; columns: 2; }
  .credits li { break-inside: avoid; }
  @media (max-width: 760px) { .credits ul { columns: 1; } }
  .credits a { color: #fff; }

  /* Lightbox */
  .lightbox {
    width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; padding: 0;
    background: rgb(8 14 10 / .94); color: #fff;
  }
  .lightbox[open] { display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
  .lightbox::backdrop { background: rgb(8 14 10 / .6); }
  .lightbox figure { display: grid; justify-items: center; gap: 12px; padding: 56px 8px 24px; height: 100dvh; grid-template-rows: 1fr auto; min-width: 0; }
  .lightbox img { max-width: 100%; max-height: calc(100dvh - 120px); object-fit: contain; border-radius: 12px; align-self: center; }
  @media (max-width: 600px) { .lightbox img { max-height: calc(100dvh - 180px); } }
  .lightbox figcaption { font-size: .9rem; color: rgb(255 255 255 / .75); text-align: center; }
  .lightbox__close, .lightbox__nav {
    display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
    background: rgb(255 255 255 / .1); color: #fff; transition: background-color .2s;
  }
  .lightbox__close:hover, .lightbox__nav:hover { background: rgb(255 255 255 / .2); }
  .lightbox__close { position: absolute; top: 14px; right: 14px; z-index: 1; }
  .lightbox__nav { margin: 0 12px; }
  .lightbox .ico { width: 22px; height: 22px; }
  @media (prefers-reduced-motion: no-preference) {
    .lightbox[open] img { animation: lb-in .35s var(--ease); }
    @keyframes lb-in { from { opacity: 0; transform: scale(.97); } }
  }
  @media (max-width: 600px) {
    .lightbox__nav { position: absolute; bottom: 18px; margin: 0; }
    .lightbox__prev { left: calc(50% - 60px); }
    .lightbox__next { right: calc(50% - 60px); }
    .lightbox figure { padding-bottom: 84px; }
  }

  .error-page { min-height: 100svh; display: grid; place-content: center; gap: 16px; text-align: center; padding: 24px; }
}

/* ---------- utilities ---------- */
@layer utilities {
  /* Scroll-driven reveal (progressive enhancement, no JS) */
  @supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
      .reveal { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% cover 22%; }
      @keyframes reveal { from { opacity: 0; transform: translateY(28px); } }
    }
  }
}
