/* m² ae — HTML prototip
   Svetla, topla paleta (Makhno referenca). Desktop i mobile imaju zasebne
   layout-e za landing hero, hero kategorije i galeriju projekta. */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300&family=Inter:wght@300;400;500&display=swap');

:root {
  --bg: #F3EFE9;
  --bg-2: #EAE4DB;
  --ink: #24211E;
  --ink-2: #5E5850;
  --muted: #8E877D;
  --line: rgba(36, 33, 30, 0.14);
  --accent: #9C7F5A;
  --on-image: #F7F4EF;

  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;

  --gutter: clamp(16px, 3vw, 40px);
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.eyebrow {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.serif { font-family: var(--serif); font-weight: 300; }

/* Desktop/mobile prekidači za zasebne layout-e */
.only-mobile { display: none !important; }
@media (max-width: 767px) {
  .only-desktop { display: none !important; }
  .only-mobile { display: revert !important; }
}

/* ---------- NAV ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--gutter);
  color: #fff;
  mix-blend-mode: difference;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav-logo {
  font-family: var(--serif);
  font-size: 1.5rem; font-weight: 400;
  letter-spacing: 0.02em;
}
.nav-links { display: flex; gap: 2.25rem; align-items: center; }
.nav-links a, .lang button {
  font-size: 0.7rem; font-weight: 400;
  letter-spacing: 0.16em; text-transform: uppercase;
  opacity: 0.85; transition: opacity .3s;
}
.nav-links a:hover, .nav-links a.is-active { opacity: 1; }
.nav-links a.is-active { text-decoration: underline; text-underline-offset: 6px; }
.lang { display: flex; gap: 0.5rem; align-items: center; font-size: 0.7rem; }
.lang .is-off { opacity: 0.4; cursor: default; }
.nav-burger { display: none; width: 28px; height: 14px; position: relative; }
.nav-burger span { position: absolute; left: 0; right: 0; height: 1px; background: currentColor; transition: transform .4s var(--ease); }
.nav-burger span:first-child { top: 0; }
.nav-burger span:last-child { bottom: 0; }

.menu-mobile {
  position: fixed; inset: 0; z-index: 99;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--nav-h) var(--gutter) 2rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .7s var(--ease);
}
.menu-mobile.is-open { clip-path: inset(0 0 0 0); }
.menu-mobile a {
  font-family: var(--serif); font-size: 2.6rem; line-height: 1.25;
  display: flex; gap: 1rem; align-items: baseline;
}
.menu-mobile a small { font-family: var(--sans); font-size: 0.7rem; color: var(--muted); letter-spacing: .15em; }
.menu-mobile .lang { margin-top: 2.5rem; color: var(--ink); }

@media (max-width: 767px) {
  :root { --nav-h: 60px; }
  .nav-links { display: none; }
  .nav-burger { display: block; }
  body.menu-open .nav-burger span:first-child { transform: translateY(6.5px) rotate(45deg); }
  body.menu-open .nav-burger span:last-child { transform: translateY(-6.5px) rotate(-45deg); }
}

/* ---------- PAGE TRANSITION ---------- */
.curtain {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  pointer-events: none;
}
.mask-open {
  position: fixed; inset: 0; z-index: 210;
  pointer-events: none;
  will-change: clip-path;
}
.mask-open img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- LANDING HERO ---------- */
.lh { position: relative; height: 320vh; background: #1d1f26; }
.lh-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.lh-media { position: absolute; inset: 0; transform-origin: 50% 50%; will-change: transform; }
.lh-media img.layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
}
.lh-media img.layer:not(.is-base) { opacity: 0; }
.lh-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(20,20,24,.25) 0%, rgba(20,20,24,0) 30%, rgba(20,20,24,0) 70%, rgba(20,20,24,.35) 100%);
}

.lh-intro {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--on-image); text-align: center; pointer-events: none;
}
.lh-title {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(4.5rem, 13vw, 12rem); line-height: .9; letter-spacing: -0.02em;
  text-shadow: 0 2px 40px rgba(0,0,0,.15);
}
.lh-tagline { margin-top: 1.25rem; font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; opacity: .9; }
.line-wrap { display: block; overflow: hidden; }
.line-inner { display: block; will-change: transform; }

