/* ============================================================
   Dunja Dumanski — portfolio site
   Design tokens and shared styles.
   Rebuilt from the design handoff (facultydept-style layout).
   ============================================================ */

:root {
  --paper: #FAF6EA;        /* background / cream */
  --paper-2: #EFE9D8;      /* loading bg, header-on-cream */
  --ink: #1A1A16;          /* text primary */
  --ink-serif: #3F3F36;    /* serif body / descriptions */
  --ink-muted: #55534A;    /* secondary text */
  --accent: #99927D;       /* numbers, kickers, captions */
  --rule-soft: #DDD5BF;    /* soft borders */
  --underline: #C6BFA8;    /* footer link underline */
  --hover: #8F8F80;        /* link hover */
  --carousel-bg: #171714;
  --select: #EDE5CE;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --maxw: 1440px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-decoration: none; transition: color 0.2s ease, opacity 0.2s ease; }
a:hover { color: var(--hover); }
::selection { background: var(--select); }

img { max-width: 100%; }

/* ---------- Header / nav ---------- */

/* Sticky header used on gallery + contact pages */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 32px;
  background: rgba(250, 246, 234, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.site-header .wordmark { font-size: 15px; font-weight: 500; letter-spacing: 0.02em; }
.site-nav { display: flex; gap: 24px; font-size: 12.5px; letter-spacing: 0.04em; }
.site-nav a { color: var(--ink-muted); }
.site-nav a.active { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

/* Overlay header used on the homepage (floats over content) */
.overlay-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 26px 36px;
  pointer-events: none;
}
.overlay-header .wordmark { pointer-events: auto; font-size: 16px; font-weight: 500; letter-spacing: 0.01em; }
.overlay-header nav {
  pointer-events: auto;
  display: flex;
  gap: 22px;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  mix-blend-mode: difference;
}
.overlay-header nav a { color: #FFFFFF; }

/* ---------- Homepage grid ---------- */

.home-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }

.gallery-rail { padding: 0 56px; }
.rail-spacer { height: 66vh; }

.entry { margin-bottom: 128px; }
.entry:last-of-type { margin-bottom: 120px; }
.entry-head {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 12px;
}
.entry-head h2 { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -0.01em; }
.entry-more { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.entry-meta {
  border-top: 1px solid var(--ink);
  padding-top: 16px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 24px;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink-serif);
  margin-bottom: 32px;
}
.entry-meta .num { color: var(--accent); }
.entry-meta .desc { max-width: 480px; }
.entry-image { position: relative; display: block; overflow: hidden; background: var(--paper-2); }
.entry-image img { width: 100%; display: block; }

/* Per-category mini carousel: the first slide sits in normal flow and
   sets the box height; the rest overlay it and cross-fade on top. */
.entry-slide { opacity: 0; transition: opacity 0.9s ease; }
.entry-slide.active { opacity: 1; }
.entry-slide:not(:first-child) { position: absolute; inset: 0; height: 100%; object-fit: cover; }

/* ---------- Homepage carousel ---------- */

.carousel {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow: hidden;
  background: var(--carousel-bg);
}
.carousel-stack { position: absolute; inset: 0; }
.carousel-slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  transition: opacity 1.1s ease;
  pointer-events: none;
}
.carousel-slide.active { opacity: 1; pointer-events: auto; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.carousel-caption {
  position: absolute;
  left: 40px; right: 40px; bottom: 44px;
  color: #FFFFFF;
  pointer-events: none;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.carousel-counter { font-family: var(--serif); font-size: 15px; }
.carousel-title { font-family: var(--serif); font-size: 26px; letter-spacing: 0.005em; }
.carousel-tag { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.85; }

.carousel-dots {
  position: absolute;
  left: 40px; bottom: 18px;
  display: flex;
  gap: 9px;
}
.carousel-dots button {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.3s ease;
}
.carousel-dots button.active { background: #FFFFFF; }

/* ---------- Homepage studio feature ---------- */

.studio-feature { position: relative; z-index: 45; background: var(--paper); padding-top: 88px; }
.studio-feature-inner { position: relative; }
.studio-feature img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.studio-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: 44px 56px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #FFFFFF;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.studio-overlay h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.studio-overlay p { margin: 0; max-width: 460px; font-family: var(--serif); font-size: 15px; line-height: 1.6; text-wrap: pretty; }
.studio-overlay a {
  pointer-events: auto;
  align-self: flex-start;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  padding-bottom: 2px;
}

/* ---------- Behind the scenes ---------- */

.bts { position: relative; z-index: 45; background: var(--paper); padding: 100px 56px 8px; }
.bts-head {
  display: grid;
  grid-template-columns: 260px 1fr auto;
  gap: 40px;
  align-items: baseline;
  margin-bottom: 52px;
}
.bts-head h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 400; letter-spacing: 0.005em; }
.bts-head p { margin: 0; max-width: 520px; font-size: 12.5px; line-height: 1.6; color: var(--ink-muted); }
.bts-head .work-with-us { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-muted); }
.bts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 28px; }
.bts figure { margin: 0; display: flex; flex-direction: column; gap: 16px; }
.bts figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.bts blockquote { margin: 0; font-family: var(--serif); font-size: 16px; line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.bts figcaption { font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }

/* ---------- Homepage footer (rich) ---------- */

.home-footer { position: relative; z-index: 45; background: var(--paper); margin-top: 96px; padding: 0 56px 64px; }
.home-footer-inner {
  border-top: 1px solid var(--ink);
  padding-top: 28px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.home-footer .bio { margin: 0; font-family: var(--serif); font-size: 16.5px; line-height: 1.6; color: var(--ink); text-wrap: pretty; }
.footer-col-label { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.clients { display: flex; flex-direction: column; gap: 12px; }
.clients-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 20px;
  font-family: var(--serif);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-serif);
}
.studio-block { display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.7; color: var(--ink-muted); }
.studio-block .name { color: var(--ink); font-weight: 500; }
.studio-block a { color: var(--ink-muted); }
.studio-block .socials { display: flex; gap: 16px; margin-top: 12px; }
.studio-block .socials a { border-bottom: 1px solid var(--underline); padding-bottom: 1px; }

/* ---------- Gallery pages ---------- */

.gallery-intro { padding: 72px 32px 48px; max-width: var(--maxw); margin: 0 auto; }
.kicker { font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.gallery-intro h1 { margin: 0 0 18px; font-size: clamp(40px, 5vw, 64px); font-weight: 500; letter-spacing: -0.02em; }
.gallery-intro p { margin: 0; max-width: 560px; font-family: var(--serif); font-size: 16px; line-height: 1.6; color: var(--ink-serif); text-wrap: pretty; }

.gallery-grid { column-count: 2; column-gap: 28px; padding: 0 32px; max-width: var(--maxw); margin: 0 auto; }
.gallery-grid img { width: 100%; display: block; break-inside: avoid; margin: 0 0 28px; }

.gallery-studio { padding: 104px 32px 0; max-width: var(--maxw); margin: 0 auto; }
.gallery-studio h2 { margin: 0 0 32px; max-width: 780px; font-size: clamp(24px, 2.6vw, 34px); font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; text-wrap: pretty; }
.gallery-studio h2 a { border-bottom: 1px solid var(--underline); }
.gallery-studio-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.gallery-studio-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }

.gallery-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 72px 32px 0;
  max-width: var(--maxw);
  margin: 0 auto;
}
.gallery-nav .prev { font-size: 13px; color: var(--ink-muted); }
.gallery-nav .next { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }

/* ---------- Contact ---------- */

.contact {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 32px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 80px;
  align-items: start;
}
.contact-left { display: flex; flex-direction: column; gap: 40px; }
.contact-left h1 { margin: 0; font-size: clamp(36px, 4vw, 56px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; text-wrap: pretty; }
.contact-links { display: flex; flex-direction: column; gap: 12px; }
.contact-email { font-size: clamp(22px, 2.4vw, 32px); font-weight: 500; letter-spacing: -0.01em; border-bottom: 1px solid var(--underline); padding-bottom: 4px; align-self: flex-start; }
.contact-phone { font-size: 18px; color: var(--ink-muted); }
.contact-address { display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.7; color: var(--ink-muted); border-top: 1px solid var(--rule-soft); padding-top: 28px; }
.contact-address .name { color: var(--ink); font-weight: 500; }
.contact-address a { color: var(--ink-muted); }
.contact-address .socials { display: flex; gap: 16px; margin-top: 14px; }
.contact-address .socials a { border-bottom: 1px solid var(--underline); padding-bottom: 1px; }
.contact-right { display: flex; flex-direction: column; gap: 20px; }
.contact-right img { width: 100%; display: block; }
.contact-right p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--ink-muted); text-wrap: pretty; }
.contact-right p a { color: var(--ink-muted); border-bottom: 1px solid var(--underline); }

