/* Borislav Knežević – portfolio
   Palette: navy + red (same as CV). Type: Archivo Black (display) + Fira Sans (text). */

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

:root {
  --navy: #0D0E24;
  --navy-2: #15173A;
  --navy-3: #262A55;
  --paper: #EEF0F8;
  --red: #F21F0C;
  --red-btn: #D3190A;
  --red-on-dark: #FF4A36;
  --red-on-paper: #C8170A;
  --white: #FFFFFF;
  --muted: #B3B6D6;
  --muted-2: #8E92BC;
  --ink-2: #4A4E78;
  --display: "Archivo Black", "Arial Black", sans-serif;
  --text: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1240px;
  --pad: clamp(20px, 4vw, 40px);
  --radius: 10px;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--navy); color: var(--white);
  font-family: var(--text); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }

:focus-visible { outline: 3px solid var(--red-on-dark); outline-offset: 3px; border-radius: 4px; }
.paper :focus-visible { outline-color: var(--red-on-paper); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--white); color: var(--navy); padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--red-btn);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border: 0; cursor: pointer; text-decoration: none;
  font-weight: 600; font-size: 1rem; color: var(--white); isolation: isolate; background: none;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--bg);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  transition: background-color .2s ease;
}
.btn:hover::before { background: #B01408; }
.btn--ghost { padding: 0 24px; }
.btn--ghost::before { display: none; }
.btn--ghost::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--white); transform: skewX(-12deg); z-index: -1; transition: background-color .15s; }
.btn--ghost:hover::after { background: rgba(255,255,255,.08); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(13,14,36,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s, transform .3s ease; }
.site-header.is-scrolled { border-bottom-color: var(--navy-3); }
.site-header.is-hidden { transform: translateY(-100%); }
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; }
.brand img { width: 42px; height: 42px; border-radius: 50%; box-shadow: 0 0 0 2px var(--white); }
.brand span { font-family: var(--display); font-size: 1.05rem; letter-spacing: -.01em; white-space: nowrap; }
.nav ul { display: flex; gap: 26px; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .98rem; padding: 6px 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.nav a:hover, .nav a[aria-current="true"] { color: var(--white); border-bottom-color: var(--red); }
.lang { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: .92rem; }
.lang a, .lang span { padding: 6px 8px; text-decoration: none; border-radius: 6px; }
.lang span { color: var(--white); background: var(--navy-3); }
.lang a { color: var(--muted); }
.lang a:hover { color: var(--white); }
.header-cv { min-height: 42px; padding: 0 20px; font-size: .95rem; }
.menu-btn { display: none; width: 46px; height: 46px; border: 0; background: var(--navy-2); border-radius: 10px; cursor: pointer; align-items: center; justify-content: center; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 20px; height: 2px; background: var(--white); position: relative; transition: transform .2s, background .2s; }
.menu-btn span::before, .menu-btn span::after { content: ""; position: absolute; left: 0; }
.menu-btn span::before { top: -6px; } .menu-btn span::after { top: 6px; }
.menu-btn[aria-expanded="true"] span { background: transparent; }
.menu-btn[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 110px); }
.stripes { position: absolute; top: 0; right: 0; width: min(36vw, 460px); height: 100%; pointer-events: none; z-index: 0; }
.stripes i { position: absolute; top: -20px; bottom: -20px; width: clamp(10px, 1.6vw, 20px); background: var(--white); opacity: .07; transform: skewX(-24deg); }
.stripes i:nth-child(1) { right: 64%; } .stripes i:nth-child(2) { right: 54%; } .stripes i:nth-child(3) { right: 44%; } .stripes i:nth-child(4) { right: 34%; }
.stripes i:nth-child(5) { right: 6%; width: clamp(40px, 6vw, 84px); background: var(--red); opacity: .9; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-family: var(--display); font-size: clamp(3.2rem, 8.6vw, 7.6rem); line-height: .92; letter-spacing: -.025em; }
.hero h1 .line { display: block; }
.hero-role { margin-top: 22px; font-size: clamp(1.25rem, 2.2vw, 1.6rem); font-weight: 600; color: var(--red-on-dark); }
.hero-lead { margin-top: 14px; max-width: 34em; color: var(--muted); font-size: clamp(1.05rem, 1.5vw, 1.18rem); }
.hero-cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px 18px; }

