/* ==========================================================================
   Resume site — styles
   You normally don't need to touch this file: text, images and colours
   live in content.js. If you do want to tweak the look, the most useful
   knobs are the variables right below.
   ========================================================================== */

@font-face {
  font-family: "Archivo Black";
  src: url("../fonts/archivo-black.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-400.woff") format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-600.woff") format("woff");
  font-weight: 600;
  font-display: swap;
}

:root {
  /* Colours (content.js -> theme can override these) */
  --bg: #0b0b0b;
  --ink: #f4f4f1;
  --muted: #9a9a96;
  --line: rgba(244, 244, 241, 0.16);
  --contact-bg: #f4f4f1;
  --contact-ink: #0b0b0b;

  /* Type */
  --display: "Archivo Black", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Layout */
  --max: 1240px;
  --pad: max(5vw, 18px);
  --radius: clamp(14px, 1.6vw, 24px);
  --nav-h: 60px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  font: 400 15px/1 var(--display); text-transform: uppercase; text-decoration: none; letter-spacing: 0.01em;
  white-space: nowrap;
}
.nav-links { position: absolute; left: 50%; transform: translateX(-50%); display: flex; gap: clamp(18px, 2.6vw, 40px); }
.nav-links a, .nav-cv {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none;
  opacity: 0.72; transition: opacity 0.2s;
  padding: 10px 0;
}
.nav-links a:hover, .nav-links a.is-active, .nav-cv:hover { opacity: 1; }
.nav-cv { white-space: nowrap; }
.nav-right { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }

/* Language switch (EN | HR) */
.lang { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.lang button {
  min-width: 38px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; opacity: 0.7; transition: opacity .2s, background-color .2s, color .2s;
}
.lang button:hover { opacity: 1; }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--bg); opacity: 1; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 9px 18px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer;
}

.menu {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  display: flex; flex-direction: column; padding: 0 var(--pad) 40px;
  opacity: 0; visibility: hidden; transition: opacity 0.25s, visibility 0.25s;
}
.menu.is-open { opacity: 1; visibility: visible; }
.menu-top { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); }
.menu-links { display: flex; flex-direction: column; gap: 6px; margin-top: 36px; }
.menu-links a { font: 400 clamp(34px, 11vw, 64px)/1.05 var(--display); text-transform: uppercase; text-decoration: none; padding: 4px 0; }
.menu-foot { margin-top: auto; color: var(--muted); font-size: 15px; display: grid; gap: 8px; justify-items: start; }
.menu-foot .btn { color: var(--ink); margin-bottom: 18px; }
.menu-foot a { text-decoration: none; }

/* ---------- Hero ---------- */
.hero { padding: calc(var(--nav-h) + clamp(28px, 7vh, 90px)) var(--pad) clamp(40px, 8vh, 90px); }
.hero-stage { position: relative; max-width: var(--max); margin: 0 auto; }
.hero-media {
  position: relative; width: 64%; margin: 0 auto; aspect-ratio: 16 / 9; max-height: 70svh;
  border-radius: var(--radius); overflow: hidden; background: #1a1a1a;
  animation: hero-in 1.2s cubic-bezier(.2,.7,.2,1) both;
}
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.35)); }

.hero-title {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-38%);
  display: flex; justify-content: space-between; align-items: flex-end; gap: 2%;
  margin: 0; font-weight: 400; pointer-events: none; z-index: 2;
}
.hero-part { display: flex; flex-direction: column; min-width: 0; }
.hero-part--right { align-items: flex-start; }
.hero-word {
  font: 400 100px/0.8 var(--display); text-transform: uppercase; white-space: nowrap;
  letter-spacing: -0.01em; margin-bottom: -0.04em;
}
.hero-word--left { font-size: 60px; }
.hero-tag {
  margin-top: 0.9em; font-size: clamp(11px, 0.95vw, 13px); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  max-width: 34ch; line-height: 1.35;
}