/* ---------- Shared simple footer (gallery + contact pages) ---------- */

.site-footer {
  border-top: 1px solid var(--rule-soft);
  margin-top: 96px;
  padding: 40px 32px 56px;
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-muted);
}
.site-footer a { color: var(--ink-muted); }
.site-footer .name { color: var(--ink); font-weight: 500; }
.site-footer .socials { display: flex; gap: 18px; align-items: baseline; }
.contact .site-footer, .contact + .site-footer { margin-top: 120px; }

/* ---------- Private client preview page ---------- */

.client-tag {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid var(--rule-soft);
  border-radius: 999px;
  padding: 4px 12px;
}
.client-intro { padding: 72px 32px 40px; max-width: 1000px; margin: 0 auto; }
.client-intro .client-tag { margin-bottom: 24px; }
.client-intro h1 { margin: 0 0 10px; font-size: clamp(34px, 4.5vw, 56px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.client-intro .subtitle { margin: 0 0 22px; font-family: var(--serif); font-size: clamp(18px, 2.2vw, 24px); color: var(--ink-muted); text-wrap: pretty; }
.client-intro .lede { margin: 0; max-width: 620px; font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--ink-serif); text-wrap: pretty; }
.client-intro .meta { margin-top: 24px; font-size: 12.5px; letter-spacing: 0.04em; color: var(--accent); }

.client-empty {
  max-width: 1000px;
  margin: 0 auto 40px;
  padding: 64px 32px;
  border: 1px dashed var(--rule-soft);
  text-align: center;
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  /* Homepage: stack the rail above the carousel */
  .home-grid { grid-template-columns: 1fr; }
  .gallery-rail { padding: 0 28px; }
  .rail-spacer { height: 24vh; }
  .carousel { position: relative; height: 70vh; }

  .overlay-header {
    position: sticky;
    padding: 16px 20px;
    background: rgba(250, 246, 234, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule-soft);
  }
  .overlay-header nav { mix-blend-mode: normal; flex-wrap: wrap; justify-content: flex-end; gap: 12px 16px; }
  .overlay-header nav a { color: var(--ink-muted); }

  .studio-feature { padding-top: 48px; }
  .studio-feature img { aspect-ratio: 4 / 3; }
  .bts { padding: 64px 28px 8px; }
  .bts-head { grid-template-columns: 1fr; gap: 12px; margin-bottom: 32px; }
  .bts-grid { grid-template-columns: 1fr 1fr; }
  .home-footer { padding: 0 28px 48px; }
  .home-footer-inner { grid-template-columns: 1fr; gap: 32px; }

  .contact { grid-template-columns: 1fr; gap: 40px; padding: 56px 24px 0; }
  .gallery-studio-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .site-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .site-nav { flex-wrap: wrap; gap: 12px 16px; }
}

@media (max-width: 560px) {
  .gallery-grid { column-count: 1; }
  .bts-grid { grid-template-columns: 1fr; }
}

/* Visually hidden but available to screen readers and search/AI crawlers. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Mobile hamburger menu ---------- */

/* The checkbox is the toggle state; kept off-screen but focusable for keyboard. */
.nav-toggle {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0);
}
/* Burger button — hidden on desktop, shown only on mobile below. */
.nav-burger { display: none; }