.lh-scroll {
  position: absolute; left: 50%; bottom: 2.5rem; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
  color: var(--on-image); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase;
}
.lh-scroll i { display: block; width: 1px; height: 44px; background: rgba(255,255,255,.3); position: relative; overflow: hidden; }
.lh-scroll i::after {
  content: ""; position: absolute; inset: 0; background: #fff;
  transform: translateY(-100%); animation: scrollLine 2.2s var(--ease) infinite;
}
@keyframes scrollLine { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* Hotspot = prozor koji vodi u kategoriju. Pozicija se računa u JS-u iz
   normalizovanih koordinata (vidi HERO_ZONES u landing.js). */
.hotspot {
  position: absolute; display: block;
  color: var(--on-image);
  opacity: 0; visibility: hidden;
}
.hotspot .frame { position: absolute; inset: -14px; pointer-events: none; }
.hotspot .frame b {
  position: absolute; width: 16px; height: 16px;
  border-color: rgba(255,255,255,.85); border-style: solid; border-width: 0;
  transition: transform .6s var(--ease);
}
.hotspot .frame b:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.hotspot .frame b:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.hotspot .frame b:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.hotspot .frame b:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.hotspot:hover .frame b:nth-child(1), .hotspot:focus-visible .frame b:nth-child(1) { transform: translate(-8px, -8px); }
.hotspot:hover .frame b:nth-child(2), .hotspot:focus-visible .frame b:nth-child(2) { transform: translate(8px, -8px); }
.hotspot:hover .frame b:nth-child(3), .hotspot:focus-visible .frame b:nth-child(3) { transform: translate(-8px, 8px); }
.hotspot:hover .frame b:nth-child(4), .hotspot:focus-visible .frame b:nth-child(4) { transform: translate(8px, 8px); }
.hotspot .dot {
  position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px;
  border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,.6);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); } 100% { box-shadow: 0 0 0 18px rgba(255,255,255,0); } }
.hotspot .label {
  position: absolute; top: 50%; white-space: nowrap;
  display: flex; align-items: center; gap: .9rem;
  transform: translateY(-50%);
}
.hotspot .label::before { content: ""; width: 48px; height: 1px; background: rgba(255,255,255,.7); transition: width .6s var(--ease); }
.hotspot:hover .label::before { width: 80px; }
.hotspot[data-side="left"] .label { right: calc(100% + 26px); flex-direction: row-reverse; }
.hotspot[data-side="right"] .label { left: calc(100% + 26px); }
.hotspot .label span { display: flex; flex-direction: column; line-height: 1.1; }
.hotspot .label small { font-size: .62rem; letter-spacing: .2em; opacity: .75; }
.hotspot .label em { font-family: var(--serif); font-style: normal; font-size: clamp(1.8rem, 2.6vw, 2.6rem); }
.hotspot[data-side="left"] .label span { align-items: flex-end; text-align: right; }

.lh-pick {
  position: absolute; left: 50%; bottom: 2.5rem; transform: translateX(-50%);
  color: var(--on-image); opacity: 0;
}
.lh-pick.eyebrow { color: rgba(255,255,255,.75); }

/* Mobile: dugmad za kategorije na dnu hero-a */
.lh-mob-links {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 1.5rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; opacity: 0;
}
.lh-mob-links a {
  padding: 1rem; border: 1px solid rgba(255,255,255,.4);
  color: var(--on-image); backdrop-filter: blur(6px); background: rgba(20,20,24,.18);
  display: flex; flex-direction: column; gap: .2rem;
}
.lh-mob-links small { font-size: .6rem; letter-spacing: .2em; opacity: .7; }
.lh-mob-links em { font-family: var(--serif); font-style: normal; font-size: 1.5rem; line-height: 1; }

@media (max-width: 767px) {
  .lh { height: 420vh; }
  .hotspot .label { display: none; }
  .hotspot .frame { inset: -8px; }
}

/* ---------- STATEMENT + KATEGORIJE (landing ispod hero-a) ---------- */
.statement {
  padding: clamp(5rem, 14vw, 11rem) var(--gutter) clamp(4rem, 9vw, 7rem);
  max-width: 1100px;
}
.statement p {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(1.8rem, 3.6vw, 3.2rem); line-height: 1.18; letter-spacing: -.005em;
}
.cat-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter);
  padding: 0 var(--gutter) clamp(5rem, 10vw, 9rem);
}
.cat-card { display: block; }
.cat-card .media { overflow: hidden; aspect-ratio: 4 / 5; background: var(--bg-2); }
.cat-card .media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 1.4s var(--ease); }
.cat-card:hover .media img { transform: scale(1.1); }
.cat-card .meta { display: flex; justify-content: space-between; align-items: baseline; padding-top: 1.1rem; border-top: 1px solid var(--line); margin-top: 1.1rem; }
.cat-card h3 { font-family: var(--serif); font-weight: 300; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1; }
.cat-card:nth-child(2) { margin-top: clamp(4rem, 12vw, 10rem); }
@media (max-width: 767px) {
  .cat-cards { grid-template-columns: 1fr; gap: 3rem; }
  .cat-card:nth-child(2) { margin-top: 0; }
  .cat-card .media { aspect-ratio: 4 / 3; }
}

