/* ==========================================================================
   Home scene: "from the lecture to the signature"
   Without JavaScript (or with reduced motion) this is a single, static
   full-height composition. scene.js adds .scene-ready to <html> and turns it
   into a pinned, scroll-driven scene.
   ========================================================================== */

.scene {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  background: var(--bg);
}

.scene__stage {
  position: relative;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
}

.scene__camera {
  position: absolute;
  inset: 0;
  /* same framing as the first frame of the scroll scene */
  transform: scale(1.04);
}

.scene__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus-x, 50%) var(--focus-y, 34%);
  /* settle the bright classroom photo into the dark palette */
  filter: saturate(0.82) contrast(1.04);
}

@media (max-aspect-ratio: 4/3) {
  .scene__photo {
    --focus-x: 32%;
  }
}

@media (max-aspect-ratio: 1/1) {
  .scene__photo {
    --focus-x: 42%;
  }
}

/* Static grade: keeps header and title legible, ties the photo to the site. */
.scene__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(16, 15, 13, 0.82) 0, rgba(16, 15, 13, 0.35) calc(var(--header) + 40px), transparent 34%),
    linear-gradient(to top, var(--bg) 0, rgba(16, 15, 13, 0.9) 16%, rgba(16, 15, 13, 0.45) 40%, transparent 62%),
    radial-gradient(120% 90% at 62% 40%, transparent 40%, rgba(42, 12, 15, 0.55) 100%),
    rgba(20, 12, 11, 0.22);
}

/* Scroll-driven darkness: the room fades out, the signature stays. */
.scene__dim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(75% 65% at 50% 48%, rgba(34, 12, 14, 0.96), var(--bg) 82%);
}

.scene__copy {
  position: absolute;
  inset: auto 0 clamp(64px, 13vh, 132px);
  z-index: 2;
}

.scene__copy > * {
  max-width: 900px;
}

.scene__title {
  margin: 14px 0 18px;
  font-family: var(--f-display);
  font-size: clamp(3.25rem, 8.4vw, 7.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}

.scene__roles {
  margin: 0;
  font-size: clamp(0.9375rem, 1.3vw, 1.1875rem);
  line-height: 1.6;
  color: #ddd5cc;
}

.scene__roles span {
  white-space: nowrap;
}

.scene__roles i {
  margin: 0 0.35em 0 0.5em;
  font-style: normal;
  color: var(--ember);
}

.scene__signature {
  position: absolute;
  top: 47%;
  left: 50%;
  z-index: 2;
  width: min(64vw, 900px);
  aspect-ratio: 796 / 222;
  transform: translate(-50%, -50%);
  visibility: hidden;
}

.scene__signature svg,
.scene__signature img {
  width: 100%;
  height: auto;
  overflow: visible;
}

.scene__caption {
  position: absolute;
  top: calc(47% + min(64vw, 900px) * 222 / 796 / 2 + clamp(20px, 4vh, 44px));
  left: 0;
  right: 0;
  z-index: 2;
  margin: 0;
  padding-inline: var(--gutter);
  text-align: center;
  font-family: var(--f-mono);
  font-size: clamp(0.6875rem, 0.9vw, 0.8125rem);
  letter-spacing: 0.3em;
  line-height: 1.8;
  text-transform: uppercase;
  color: var(--muted);
  visibility: hidden;
}

.scene__caption span {
  margin: 0 0.6em;
  color: var(--ember);
}

/* Scroll cue, borrowed from the "Profil" marker of the existing page. */
.scene__cue {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(40px, 8vh, 84px);
  z-index: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.32em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--muted);
}

.scene__cue i {
  position: relative;
  display: block;
  width: 1px;
  height: 72px;
  background: rgba(238, 230, 222, 0.18);
  overflow: hidden;
}

.scene__cue i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ember);
  transform: scaleY(var(--progress, 0));
  transform-origin: top;
}

/* ---------------------------------------------------------------- scroll scene */

.scene-ready .scene {
  height: 400vh;
  min-height: 0;
}

.scene-ready .scene__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.scene-ready .scene__camera {
  transform-origin: 0 0;
}

/* scene.js sizes and places the photo at its full cover size */
.scene-ready .scene__photo {
  position: absolute;
  max-width: none;
  object-fit: fill;
}

.scene-ready .scene__camera,
.scene-ready .scene__copy {
  will-change: transform;
}

.scene-ready .scene__signature,
.scene-ready .scene__caption {
  visibility: visible;
}

.scene-ready .scene__caption {
  opacity: 0;
}

.scene-ready .scene__cue {
  display: flex;
}

