/* ==========================================================================
   Matrona Zirić — portfolio
   Olive editorial system: Bogue serif, cream paper, olive ink
   ========================================================================== */

/* ---------- Tokens ---------- */

:root {
  --olive-950: #171c11;
  --olive-900: #1f2617;
  --olive-800: #2a341e;
  --olive-700: #37452a;
  --olive-600: #47593a;
  --olive-500: #5c7148;
  --olive-400: #79905f;
  --olive-300: #9db085;
  --olive-200: #c3d1ad;
  --olive-100: #e2e9d6;
  --olive-50:  #f0f3e9;

  --cream: #f8f6ef;
  --cream-2: #f1eee2;
  --ink: #232819;
  --ink-soft: #5a6152;
  --ink-faint: #8b917f;
  --line: rgba(35, 40, 25, 0.16);
  --line-soft: rgba(35, 40, 25, 0.08);

  --on-dark: #f3f1e6;
  --on-dark-soft: rgba(243, 241, 230, 0.64);
  --on-dark-faint: rgba(243, 241, 230, 0.34);

  --font: "Bogue", "Georgia", serif;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

/* ---------- Reset ---------- */

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

* { margin: 0; }

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

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 1.04rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}

/* thin printed frame around the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 10px;
  border: 1px solid var(--line-soft);
  pointer-events: none;
  z-index: 300;
}

img, svg, button { display: block; }
img { max-width: 100%; height: auto; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

ul[class], ol[class] { list-style: none; padding: 0; }

h1, h2, h3, h4 {
  font-weight: 300;
  line-height: 1.08;
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection { background: var(--olive-200); color: var(--olive-900); }

:focus-visible {
  outline: 2px solid var(--olive-600);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Fonts (Bogue, SIL OFL) ---------- */

