/* Ivan Matković. "Pozornica": the iPhone stays, the whole evening scrolls past it, and a constellation joins the steps.
   Everything that moves here moves by transform or opacity, so nothing is repainted while the page scrolls. */
:root { --lead: clamp(18px, 1.45vw, 21px); --h3: clamp(21px, 2vw, 28px); --h2: clamp(30px, 3.4vw, 50px); --pad: clamp(28px, 5vw, 84px); --gutter: 46px; }
main, footer { position: relative; z-index: 1; }
h1 { font-size: clamp(40px, 4.5vw, 66px); font-weight: 900; letter-spacing: -.03em; line-height: 1; }
h2 { font-size: var(--h2); font-weight: 900; letter-spacing: -.03em; line-height: 1.02; }

/* Layout: the stage on the left never moves, the column on the right scrolls */
.tour { display: grid; grid-template-columns: 47fr 53fr; grid-template-rows: auto auto 1fr; }
.top { grid-column: 2; grid-row: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 96px; padding: 0 var(--margin) 0 var(--pad); }
.top nav { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 32px); font-size: 15px; font-weight: 700; }
.top nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.top nav a:hover { color: var(--gold-text); }
.top .lang { color: var(--soft); } .top .lang b { color: var(--ink); font-weight: 800; }
.hero { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 24px; min-height: calc(100svh - 96px); padding: 20px var(--margin) 110px var(--pad); }
.hero p.say { max-width: 36ch; font-size: var(--lead); line-height: 1.5; }
.hero .note { margin-top: -10px; }
.js .hero .w { display: inline-block; opacity: 0; transform: translateY(.55em) rotate(3deg); }
.js.ready .hero .w { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i) * 85ms + 120ms); }

