/* P21 · Deväť chát – Vyšné Lazy · Topographic atlas
   Tokens → base → stage → journey chapters → ground → components → motion states → reduced motion */

:root {
  --surface: oklch(0.965 0.006 230);
  --surface-2: oklch(0.93 0.008 230);
  --fg: oklch(0.24 0.02 240);
  --muted: oklch(0.48 0.02 240);
  --on-video: oklch(0.97 0.005 230);
  --on-video-muted: oklch(0.85 0.01 230);
  --accent: oklch(0.7 0.13 62);
  --accent-fg: oklch(0.2 0.03 60);
  --line: oklch(0.8 0.01 235);
  --contour: oklch(0.6 0.02 235 / 0.35);
  --video-dark: oklch(0.2 0.02 240);
  --chapter-vh: 160vh;
  --section-y: clamp(6rem, 5rem + 5vw, 10rem);
  --gutter: clamp(1.25rem, 7vw, 6rem);
  --col-gap: 24px;
  --rail: 56px;
  --display: "Marcellus", "Times New Roman", serif;
  --text: "Geist", "Inter", system-ui, sans-serif;
  --step-0: 1.0625rem;
  --lead: 1.25rem;
  --display-1: clamp(2.5rem, 1.6rem + 2.6vw, 5rem);
  --display-2: clamp(2rem, 1.5rem + 2.5vw, 4rem);
  --display-3: clamp(1.5rem, 1.25rem + 1vw, 2.25rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--video-dark); scroll-padding-top: 0; }
html.motion { scroll-behavior: auto !important; }
body {
  margin: 0;
  font-family: var(--text);
  font-weight: 400;
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--fg);
  background: var(--video-dark);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: -0.12em; }
.skip { position: fixed; left: 1rem; top: -4rem; z-index: 60; padding: 0.6rem 1rem; background: var(--surface); color: var(--fg); border: 1px solid var(--line); }
.skip:focus { top: 1rem; }

