/* ==========================================================================
   Saulės užtemimas — main stylesheet
   Design grid: 1366 × 768 (XD "Web 1366"). 1rem == 10 design px at 1366w,
   so every measurement below is the XD value ÷ 10.
   ========================================================================== */

:root {
    --bg: #070707;
    --black: #000;
    --fg: #fff;
    --fg-2: rgba(255, 255, 255, .78);
    --muted: rgba(255, 255, 255, .5);
    --line: rgba(255, 255, 255, .28);
    --line-strong: rgba(255, 255, 255, .42);

    --font: "Figtree", "Gilroy", "Helvetica Neue", Arial, sans-serif;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-io: cubic-bezier(.65, 0, .35, 1);

    --gutter-l: 4.2rem;
    --gutter-r: 3.7rem;
    --vh: 1vh;
}

@supports (height: 100svh) { :root { --vh: 1svh; } }

html {
    font-size: clamp(8px, calc(100vw / 136.6), 15px);
    -webkit-text-size-adjust: 100%;
    background: var(--black);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--black);
    color: var(--fg);
    font-family: var(--font);
    font-weight: 300;
    font-size: 1.3rem;
    line-height: 1.4;
    letter-spacing: .01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; text-align: inherit; }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; font-weight: inherit; }
ol, ul { list-style: none; }
canvas { display: block; }
::selection { background: #fff; color: #000; }

:focus-visible { outline: 1px solid rgba(255, 255, 255, .7); outline-offset: 4px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- film grain (matches the photographic noise in the XD) ---------- */
.grain {
    position: fixed; inset: -50%;
    z-index: 60; pointer-events: none;
    opacity: .045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain 1s steps(6) infinite;
    will-change: transform;
}
@keyframes grain {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-3%, 2%); }
    40% { transform: translate(2%, -4%); }
    60% { transform: translate(-4%, -1%); }
    80% { transform: translate(3%, 3%); }
    100% { transform: translate(0, 0); }
}

/* ---------- shared: link with ↗ arrow ---------- */
.link-arrow {
    display: inline-flex; align-items: center; gap: 1.3rem;
    white-space: nowrap;
}
.link-arrow__text {
    position: relative; display: inline-block;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
    transition: background-size .6s var(--ease-out);
    padding-bottom: .1em;
}
.i-arrow { width: 1.05rem; height: 1.05rem; flex: none; overflow: visible; transition: transform .6s var(--ease-out); }
.link-arrow:hover .link-arrow__text,
.link-arrow:focus-visible .link-arrow__text { background-size: 100% 1px; }
.link-arrow:hover .i-arrow,
.link-arrow:focus-visible .i-arrow { transform: translate(.3rem, -.3rem); }

/* ==========================================================================
   Header (fixed)
   ========================================================================== */