/* ---------- KATEGORIJA HERO ---------- */
.ch { position: relative; height: 220vh; }
.ch-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.ch-media { position: absolute; inset: 0; will-change: clip-path; }
.ch-media img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.ch-shade { position: absolute; inset: 0; background: rgba(20,20,24,.22); pointer-events: none; }
.ch-head {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(2rem, 6vh, 4rem);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem;
  color: var(--on-image);
}
.ch-title { font-family: var(--serif); font-weight: 300; font-size: clamp(4rem, 12vw, 11rem); line-height: .85; letter-spacing: -.02em; }
.ch-count { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; padding-bottom: .8rem; }
@media (max-width: 767px) {
  .ch { height: 170vh; }
  .ch-head { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .ch-count { padding-bottom: 0; }
}

.cat-intro {
  display: grid; grid-template-columns: 1fr 2fr; gap: var(--gutter);
  padding: clamp(4rem, 10vw, 8rem) var(--gutter) clamp(3rem, 6vw, 5rem);
}
.cat-intro p { font-family: var(--serif); font-size: clamp(1.5rem, 2.4vw, 2.2rem); line-height: 1.25; max-width: 30ch; }
@media (max-width: 767px) { .cat-intro { grid-template-columns: 1fr; gap: 1rem; } }

/* ---------- GRID PROJEKATA ---------- */
.pgrid {
  display: grid; grid-template-columns: 1fr 1fr;
  column-gap: clamp(24px, 6vw, 96px); row-gap: clamp(4rem, 9vw, 8rem);
  padding: 0 var(--gutter) clamp(5rem, 10vw, 9rem);
}
.pcard { display: block; }
.pcard:nth-child(even) { transform: translateY(clamp(4rem, 14vw, 12rem)); }
.pcard .media { position: relative; overflow: hidden; aspect-ratio: 3 / 2; background: var(--bg-2); }
.pcard:nth-child(4n+1) .media, .pcard:nth-child(4n) .media { aspect-ratio: 4 / 5; }
.pcard .media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 1.4s var(--ease); }
.pcard:hover .media img { transform: scale(1.08); }
.pcard .media::after {
  content: "Pogledaj projekat"; position: absolute; left: 1.25rem; bottom: 1.1rem;
  color: #fff; font-size: .65rem; letter-spacing: .2em; text-transform: uppercase;
  opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s var(--ease);
}
.pcard:hover .media::after { opacity: 1; transform: none; }
.pcard .info { display: grid; grid-template-columns: auto 1fr; column-gap: 1.25rem; padding-top: 1.1rem; }
.pcard .num { font-size: .7rem; color: var(--muted); letter-spacing: .1em; padding-top: .45rem; }
.pcard h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 2.4vw, 2.2rem); line-height: 1.1; }
.pcard p { grid-column: 2; font-size: .78rem; color: var(--ink-2); margin-top: .3rem; }
@media (max-width: 767px) {
  .pgrid { grid-template-columns: 1fr; row-gap: 3.5rem; }
  .pcard:nth-child(even) { transform: none; }
  .pcard .media, .pcard:nth-child(4n+1) .media, .pcard:nth-child(4n) .media { aspect-ratio: 4 / 3; }
}

.cross {
  position: relative; display: block; height: 70vh; overflow: hidden; color: var(--on-image);
}
.cross img { position: absolute; inset: -10% 0; width: 100%; height: 120%; object-fit: cover; }
.cross::before { content: ""; position: absolute; inset: 0; background: rgba(20,20,24,.35); z-index: 1; }
.cross .in {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 1rem;
}
.cross .eyebrow { color: rgba(255,255,255,.75); }
.cross h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(3rem, 9vw, 8rem); line-height: .9; }

/* ---------- PROJEKAT ---------- */
.ph { position: relative; height: 100vh; height: 100svh; }
.ph-stage { position: fixed; inset: 0; height: 100vh; height: 100svh; overflow: hidden; z-index: 0; }
.ph-stage img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.ph-shade { position: absolute; inset: 0; background: rgba(20,20,24,.28); }
.ph-content {
  position: absolute; inset: 0; color: var(--on-image);
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: 0 var(--gutter);
}
.ph-back { font-size: .65rem; letter-spacing: .2em; text-transform: uppercase; opacity: .75; margin-bottom: 2.5rem; }
.ph-back:hover { opacity: 1; }
.ph-title { font-family: var(--serif); font-weight: 300; font-size: clamp(3rem, 9vw, 8rem); line-height: 1; letter-spacing: -.02em; }
.ph-sub { margin-top: 1.5rem; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; opacity: .85; }
.ph-meta {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 2.25rem;
  display: flex; justify-content: space-between; align-items: flex-end;
  color: rgba(255,255,255,.75); font-size: .65rem; letter-spacing: .18em; text-transform: uppercase;
}