/* ---------- type ---------- */
.display-1, .display-2, .display-3, .type-name, .ms-date, .loader-num, .unit-n, .peak-name {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.01em;
}
.display-1 { font-size: var(--display-1); line-height: 1.02; text-wrap: balance; }
.display-2 { font-size: var(--display-2); line-height: 1.06; text-wrap: balance; }
.display-3 { font-size: var(--display-3); line-height: 1.15; }
.lead { font-size: var(--lead); line-height: 1.5; font-weight: 300; }
.label, .kota, .chip, .btn, .rail-num, .rail-brand, .type-meta, .unit-meta, .view-type, .ms-t, .loader-label, .footer-demo, .kota-n, .peak-alt {
  font-weight: 500;
}
.label, .kota, .loader-label, .kota-n, .ms-t, .rail-brand, .rail-unit, .loader-unit {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.kota { display: block; margin-bottom: 1rem; }
.note { font-size: 0.9375rem; color: var(--muted); }
.on-video { color: var(--on-video); }
.on-video-muted { color: var(--on-video-muted); }

/* ---------- container & grid ---------- */
.container { width: min(100% - 2 * var(--gutter), 1536px); margin-inline: auto; }
.section { padding-block: var(--section-y); position: relative; }

/* ---------- buttons, links, chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 52px; padding: 0.85rem 1.6rem;
  border: 1px solid transparent; border-radius: 0; cursor: pointer; text-decoration: none;
  font-size: 0.9375rem; letter-spacing: 0.02em; white-space: nowrap;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: oklch(0.74 0.13 62); }
.text-link {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px;
  font-size: 0.9375rem; font-weight: 500; letter-spacing: 0.02em; text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 0.1rem; line-height: 1.2; align-self: center;
}
.text-link .ic { transition: transform 0.4s var(--ease-out); }
.text-link:hover .ic { transform: translateY(3px); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block: 2rem 1.5rem; }
.chip {
  min-height: 44px; padding: 0.5rem 1.1rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s;
}
.chip:hover { border-color: var(--fg); }
.chip.is-active { background: var(--fg); color: var(--surface); border-color: var(--fg); }
.contact-link { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; text-decoration: none; }
.contact-link:hover { text-decoration: underline; }

/* ---------- preloader ---------- */
.loader { position: fixed; inset: 0; z-index: 50; display: none; pointer-events: none; }
html.js .loader { display: block; }
html.js.intro-done .loader, html.reduce .loader { display: none; }
.loader-half { position: absolute; left: 0; right: 0; top: 0; height: 100%; background: oklch(0.965 0.006 230 / 0.92); }
.loader-top { clip-path: polygon(0 0, 100% 0, 100% 51.5%, 92% 49.8%, 84% 51.6%, 75% 48.9%, 66% 50.8%, 57% 48.6%, 48% 50.9%, 39% 49.1%, 30% 51.4%, 21% 48.8%, 12% 50.6%, 5% 49.2%, 0 50.4%); }
.loader-bottom { clip-path: polygon(0 50.4%, 5% 49.2%, 12% 50.6%, 21% 48.8%, 30% 51.4%, 39% 49.1%, 48% 50.9%, 57% 48.6%, 66% 50.8%, 75% 48.9%, 84% 51.6%, 92% 49.8%, 100% 51.5%, 100% 100%, 0 100%); }
html.is-safari .loader-top, html.is-safari .loader-bottom { clip-path: none; }
html.is-safari .loader-top { height: 50%; }
html.is-safari .loader-bottom { top: 50%; height: 50%; }
.loader-center {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 0.5rem;
  color: var(--fg); text-align: center;
}
.loader-contours { width: min(320px, 70vw); height: auto; overflow: visible; }
.loader-contours .contour { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 420; stroke-dashoffset: 420; }
.loader-alt { display: flex; align-items: baseline; gap: 0.75rem; }
.loader-num { font-size: clamp(4rem, 3rem + 6vw, 10rem); line-height: 1; font-variant-numeric: tabular-nums; }
.loader-unit { font-size: 0.875rem; }
.loader-label { margin-top: 0.25rem; }

/* ---------- stage ---------- */
.stage { position: fixed; inset: 0; z-index: 0; background: var(--video-dark); overflow: hidden; }
.stage-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.stage.is-live .stage-canvas { opacity: 1; }
.stage.is-live .stage-poster { visibility: hidden; }
.stage-grain {
  position: absolute; inset: 0; opacity: 0.065; pointer-events: none; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}
html:not(.motion) .stage { display: none; }
.stage.is-faded .stage-canvas { transition: opacity 0.6s; opacity: 0; }

/* ---------- journey ---------- */
.journey { position: relative; z-index: 1; }
.chapter { position: relative; }
html.motion .journey { height: calc(6 * var(--chapter-vh) + 100vh); }
html.motion .journey-sticky { position: sticky; top: 0; height: 100vh; overflow: clip; }
html.motion .chapter { position: absolute; inset: 0; height: 100vh; visibility: hidden; }
html.motion .chapter.is-active { visibility: visible; }
html.motion .chapter-inner { height: 100%; }
html.motion .chapter-ui { transition: opacity 0.6s var(--ease-inout), transform 0.6s var(--ease-inout); }
html.motion .chapter.is-leaving .chapter-ui { opacity: 0; transform: translateY(-16px); }
html.motion .chapter-media { display: none; }
.chapter-media { aspect-ratio: 16 / 9; background: var(--video-dark); overflow: hidden; }
.chapter-media img { width: 100%; height: 100%; object-fit: cover; }
.scrim { position: absolute; inset: 0; pointer-events: none; display: none; }
html.motion .scrim { display: block; }
.scrim-left { background: linear-gradient(0deg, oklch(0.2 0.02 240 / 0.55), transparent 60%), linear-gradient(90deg, oklch(0.2 0.02 240 / 0.35), transparent 55%); }
.scrim-right { background: linear-gradient(0deg, oklch(0.2 0.02 240 / 0.5), transparent 60%), linear-gradient(270deg, oklch(0.2 0.02 240 / 0.4), transparent 55%); }
.scrim-bottom { background: linear-gradient(0deg, oklch(0.2 0.02 240 / 0.62), transparent 55%); }

.chapter-ui {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap);
  align-content: end;
  padding: 2rem var(--gutter) clamp(2.5rem, 6vh, 5rem);
  min-height: 100%;
  padding-right: calc(var(--gutter) + var(--rail));
}
html:not(.motion) .chapter-ui { background: var(--video-dark); min-height: 0; padding-block: 2.5rem 3.5rem; }
html.motion .chapter-ui { height: 100vh; }
.chapter-ui > * { grid-column: 1 / 6; }
.ui-right > * { grid-column: 8 / 13; }
.ui-left > * { grid-column: 1 / 6; }
.chapter-ui .display-2 { margin-bottom: 1.5rem; max-width: 18ch; }