@font-face { font-family: "Bogue"; src: url("/static/fonts/Bogue%20Thin.ttf") format("truetype"); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: "Bogue"; src: url("/static/fonts/Bogue%20Thin%20Italic.ttf") format("truetype"); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: "Bogue"; src: url("/static/fonts/Bogue%20Light.ttf") format("truetype"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Bogue"; src: url("/static/fonts/Bogue%20Light%20Italic.ttf") format("truetype"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Bogue"; src: url("/static/fonts/Bogue%20Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Bogue"; src: url("/static/fonts/Bogue%20Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Bogue"; src: url("/static/fonts/Bogue%20Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Bogue"; src: url("/static/fonts/Bogue%20Medium%20Italic.ttf") format("truetype"); font-weight: 500; font-style: italic; font-display: swap; }

/* ---------- Utilities ---------- */

.wrap {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 4rem);
}

.kicker {
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--olive-500);
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.kicker::before {
  content: "";
  width: 2.2rem;
  height: 1px;
  background: var(--olive-400);
}

.sec-head { margin-bottom: clamp(2.2rem, 5vw, 3.6rem); }

.sec-title {
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  margin-top: 0.9rem;
  letter-spacing: 0.01em;
}

.btn {
  display: inline-block;
  padding: 0.9em 1.9em;
  border: 1px solid var(--olive-700);
  color: var(--olive-800);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.btn:hover { background: var(--olive-700); color: var(--cream); }

.btn-ghost { border-color: var(--on-dark-faint); color: var(--on-dark); }
.btn-ghost:hover { background: var(--cream); border-color: var(--cream); color: var(--olive-900); }

.link-arrow {
  display: inline-block;
  margin-top: 1.8rem;
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.35em;
  transition: color 0.3s, letter-spacing 0.3s;
}

.link-arrow:hover { letter-spacing: 0.26em; }

.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 400;
  background: var(--olive-800);
  color: var(--cream);
  padding: 0.7em 1.2em;
  font-size: 0.8rem;
  transition: top 0.2s;
}

.skip-link:focus { top: 12px; }

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

.site-head {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1.25rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--cream) 86%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  font-size: 1.22rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-name--it {
  font-style: italic;
  color: var(--olive-600);
  margin-left: 0.45em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.4rem, 3vw, 2.6rem);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 2.4vw, 2rem);
}

.nav-link {
  position: relative;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0.35em 0;
  transition: color 0.25s;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--olive-600);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.nav-link:hover { color: var(--olive-800); }
.nav-link:hover::after { transform: scaleX(1); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  padding: 0.35rem 0.8rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lang-current { color: var(--ink-faint); }

.lang-link { color: var(--olive-700); font-weight: 500; }
.lang-link:hover { color: var(--olive-500); }

/* mobile toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0;
}

.nav-toggle-label {
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nav-toggle-icon {
  display: grid;
  gap: 6px;
  width: 26px;
  align-content: center;
}

.nav-toggle-icon span {
  height: 1px;
  width: 100%;
  background: var(--olive-800);
  transition: transform 0.4s var(--ease), opacity 0.3s;
}

body.nav-open .nav-toggle-icon span:first-child { transform: translateY(3.5px) rotate(45deg); }
body.nav-open .nav-toggle-icon span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Hero (home) ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  color: var(--on-dark);
  overflow: hidden;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(23, 28, 17, 0.5) 0%, rgba(23, 28, 17, 0.16) 38%, rgba(23, 28, 17, 0.78) 100%),
    linear-gradient(90deg, rgba(23, 28, 17, 0.42) 0%, rgba(23, 28, 17, 0) 65%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(1.25rem, 5vw, 4rem) clamp(1.25rem, 5vw, 4rem) clamp(5.5rem, 10vh, 7.5rem);
  max-width: 1240px;
}

.hero-kicker {
  font-weight: 500;
  font-size: 0.74rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--olive-200);
  margin-bottom: 1.4rem;
}

.hero-name {
  font-weight: 100;
  font-size: clamp(3.4rem, 13vw, 10.5rem);
  line-height: 0.94;
  text-transform: uppercase;
  letter-spacing: 0.015em;
}

.hero-name-line--it {
  font-style: italic;
  font-weight: 100;
  color: var(--olive-200);
  margin-left: clamp(1.5rem, 8vw, 7rem);
}

.hero-line {
  margin-top: 1.6rem;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--on-dark-soft);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.4rem;
}

/* the base .btn is styled for light surfaces — on the dark hero image the
   solid variant must read as a cream button (the ghost keeps its outline) */
.hero .btn:not(.btn-ghost) { background: var(--cream); border-color: var(--cream); color: var(--olive-900); }
.hero .btn:not(.btn-ghost):hover { background: var(--olive-100); border-color: var(--olive-100); color: var(--olive-950); }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 1px;
  height: 64px;
  background: var(--on-dark-faint);
  overflow: hidden;
  z-index: 1;
}

.scroll-cue span {
  position: absolute;
  top: -40%;
  left: 0;
  width: 100%;
  height: 40%;
  background: var(--on-dark);
  animation: cue 2.4s var(--ease) infinite;
}

@keyframes cue {
  0% { top: -40%; }
  60%, 100% { top: 110%; }
}

/* ---------- Marquee ---------- */

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line-soft);
  background: var(--cream-2);
  padding-block: 0.85rem;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 46s linear infinite;
}

.marquee-item {
  font-weight: 300;
  font-size: 0.82rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--olive-600);
  white-space: nowrap;
}

.marquee-dot {
  color: var(--olive-300);
  margin-inline: 2.2rem;
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Works grid (home) ---------- */

.works { padding-block: clamp(4rem, 9vw, 7rem); }

.works-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(0.9rem, 2vw, 1.5rem);
}

.work {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--olive-100);
}

.work img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

.work:hover img,
.work:focus-visible img { transform: scale(1.045); }

.work-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.4rem 1.1rem 0.9rem;
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream);
  background: linear-gradient(180deg, transparent, rgba(23, 28, 17, 0.72));
  transform: translateY(100%);
  transition: transform 0.5s var(--ease);
}

.work:hover .work-cap,
.work:focus-visible .work-cap { transform: translateY(0); }