.pbody { position: relative; z-index: 1; background: var(--bg); box-shadow: 0 -40px 80px rgba(20,20,24,.18); }
.pinfo {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 2rem;
  padding: clamp(3rem, 7vw, 5rem) var(--gutter); border-bottom: 1px solid var(--line);
}
.pinfo .v { font-family: var(--serif); font-size: 1.35rem; margin-top: .35rem; }
.pdesc {
  display: grid; grid-template-columns: 1fr 2fr; gap: var(--gutter);
  padding: clamp(4rem, 9vw, 7rem) var(--gutter);
}
.pdesc p { font-size: 1.05rem; line-height: 1.85; color: var(--ink-2); max-width: 62ch; }
@media (max-width: 767px) {
  .pinfo { grid-template-columns: 1fr 1fr; }
  .pdesc { grid-template-columns: 1fr; gap: 1rem; }
}

/* Galerija — desktop: ritam full / par / pomereni; mobile: jedna kolona */
.gallery { padding: 0 var(--gutter) clamp(4rem, 9vw, 8rem); display: flex; flex-direction: column; gap: clamp(1rem, 2vw, 1.75rem); }
.g-row { display: grid; gap: clamp(1rem, 2vw, 1.75rem); }
.g-row.full { grid-template-columns: 1fr; margin: 0 calc(var(--gutter) * -1); }
.g-row.pair { grid-template-columns: 1fr 1fr; align-items: start; }
.g-row.offset-r { grid-template-columns: 1fr 1.6fr; }
.g-row.offset-r .g-cell { grid-column: 2; }
.g-row.offset-l { grid-template-columns: 1.6fr 1fr; }
.g-cell { overflow: hidden; background: var(--bg-2); }
.g-cell img { width: 100%; height: auto; will-change: transform; }
.g-row.full .g-cell img { height: 92vh; object-fit: cover; }
/* rezerva za parallax pomeraj unutar ćelije (GSAP koristi transform, ovo je zaseban scale) */
.gallery.only-desktop .g-cell img { scale: 1.12; }
.gallery-mob .g-cell + .g-cell { margin-top: 12px; }
.gallery-mob .g-cell img { width: 100%; height: auto; }

.next {
  position: relative; display: block; height: 80vh; overflow: hidden; color: var(--on-image);
}
.next img { position: absolute; inset: -10% 0; width: 100%; height: 120%; object-fit: cover; }
.next::before { content: ""; position: absolute; inset: 0; background: rgba(20,20,24,.4); z-index: 1; }
.next .in { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem; text-align: center; padding: 0 var(--gutter); }
.next .eyebrow { color: rgba(255,255,255,.75); }
.next h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(2.6rem, 7vw, 6rem); line-height: 1; }

/* ---------- FOOTER / O MENI ---------- */
.footer { position: relative; z-index: 1; background: var(--bg-2); padding: clamp(4rem, 9vw, 7rem) var(--gutter) 2rem; }
.f-grid { display: grid; grid-template-columns: 1.1fr 1.4fr 1fr; gap: clamp(2rem, 5vw, 5rem); }
.f-portrait { aspect-ratio: 4 / 5; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .7rem; letter-spacing: .15em; text-transform: uppercase; max-width: 340px; }
.f-about h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(2.6rem, 5vw, 4.2rem); line-height: 1; margin: .75rem 0 1.5rem; }
.f-about .role { font-size: .8rem; color: var(--ink-2); margin-bottom: 1.25rem; }
.f-about p { color: var(--ink-2); max-width: 46ch; }
.f-contact ul { list-style: none; margin-top: .75rem; display: flex; flex-direction: column; gap: .55rem; }
.f-contact a:hover { color: var(--accent); }
.f-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: clamp(4rem, 8vw, 6rem); padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .72rem; color: var(--muted); }
.f-bottom .brand { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); }
@media (max-width: 767px) {
  .f-grid { grid-template-columns: 1fr; }
  .f-portrait { max-width: none; aspect-ratio: 4 / 3; }
}

/* ---------- REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(32px); }
.clip-reveal { clip-path: inset(100% 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .clip-reveal { clip-path: none; }
  .lh-scroll i::after, .hotspot .dot { animation: none; }
}