/* hero */
.hero-ui { align-content: end; row-gap: 0; }
.hero-label { margin-bottom: 1.25rem; color: var(--on-video-muted); }
.hero-title { grid-column: 1 / 8; max-width: 21ch; margin-bottom: 1.5rem; }
.hero-lead { max-width: 38ch; margin-bottom: 2rem; color: var(--on-video-muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: center; }
.hero-title .line { display: block; overflow: hidden; padding-block: 0.04em; }
.hero-title .line > div { display: block; }

/* chapter 1: atlas table */
.atlas-table { width: 100%; border-collapse: collapse; }
.atlas-table th, .atlas-table td { padding: 0.9rem 0; text-align: left; font-weight: 400; vertical-align: baseline; }
.atlas-table td { text-align: right; font-weight: 500; }
.atlas-table tr { position: relative; }
.atlas-table th::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: oklch(0.97 0.005 230 / 0.35); transform-origin: left; transform: scaleX(1);
}
html.motion .atlas-table th::after { transform: scaleX(0); transition: transform 1.2s linear; }
html.motion .atlas-table tr.is-in th::after { transform: scaleX(1); }

/* chapter 2: types */
.types { border-top: 1px solid oklch(0.97 0.005 230 / 0.3); }
.type-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name price" "meta state";
  gap: 0.25rem 1.5rem; padding: 1.1rem 0.5rem; margin-inline: -0.5rem; border-bottom: 1px solid oklch(0.97 0.005 230 / 0.3);
  color: var(--on-video); text-decoration: none; transition: background-color 0.3s;
}
.type-row:hover, .type-row:focus-visible { background: oklch(0.97 0.005 230 / 0.1); }
.type-name { grid-area: name; font-size: var(--display-3); line-height: 1.1; }
.type-meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-size: 0.8125rem; color: var(--on-video-muted); letter-spacing: 0.04em; }
.type-price { grid-area: price; font-family: var(--display); font-size: 1.25rem; align-self: end; }
.type-state { grid-area: state; font-size: 0.8125rem; color: var(--on-video-muted); text-align: right; letter-spacing: 0.04em; }
.type-state.has-free { color: var(--accent); }

/* chapter 3: kóty */
.ui-koty { align-content: start; grid-template-rows: auto 1fr; }
.koty-head { grid-column: 1 / 7; align-self: start; padding-top: 2.5rem; }
.koty-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.koty-lines line { stroke: var(--on-video); stroke-width: 1; stroke-dasharray: 600; stroke-dashoffset: 600; }
.koty-lines circle { fill: none; stroke: var(--on-video); stroke-width: 1; }
html:not(.motion) .koty-lines { display: none; }
.koty { grid-column: 1 / 13; position: relative; align-self: stretch; }
html.motion .kota-item {
  position: absolute; left: calc(var(--kx) * 100%); top: calc(var(--ky) * 100%);
  transform: translate(-50%, -50%); max-width: 16rem; display: grid; gap: 0.2rem;
}
.kota-item { color: var(--on-video); }
.kota-n { color: var(--on-video-muted); }
.kota-t { font-size: 0.9375rem; line-height: 1.35; background: oklch(0.2 0.02 240 / 0.55); padding: 0.3rem 0.5rem; }
html:not(.motion) .koty { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }

