/* ==========================================================================
   Ivo Dukić · Photography
   Minimal, light, sidebar-led portfolio — "Offset" inspired
   ========================================================================== */

:root {
  --bg: #ffffff;
  --ink: #15161a;
  --ink-soft: #6a6e76;
  --ink-faint: #a0a4ac;
  --line: rgba(0, 0, 0, 0.10);
  --line-soft: rgba(0, 0, 0, 0.06);
  --accent: #15161a;
  --sidebar-w: 248px;
  --gutter: clamp(1.4rem, 4vw, 3.5rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: #fff; }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 200;
}
.skip-link:focus { left: 0; }

.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;
}

.eyebrow {
  font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 500; margin: 0 0 1.2rem;
}

/* ---------- sidebar ---------- */
.site-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  padding: clamp(2rem, 4vh, 3rem) 1.8rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-soft);
  background: var(--bg);
  z-index: 100;
}
.brand {
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
}
.brand small {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  margin-top: 0.5rem;
}
.nav {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.nav a {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.45rem 0;
  width: fit-content;
  position: relative;
  transition: color 0.25s var(--ease);
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0.25rem;
  width: 0; height: 1px; background: var(--ink);
  transition: width 0.3s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { width: 1.1rem; }

.sidebar-foot { margin-top: auto; padding-top: 2rem; }
.sidebar-social { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.2rem; }
.sidebar-social a {
  font-size: 0.78rem; color: var(--ink-soft); width: fit-content;
  transition: color 0.2s;
}
.sidebar-social a:hover { color: var(--ink); }
.sidebar-foot p { font-size: 0.72rem; color: var(--ink-faint); margin: 0; line-height: 1.6; }

/* mobile topbar (hidden on desktop) */
.topbar { display: none; }

/* ---------- main / layout ---------- */
.layout-main { margin-left: var(--sidebar-w); }
.wrap { width: 100%; max-width: 1180px; padding-inline: var(--gutter); }
.section { padding: clamp(2.5rem, 6vh, 5rem) 0; }

/* ---------- intro ---------- */
.intro { padding: clamp(3rem, 9vh, 6.5rem) 0 clamp(1.5rem, 4vh, 3rem); }
.intro h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 300;
  letter-spacing: -0.015em;
  line-height: 1.18;
  margin: 0 0 1.3rem;
  max-width: 20ch;
}
.intro .lead {
  font-size: 1rem; color: var(--ink-soft); max-width: 56ch; font-weight: 400;
}
.intro .meta-line {
  margin-top: 1.6rem; font-size: 0.78rem; letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* ---------- filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem;
  margin: 0 0 clamp(2rem, 5vh, 3.5rem);
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 1.2rem;
}
.filter {
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 0.78rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 0.2rem 0; position: relative;
  transition: color 0.22s var(--ease);
}
.filter:hover { color: var(--ink-soft); }
.filter[aria-pressed="true"] { color: var(--ink); }
.filter[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 0; bottom: -0.2rem;
  width: 100%; height: 1px; background: var(--ink);
}

/* ---------- slideshow (one image at a time) ---------- */
.intro--tight { padding-bottom: clamp(1rem, 3vh, 2rem); }
.section--stage { padding-top: clamp(1rem, 3vh, 2rem); }
.stage-note { margin-top: 1.6rem; font-size: 0.78rem; color: var(--ink-faint); }
.stage-note a { color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.stage-note a:hover { color: var(--ink); }

.slideshow { position: relative; outline: none; }
.slideshow__viewport { position: relative; }
.slide { display: none; margin: 0; }
.slide.is-active { display: block; animation: slideFade 0.55s var(--ease); }
@keyframes slideFade { from { opacity: 0; } to { opacity: 1; } }
.slide__media {
  text-align: center; background: #f5f5f6; line-height: 0;
}
.slide__media img {
  display: inline-block; width: auto; max-width: 100%; max-height: 74vh; margin-inline: auto;
}
.slide__cap {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  margin-top: 0.9rem; border-top: 1px solid var(--line-soft); padding-top: 0.75rem; line-height: 1.5;
}
.slide__title { font-size: 0.86rem; font-weight: 500; color: var(--ink); }
.slide__sub { font-size: 0.74rem; color: var(--ink-faint); text-align: right; white-space: nowrap; }

.ss-controls {
  display: flex; align-items: center; justify-content: center; gap: 1.6rem;
  margin-top: 1.4rem;
}
.ss-btn {
  background: none; border: 1px solid var(--line); color: var(--ink);
  width: 46px; height: 46px; border-radius: 50%; font-size: 1.3rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.ss-btn:hover { border-color: var(--ink); transform: scale(1.06); }
.ss-counter {
  font-size: 0.78rem; letter-spacing: 0.08em; color: var(--ink-faint);
  min-width: 4.5ch; text-align: center; font-variant-numeric: tabular-nums;
}
.ss-now { color: var(--ink); }

/* ---------- feature variant: image-dominant (portfolio + projects) ---------- */
.intro--bare { padding: clamp(1.8rem, 4vh, 3rem) 0 clamp(0.6rem, 2vh, 1.2rem); }
.intro--bare h1 {
  font-size: clamp(1.25rem, 2.3vw, 1.65rem); font-weight: 400;
  letter-spacing: 0; margin: 0; max-width: none;
}
.intro--bare .eyebrow { margin-bottom: 0.7rem; }

.section--feature .wrap { max-width: 1560px; padding-inline: clamp(1.1rem, 3vw, 2.4rem); }
.section--stage.section--feature { padding-top: clamp(0.5rem, 2vh, 1rem); }
.section--stage.section--top { padding-top: clamp(2rem, 5vh, 3.5rem); }

.slideshow--feature .slide__media img { max-height: 88vh; }
.slideshow--feature .slide__cap {
  border-top: none; justify-content: center; padding-top: 0.95rem; gap: 0;
}
.slideshow--feature .slide__title {
  font-weight: 400; color: var(--ink-faint); font-size: 0.74rem; letter-spacing: 0.05em;
}
.slideshow--feature .slide__sub { display: none; }
.slideshow--feature .ss-controls { margin-top: 1.1rem; }

/* ---------- horizontal-scroll gallery (project pages) ---------- */
.hscroll-wrap { position: relative; }
.hscroll {
  display: flex;
  gap: clamp(1rem, 2.4vw, 2.2rem);
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faint) transparent;
  overflow-anchor: none;
  overscroll-behavior-x: contain;
  outline: none;
}
.hscroll::-webkit-scrollbar { height: 6px; }
.hscroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.hscroll::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
.hscroll.is-grabbing { cursor: grabbing; scroll-behavior: auto; }

.hslide {
  flex: 0 0 auto;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.hslide__media { background: #f5f5f6; line-height: 0; }
.hslide__media img {
  height: clamp(300px, 74vh, 860px);
  width: auto;
  max-width: none;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.hslide__cap {
  margin-top: 0.8rem;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  text-align: center;
  max-width: 42ch;
}

.hscroll-controls {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1.4rem;
}
.hscroll-hint {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
}

@media (max-width: 600px) {
  .hslide__media img { height: clamp(260px, 60vh, 520px); }
}

/* ---------- project index ---------- */
.proj-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  column-gap: clamp(1.6rem, 4vw, 3.5rem); row-gap: clamp(2.4rem, 5vw, 4rem);
}
.proj-grid .proj-tile:nth-child(even) { margin-top: clamp(2rem, 6vw, 4.5rem); }
.proj-tile { display: block; }
.proj-tile__media { overflow: hidden; background: #f4f4f5; }
.proj-tile__media img { width: 100%; aspect-ratio: 3/2; object-fit: cover; transition: transform 0.9s var(--ease); }
.proj-tile:hover .proj-tile__media img { transform: scale(1.04); }
.proj-tile__meta { margin-top: 0.9rem; border-top: 1px solid var(--line-soft); padding-top: 0.75rem; }
.proj-tile__title { display: block; font-size: 1rem; font-weight: 500; }
.proj-tile__sub { display: block; font-size: 0.76rem; color: var(--ink-faint); margin-top: 0.15rem; }

/* ---------- blog list ---------- */
.post-list { display: grid; gap: clamp(1.6rem, 4vh, 2.6rem); }
.post-row {
  display: grid; grid-template-columns: 320px 1fr; gap: clamp(1.4rem, 4vw, 2.8rem);
  align-items: center; padding-bottom: clamp(1.6rem, 4vh, 2.6rem);
  border-bottom: 1px solid var(--line-soft);
}
.post-row:last-child { border-bottom: none; }
.post-row__media { overflow: hidden; background: #f4f4f5; }
.post-row__media img { width: 100%; aspect-ratio: 3/2; object-fit: cover; transition: transform 0.9s var(--ease); }
.post-row:hover .post-row__media img { transform: scale(1.04); }
.post-row__date { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.post-row__title { font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 400; margin: 0.5rem 0 0.6rem; letter-spacing: -0.01em; }
.post-row__excerpt { color: var(--ink-soft); margin: 0 0 0.8rem; font-size: 0.92rem; max-width: 52ch; }
.post-row__more { font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; border-bottom: 1px solid var(--ink); padding-bottom: 0.2rem; }

/* ---------- single post ---------- */
.post__date { display: block; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-top: 0.6rem; }
.post__hero { margin: 0 0 clamp(2rem, 5vh, 3rem); background: #f4f4f5; }
.post__hero img { width: 100%; }
.post__body { max-width: 64ch; }
.post__body .cred-list { margin: 0 0 1.3rem; }
.post__gallery { margin-top: clamp(2.5rem, 6vh, 4rem); padding-top: clamp(2rem, 5vh, 3rem); border-top: 1px solid var(--line-soft); }
.post__gallery .eyebrow { margin-bottom: 1.4rem; }
.post__back { margin-top: 2.5rem; }
.post__back a { font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); }
.post__back a:hover { color: var(--ink); }

/* ---------- about ---------- */
.about-grid {
  display: grid; grid-template-columns: minmax(220px, 0.7fr) 1.3fr;
  gap: clamp(2rem, 6vw, 5rem); align-items: start;
}
.about-portrait { position: sticky; top: clamp(2rem, 4vh, 3rem); }
.prose { max-width: 60ch; }
.prose h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 300;
  letter-spacing: -0.01em; margin: 0 0 1.6rem; line-height: 1.2;
}
.prose p { color: var(--ink-soft); margin: 0 0 1.3rem; }
.prose p strong { color: var(--ink); font-weight: 500; }
.prose a { color: var(--ink); border-bottom: 1px solid var(--line); transition: border-color 0.2s; }
.prose a:hover { border-color: var(--ink); }
.prose h3 {
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 500; margin: 2.6rem 0 1rem;
}
.cred-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.cred-list li { color: var(--ink-soft); padding-left: 1.1rem; position: relative; }
.cred-list li::before { content: "—"; position: absolute; left: 0; color: var(--ink-faint); }

/* ---------- buttons (minimal text links) ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 1.8rem; margin-top: 2.2rem; }
.btn {
  font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 500; color: var(--ink); position: relative; padding-bottom: 0.3rem;
}
.btn::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px;
  width: 100%; background: var(--ink);
  transform: scaleX(1); transform-origin: left; transition: transform 0.3s var(--ease);
}
.btn--ghost::after { background: var(--line); }
.btn:hover::after { transform: scaleX(0.4); }

/* ---------- contact ---------- */
.contact-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 6vw, 5rem); align-items: start;
}
.field { display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 1.4rem; }
.field label {
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 500;
}
.field input, .field textarea {
  background: none; border: none; border-bottom: 1px solid var(--line);
  color: var(--ink); padding: 0.6rem 0; font: inherit; font-size: 0.95rem;
  transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field textarea { resize: vertical; min-height: 120px; }
.contact-links { display: grid; gap: 1.3rem; }
.contact-card { display: block; }
.contact-card__l { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); }
.contact-card__v { font-weight: 500; border-bottom: 1px solid var(--line); display: inline-block; transition: border-color 0.2s; }
.contact-card:hover .contact-card__v { border-color: var(--ink); }

/* ---------- prints / licensing CTA ---------- */
.cta {
  border: 1px solid var(--line);
  padding: clamp(2.2rem, 5vw, 3.8rem);
  text-align: center;
}
.cta__title {
  font-weight: 300; font-size: clamp(1.4rem, 3vw, 2.1rem);
  letter-spacing: -0.01em; margin: 0.4rem 0 1rem; line-height: 1.2;
}
.cta__text { color: var(--ink-soft); max-width: 48ch; margin: 0 auto 1.8rem; }
.cta .btn::after { width: 100%; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line-soft);
  padding: 2.5rem 0; margin-top: clamp(3rem, 8vh, 6rem);
}
.site-footer p { font-size: 0.74rem; color: var(--ink-faint); margin: 0; }
.site-footer a { color: var(--ink-soft); }

/* ---------- cookie consent ---------- */
.consent {
  position: fixed;
  left: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 250;
  max-width: 340px;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.28);
  padding: 1.2rem 1.3rem;
}
.consent[hidden] { display: none; }
.consent__text { margin: 0 0 1rem; font-size: 0.8rem; line-height: 1.6; color: var(--ink-soft); }
.consent__actions { display: flex; gap: 0.6rem; }
.consent__btn {
  font: inherit; font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase;
  font-weight: 500; cursor: pointer; padding: 0.55rem 1.1rem;
  border: 1px solid var(--line); background: none; color: var(--ink);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.consent__btn:hover { border-color: var(--ink); }
.consent__btn--accept { background: var(--ink); color: #fff; border-color: var(--ink); }
.consent__btn--accept:hover { background: #000; }

@media (max-width: 600px) {
  .consent { left: 0.8rem; right: 0.8rem; bottom: 0.8rem; max-width: none; }
}

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .site-sidebar {
    position: sticky; top: 0; left: 0; right: 0; bottom: auto;
    width: 100%; flex-direction: row; align-items: center;
    justify-content: space-between; padding: 1rem var(--gutter);
    border-right: none; border-bottom: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px);
  }
  .brand small { display: none; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 0; background: var(--bg);
    border-bottom: 1px solid var(--line-soft);
    padding: 0.5rem var(--gutter) 1.2rem;
    transform: translateY(-130%); transition: transform 0.35s var(--ease);
    box-shadow: 0 20px 40px -24px rgba(0,0,0,0.2); z-index: -1;
  }
  .nav.is-open { transform: translateY(0); }
  .nav a { width: 100%; padding: 0.75rem 0; }
  .sidebar-foot { display: none; }
  .topbar { display: flex; }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; background: none; border: 1px solid var(--line);
    color: var(--ink); cursor: pointer; font-size: 1rem;
  }
  .layout-main { margin-left: 0; }
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { position: static; max-width: 300px; }
  .contact-grid { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: 1fr; gap: 1rem; }
  .slide__media img { max-height: 64vh; }
}

@media (max-width: 600px) {
  .proj-grid { grid-template-columns: 1fr; row-gap: clamp(2rem, 8vw, 3rem); }
  .proj-grid .proj-tile:nth-child(even) { margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