/* The stage */
.stage { grid-column: 1; grid-row: 1 / span 3; align-self: start; position: sticky; top: 20px; z-index: 3; height: calc(100svh - 40px); margin: 20px 0 20px 20px; border-radius: var(--r-card); overflow: hidden; background: var(--surface); display: grid; place-items: center; }
.stage .art { position: absolute; top: -4%; left: -4%; width: 108%; height: 108%; max-width: none; object-fit: cover; opacity: 0; transform: scale(1.08); transition: opacity 1s ease, transform 7s cubic-bezier(.2, .6, .3, 1); will-change: opacity, transform; }
.stage .art.on { opacity: 1; transform: none; }
.stage::after { content: ""; position: absolute; inset: 0; background: rgb(10 12 27 / .6); }
.rig { position: relative; z-index: 1; margin-top: -40px; transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
.js .rig { opacity: 0; translate: 0 70px; scale: .92; }
.js.ready .rig { opacity: 1; translate: 0 0; scale: 1; transition: transform .5s cubic-bezier(.2, .7, .2, 1), opacity .9s var(--ease) .15s, translate 1.1s var(--ease) .15s, scale 1.1s var(--ease) .15s; }
.stage .phone { --pw: min(25vw, calc((100svh - 210px) / 2.174)); animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.stage .phone .shot, .stage .phone video { position: absolute; inset: calc(var(--pw) * .028); width: calc(100% - var(--pw) * .056); height: calc(100% - var(--pw) * .056); object-fit: cover; border-radius: calc(var(--pw) * .134); }
.stage .phone .shot { opacity: 0; transform: translateY(calc(var(--dir, 1) * 12%)) scale(.94); will-change: opacity, transform; }
.stage .phone .shot.on { opacity: 1; transform: none; transition: opacity .55s ease, transform .7s var(--ease); z-index: 2; }
.stage .phone .shot.off { opacity: 0; transform: translateY(calc(var(--dir, 1) * -7%)) scale(.97); transition: opacity .4s ease, transform .5s ease; z-index: 1; }
.stage .phone video { z-index: 3; opacity: 0; transition: opacity .45s ease; background: #04050c; }
.stage .phone video.on { opacity: 1; }
.no-js-shot { opacity: 1 !important; transform: none !important; }

/* The rail: steps as linked circles that fill in, like the app's evening ritual */
.rail { position: absolute; z-index: 2; left: 0; right: 0; bottom: 12px; display: grid; justify-items: center; gap: 2px; }
.rail .now { font-size: 15px; font-weight: 800; color: var(--ink); min-height: 1.4em; }
.rail ol { position: relative; display: flex; }
.rail ol::before, .rail ol::after { content: ""; position: absolute; top: 50%; left: 17px; right: 17px; height: 2px; margin-top: -1px; background: rgb(242 234 211 / .22); }
.rail ol::after { right: auto; width: calc((100% - 34px) * var(--done, 0)); background: var(--gold-text); transition: width .6s var(--ease); }
.rail a { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 44px; }
.rail a::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #55536a; box-shadow: 0 0 0 3px #131630; transition: background .3s, transform .4s var(--ease), box-shadow .3s; }
.rail li.done a::before { background: var(--gold-text); }
.rail li.now a::before { background: var(--gold-text); transform: scale(1.5); box-shadow: 0 0 0 3px #131630, 0 0 0 6px rgb(246 208 122 / .28); }
.rail a:hover::before { transform: scale(1.5); }

/* The acts */
.acts { grid-column: 2; grid-row: 3; position: relative; padding: 0 var(--margin) 14svh calc(var(--pad) + var(--gutter)); }
.thread { position: absolute; top: 0; left: calc(var(--pad) - 10px); width: 56px; height: 100%; overflow: visible; pointer-events: none; }
.thread path { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.thread .base { stroke: rgb(242 234 211 / .16); stroke-dasharray: 1 8; }
.thread .lit { stroke: var(--gold-text); }
.thread .pt { fill: #55536a; transition: fill .4s, transform .6s var(--ease); transform-box: fill-box; transform-origin: center; transform: scale(.55); }
.thread .pt.lit { fill: var(--gold-text); transform: scale(1); }
.thread .halo { fill: rgb(246 208 122 / .16); opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.3); transition: opacity .5s, transform .8s var(--ease); }
.thread .halo.lit { opacity: 1; transform: scale(1); }
.block { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 22px; min-height: 84svh; max-width: 560px; padding-block: 40px; scroll-margin-top: 4svh; }
.block p { max-width: 36ch; font-size: var(--lead); line-height: 1.5; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 26px; font-size: 17px; line-height: 1.4; }
.facts dt { font-weight: 800; }
.facts dd { color: var(--soft); }
.story-illustration { width: min(100%, 440px); height: auto; border-radius: var(--r-art); }
.readalong { max-width: 22ch; font-size: var(--h3) !important; font-weight: 800; line-height: 1.25 !important; letter-spacing: -.01em; }
.readalong span { color: var(--soft); animation: said 7s infinite paused; animation-delay: calc(var(--w) * .45s); }
.block.active .readalong span, .block.active .hold::before { animation-play-state: running; }
@keyframes said { 0%, 2% { color: var(--soft); } 6%, 82% { color: var(--gold-text); } 90%, 100% { color: var(--soft); } }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-alt); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 62px; padding: 6px 16px; border-radius: 999px; font-size: 15px; font-weight: 800; color: var(--soft); cursor: pointer; transition: color .2s, background .2s, transform .15s; }
.seg label:active { transform: scale(.97); }
.seg input:checked + label { color: var(--on-gold); background: var(--accent-fill); }
.seg input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 3px; }
.clock { font-weight: 700; color: var(--ink); }
.clock b { color: var(--gold-text); font-weight: 900; }
.thumbs { display: flex; gap: 10px; }
.thumbs img { min-width: 0; width: clamp(64px, 7vw, 96px); aspect-ratio: 1; object-fit: cover; border-radius: 14px; }
.hold { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 20px; border-radius: 999px; overflow: hidden; background: var(--surface-alt); font-size: 15px !important; font-weight: 800; }
.hold::before { content: ""; position: absolute; inset: 0; background: rgb(246 208 122 / .22); transform-origin: left; animation: hold 4.5s infinite paused; }
.hold span { position: relative; }
@keyframes hold { 0%, 12% { transform: scaleX(0); } 62%, 78% { transform: scaleX(1); opacity: 1; } 90%, 100% { transform: scaleX(1); opacity: 0; } }

.shell { width: min(1240px, 100% - 2 * var(--margin)); margin-inline: auto; }
.gap { margin-top: clamp(110px, 14vw, 200px); }

/* More in Snivaj: three whole screens. A row on a computer, a row to swipe on a phone. */
.more h2 { margin-bottom: clamp(36px, 5vw, 64px); }
.reel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 64px); width: min(1240px, 100% - 2 * var(--margin)); margin-inline: auto; }
.reel li { display: flex; flex-direction: column; align-items: flex-start; }
.reel .phone { --pw: clamp(210px, 21vw, 290px); }
.reel h3 { margin-top: 26px; font-size: var(--h3); font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.reel p { margin-top: 10px; max-width: 30ch; color: var(--soft); }
.notes { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; }
.notes h2 { grid-column: 1 / span 4; }
.notes .text { grid-column: 5 / span 8; columns: 2; column-gap: 56px; }
.notes .text p { break-inside: avoid; margin-bottom: 22px; line-height: 1.6; color: var(--soft); }
.notes .text b { color: var(--ink); font-weight: 800; }
.open { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: center; min-height: min(88svh, 760px); padding: 0 max(var(--margin), calc((100% - 1240px) / 2)); overflow: hidden; color: var(--on-gold); background: var(--gold-text); }
.open .say { grid-column: 1 / span 6; display: flex; flex-direction: column; align-items: flex-start; gap: 22px; padding-block: 64px; }
.open h2 { font-size: clamp(38px, 5.4vw, 80px); }
.open p { max-width: 36ch; font-size: var(--lead); line-height: 1.5; }
.open .phone { --pw: clamp(250px, 25vw, 340px); grid-column: 8 / span 4; justify-self: center; align-self: start; margin: 70px 0 -160px; box-shadow: none; }
.android { font-size: 15px !important; }
footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 28px; padding-block: 34px; font-size: 15px; color: var(--soft); }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
footer a:hover { color: var(--gold-text); }