@media (max-width: 900px) {
  .scene-ready .scene {
    height: 360vh;
  }

  .scene__signature {
    top: 45%;
    width: 88vw;
  }

  .scene__caption {
    top: calc(45% + 88vw * 222 / 796 / 2 + 28px);
    letter-spacing: 0.22em;
  }

  .scene__cue {
    right: auto;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
  }

  .scene__cue i {
    height: 44px;
  }

  .scene__copy {
    bottom: clamp(96px, 16vh, 140px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-ready .scene {
    height: 100vh;
    height: 100svh;
  }

  .scene-ready .scene__stage {
    position: relative;
  }
}


/* ---------------------------------------------------------------- dopune (naš sajt, 17.10.2026.) */

/* header preko fotografije: providan dok traje scena, tamni tek kad scena završi (scene.js dodaje .is-solid) */
.home-scene .site-header.is-scrolled:not(.is-solid),
.home-scene .site-header.is-open:not(.is-solid) { background: transparent; border-bottom-color: transparent; }
.home-scene .site-header.is-open { background: rgba(14, 13, 12, .96); }

/* vodeća tačka: vrh pera koji piše potpis */
.scene__pen {
  position: absolute; left: 0; top: 0; z-index: 3; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; pointer-events: none; opacity: 0; will-change: transform, opacity;
  background: radial-gradient(circle, #fff 0 22%, rgba(229, 72, 77, .95) 38%, rgba(196, 36, 48, 0) 72%);
  box-shadow: 0 0 22px 6px rgba(196, 36, 48, .38);
}

/* preskoči uvod */
.scene__skip {
  position: absolute; z-index: 4; left: var(--gutter); bottom: clamp(40px, 8vh, 84px);
  font: 500 12px/1 var(--f-mono); letter-spacing: .24em; text-transform: uppercase; text-decoration: none;
  color: var(--muted); padding: 12px 0; border-bottom: 1px solid var(--rule-2); transition: color .2s, border-color .2s;
}
.scene__skip:hover, .scene__skip:focus-visible { color: var(--text); border-color: var(--ember); }
html:not(.scene-ready) .scene__skip { display: none; }

@media (max-width: 900px) {
  .scene__skip { left: auto; right: var(--gutter); bottom: auto; top: calc(var(--header) + 6px); padding: 8px 0; font-size: 11px; }
  .has-home-choice .scene__cue { bottom: 84px; }
  .has-home-choice .scene__copy { bottom: 176px; }
}

/* ---------------------------------------------------------------- izbor početne (Klasična | Animirana) */
.home-choice {
  position: fixed; z-index: 90; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; padding: 5px 5px 5px 14px;
  background: rgba(19, 17, 16, .88); border: 1px solid var(--rule-2); border-radius: 999px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.home-choice.is-hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 12px); }
.home-choice__k { font: 500 11px/1 var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-right: 6px; white-space: nowrap; }
.home-choice a {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border-radius: 999px;
  font: 500 13px/1 var(--f-body); color: var(--text-2); text-decoration: none; white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.home-choice a b { font: 500 11px/1 var(--f-mono); color: var(--ember-text); }
.home-choice a:hover { color: var(--text); background: rgba(237, 230, 218, .07); }
.home-choice a[aria-current="true"] { background: var(--ember); color: #fff; }
.home-choice a[aria-current="true"] b { color: #fff; }
@media (max-width: 520px) {
  .home-choice { width: calc(100% - 24px); bottom: 12px; padding: 4px; justify-content: center; }
  .home-choice__k { display: none; }
  .home-choice a { flex: 1; justify-content: center; padding: 12px 10px; }
}


/* ---------------------------------------------------------------- nivo 2 (17.10.2026.) */

/* logo u headeru čeka da potpis sleti (samo dok traje scena; bez JS-a / reduced motion ostaje vidljiv) */
html.scene-ready .home-scene .site-header .brand { opacity: var(--brand-o, 0); }

/* uvodna animacija prvog kadra */
@keyframes sceneIn { from { opacity: 0; transform: translate3d(0, 18px, 0); } }
@keyframes sceneFade { from { opacity: 0; } }
.scene__camera { animation: sceneFade 1.4s ease-out both; }
.scene__copy > * { animation: sceneIn 1s var(--ease) both; }
.scene__copy > :nth-child(1) { animation-delay: .25s; }
.scene__copy > :nth-child(2) { animation-delay: .4s; }
.scene__copy > :nth-child(3) { animation-delay: .6s; }
@media (prefers-reduced-motion: reduce) {
  .scene__camera, .scene__copy > * { animation: none; }
}

/* blagi crveni sjaj potpisa */
.scene__signature svg { filter: drop-shadow(0 0 16px rgba(196, 36, 48, .26)); }

/* fino zrno: filmski osjećaj i manje „stepenica“ u tamnim gradijentima */
.scene__stage::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .075;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
