/* Qoley motion: enamel, ink and signal red. All content is visible by default. */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); }
.hero { position: relative; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 82% 40%, #2f80ed13, transparent 58%),
    radial-gradient(ellipse at 55% 75%, #d7263d0b, transparent 45%);
}
.hero-copy { animation: none; min-width: 0; }
.hero-visual { perspective: 1100px; }
.hero-visual::before { inset: 0 -8px 6px 24px; transform: rotate(4deg); opacity: .25; }
.hero h1 { overflow-wrap: anywhere; }
.hero h1 span { display: inline-block; max-width: 100%; }
.primary { box-shadow: 0 6px 18px var(--shadow); }
.button { transition: transform .25s var(--ease-out), box-shadow .25s, background .25s; }
.button:hover { box-shadow: 0 12px 28px var(--shadow); }
.button svg { transition: transform .25s var(--ease-out); }
.button:hover svg { transform: translate(2px, -2px); }
.header nav a { position: relative; }
.header nav a::after {
  content: ""; position: absolute; bottom: -5px; left: 0; right: 0; height: 2px;
  background: var(--signal); transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease-out);
}
.header nav a:hover::after, .header nav a:focus-visible::after { transform: scaleX(1); }
.theme-toggle { transition: transform .3s var(--ease-out), background .2s; }
.theme-toggle:hover { transform: rotate(-14deg); background: var(--surface2); }
.feature-grid { gap: 16px; }
.feature-grid article, .feature-grid article+article {
  padding: 30px; border: 1px solid var(--line); border-radius: 24px;
  background: var(--surface); position: relative;
  transition: translate .35s var(--ease-out), box-shadow .35s, border-color .35s;
}
.feature-icon { padding: 14px; background: var(--surface2); border-radius: 18px; }
.feature-icon svg { transition: transform .4s var(--ease-out); }
@media(hover:hover) {
  .feature-grid article:hover { translate: 0 -6px; border-color: var(--muted); box-shadow: 0 18px 38px var(--shadow); }
  .feature-grid article:hover .feature-icon svg { transform: rotate(-8deg) scale(1.08); }
}
.how { position: relative; isolation: isolate; overflow: hidden; }
.how::before {
  content: ""; position: absolute; inset: -80px 0; z-index: -1; opacity: .1; pointer-events: none;
  background: repeating-linear-gradient(115deg, transparent 0 70px, #a9bbcf 71px 72px, transparent 73px 94px);
}
.how .steps { position: relative; }
.steps article>span { font-size: 2rem; line-height: 1.2; }
.offline { position: relative; }
.offline::before { content: ""; position: absolute; left: 0; top: 40px; height: 3px; width: 70px; background: var(--signal); }
.facts strong { font-size: clamp(2rem, 4vw, 3.2rem); }
.lang[open] .lang-list, .header nav.open, .faq details[open] p { animation: panel-enter .25s var(--ease-out) both; }
@keyframes panel-enter { from { opacity: 0; translate: 0 -6px; } to { opacity: 1; translate: 0 0; } }

/* Observed once. No JS or a failed observer leaves the page fully readable.
   Focus always reveals a pending element immediately. */
@media(prefers-reduced-motion:no-preference) {
  .motion-ready [data-reveal] { transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
  .motion-ready [data-reveal="pending"] { opacity: 0; transform: translateY(26px); }
  .motion-ready [data-reveal="pending"]:focus-within { opacity: 1; transform: none; }
  .motion-ready .feature-grid [data-reveal]:nth-child(2),
  .motion-ready .steps [data-reveal]:nth-child(2) { transition-delay: 80ms; }
  .motion-ready .feature-grid [data-reveal]:nth-child(3),
  .motion-ready .steps [data-reveal]:nth-child(3) { transition-delay: 160ms; }
  .hero-copy > * { animation: hero-enter .8s var(--ease-out) both; }
  .hero-copy h1 { animation-delay: 70ms; }
  .hero-copy .lead { animation-delay: 140ms; }
  .hero-copy .actions { animation-delay: 210ms; }
  @keyframes hero-enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  @supports(animation-timeline: view()) {
    .hero-visual { animation: hero-parallax linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    .how::before { animation: rails-parallax linear both; animation-timeline: view(); }
    @keyframes hero-parallax { to { transform: translateY(32px) rotate(-1.5deg); } }
    @keyframes rails-parallax { from { transform: translateY(-40px); } to { transform: translateY(40px); } }
  }
}

/* A silent 12-second story: approach → reminder → time to read → hidden reset.
   Every moving part shares the controller's pause/offscreen/reduced-motion state. */
.journey {
  --journey-cycle: 12s; position: relative; isolation: isolate; overflow: hidden;
  border: 1px solid var(--line); border-radius: 32px; background: var(--surface);
  box-shadow: 0 32px 70px -24px var(--shadow), 0 2px 4px var(--shadow);
}
.journey-heading {
  display: flex; align-items: center; gap: 9px; min-height: 66px; padding: 16px 68px 16px 24px;
  font-size: .68rem; letter-spacing: .06em; font-weight: 700; line-height: 1.5; color: var(--muted);
}
.journey-heading > span:not([class]) { opacity: .45; }
.journey-heading-copy { min-width: 0; overflow-wrap: anywhere; }
.journey-signal { width: 7px; height: 7px; background: #2f80ed; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 4px #2f80ed14; }
.journey-stage { position: relative; }
.journey-map { display: block; width: 100%; height: auto; background: var(--bg); }
.journey-grid { stroke: var(--line); stroke-opacity: .35; }
.journey-park { fill: #5e96821a; }
.journey-trees { fill: #5e96822b; stroke: #5e96823b; stroke-width: 2; }
.journey-street { fill: none; stroke: var(--surface); stroke-width: 16; }
.journey-buildings { fill: var(--surface2); stroke: var(--line); stroke-width: 1.5; }
.journey-road-edge { stroke: var(--line); }
.journey-road { stroke: var(--surface); }
.journey-lane { stroke: var(--muted); stroke-opacity: .3; }
.journey-route { stroke: #2f80ed; opacity: .12; }
.journey-ties { stroke: var(--muted); stroke-opacity: .5; }
.journey-rails { stroke: var(--text); }
.journey-crossing-ring, .journey-echo { fill: var(--signal); fill-opacity: .07; stroke: var(--signal); stroke-opacity: .3; stroke-width: 1.5; transform-origin: 271px 165px; }
.journey-echo { fill: none; opacity: .4; transform: scale(1.35); }
.journey-crossing { fill: var(--signal); stroke: var(--surface); stroke-width: 4; }
.journey-marker { transform: translate(262px, 218px); }
.journey-car-halo { fill: #2f80ed; fill-opacity: .1; stroke: #2f80ed; stroke-opacity: .2; }
.journey-car { fill: #226cd0; stroke: var(--surface); stroke-width: 2.5; }
.journey-crossing-caption {
  position: absolute; left: 7%; top: 31%; max-width: 34%; font-size: .7rem; font-weight: 700; line-height: 1.5;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; color: var(--text);
}
.journey-notification {
  position: absolute; left: 20px; right: 20px; bottom: 20px; display: flex; gap: 12px; align-items: flex-start;
  padding: 17px 18px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface); box-shadow: 0 14px 32px var(--shadow); pointer-events: none;
}
.journey-notification-icon { flex-shrink: 0; }
.journey-notification-icon img { display: block; }
.journey-app-name { display: block; font-size: .7rem; color: var(--muted); margin-bottom: 3px; }
.journey-notification strong { display: block; color: var(--text); font-size: .92rem; line-height: 1.4; }
.journey-caption { display: block; font-size: .76rem; line-height: 1.6; color: var(--muted); margin-top: 6px; }
.journey-wave { display: flex; align-items: center; gap: 4px; height: 18px; margin-top: 10px; }
.journey-wave i { width: 3px; height: 8px; border-radius: 2px; background: var(--signal); transform-origin: center; }
.journey-wave i:nth-child(3n) { height: 18px; }
.journey-wave i:nth-child(3n+2) { height: 12px; }
.journey-story { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 20px 24px; }
.journey-step { position: relative; color: var(--muted); font-size: .69rem; line-height: 1.5; padding-top: 12px; overflow-wrap: anywhere; }
.journey-step::before, .journey-step::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; border-radius: 2px; background: var(--line); }
.journey-step::after { background: var(--signal); transform-origin: left; }
.journey-step b { display: block; font: 600 1.1rem/1.3 var(--display); color: var(--text); margin-bottom: 5px; }
.journey-toggle { position: absolute; top: 11px; right: 12px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--muted); }
.journey-toggle:hover, .journey-toggle:focus-visible { color: var(--text); border-color: var(--muted); }
.journey-toggle svg { grid-area: 1/1; width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.journey-toggle .journey-resume-icon, .journey-toggle[aria-pressed="true"] .journey-pause-icon { display: none; }
.journey-toggle[aria-pressed="true"] .journey-resume-icon { display: block; }

.journey[data-motion] .journey-marker { animation: journey-approach var(--journey-cycle) linear infinite both paused; }
.journey[data-motion] .journey-notification { animation: journey-notify var(--journey-cycle) linear infinite both paused; }
.journey[data-motion] .journey-route { animation: journey-route var(--journey-cycle) linear infinite both paused; }
.journey[data-motion] .journey-crossing-ring { animation: journey-arrival var(--journey-cycle) linear infinite both paused; }
.journey[data-motion] .journey-echo { animation: journey-echo var(--journey-cycle) linear infinite both paused; }
.journey[data-motion] .journey-wave i { animation: journey-wave var(--journey-cycle) linear infinite both paused; }
.journey[data-motion] .journey-wave i:nth-child(2n) { animation-name: journey-wave-alt; }
.journey[data-motion] .journey-step::after { animation: journey-progress-one var(--journey-cycle) linear infinite both paused; }
.journey[data-motion] .journey-step-reminder::after { animation-name: journey-progress-two; }
.journey[data-motion] .journey-step-attention::after { animation-name: journey-progress-three; }
.journey[data-motion="running"] :is(.journey-marker, .journey-notification, .journey-route, .journey-crossing-ring, .journey-echo, .journey-wave i), .journey[data-motion="running"] .journey-step::after { animation-play-state: running; }
.journey[data-motion="static"] :is(.journey-marker, .journey-notification, .journey-route, .journey-crossing-ring, .journey-echo, .journey-wave i), .journey[data-motion="static"] .journey-step::after { animation: none; }
@keyframes journey-approach {
  0% { transform: translate(217px, 407px); opacity: 0; }
  7% { transform: translate(217px, 407px); opacity: 1; }
  22% { transform: translate(231px, 350px); opacity: 1; }
  37% { transform: translate(247px, 290px); opacity: 1; }
  52% { transform: translate(258px, 239px); opacity: 1; }
  60%, 86% { transform: translate(262px, 218px); opacity: 1; }
  93%, 100% { transform: translate(262px, 218px); opacity: 0; }
}
@keyframes journey-notify {
  0%, 33% { opacity: 0; transform: translateY(22px) scale(.96); }
  41%, 82% { opacity: 1; transform: translateY(0) scale(1); }
  89%, 100% { opacity: 0; transform: translateY(8px) scale(.98); }
}
@keyframes journey-route { 0%, 7% { opacity: 0; } 16%, 82% { opacity: .12; } 92%, 100% { opacity: 0; } }
@keyframes journey-arrival { 0%, 33% { opacity: .4; transform: scale(.85); } 42% { opacity: 1; transform: scale(1.15); } 54%, 82% { opacity: .7; transform: scale(1); } 94%, 100% { opacity: .4; transform: scale(.85); } }
@keyframes journey-echo { 0%, 33% { opacity: 0; transform: scale(.8); } 38% { opacity: .8; } 52%, 100% { opacity: 0; transform: scale(1.85); } }
@keyframes journey-wave { 0%, 40%, 68%, 100% { transform: scaleY(.35); } 44%, 52%, 60% { transform: scaleY(1); } 48%, 56%, 64% { transform: scaleY(.4); } }
@keyframes journey-wave-alt { 0%, 40%, 68%, 100% { transform: scaleY(.5); } 44%, 52%, 60% { transform: scaleY(.4); } 48%, 56%, 64% { transform: scaleY(1.1); } }
@keyframes journey-progress-one { 0% { transform: scaleX(0); opacity: 1; } 33%, 86% { transform: scaleX(1); opacity: 1; } 94%, 100% { transform: scaleX(1); opacity: 0; } }
@keyframes journey-progress-two { 0%, 33% { transform: scaleX(0); opacity: 1; } 60%, 86% { transform: scaleX(1); opacity: 1; } 94%, 100% { transform: scaleX(1); opacity: 0; } }
@keyframes journey-progress-three { 0%, 60% { transform: scaleX(0); opacity: 1; } 86% { transform: scaleX(1); opacity: 1; } 94%, 100% { transform: scaleX(1); opacity: 0; } }
@media(min-width:761px) and (max-width:1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { max-width: 640px; }
  .hero-visual { width: min(100%, 560px); margin-inline: auto; }
}
@media(max-width:760px) {
  .hero { padding-block: 30px 42px; }
  .hero-visual { padding: 0; }
  /* Tall, enlarged text must not rotate decoration beyond the viewport. */
  .hero-visual::before { display: none; }
  .feature-grid article, .feature-grid article+article { padding: 26px; }
  .journey { border-radius: 26px; }
  .journey-heading { padding-left: 16px; font-size: .63rem; }
  .journey-stage { display: flow-root; background: var(--bg); }
  .journey-notification { position: relative; left: auto; right: auto; bottom: auto; margin: -60px 12px 12px; padding: 12px; gap: 8px; }
  .journey-notification-icon img { width: 30px; height: 30px; }
  .journey-notification strong { font-size: .8rem; }
  .journey-caption { font-size: .7rem; }
  .journey-wave { margin-top: 6px; height: 14px; }
  .journey-crossing-caption { font-size: .62rem; left: 5%; }
  .journey-story { padding: 16px; gap: 10px; }
  .journey-step { font-size: .65rem; }
  .offline::before { top: 26px; width: 48px; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .journey-toggle { display: none; }
  .feature-grid article:hover, .theme-toggle:hover { translate: none; transform: none; }
  .button:hover svg, .feature-grid article:hover .feature-icon svg { transform: none; }
}