.site-header {
    position: fixed; z-index: 50; top: 0; left: 0; right: 0;
    display: flex; justify-content: space-between; align-items: center;
    padding: 4.1rem var(--gutter-r) 0 var(--gutter-l);
    font-size: 1.5rem; line-height: 1.8rem; letter-spacing: .015em;
    pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.site-header__date { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   01 — Hero / eclipse
   ========================================================================== */
.hero {
    position: relative;
    height: calc(var(--vh) * 100);
    min-height: 52rem;
    overflow: hidden;
    background: #050505;
    z-index: 1;
}
.hero__canvas, .hero__fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__fallback {
    /* CSS-only eclipse, shown until WebGL is ready (or if it is unavailable) */
    background:
        radial-gradient(circle at 50% 49.7%, #000 0 22rem, rgba(255, 250, 240, .95) 22.3rem, rgba(210, 230, 240, .45) 24rem, rgba(120, 170, 190, .14) 30rem, transparent 42rem),
        #050505;
    transition: opacity 1.2s var(--ease-out);
}
.webgl-ready .hero__fallback { opacity: 0; }

.hero__countdown {
    position: absolute; left: var(--gutter-l); top: calc(50% + 1.9rem);
    transform: translateY(-50%);
    display: flex; gap: 2.2rem;
    font-size: 1.3rem; line-height: 1.8rem; letter-spacing: .02em;
}
.hero__countdown-value { font-variant-numeric: tabular-nums; min-width: 8ch; }

.hero__link { position: absolute; font-size: 1.3rem; line-height: 1.8rem; letter-spacing: .02em; }
.hero__link--prepare { left: var(--gutter-l); bottom: 5.7rem; }
.hero__link--locations { right: var(--gutter-r); bottom: 4.8rem; }

/* ==========================================================================
   02 — Locations / globe
   ========================================================================== */
.loc {
    position: relative; z-index: 2;
    height: 84.7rem;
    background: var(--bg);
    overflow: hidden;
    will-change: clip-path, transform;
}
.loc__panel {
    position: absolute; top: 0; bottom: 0; left: 20.2rem; width: 94.6rem;
    background: var(--black);
    overflow: hidden;
}
.loc__globe { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.loc__globe.is-dragging { cursor: grabbing; }
.loc__hud { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.hud-ring { fill: none; stroke: rgba(255, 255, 255, .2); stroke-width: .9; }
.hud-line { stroke: rgba(255, 255, 255, .16); stroke-width: .9; }
.hud-mark { fill: rgba(255, 255, 255, .55); }
.hud-plus { stroke: rgba(255, 255, 255, .75); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.hud-ruler line { stroke: rgba(255, 255, 255, .35); stroke-width: 1; vector-effect: non-scaling-stroke; }
.hud-ruler line.is-major { stroke: rgba(255, 255, 255, .8); }

.loc__current {
    position: absolute; left: 8.3rem; top: 8.1rem;
    display: grid; gap: 0; font-size: 1.1rem; line-height: 1.35rem; letter-spacing: .02em;
}
.loc__current-town { position: relative; }
.i-chev { position: absolute; left: -1rem; top: .35rem; width: .55rem; height: .75rem; }
.loc__current-coords { color: var(--muted); }

.loc__list { position: absolute; left: 5.2rem; top: 33.2rem; width: 24.3rem; }
.loc__title { padding-left: 1.5rem; font-size: 1.5rem; line-height: 1.8rem; letter-spacing: .02em; margin-bottom: 2.3rem; }
.loc__items { display: grid; gap: .4rem; }
.loc__item {
    position: relative; display: flex; width: 100%; min-height: 4.2rem;
    padding: .7rem 1.5rem .8rem;
    font-size: 1.1rem; line-height: 1.45rem; letter-spacing: .02em;
    border: 1px solid transparent;
    transition: border-color .5s var(--ease-out), background-color .5s var(--ease-out);
}
.loc__item::before {
    content: ""; position: absolute; inset: -1px; border: 1px solid var(--line-strong);
    clip-path: inset(0 100% 0 0); transition: clip-path .7s var(--ease-out);
}
.loc__item.is-active::before { clip-path: inset(0 0 0 0); }
.loc__item:hover:not(.is-active) { background: rgba(255, 255, 255, .03); }
.loc__item-num { width: 4.1rem; flex: none; color: var(--fg-2); }
.loc__item-body { display: grid; }
.loc__item-coords { color: var(--muted); font-size: 1.05rem; }
.loc__item .loc__item-name { transition: transform .5s var(--ease-out); }
.loc__item:hover .loc__item-name { transform: translateX(.4rem); }

.loc__intro {
    position: absolute; left: 6.7rem; top: 71.2rem; width: 53rem;
    font-size: 1.25rem; line-height: 1.85rem; letter-spacing: .02em;
}

.loc__card {
    position: absolute; left: 101rem; top: 39rem; width: 25.8rem; height: 35.6rem;
    display: grid; grid-template-rows: 4.4rem 1fr 3rem;
    border: 1px solid var(--line-strong);
    background: rgba(0, 0, 0, .25);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    transform-origin: 100% 0;
}
.loc__card.is-closed { pointer-events: none; }
.loc__card-head {
    display: flex; align-items: center; gap: 1rem;
    padding: 0 1.4rem 0 1.7rem; border-bottom: 1px solid var(--line-strong);
    font-size: 1.1rem; line-height: 1.3rem; letter-spacing: .02em;
}
.loc__card-num { align-self: flex-start; padding-top: .9rem; }
.loc__card-title { display: grid; flex: 1; }
.loc__card-coords { color: var(--muted); font-size: 1.05rem; }
.loc__card-close { width: 2.4rem; height: 2.4rem; display: grid; place-items: center; margin-right: -.4rem; }
.loc__card-close svg { width: 1.3rem; height: 1.3rem; transition: transform .6s var(--ease-out); }
.loc__card-close:hover svg { transform: rotate(90deg); }
.loc__card-map { position: relative; overflow: hidden; }
.loc__card-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.loc__card-cross { position: absolute; inset: 0; pointer-events: none;
    background:
        linear-gradient(rgba(255,255,255,.14), rgba(255,255,255,.14)) 58% 0 / 1px 100% no-repeat,
        linear-gradient(rgba(255,255,255,.14), rgba(255,255,255,.14)) 0 57% / 100% 1px no-repeat; }
.loc__card-link {
    justify-content: flex-end; gap: .9rem; padding: 0 1.4rem;
    border-top: 1px solid var(--line-strong);
    font-size: 1.1rem; color: var(--fg-2);
}
.loc__card-link .i-arrow { width: .9rem; height: .9rem; }

.loc__reopen { display: none; }

/* ==========================================================================
   03 — Prepare / node graph
   ========================================================================== */
.prep {
    position: relative; z-index: 2;
    height: 64.9rem;
    background: var(--bg);
    overflow: hidden;
}
.prep__graph { position: absolute; inset: 0; }
.prep__lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.prep__lines path { fill: none; stroke: rgba(255, 255, 255, .32); stroke-width: 1; transition: stroke .5s; }
.prep__lines path.is-active { stroke: rgba(255, 255, 255, .6); }

.prep__root {
    position: absolute; left: 6.7rem; top: 28.6rem; transform: translateY(-50%);
    display: flex; align-items: center; gap: 1.5rem;
    font-size: 1.3rem; line-height: 1.8rem; letter-spacing: .02em;
}
.prep__root-dot {
    position: relative; width: 1.35rem; height: 1.35rem; border-radius: 50%;
    background: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.6);
}
.prep__root-dot::after {
    content: ""; position: absolute; inset: -.6rem; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .35);
    animation: pulse 2.8s var(--ease-out) infinite;
}
@keyframes pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }

.prep__node { position: absolute; transform: translate(-50%, -50%); }
.prep__node button { display: flex; align-items: center; gap: 1.3rem; padding: 1rem; margin: -1rem; }
.prep__node-dot {
    width: .5rem; height: .5rem; border-radius: 50%; background: rgba(255,255,255,.55);
    transition: transform .5s var(--ease-out), background-color .5s;
}
.prep__node-label {
    position: absolute; left: calc(100% + .6rem); top: 50%; transform: translateY(-50%);
    white-space: nowrap; font-size: 1.3rem; line-height: 1.8rem; letter-spacing: .01em;
    color: var(--muted); transition: color .5s var(--ease-out);
}
.prep__node.is-active .prep__node-label,
.prep__node:hover .prep__node-label { color: var(--fg); }
.prep__node.is-active .prep__node-dot,
.prep__node:hover .prep__node-dot { background: #fff; transform: scale(1.6); }

/* XD positions of the three nodes (dot centres) */
.prep__node--1 { left: 55.3rem; top: 18rem; }
.prep__node--2 { left: 70.9rem; top: 22.5rem; }
.prep__node--3 { left: 60.3rem; top: 39.7rem; }

.prep__panel { position: absolute; left: 99.6rem; top: 25rem; width: 26rem; }
.prep__panel-title { font-size: 1.5rem; line-height: 1.8rem; letter-spacing: .02em; margin-bottom: 1.3rem; }
.prep__panel-text { text-wrap: pretty; font-size: 1.25rem; line-height: 1.85rem; color: var(--fg-2); letter-spacing: .01em; }

/* ==========================================================================
   04 — Finale / space
   ========================================================================== */
.finale { position: relative; z-index: 2; background: #000; }
.finale__stage { position: relative; height: calc(var(--vh) * 100); min-height: 52rem; overflow: hidden; }
.finale__canvas, .finale__fallback { position: absolute; inset: 0; width: 100%; height: 100%; }
.finale__fallback {
    background:
        radial-gradient(ellipse 160% 60% at 50% 128%, #dfe6ee 0 55%, #3d7fa8 57%, rgba(20, 60, 90, .6) 60%, transparent 66%),
        radial-gradient(circle at 57.5% 37.5%, #fff 0 2rem, rgba(255,255,255,.35) 5rem, transparent 12rem),
        radial-gradient(circle at 46.7% 29.3%, #1a1a1a 0 9.4rem, transparent 9.5rem),
        #000;
    transition: opacity 1.2s;
}
.webgl-ready .finale__fallback { opacity: 0; }

/* ==========================================================================
   Motion helpers
   ========================================================================== */
.js [data-light] { opacity: 0; }
.no-js [data-light], .reduced-motion [data-light] { opacity: 1 !important; }

.line-mask { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Tablet & phone: reflow the absolutely-positioned XD composition into a flow layout */
@media (max-width: 1099px) {
    html { font-size: 10px; }
    :root { --gutter-l: 2.4rem; --gutter-r: 2.4rem; }

    .site-header { padding-top: 2.4rem; font-size: 1.3rem; }

    .hero { min-height: 56rem; }
    .hero__fallback { background: radial-gradient(circle at 50% 46%, #000 0 30vw, rgba(255,250,240,.9) 30.5vw, rgba(120,170,190,.14) 45vw, transparent 60vw), #050505; }
    .hero__countdown { top: auto; bottom: 13rem; transform: none; flex-direction: column; gap: .4rem; }
    .hero__countdown-value { font-size: 2.6rem; line-height: 1.2; letter-spacing: .04em; }
    .hero__link { font-size: 1.2rem; }
    .hero__link--prepare { bottom: 7.2rem; }
    .hero__link--locations { left: var(--gutter-l); right: auto; bottom: 3.6rem; }

    .loc { height: auto; display: flex; flex-direction: column; padding-bottom: 6rem; }
    .loc__panel { position: relative; left: 0; width: 100%; height: min(112vw, 72rem); order: 2; }
    .loc__current { position: relative; left: auto; top: auto; order: 1; padding: 11rem var(--gutter-l) 3rem calc(var(--gutter-l) + 1.2rem); }
    .loc__list { position: relative; left: auto; top: auto; width: auto; order: 3; padding: 4rem var(--gutter-l) 0; }
    .loc__title { padding-left: 0; }
    .loc__item { padding-left: 1.2rem; }
    .loc__card { position: relative; left: auto; top: auto; width: auto; max-width: 48rem; height: 34rem; margin: 3rem var(--gutter-l) 0; order: 4; }
    .loc__intro { max-width: 60rem; }
    .loc__intro { position: relative; left: auto; top: auto; width: auto; order: 5; padding: 4rem var(--gutter-l) 0; }

    .prep { height: auto; padding: 10rem 0 8rem; display: flex; flex-direction: column; }
    .prep__graph { position: relative; height: 38rem; margin: 0 var(--gutter-l); }
    .prep__root { left: 0; top: 50%; }
    .prep__root-label { max-width: 14ch; }
    .prep__node--1 { left: 56%; top: 12%; }
    .prep__node--2 { left: 66%; top: 44%; }
    .prep__node--3 { left: 52%; top: 86%; }
    .prep__panel { position: relative; left: auto; top: auto; width: auto; max-width: 42rem; margin: 4rem var(--gutter-l) 0; }

    .finale__stage { min-height: 60rem; }
}

@media (max-width: 599px) {
    .loc__card { height: 30rem; }
    .loc__item-name { font-size: 1.1rem; }
    .prep__graph { height: 34rem; }
    .prep__node-label { font-size: 1.2rem; }
}

@media (prefers-reduced-motion: reduce) {
    .grain { animation: none; }
    .prep__root-dot::after { animation: none; }
    *, *::before, *::after { transition-duration: .01ms !important; }
}

.js [data-hero-fade] { opacity: 0; }
.reduced-motion [data-hero-fade] { opacity: 1; }