.work:nth-child(1)  { grid-column: span 7; aspect-ratio: 4 / 3; }
.work:nth-child(2)  { grid-column: span 5; aspect-ratio: 3 / 4; }
.work:nth-child(3)  { grid-column: span 5; aspect-ratio: 4 / 5; }
.work:nth-child(4)  { grid-column: span 7; aspect-ratio: 4 / 3; }
.work:nth-child(5)  { grid-column: span 6; aspect-ratio: 3 / 2; }
.work:nth-child(6)  { grid-column: span 6; aspect-ratio: 3 / 2; }
.work:nth-child(7)  { grid-column: span 7; aspect-ratio: 4 / 3; }
.work:nth-child(8)  { grid-column: span 5; aspect-ratio: 3 / 4; }
.work:nth-child(9)  { grid-column: span 12; aspect-ratio: 21 / 9; }

/* ---------- Section index (home) ---------- */

.index {
  padding-block: clamp(1rem, 4vw, 3rem) clamp(4rem, 9vw, 7rem);
}

.index-list {
  border-top: 1px solid var(--line);
}

.index-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto 2rem;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.4rem);
  padding-block: clamp(1.5rem, 3.4vw, 2.4rem);
  border-bottom: 1px solid var(--line);
}

.index-num {
  font-weight: 100;
  font-size: 1.9rem;
  color: transparent;
  -webkit-text-stroke: 1px var(--olive-400);
}

.index-title {
  display: block;
  font-weight: 300;
  font-size: clamp(1.9rem, 5vw, 3.3rem);
  line-height: 1.05;
  transition: color 0.3s, transform 0.5s var(--ease);
}

.index-desc {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.index-count {
  display: block;
  margin-top: 0.55rem;
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--olive-500);
}

.index-thumb {
  width: clamp(110px, 14vw, 190px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--olive-100);
}

.index-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transition: transform 0.9s var(--ease);
}

.index-arrow {
  font-size: 1.5rem;
  color: var(--olive-500);
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.35s, transform 0.45s var(--ease);
}

.index-row:hover .index-title { color: var(--olive-700); transform: translateX(10px); }
.index-row:hover .index-thumb img { transform: scale(1); }
.index-row:hover .index-arrow { opacity: 1; transform: translateX(0); }
.index-row:focus-visible .index-title { color: var(--olive-700); }

/* ---------- About teaser (home) ---------- */

.teaser {
  background: var(--olive-900);
  color: var(--on-dark);
  padding-block: clamp(4rem, 9vw, 7rem);
}

.teaser .wrap {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.teaser-media {
  position: relative;
  /* the profile source is 300px wide — never stretch it past native size */
  max-width: 300px;
}

.teaser-media img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  outline: 1px solid var(--on-dark-faint);
  outline-offset: 10px;
}

.teaser .sec-title { color: var(--on-dark); }

.teaser-text p {
  margin-top: 1.1rem;
  font-weight: 300;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.75;
  color: var(--on-dark-soft);
}

.teaser-text strong { color: var(--on-dark); font-weight: 500; }

.teaser .link-arrow { color: var(--olive-200); }
.teaser .link-arrow:hover { color: var(--cream); }

/* ---------- About page ---------- */

.about { padding-block: clamp(3rem, 7vw, 5rem) clamp(4rem, 9vw, 7rem); }

.about-head { margin-bottom: clamp(2.5rem, 6vw, 4rem); }

.about-name {
  font-weight: 100;
  font-size: clamp(2.8rem, 9vw, 6.5rem);
  margin-top: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.about-name em { color: var(--olive-600); font-style: italic; }

.about-tag {
  margin-top: 0.8rem;
  font-weight: 300;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.about-side {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 1.6rem;
  justify-items: start;
}

.about-portrait {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  outline: 1px solid var(--line);
  outline-offset: 8px;
}

.socials { display: grid; gap: 0.65rem; }

.socials a {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.25s;
}

.socials a:hover { color: var(--olive-700); }

.socials img { width: 17px; height: 17px; opacity: 0.65; transition: opacity 0.25s; }
.socials a:hover img { opacity: 1; }

/* same box size as the 17px icons so all social rows align */
.soc-text {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid var(--line);
  font-size: 0.55rem;
}

.btn-block { width: 100%; text-align: center; margin-top: 0.4rem; }

.block {
  padding-block: 2.4rem;
  border-top: 1px solid var(--line);
}

.block:first-child { border-top: 0; padding-top: 0; }

.block-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.block-title::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--olive-400);
}