@media (max-width: 720px) {
  /* Keep wordmark and burger on one row for both header variants. */
  .overlay-header,
  .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: sticky;
  }

  /* Show the burger button. */
  .nav-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    pointer-events: auto; /* overlay-header sets pointer-events:none on itself */
    z-index: 70;
  }
  .nav-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  /* Collapse the nav into a dropdown panel, hidden until toggled. */
  .overlay-header nav,
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: auto;
    padding: 6px 20px 14px;
    background: rgba(250, 246, 234, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule-soft);
    mix-blend-mode: normal;
  }
  .nav-toggle:checked ~ nav { display: flex; }

  .overlay-header nav a,
  .site-nav a {
    color: var(--ink-muted);
    width: 100%;
    padding: 11px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--rule-soft);
  }
  .overlay-header nav a:last-child,
  .site-nav a:last-child { border-bottom: 0; }

  /* Keyboard focus ring on the burger when the (hidden) checkbox is focused. */
  .nav-toggle:focus-visible ~ .nav-burger {
    outline: 2px solid var(--ink);
    outline-offset: 4px;
  }

  /* Animate burger into an X when open. */
  .nav-toggle:checked ~ .nav-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Studio feature: on mobile the white overlay is unreadable on the bright
     photo, so lift the caption above the image and set it in black. */
  .studio-feature-inner { display: flex; flex-direction: column; }
  .studio-overlay {
    position: static;
    order: -1;               /* render before the image */
    padding: 0 28px 18px;
    color: var(--ink);
    text-shadow: none;
    pointer-events: auto;
  }
  .studio-overlay p { max-width: none; color: var(--ink-serif); }
  .studio-overlay a {
    color: var(--ink);
    border-bottom-color: var(--underline);
  }
}
