/* Kuća Spinut scroll walk-through. Fluid by rule: no fixed pixel widths, no max-width caps, grids are fr or %. */
:root {
  --ink: #f5f0e6; --muted: #c9d3d4; --bg: #0d1a1e; --glass: rgba(10, 21, 25, .62); --line: rgba(255, 255, 255, .16);
  --accent: #f0a066; --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(1rem, 5vw, 6rem);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); line-height: 1.6; font-size: 1.0625rem; overflow-x: hidden; }
a { color: inherit; }
h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0 0 .55em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.6vw, 4.2rem); }
h2 { font-size: clamp(1.6rem, 3.3vw, 2.5rem); }
p { margin: 0 0 1em; }

/* backdrop: WebGL canvas when available, still renders otherwise */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: none; z-index: 0; }
.gl #gl { display: block; }
.still { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; z-index: 0; transition: opacity .7s; }
.static .still.on { opacity: 1; }
.gl .still { display: none; }
.veil { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(to bottom, rgba(6, 14, 17, .5), rgba(6, 14, 17, 0) 18%, rgba(6, 14, 17, 0) 70%, rgba(6, 14, 17, .45)); }

/* top navigation, always visible */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: .7rem var(--gutter); background: linear-gradient(to bottom, rgba(6, 14, 17, .72), rgba(6, 14, 17, 0)); }
.brand { text-decoration: none; display: grid; line-height: 1.15; }
.brand b { font-family: var(--serif); font-size: 1.2rem; }
.brand small { opacity: .75; font-size: .78rem; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem 1.2rem; }
.links a { text-decoration: none; font-size: .9rem; opacity: .85; padding: .2rem 0; border-bottom: 1px solid transparent; }
.links a:hover { opacity: 1; border-bottom-color: currentColor; }
.tools { display: flex; align-items: center; gap: .6rem; }
.lang { display: flex; gap: .25rem; }
.lang a, .btn-mode { font: inherit; color: inherit; text-decoration: none; font-size: .78rem; font-weight: 600; padding: .28rem .55rem; border: 1px solid rgba(255, 255, 255, .35); border-radius: .4rem; background: rgba(6, 14, 17, .35); backdrop-filter: blur(6px); cursor: pointer; }
.lang a[aria-current] { background: var(--ink); color: #0d1a1e; border-color: var(--ink); }
.btn-mode[hidden] { display: none; }
@media (max-width: 900px) { .links { display: none; } .nav { grid-template-columns: 1fr auto; } .brand small { display: none; } }

/* persistent labels */
.ill { position: fixed; left: var(--gutter); bottom: max(.8rem, env(safe-area-inset-bottom)); z-index: 30; margin: 0; padding: .35rem .7rem; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; background: rgba(6, 14, 17, .66); border: 1px solid var(--line); border-radius: 999px; backdrop-filter: blur(6px); }
.chapter { position: fixed; right: var(--gutter); bottom: max(.8rem, env(safe-area-inset-bottom)); z-index: 30; margin: 0; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; opacity: .85; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.rail { position: fixed; right: calc(var(--gutter) / 2.4); top: 50%; transform: translateY(-50%); z-index: 25; display: grid; gap: .55rem; }
.rail a { display: block; width: .55rem; height: .55rem; border-radius: 50%; background: rgba(255, 255, 255, .35); border: 1px solid rgba(255, 255, 255, .5); transition: transform .3s, background .3s; }
.rail a[aria-current] { background: var(--accent); border-color: var(--accent); transform: scale(1.5); }
.static .rail { display: none; }
.loading-msg { position: fixed; inset: 0; z-index: 40; display: none; place-items: center; margin: 0; background: var(--bg); font-family: var(--serif); font-size: 1.4rem; }
.loading .loading-msg { display: grid; }

/* text sections scroll over the scene */
main { position: relative; z-index: 5; }
section { min-height: 130vh; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 1.2rem; align-items: center; padding: 0 var(--gutter); }
section.tall { min-height: 160vh; }
.card { grid-column: 1 / span 5; padding: clamp(1.1rem, 2.6vw, 2rem); border-radius: 1.1rem; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, .25); }
section.right .card { grid-column: 8 / span 5; }
.hero .card { grid-column: 1 / span 7; background: rgba(8, 18, 22, .38); }
.hero { min-height: 120vh; align-items: center; }
.gl .card, .loading .card { opacity: 0; transform: translateY(2.2rem); transition: opacity .8s ease, transform .8s ease; }
.gl .card.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .gl .card { transition: opacity .2s; transform: none; } }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; color: var(--accent); margin-bottom: .8rem; font-weight: 600; }
.lede { font-size: 1.15rem; color: var(--muted); }
.cue { margin: 1.4rem 0 0; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cue::after { content: " \2193"; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; margin: 1.3rem 0 0; }
.facts div { border-top: 1px solid var(--line); padding-top: .6rem; }
.facts dt { font-family: var(--serif); font-size: 1.5rem; line-height: 1.1; }
.facts dd { margin: .2rem 0 0; font-size: .85rem; color: var(--muted); line-height: 1.35; }
.fine { font-size: .82rem; color: var(--muted); margin: 0; }

/* still-image mode: no scroll-driven camera, so the sections are shorter and always visible */
.static section { min-height: 90vh; }
.static section.tall { min-height: 90vh; }
.static .card { opacity: 1; background: rgba(8, 18, 22, .72); }
.static .cue { display: none; }

.perf { position: fixed; left: .5rem; top: 4rem; z-index: 50; margin: 0; padding: .3rem .5rem; font-size: .7rem; background: rgba(0, 0, 0, .7); color: #8f8; }

/* phones and narrow windows: cards become a bottom sheet so the scene stays visible above */
@media (max-width: 900px) {
  section { align-items: end; padding-bottom: 12vh; }
  .card, section.right .card, .hero .card { grid-column: 1 / -1; }
  .hero { align-items: end; }
  body { font-size: 1rem; }
  .rail { display: none; }
  .ill { bottom: auto; top: 3.6rem; left: var(--gutter); font-size: .66rem; }
  .chapter { display: none; }
  section { padding-bottom: 8vh; }
}