.block--intro p {
  font-weight: 300;
  font-size: clamp(1.12rem, 2vw, 1.32rem);
  line-height: 1.8;
}

.block--intro strong { font-weight: 500; }

.entry { margin-bottom: 1.9rem; }
.entry:last-child { margin-bottom: 0; }

.entry-head {
  font-weight: 500;
  font-size: 1.08rem;
  line-height: 1.35;
}

.entry-period {
  margin-top: 0.3rem;
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--olive-500);
}

.entry-lines { margin-top: 0.5rem; color: var(--ink-soft); }
.entry-lines p + p { margin-top: 0.35rem; }

.entry-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2.5rem;
  margin-top: 0.4rem;
}

.entry-list li {
  display: flex;
  gap: 0.7rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
}

.entry-list li::before {
  content: "—";
  color: var(--olive-400);
  flex-shrink: 0;
}

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

.gallery { padding-block: clamp(3rem, 7vw, 5rem) clamp(4rem, 9vw, 7rem); }

.gallery-head {
  max-width: 760px;
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.gallery-title {
  font-weight: 100;
  font-size: clamp(2.8rem, 10vw, 6.5rem);
  margin-top: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.gallery-desc {
  margin-top: 0.9rem;
  font-weight: 300;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.gallery-count {
  margin-top: 1.4rem;
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--olive-500);
}

.masonry {
  columns: 3;
  column-gap: 1.25rem;
}

.m-item {
  break-inside: avoid;
  margin-bottom: 1.25rem;
  cursor: zoom-in;
}

.m-btn {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--olive-100);
}

.m-btn img {
  width: 100%;
  transition: transform 0.9s var(--ease);
}

.m-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(23, 28, 17, 0.42));
  opacity: 0;
  transition: opacity 0.4s;
}

.m-btn:hover img { transform: scale(1.035); }
.m-btn:hover::after,
.m-btn:focus-visible::after { opacity: 1; }

/* ---------- Lightbox ---------- */

/* Full-viewport dialog so the figure can be centered on both axes;
   the ::backdrop still paints behind it. */
.lightbox {
  position: fixed;
  inset: 0;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  display: grid;
  overflow: auto;
}