/* chapter 4: peak finder */
.ui-peaks { align-content: end; row-gap: 1rem; }
.peaks-head { grid-column: 1 / 8; }
.peaks-hint { font-size: 1rem; }
.peaks {
  grid-column: 1 / 13; position: relative; height: 120px; cursor: grab; touch-action: pan-y; user-select: none;
  background: linear-gradient(180deg, transparent, oklch(0.2 0.02 240 / 0.25));
}
.peaks:active { cursor: grabbing; }
.peaks-horizon { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: oklch(0.97 0.005 230 / 0.55); }
.peaks-dots { position: absolute; inset: 0; }
.peaks-dot { position: absolute; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--on-video); opacity: 0.4; transition: opacity 0.3s; }
.peaks-dot.is-marked { opacity: 1; }
.peaks-dot.is-current { background: var(--accent); opacity: 1; }
.peak-marks { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.peak-mark { position: absolute; transform: translate(-50%, -100%); display: grid; justify-items: center; gap: 0.35rem; opacity: 0; }
.peak-mark .peak-line { width: 1px; height: 72px; background: var(--on-video); transform-origin: bottom; transform: scaleY(0); }
.peak-mark .peak-name { font-size: 1.5rem; color: var(--on-video); line-height: 1; white-space: nowrap; }
.peak-mark .peak-alt { font-size: 0.8125rem; color: var(--on-video-muted); letter-spacing: 0.08em; }
.peak-mark.is-marked { opacity: 1; }
.peak-mark.is-marked .peak-line { transform: scaleY(1); transition: transform 0.3s var(--ease-out); }
.peak-mark.is-marked.is-past { opacity: 0.55; }
.peak-mark.is-marked.is-past .peak-name { font-size: 1rem; }
html:not(.motion) .peak-marks { display: none; }
.views { grid-column: 1 / 13; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.view-seg {
  min-height: 56px; padding: 0.6rem 0.9rem; border: 1px solid oklch(0.97 0.005 230 / 0.3); background: oklch(0.2 0.02 240 / 0.35);
  color: var(--on-video); cursor: pointer; display: grid; justify-items: start; gap: 0.15rem; text-align: left;
  transition: background-color 0.3s, border-color 0.3s;
}
.view-seg:hover { border-color: var(--on-video); }
.view-seg.is-current { border-color: var(--accent); background: oklch(0.2 0.02 240 / 0.6); }
.view-seg.is-chosen { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.view-type { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; }
.view-range { font-family: var(--display); font-size: 1.125rem; }
.views-label { grid-column: 1 / 13; font-size: 0.9375rem; }
.peaks-fallback { grid-column: 1 / 13; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; font-size: 0.9375rem; color: var(--on-video-muted); }
html.motion .peaks-fallback { display: none; }
html:not(.motion) .peaks { display: none; }

/* chapter 5: night */
.ui-night { align-content: center; }
.night-line { grid-column: 1 / 9; max-width: 22ch; margin-bottom: 3rem; }
.timeline { grid-column: 1 / 13; position: relative; padding-top: 1rem; }
.timeline-contour { width: 100%; height: 120px; }
.timeline-contour path { fill: none; stroke: oklch(0.97 0.005 230 / 0.5); stroke-width: 1; stroke-dasharray: 1100; stroke-dashoffset: 1100; }
html:not(.motion) .timeline-contour path, .timeline.is-in .timeline-contour path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s linear; }
.milestones { position: relative; height: 5.5rem; }
.milestones li { position: absolute; left: calc(var(--mx) * 100%); top: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 0.3rem; text-align: center; }
.milestones li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--on-video); margin-top: -0.3rem; }
.milestones li.is-today::before { background: var(--accent); box-shadow: 0 0 0 4px oklch(0.7 0.13 62 / 0.3); }
.ms-date { font-size: 2rem; line-height: 1; color: var(--on-video); }
.ms-t { color: var(--on-video-muted); white-space: nowrap; }