@keyframes hero-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Marquee strip ---------- */
.strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 22px 0; }
.strip-track { display: flex; width: max-content; animation: marquee var(--strip-speed, 40s) linear infinite; }
.strip:hover .strip-track { animation-play-state: paused; }
.strip-group { display: flex; align-items: center; gap: clamp(40px, 6vw, 88px); padding-right: clamp(40px, 6vw, 88px); }
.strip-item { font: 400 clamp(16px, 1.8vw, 22px)/1 var(--display); text-transform: uppercase; white-space: nowrap; opacity: 0.9; }
.strip-item img { height: clamp(24px, 2.6vw, 34px); width: auto; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(70px, 11vw, 150px) 0 0; }
.section-title {
  font: 400 clamp(30px, 4.6vw, 58px)/1.02 var(--display); text-transform: uppercase; text-align: center;
  margin: 0 0 clamp(36px, 5vw, 64px); text-wrap: balance; letter-spacing: -0.005em;
}
.section-intro { max-width: 60ch; margin: calc(-1 * clamp(18px, 3vw, 40px)) auto clamp(36px, 5vw, 56px); text-align: center; color: var(--muted); }
.note { text-align: center; margin: clamp(36px, 5vw, 60px) 0 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 80px); align-items: center; max-width: 1080px; margin: 0 auto; }
.about-photo { border-radius: var(--radius); overflow: hidden; aspect-ratio: 5 / 6; background: #1a1a1a; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo.is-bw img { filter: grayscale(1) contrast(1.05); }
.about-text p { text-wrap: pretty; margin: 0 0 1em; font-size: clamp(16px, 1.25vw, 18px); max-width: 56ch; }
.about-text p:first-child { font-size: clamp(19px, 1.7vw, 24px); line-height: 1.4; }
.facts { margin: 28px 0 0; padding: 0; display: grid; }
.facts div { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.facts div:last-child { border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; font-size: 15px; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 12px 24px; border-radius: 999px; border: 1px solid currentColor;
  font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; background: none;
  transition: background-color .2s, color .2s;
}
.btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--solid { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn--solid:hover { background: transparent; color: var(--ink); }

/* ---------- Timeline (experience / education) ---------- */
.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 1080px; }
.tl-row {
  display: grid; grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.5fr) minmax(0, 1.75fr); gap: clamp(16px, 3vw, 48px);
  padding: clamp(22px, 2.6vw, 34px) 0; border-top: 1px solid var(--line);
}
.tl-row:last-child { border-bottom: 1px solid var(--line); }
.tl-period { color: var(--muted); font-size: 14px; font-weight: 600; padding-top: 0.3em; font-variant-numeric: tabular-nums; }
.tl-role { font: 400 clamp(19px, 1.9vw, 26px)/1.12 var(--display); text-transform: uppercase; margin: 0; }
.tl-org { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.tl-body { font-size: 15.5px; }
.tl-body p { margin: 0 0 0.6em; }
.tl-body ul { margin: 0; padding-left: 1.1em; }
.tl-body li { margin: 0 0 0.35em; }
.tl-body li::marker { color: var(--muted); }

/* ---------- Gallery ---------- */
.gallery { display: grid; gap: clamp(10px, 1.3vw, 18px); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gallery--collage { grid-auto-rows: clamp(170px, 19vw, 280px); grid-auto-flow: dense; }
.gallery--grid .card { aspect-ratio: 4 / 3; }
.card { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; background: #1a1a1a; }
.card--wide { grid-column: span 2; }
.card--tall { grid-row: span 2; }
.card--big { grid-column: span 2; grid-row: span 2; }
.card-hit {
  position: absolute; inset: 0; display: block; width: 100%; padding: 0; border: 0; background: none;
  cursor: pointer; text-align: left; text-decoration: none; border-radius: inherit;
}
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.card figcaption {
  position: absolute; inset: auto 0 0 0; padding: clamp(14px, 1.6vw, 22px);
  display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 6px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.7));
  opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s;
}
.card-cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.85; }
.card-title { font: 400 clamp(17px, 1.9vw, 28px)/1.05 var(--display); text-transform: uppercase; }
.card-hit:hover img, .card-hit:focus-visible img { transform: scale(1.045); }
.card-hit:hover figcaption, .card-hit:focus-visible figcaption { opacity: 1; transform: none; }
@media (hover: none) { .card figcaption { opacity: 1; transform: none; } }

.missing {
  width: 100%; height: 100%; min-height: 120px; display: grid; place-items: center; padding: 16px; text-align: center;
  background: repeating-linear-gradient(45deg, #161616 0 12px, #1c1c1c 12px 24px);
  color: var(--muted); font-size: 13px; line-height: 1.4;
}

/* ---------- Tags (skills) ---------- */
.tags { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: clamp(28px, 4vw, 56px); max-width: 1080px; margin: 0 auto; }
.tags h3 { margin: 0 0 16px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.tags ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { border: 1px solid var(--line); border-radius: 999px; padding: 7px 15px; font-size: 14.5px; }

/* ---------- Free text ---------- */
.text-block { max-width: 64ch; margin: 0 auto; font-size: clamp(16px, 1.3vw, 19px); }
.text-block p { margin: 0 0 1em; }

/* ---------- Contact / footer ---------- */
.contact { margin-top: clamp(90px, 13vw, 180px); background: var(--contact-bg); color: var(--contact-ink); padding: clamp(48px, 6vw, 80px) 0 32px; }
.contact .btn:hover { background: var(--contact-ink); color: var(--contact-bg); border-color: var(--contact-ink); }
.contact-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding-bottom: clamp(32px, 4vw, 48px); border-bottom: 1px solid currentColor; }
.contact-title { font: 400 clamp(36px, 6.4vw, 84px)/0.95 var(--display); text-transform: uppercase; margin: 0; max-width: 12ch; text-wrap: balance; }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding: 36px 0 64px; font-size: 16px; }
.contact-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; align-content: start; }
.contact-grid a { text-decoration: none; }
.contact-grid a:hover { text-decoration: underline; text-underline-offset: 3px; }
.contact-links a { text-transform: uppercase; }
.contact-social { justify-items: end; }
.contact-social a { text-transform: uppercase; font-weight: 600; font-size: 14px; letter-spacing: 0.04em; }
.contact-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; }
.contact-base a { text-decoration: none; }