.lightbox::backdrop {
  background: rgba(23, 28, 17, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* margin: auto centers the figure in the full-viewport dialog on both
   axes; the padding leaves breathing room above the image and below the
   caption. On overflow (short screens) the top stays reachable. */
.lb-figure {
  margin: auto;
  display: grid;
  justify-items: center;
  padding: clamp(2.5rem, 7vh, 4.5rem) 1rem;
}

/* leaves ~12rem for the figure padding + caption so nothing overflows */
.lb-img {
  max-width: 94vw;
  max-height: min(80svh, calc(100svh - 12rem));
  width: auto;
  height: auto;
  margin-inline: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.lb-cap {
  margin-top: 1rem;
  text-align: center;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
}

.lb-btn {
  position: fixed;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--on-dark-faint);
  border-radius: 50%;
  color: var(--on-dark);
  background: rgba(23, 28, 17, 0.4);
  font-size: 1.1rem;
  transition: background 0.3s, border-color 0.3s;
  z-index: 200;
}

.lb-btn:hover { background: var(--olive-600); border-color: var(--olive-400); }

/* the × glyph renders a hair below the circle's optical center — nudge it up */
.lb-close span { display: inline-block; transform: translateY(-0.1em); }

.lb-close { top: 1.2rem; right: 1.4rem; }
.lb-prev { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.4rem; top: 50%; transform: translateY(-50%); }

/* ---------- 404 ---------- */

.nf {
  min-height: 62vh;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding-block: 4rem;
}

.nf-code {
  font-weight: 100;
  font-size: clamp(5.5rem, 18vw, 11rem);
  line-height: 1;
  color: var(--olive-100);
  -webkit-text-stroke: 1px var(--olive-300);
}

.nf-title { margin-top: 1.2rem; font-size: 1.9rem; }

.nf-body {
  margin-top: 0.9rem;
  max-width: 46ch;
  color: var(--ink-soft);
}

.nf .btn { margin-top: 2.2rem; }

/* ---------- Footer ---------- */

.site-foot {
  background: var(--olive-950);
  color: var(--on-dark);
  padding-top: clamp(4rem, 8vw, 6rem);
}

.foot-big {
  font-weight: 100;
  font-style: italic;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1.1;
  max-width: 18ch;
}

.foot-mail {
  display: inline-block;
  margin-top: 1.6rem;
  font-weight: 300;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--olive-200);
  border-bottom: 1px solid var(--on-dark-faint);
  padding-bottom: 0.3rem;
  transition: color 0.3s, border-color 0.3s;
}

.foot-mail:hover { color: var(--cream); border-color: var(--cream); }

.foot-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 2.2rem;
  margin-top: 2.4rem;
}

.foot-social a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-dark-soft);
  transition: color 0.25s;
}

.foot-social a:hover { color: var(--cream); }
/* icons rest at the same strength as the label text (on-dark-soft) and
   brighten to full on hover, matching the [Y] chip's color transition */
.foot-social img { width: 17px; height: 17px; opacity: 0.64; transition: opacity 0.25s; }
.foot-social a:hover img { opacity: 1; }

.foot-social .soc-text { border-color: var(--on-dark-faint); }

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 2rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-block: 1.4rem;
  border-top: 1px solid rgba(243, 241, 230, 0.14);
  font-size: 0.78rem;
  color: var(--on-dark-soft);
}

.to-top { letter-spacing: 0.08em; transition: color 0.25s; }
.to-top:hover { color: var(--cream); }

/* ---------- Scroll reveal (progressive enhancement) ---------- */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .work,
    .index-item,
    .m-item,
    .block,
    .teaser-media,
    .teaser-body {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

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

@media (max-width: 1100px) {
  .masonry { columns: 2; }
}

@media (max-width: 900px) {
  /* mobile nav overlay */
  .nav-toggle { display: inline-flex; }

  /* keep the header (and its toggle) above the overlay so the menu can be closed */
  .site-head { z-index: 200; }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 150;
    flex-direction: column;
    justify-content: center;
    gap: 2.6rem;
    background: var(--cream);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease), visibility 0.4s;
  }

  body.nav-open .site-nav { opacity: 1; visibility: visible; }
  body.nav-open { overflow: hidden; }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.3rem;
  }

  .nav-link {
    font-weight: 300;
    font-size: 1.7rem;
    text-transform: none;
    letter-spacing: 0.02em;
    color: var(--ink);
  }

  .lang-switch {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
  }

  .teaser .wrap { grid-template-columns: 1fr; }
  .teaser-media { max-width: 340px; }

  .about-grid { grid-template-columns: 1fr; }
  .about-side {
    position: static;
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .work:nth-child(n) { grid-column: span 12; aspect-ratio: 4 / 3; }
  .work:nth-child(9) { aspect-ratio: 16 / 10; }

  .index-row { grid-template-columns: 2.4rem 1fr 2rem; }
  .index-thumb { display: none; }
}

@media (max-width: 640px) {
  .masonry { columns: 1; }

  .entry-list { grid-template-columns: 1fr; }

  .hero-actions .btn { padding: 0.9em 1.4em; }

  .lb-prev { left: 0.6rem; }
  .lb-next { right: 0.6rem; }
  .lb-btn { width: 40px; height: 40px; }

  body::after { inset: 5px; }
}