/* ---------- rail ---------- */
.rail {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--rail); z-index: 20;
  display: grid; grid-template-rows: auto 1fr auto 1fr auto; justify-items: center; align-items: center;
  padding: 1.25rem 0; color: var(--on-video);
  transition: background-color 0.4s, color 0.4s;
}
.rail.is-ground { background: oklch(0.965 0.006 230 / 0.9); color: var(--fg); }
.rail-brand { writing-mode: vertical-rl; transform: rotate(180deg); text-decoration: none; color: inherit; letter-spacing: 0.18em; }
.rail-alt { display: grid; justify-items: center; gap: 0.1rem; }
.rail-num { font-size: 0.9375rem; letter-spacing: 0.04em; color: inherit; }
.rail-unit { font-size: 0.5625rem; letter-spacing: 0.12em; color: inherit; opacity: 0.7; }
.rail-ticks { display: grid; gap: 14px; }
.rail-ticks a { display: block; width: 44px; height: 14px; position: relative; }
.rail-ticks a::after {
  content: ""; position: absolute; right: 14px; top: 6px; height: 1px; width: 12px; background: currentColor; opacity: 0.6;
  transition: width 0.3s var(--ease-out), opacity 0.3s, background-color 0.3s;
}
.rail-ticks a.is-active::after { width: 24px; opacity: 1; background: var(--accent); }
.rail-menu {
  writing-mode: vertical-rl; transform: rotate(180deg); background: none; border: 0; padding: 0.5rem 0.25rem; cursor: pointer;
  font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase; min-height: 44px; color: inherit;
}
html:not(.motion) .rail { color: var(--fg); background: oklch(0.965 0.006 230 / 0.9); }

/* ---------- menu ---------- */
.menu { border: 0; padding: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: var(--surface); color: var(--fg); }
.menu::backdrop { background: oklch(0.2 0.02 240 / 0.4); }
.menu-inner { min-height: 100%; padding: 2rem var(--gutter); display: grid; grid-template-rows: auto 1fr auto; gap: 2rem; }
.menu-close { justify-self: end; display: inline-flex; align-items: center; gap: 0.5rem; background: none; border: 0; cursor: pointer; min-height: 44px; font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase; }
.menu-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem 4rem; align-content: start; }
.menu-nav .label { grid-column: 1 / -1; }
.menu-chapters a, .menu-links a { font-family: var(--display); font-size: clamp(2rem, 1.5rem + 2vw, 3rem); line-height: 1.2; text-decoration: none; display: flex; gap: 1rem; align-items: baseline; min-height: 44px; }
.menu-chapters span { font-family: var(--text); font-size: 0.75rem; letter-spacing: 0.14em; color: var(--muted); }
.menu-chapters a:hover, .menu-links a:hover { color: var(--accent-fg); text-decoration: underline; }
.menu-contact p { margin-top: 0.25rem; }

/* ---------- ground ---------- */
.ground { position: relative; z-index: 3; background: var(--surface); color: var(--fg); }
.ground::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; background-color: var(--contour);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M0 120 C150 80 260 170 420 130 S700 60 860 120 S1080 200 1200 140'/%3E%3Cpath d='M0 260 C120 220 300 300 460 250 S760 180 900 240 S1100 330 1200 270'/%3E%3Cpath d='M0 400 C160 360 280 440 440 400 S720 330 880 390 S1080 470 1200 410'/%3E%3Cpath d='M0 540 C140 500 300 580 460 540 S740 470 900 530 S1100 610 1200 550'/%3E%3Cpath d='M0 680 C150 640 260 720 420 680 S700 610 860 670 S1080 750 1200 690'/%3E%3Cpath d='M200 0 C260 40 340 20 420 60 S600 40 700 0'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='800'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M0 120 C150 80 260 170 420 130 S700 60 860 120 S1080 200 1200 140'/%3E%3Cpath d='M0 260 C120 220 300 300 460 250 S760 180 900 240 S1100 330 1200 270'/%3E%3Cpath d='M0 400 C160 360 280 440 440 400 S720 330 880 390 S1080 470 1200 410'/%3E%3Cpath d='M0 540 C140 500 300 580 460 540 S740 470 900 530 S1100 610 1200 550'/%3E%3Cpath d='M0 680 C150 640 260 720 420 680 S700 610 860 670 S1080 750 1200 690'/%3E%3Cpath d='M200 0 C260 40 340 20 420 60 S600 40 700 0'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-size: 1200px 800px; mask-size: 1200px 800px; -webkit-mask-repeat: repeat; mask-repeat: repeat;
}
.ground .container { position: relative; }
.ground .section + .section { border-top: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 1rem; align-items: end; }
.section-head .display-2 { grid-column: 1 / 7; }
.section-head .lead { grid-column: 8 / 13; max-width: 40ch; }