/* ---------- slot machine ---------- */
.machine { position: relative; background: var(--navy-2); border: 1px solid var(--navy-3); border-radius: 22px; padding: 16px 16px 20px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.7); }
.machine::before { content: ""; position: absolute; inset: -1px; border-radius: 22px; padding: 1px; background: linear-gradient(160deg, rgba(242,31,12,.8), transparent 40%, transparent 70%, rgba(255,255,255,.25)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.bulbs { display: flex; justify-content: space-between; padding: 2px 6px 14px; }
.bulbs i { width: 8px; height: 8px; border-radius: 50%; background: var(--navy-3); }
.bulbs i:nth-child(odd) { background: rgba(242,31,12,.55); }
.machine.is-spinning .bulbs i { animation: blink .32s steps(2) infinite; }
.machine.is-spinning .bulbs i:nth-child(even) { animation-delay: .16s; }
@keyframes blink { 50% { background: var(--white); box-shadow: 0 0 10px rgba(255,255,255,.8); } }
.reels { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.reel { position: relative; overflow: hidden; border-radius: 12px; background: #07081A; aspect-ratio: 1 / 1.78; cursor: pointer; }
.reel::before, .reel::after { content: ""; position: absolute; left: 0; right: 0; height: 22%; z-index: 2; pointer-events: none; }
.reel::before { top: 0; background: linear-gradient(#07081A, rgba(7,8,26,0)); }
.reel::after { bottom: 0; background: linear-gradient(rgba(7,8,26,0), #07081A); }
.strip { }
.machine.is-spinning .strip { will-change: transform; }
.cell { padding: 5px; aspect-ratio: 4 / 5; }
.cell img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.payline { position: absolute; left: -6px; right: -6px; top: 50%; height: var(--cell-h, 50%); transform: translateY(-50%); border-top: 2px solid var(--red); border-bottom: 2px solid var(--red); pointer-events: none; z-index: 3; }
.payline::before, .payline::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; border: 8px solid transparent; transform: translateY(-50%); }
.payline::before { left: -6px; border-left-color: var(--red); }
.payline::after { right: -6px; border-right-color: var(--red); }
.machine-foot { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.spin { min-height: 56px; padding: 0 34px; font-family: var(--display); font-size: 1.15rem; letter-spacing: .01em; flex: none; }
.spin[disabled] { cursor: progress; }
.spin[disabled]::before { background: #8A1206; }
.machine-hint { font-size: .9rem; color: var(--muted-2); line-height: 1.45; }

/* ---------- clients ---------- */
.clients { border-top: 1px solid var(--navy-3); border-bottom: 1px solid var(--navy-3); padding: 30px 0; }
.clients-inner { display: flex; align-items: center; gap: 20px 44px; flex-wrap: wrap; }
.clients h2 { font-family: var(--text); font-weight: 600; font-size: 1rem; color: var(--muted-2); }
.clients ul { display: flex; flex-wrap: wrap; align-items: center; gap: 22px 40px; }
.clients img { height: 34px; width: auto; }
.clients li:first-child img { height: 40px; }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px 40px; margin-bottom: clamp(28px, 4vw, 44px); }
.section h2 { font-family: var(--display); font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1; letter-spacing: -.02em; }
.section-intro { max-width: 40em; color: var(--muted); margin-top: 14px; }

/* filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { position: relative; border: 0; background: none; padding: 10px 16px; cursor: pointer; font-weight: 600; font-size: .96rem; color: var(--muted); isolation: isolate; }
.filter::before { content: ""; position: absolute; inset: 0; z-index: -1; border: 1px solid var(--navy-3); transform: skewX(-12deg); transition: background-color .15s, border-color .15s; }
.filter:hover { color: var(--white); }
.filter:hover::before { border-color: var(--muted-2); }
.filter[aria-pressed="true"] { color: var(--white); }
.filter[aria-pressed="true"]::before { background: var(--red-btn); border-color: var(--red-btn); }
.filter sup { font-size: .72em; margin-left: 3px; opacity: .8; vertical-align: super; line-height: 0; }

/* grid */
.grid { columns: 4 240px; column-gap: 20px; }
.more-wrap { margin-top: 18px; text-align: center; }
.more-wrap[hidden] { display: none; }
.work { break-inside: avoid; margin-bottom: 26px; }
.work[hidden] { display: none; }
.work-btn { display: block; width: 100%; padding: 0; border: 0; background: var(--navy-2); border-radius: var(--radius); overflow: hidden; cursor: zoom-in; }
.work-btn img { width: 100%; transition: transform .45s cubic-bezier(.2,.7,.2,1), opacity .3s; }
.work-btn:hover img { transform: scale(1.035); }
.work--link .work-btn { position: relative; cursor: pointer; }
.badge { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(13,14,36,.88); color: var(--white); font-weight: 600; font-size: .82rem; transition: background-color .15s; }
.badge svg { width: 14px; height: 14px; }
.work--link .work-btn:hover .badge { background: var(--red-btn); }
.work figcaption { margin-top: 10px; display: flex; flex-direction: column; gap: 1px; }
.work .t { font-weight: 600; font-size: .98rem; line-height: 1.35; }
.work .c { font-size: .86rem; color: var(--muted-2); }

/* ---------- paper band: services + experience ---------- */
.paper { background: var(--paper); color: var(--navy); }
.paper .section-intro { color: var(--ink-2); }
.services { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(32px, 6vw, 88px); border-top: 2px solid var(--navy); }
.services li { padding: 24px 0 26px; border-bottom: 1px solid #CDD0E2; }
.services h3 { font-family: var(--display); font-size: 1.32rem; line-height: 1.15; letter-spacing: -.01em; }
.services p { margin-top: 8px; color: var(--ink-2); max-width: 32em; }

.timeline { border-top: 2px solid var(--navy); }
.timeline li { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 8px 40px; padding: 26px 0; border-bottom: 1px solid #CDD0E2; }
.timeline time { font-weight: 600; color: var(--red-on-paper); font-variant-numeric: tabular-nums; padding-top: 2px; }
.timeline h3 { font-family: var(--display); font-size: 1.32rem; line-height: 1.2; }
.timeline .org { font-weight: 600; color: var(--ink-2); margin-top: 2px; }
.timeline p.desc { margin-top: 8px; max-width: 46em; color: var(--ink-2); }
.timeline-logo { display: inline-flex; vertical-align: middle; width: 30px; height: 30px; border-radius: 6px; background: var(--navy); padding: 4px; margin-right: 10px; }
.timeline-logo img { width: 100%; height: 100%; object-fit: contain; }
.edu-title { font-family: var(--display); font-size: 1.6rem; margin: clamp(40px, 6vw, 64px) 0 10px; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 88px); align-items: start; }
.portrait { position: relative; max-width: 420px; }
.portrait img { width: 100%; border-radius: 50%; box-shadow: 0 0 0 6px var(--white); }
.portrait { isolation: isolate; }
.about-text p { color: var(--muted); max-width: 38em; }
.about-text p + p { margin-top: 16px; }
.about-text h2 { margin-bottom: 26px; }
.facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 34px 0 30px; border-top: 1px solid var(--navy-3); }
.facts div { padding: 18px 16px 18px 0; border-bottom: 1px solid var(--navy-3); }
.facts dt { font-family: var(--display); font-size: 2rem; line-height: 1; color: var(--white); }
.facts dd { margin-top: 6px; font-size: .92rem; color: var(--muted-2); line-height: 1.35; }
.about-text .meta { font-size: .98rem; }
.about-text .meta strong { color: var(--white); font-weight: 600; }

/* ---------- contact ---------- */
.contact { border-top: 1px solid var(--navy-3); }
.contact .lead { font-size: clamp(1.15rem, 2vw, 1.4rem); color: var(--muted); margin-top: 16px; max-width: 30em; }
.mail-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; margin-top: clamp(28px, 4vw, 44px); }
.mail { font-family: var(--display); font-size: clamp(1.45rem, 4.4vw, 3.4rem); line-height: 1.1; letter-spacing: -.02em; text-decoration: none; overflow-wrap: anywhere; background-image: linear-gradient(var(--red), var(--red)); background-size: 0 4px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .3s ease; }
.mail:hover { background-size: 100% 4px; }
.copy { min-height: 46px; font-size: .95rem; padding: 0 20px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px clamp(32px, 6vw, 88px); margin-top: clamp(40px, 6vw, 64px); align-items: start; }
.reach { color: var(--muted); margin-bottom: 18px; }
.socials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.socials li:last-child { grid-column: 1 / -1; }
.socials a { display: flex; align-items: center; gap: 14px; padding: 20px 20px; font-size: 1.08rem; background: var(--navy-2); border: 1px solid var(--navy-3); border-radius: 12px; text-decoration: none; font-weight: 600; transition: border-color .15s, background-color .15s, transform .15s; }
.socials a:hover { border-color: var(--red); background: #1C1F48; transform: translateY(-2px); }
.socials svg { width: 26px; height: 26px; flex: none; color: var(--red-on-dark); }
.form { background: var(--navy-2); border: 1px solid var(--navy-3); border-radius: 16px; padding: clamp(22px, 3vw, 32px); }
.form h3 { font-family: var(--display); font-size: 1.5rem; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field textarea { font: inherit; color: var(--white); background: var(--navy); border: 1px solid var(--navy-3); border-radius: 10px; padding: 12px 14px; min-height: 48px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red-on-dark); box-shadow: 0 0 0 3px rgba(255,74,54,.25); }
.field [aria-invalid="true"] { border-color: var(--red-on-dark); }
.form-err { color: var(--red-on-dark); font-weight: 600; font-size: .95rem; min-height: 1.2em; margin-bottom: 10px; }
.form .btn { width: 100%; }
.form-note { margin-top: 12px; font-size: .86rem; color: var(--muted-2); }
.dl-title { font-family: var(--text); font-weight: 600; font-size: .95rem; color: var(--muted-2); margin: 34px 0 12px; }
.downloads li + li { margin-top: 10px; }
.downloads a { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--navy-3); padding-bottom: 2px; }
.downloads a:hover { border-color: var(--red); }
.downloads svg { width: 18px; height: 18px; color: var(--red-on-dark); }
.foot-icons { display: flex; gap: 10px; }
.foot-icons a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--navy-2); color: var(--muted); transition: background-color .15s, color .15s; }
.foot-icons a:hover { background: var(--red-btn); color: var(--white); }
.foot-icons svg { width: 19px; height: 19px; }
.footer-inner { align-items: center; }

.site-footer { border-top: 1px solid var(--navy-3); padding: 28px 0 40px; color: var(--muted-2); font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.site-footer a { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--white); color: var(--navy); font-weight: 600; padding: 12px 20px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- lightbox ---------- */
.lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; background: rgba(7,8,26,.96); color: var(--white); }
.lightbox::backdrop { background: rgba(7,8,26,.9); }
.lb-inner { position: relative; height: 100%; display: grid; grid-template-rows: 1fr auto; padding: 64px 80px 24px; }
.lb-figure { display: flex; align-items: center; justify-content: center; min-height: 0; }
.lb-figure img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.lb-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding-top: 16px; max-width: 1100px; margin: 0 auto; width: 100%; }
.lb-cap .t { font-weight: 600; }
.lb-cap .c, .lb-count { color: var(--muted-2); }
.lb-btn { position: absolute; width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--navy-2); cursor: pointer; display: grid; place-items: center; }
.lb-btn:hover { background: var(--red-btn); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav ul { gap: 18px; }
  .header-cv { display: none; }
}
@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .menu-btn { display: inline-flex; }
  .nav { position: fixed; inset: var(--header-h) 0 auto 0; background: var(--navy); border-bottom: 1px solid var(--navy-3); padding: 12px var(--pad) 26px; display: none; }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { display: block; padding: 14px 0; font-size: 1.2rem; border-bottom: 1px solid var(--navy-3); }
  .hero-grid { grid-template-columns: 1fr; }
  .machine { max-width: 560px; }
  .services { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 300px; }
    .contact-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .brand span { font-size: .95rem; }
  .brand img { width: 36px; height: 36px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .socials { grid-template-columns: 1fr; }
  .grid { columns: 2; column-gap: 12px; }
  .work { margin-bottom: 18px; }
  .work figcaption { margin-top: 7px; }
  .work .t { font-size: .88rem; }
  .work .c { font-size: .78rem; }
  .lb-inner { padding: 64px 12px 18px; }
  .lb-prev, .lb-next { top: auto; bottom: 70px; transform: none; }
  .machine-foot { flex-direction: column; align-items: stretch; text-align: center; }
  .clients img { height: 28px; }
}

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