/* ---------- Lightbox ---------- */
.lightbox {
  width: min(1100px, 94vw); max-height: 94svh; padding: 0; border: 0; border-radius: var(--radius);
  background: #111; color: var(--ink); overflow: auto;
}
.lightbox::backdrop { background: rgba(0,0,0,.85); }
.lightbox img { width: 100%; max-height: 72svh; object-fit: contain; background: #000; }
.lb-body { display: flex; justify-content: space-between; gap: 24px; padding: 20px 24px 24px; align-items: flex-start; flex-wrap: wrap; }
.lb-title { font: 400 clamp(20px, 2.4vw, 30px)/1.1 var(--display); text-transform: uppercase; margin: 4px 0 0; }
.lb-desc { margin: 10px 0 0; max-width: 62ch; color: #cfcfcb; }
.lb-desc:empty { display: none; }
.lb-actions { display: flex; gap: 8px; margin-left: auto; }
.lb-actions button { min-width: 46px; min-height: 46px; border-radius: 999px; border: 1px solid var(--line); background: none; cursor: pointer; font-size: 18px; }
.lb-actions button:hover { background: var(--ink); color: var(--bg); }

/* ---------- Error / notice panel ---------- */
.site-error { max-width: 640px; margin: 15vh auto; padding: 28px; border: 1px solid #ff6b6b; border-radius: 16px; font-size: 16px; }
.site-error h1 { font: 400 26px/1.1 var(--display); text-transform: uppercase; margin: 0 0 12px; }
.site-error code { background: #222; padding: 2px 6px; border-radius: 4px; }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1000px) {
  .tl-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .tl-body { grid-column: 2; }
}

@media (max-width: 860px) {
  .nav-links, .nav-cv { display: none; }
  .nav-toggle { display: inline-flex; }

  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery--collage { grid-auto-rows: clamp(160px, 30vw, 260px); }
  .card--big { grid-column: span 2; grid-row: span 2; }

  .hero-media { width: 76%; aspect-ratio: 4 / 3; }
  .about { gap: 32px; }

  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-social { justify-items: start; }
}

/* Phones: the hero becomes a stacked poster */
@media (max-width: 640px) {
  .hero { padding-top: calc(var(--nav-h) + 24px); }
  .hero-stage { display: flex; flex-direction: column; }
  .hero-title { display: contents; }
  .hero-part { position: relative; z-index: 2; }
  .hero-part--left { order: 1; align-items: flex-start; }
  .hero-part--left .hero-tag { order: -1; margin: 0 0 14px; }
  .hero-part--left .hero-word { margin-bottom: -0.3em; }
  .hero-media { order: 2; width: 100%; aspect-ratio: 4 / 5; max-height: 64svh; }
  .hero-part--right { order: 3; align-items: flex-end; text-align: right; margin-top: -0.42em; }
  .hero-part--right .hero-tag { margin-top: 14px; }

  .about { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .about-photo { aspect-ratio: 4 / 4.4; }

  .gallery, .gallery--grid { grid-template-columns: minmax(0, 1fr); }
  .gallery--collage { grid-auto-rows: auto; }
  .card, .card--wide, .card--big { grid-column: auto; grid-row: auto; aspect-ratio: 4 / 3; }
  .card--tall { grid-row: auto; aspect-ratio: 4 / 5; }

  .tl-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .tl-body { grid-column: auto; margin-top: 6px; }
  .tl-period { padding-top: 0; }

  .facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-bottom: 44px; }
  .contact-head .btn { width: 100%; }
  .lb-body { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .strip-track { width: auto; }
  .strip-group { flex-wrap: wrap; justify-content: center; row-gap: 16px; padding: 0 var(--pad); }
  .strip-group[aria-hidden="true"], .strip-dup { display: none; }
  .js .reveal { opacity: 1; transform: none; }
}