/* units */
.units { border-top: 1px solid var(--fg); margin-top: 0.5rem; }
.unit {
  display: grid; grid-template-columns: 3rem 1fr 1fr 1.2fr 1fr 1fr auto auto; gap: 1rem; align-items: center;
  padding: 1.1rem 0; border-bottom: 1px solid var(--line); transition: opacity 0.3s, background-color 0.3s;
}
.unit.is-hidden { display: none; }
.unit-n { font-size: var(--display-3); }
.unit-type { font-family: var(--display); font-size: 1.25rem; }
.unit-meta { font-size: 0.8125rem; letter-spacing: 0.04em; color: var(--muted); display: block; }
.unit-state { font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; white-space: nowrap; }
.unit-state[data-state="volna"] { color: var(--accent-fg); }
.unit-state[data-state="volna"]::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 0.5rem; vertical-align: 0.05em; }
.unit-state[data-state="rezervovana"], .unit-state[data-state="predana"] { color: var(--muted); }
.unit-btn { min-height: 44px; padding: 0.5rem 1rem; border: 1px solid var(--fg); background: transparent; cursor: pointer; font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; transition: background-color 0.25s, color 0.25s; }
.unit-btn:hover { background: var(--fg); color: var(--surface); }
.unit-btn[disabled] { opacity: 0.4; cursor: default; }
.unit.is-lit { background: oklch(0.7 0.13 62 / 0.12); }

/* builder, faq, visit */
.builder-grid, .faq-grid, .visit-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); row-gap: 2.5rem; }
.builder-grid > div { grid-column: 1 / 6; }
.builder-grid > div p + p { margin-top: 1rem; }
.builder-grid .media { grid-column: 7 / 13; }
.media { background: var(--surface-2); overflow: hidden; }
.media-3-2 { aspect-ratio: 3 / 2; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media figcaption { font-size: 0.8125rem; color: var(--muted); padding-top: 0.6rem; }
.media.is-missing { position: relative; background-color: var(--surface-2); }
.media.is-missing::after { content: "1 120"; position: absolute; right: 1rem; bottom: 1rem; font-size: 0.75rem; letter-spacing: 0.14em; color: var(--muted); }
.faq-grid > div:first-child { grid-column: 1 / 5; }
.faq-list { grid-column: 6 / 13; border-top: 1px solid var(--fg); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { cursor: pointer; padding: 1.1rem 2.5rem 1.1rem 0; font-family: var(--display); font-size: var(--display-3); line-height: 1.2; list-style: none; position: relative; min-height: 44px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); font-family: var(--text); font-weight: 300; font-size: 1.75rem; color: var(--muted); transition: transform 0.3s; }
.faq-list details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-list details p { padding: 0 2.5rem 1.25rem 0; max-width: 60ch; }
.visit-grid > div:first-child { grid-column: 1 / 6; }
.visit-grid .lead { margin-top: 1.5rem; max-width: 36ch; }
.visit-contact { margin-top: 2.5rem; display: grid; gap: 0.25rem; }
.form { grid-column: 7 / 13; display: grid; gap: 1.25rem; align-content: start; }
.field { display: grid; gap: 0.4rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.field label { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.field input:not([type="checkbox"]), .field select {
  width: 100%; min-height: 52px; padding: 0.7rem 0.9rem; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; border-radius: 0;
}
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--fg); }
.field input[aria-invalid="true"] { border-color: oklch(0.55 0.18 25); }
.field .error { font-size: 0.8125rem; color: oklch(0.5 0.18 25); min-height: 1.2em; }
.field-consent { grid-template-columns: auto 1fr; align-items: start; column-gap: 0.75rem; }
.field-consent input { width: 20px; height: 20px; margin-top: 0.2rem; accent-color: var(--accent); }
.field-consent label { text-transform: none; letter-spacing: 0; font-size: 0.9375rem; color: var(--fg); font-weight: 400; }
.field-consent .error { grid-column: 1 / -1; }
.form-view { margin-top: -0.5rem; }
.form .btn { justify-self: start; }
.form-status { min-height: 1.5em; }
.form-status.is-ok { color: var(--accent-fg); }
.form-status.is-err { color: oklch(0.5 0.18 25); }

/* footer */
.footer { padding-block: 3rem 2.5rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 3rem; align-items: start; }
.footer-brand { font-family: var(--display); font-size: 1.25rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; font-size: 0.875rem; letter-spacing: 0.06em; text-transform: uppercase; }
.footer-links a:hover { text-decoration: underline; }
.footer-demo { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--muted); letter-spacing: 0.02em; }
.footer-glyphs { grid-column: 1 / -1; color: var(--muted); opacity: 0.6; }