/* A falling star now and then, as on the first snivaj.com */
.shootwrap { position: fixed; z-index: 0; pointer-events: none; transform: rotate(150deg); }
.shoot { position: relative; width: 150px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(242,234,211,0) 0%, rgba(242,234,211,.85) 78%, #FFF9E8 100%); animation: shootAnim 1.5s cubic-bezier(.2,.6,.4,1) forwards; }
@keyframes shootAnim { 0% { transform: translateX(0); opacity: 0; } 8% { opacity: 1; } 70% { opacity: 1; } 100% { transform: translateX(58vmax); opacity: 0; } }

@media (max-width: 900px) {
  :root { --gutter: 38px; }
  .tour { display: block; }
  .top { padding-inline: var(--margin); min-height: 72px; }
  .top nav a.wide { display: none; }
  .hero { min-height: 0; padding: 14px var(--margin) 40px; }
  .hero .btn { width: 100%; }
  .stage { top: 0; height: 50svh; margin: 0; border-radius: 0 0 var(--r-card) var(--r-card); }
  .rig { margin-top: -44px; }
  .stage .phone { --pw: min(46vw, calc((50svh - 104px) / 2.174)); }
  .rail { bottom: 4px; gap: 0; }
  .rail .now { font-size: 14px; }
  .rail a { width: min(28px, calc(100vw / 12)); }
  .rail ol::before, .rail ol::after { left: 14px; right: 14px; }
  .rail ol::after { right: auto; width: calc((100% - 28px) * var(--done, 0)); }
  .acts { padding: 8px var(--margin) 6svh calc(var(--margin) + var(--gutter)); }
  .thread { left: calc(var(--margin) - 14px); width: 40px; }
  .block { min-height: 46svh; justify-content: flex-start; max-width: none; padding-block: 30px 34px; gap: 18px; scroll-margin-top: calc(50svh + 6px); }
  .reel { display: flex; width: auto; margin: 0; padding: 4px var(--margin) 14px; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--margin); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .reel::-webkit-scrollbar { display: none; }
  .reel li { flex: 0 0 64vw; scroll-snap-align: start; }
  .reel .phone { --pw: 64vw; }
  .notes h2, .notes .text { grid-column: 1 / -1; }
  .notes .text { columns: 1; margin-top: 26px; }
  .open { grid-template-columns: 1fr; min-height: 0; }
  .open .say, .open .phone { grid-column: 1; }
  .open .say { padding-block: 56px 0; }
  .open .say .btn { width: 100%; }
  .open .phone { --pw: min(260px, 70vw); margin: 40px 0 -170px; }
}
@media (prefers-reduced-motion: reduce) {
  .stage .art, .stage .phone .shot, .rig, .rail ol::after, .thread .pt, .thread .halo { transition: none !important; }
  .stage .phone, .hold::before { animation: none; }
  .readalong span { animation: none; color: var(--gold-text); }
  .js .hero .w, .js .rig { opacity: 1; transform: none; translate: none; scale: none; transition: none; }
}