/* ---------- cursor & magnet ---------- */
.cursor { display: none; }
@media (pointer: fine) {
  html.motion .cursor { display: block; position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; mix-blend-mode: difference; opacity: 0; transition: opacity 0.3s; }
  html.motion .cursor.is-on { opacity: 1; }
  html.motion body { cursor: none; }
  html.motion a, html.motion button, html.motion summary, html.motion input, html.motion select, html.motion label { cursor: pointer; }
  html.motion input[type="text"], html.motion input[type="tel"], html.motion input[type="email"], html.motion input[type="date"] { cursor: text; }
  .cursor-dot { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: oklch(0.97 0.005 230); }
  .cursor-ring { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid oklch(0.97 0.005 230); transition: transform 0.3s var(--ease-out), opacity 0.3s; }
  .cursor-label { position: absolute; left: 22px; top: -0.6em; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: oklch(0.97 0.005 230); white-space: nowrap; opacity: 0; transition: opacity 0.2s; }
  .cursor.has-label .cursor-label { opacity: 1; }
  .cursor.has-label .cursor-ring { transform: scale(1.6); opacity: 0.6; }
}

/* ---------- motion start states (only with html.motion) ---------- */
html.motion [data-enter], html.motion .hero-title { opacity: 0; }
html.motion .hero-title.is-ready { opacity: 1; }
html.motion .ui-right > *, html.motion .ui-left > *, html.motion .koty-head, html.motion .kota-item, html.motion .peaks-head > *, html.motion .peaks, html.motion .views, html.motion .views-label, html.motion .night-line, html.motion .timeline {
  opacity: 0; transform: translateY(16px);
}
html.motion .is-in, html.motion .chapter.is-entered .ui-right > *, html.motion .chapter.is-entered .ui-left > *, html.motion .chapter.is-entered .koty-head, html.motion .chapter.is-entered .peaks-head > *, html.motion .chapter.is-entered .peaks, html.motion .chapter.is-entered .views, html.motion .chapter.is-entered .views-label, html.motion .chapter.is-entered .night-line, html.motion .chapter.is-entered .timeline {
  opacity: 1; transform: none; transition: opacity 1.4s var(--ease-inout), transform 1.4s var(--ease-inout);
}
html.motion .kota-item.is-in { opacity: 1; transform: translate(-50%, -50%); transition: opacity 0.8s var(--ease-inout), transform 0.8s var(--ease-inout); }
html.motion .koty-lines line.is-in { stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s linear; }
html.motion .ui-right > *:nth-child(2), html.motion .ui-left > *:nth-child(2) { transition-delay: 0.1s; }
html.motion .ui-right > *:nth-child(3), html.motion .ui-left > *:nth-child(3) { transition-delay: 0.2s; }
html.motion .ui-right > *:nth-child(4), html.motion .ui-left > *:nth-child(4) { transition-delay: 0.3s; }
html.motion .atlas-table tr { opacity: 0; transform: translateY(10px); transition: opacity 0.9s var(--ease-inout), transform 0.9s var(--ease-inout); }
html.motion .atlas-table tr.is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1023px) {
  .chapter-ui > *, .ui-right > *, .ui-left > * { grid-column: 1 / 13; }
  .chapter-ui .display-2 { max-width: 20ch; }
  .peaks-head, .koty-head { grid-column: 1 / 13; }
  .section-head .display-2, .section-head .lead { grid-column: 1 / 13; }
  .builder-grid > div, .builder-grid .media, .faq-grid > div:first-child, .faq-list, .visit-grid > div:first-child, .form { grid-column: 1 / 13; }
  .unit { grid-template-columns: 3rem 1fr auto; grid-template-areas: "n type state" "n meta meta" "n btn btn"; row-gap: 0.5rem; }
  .unit-btn { justify-self: start; white-space: normal; text-align: left; }
  .unit > :nth-child(3), .unit > :nth-child(4), .unit > :nth-child(5), .unit > :nth-child(6) { display: none; }
  .unit-n { grid-area: n; }
  .unit-type { grid-area: type; }
  .unit-state { grid-area: state; justify-self: end; }
  .unit-btn { grid-area: btn; }
  .unit .unit-meta-m { grid-area: meta; display: block; }
}
@media (min-width: 1024px) { .unit .unit-meta-m { display: none; } }
@media (max-width: 767px) {
  :root { --rail: 0px; --chapter-vh: 150vh; }
  body { padding-bottom: 48px; }
  .chapter-ui { padding-bottom: clamp(4.5rem, 10vh, 6rem); padding-right: var(--gutter); }
  .hero-title { max-width: 14ch; grid-column: 1 / 13; }
  .hero-actions { gap: 1rem; }
  .hero-actions .btn { width: 100%; }
  .scrim-left, .scrim-right { background: linear-gradient(0deg, oklch(0.2 0.02 240 / 0.7), oklch(0.2 0.02 240 / 0.2) 55%, transparent 75%); }
  .rail {
    top: auto; left: 0; right: 0; width: auto; height: 48px; padding: 0 1rem;
    grid-template-rows: none; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
    background: oklch(0.2 0.02 240 / 0.6);
  }
  .rail-brand { display: none; }
  .rail-alt { grid-auto-flow: column; align-items: baseline; gap: 0.4rem; }
  .rail-ticks { grid-auto-flow: column; gap: 2px; justify-self: center; }
  .rail-ticks a { width: 24px; height: 44px; }
  .rail-ticks a::after { right: auto; left: 6px; top: 22px; width: 12px; height: 1px; transform-origin: left; }
  .rail-ticks a.is-active::after { width: 12px; height: 3px; top: 21px; }
  .rail-menu { writing-mode: horizontal-tb; transform: none; }
  html.motion .ui-koty { align-content: end; grid-template-rows: none; }
  .koty-head { padding-top: 0; }
  html.motion .kota-item, html.motion .kota-item.is-in { position: static; transform: none; max-width: none; grid-template-columns: 2.5rem 1fr; left: auto; top: auto; }
  .koty { display: grid; gap: 0.35rem; align-self: end; }
  .kota-t { background: none; padding: 0; }
  .koty-lines { display: none; }
  .peaks { height: 96px; }
  .views { grid-template-columns: 1fr; gap: 0.35rem; }
  .view-seg { min-height: 44px; grid-auto-flow: column; justify-content: space-between; align-items: center; border-radius: 999px; padding: 0.4rem 1rem; }
  .ms-date { font-size: 1.25rem; }
  .ms-t { font-size: 0.6rem; white-space: normal; max-width: 5rem; }
  .milestones { height: 6.5rem; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .menu-inner { padding-bottom: 4rem; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-title { max-width: 18ch; grid-column: 1 / 13; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}
