/* ===================================================================
   Milan Stanojković - Portfolio
   Dark, minimalist theme
=================================================================== */

:root {
  --bg: #0b0d10;
  --bg-alt: #101317;
  --surface: #161a20;
  --surface-hover: #1c2129;
  --border: #242a33;
  --text: #e9eaec;
  --text-muted: #98a1ad;
  --text-faint: #626b78;
  --accent: #d9a441;
  --accent-soft: rgba(217, 164, 65, 0.12);
  --accent-teal: #4fd1c5;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;

  --max-width: 1080px;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

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

img { max-width: 100%; display: block; }

ul { list-style: none; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 26px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #16130a;
}
.btn-primary:hover { background: #e6b458; }

.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-small {
  padding: 9px 18px;
  font-size: 0.85rem;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(11, 13, 16, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-size: 0.92rem;
  color: var(--text-muted);
  position: relative;
  padding: 4px 0;
  transition: color 0.15s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--accent); }

.nav-cta { display: inline-flex; }

.nav-cta-mobile { display: none; align-self: flex-start; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 68px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(217, 164, 65, 0.10), transparent 60%),
    radial-gradient(ellipse 50% 50% at 85% 75%, rgba(79, 209, 197, 0.08), transparent 60%),
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: auto, auto, 64px 64px, 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 90%);
  opacity: 0.5;
}

.hero-inner {
  position: relative;
  max-width: 760px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 22px;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 18px;
}

.accent { color: var(--accent); }

.hero-desc {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 600px;
  margin-bottom: 36px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 110px 0; }
.section-alt { background: var(--bg-alt); }

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

.section-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin-bottom: 48px;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: start;
}

.about-text {
  color: var(--text-muted);
  font-size: 1.03rem;
}

.about-facts {
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-left: 2px solid var(--border);
  padding-left: 24px;
}

.fact dt {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.fact dd { font-size: 0.95rem; color: var(--text); }

/* ---------- Projects ---------- */
/* ---------- Access notice ---------- */
.access-note {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  margin-bottom: 28px;
  border: 1px solid rgba(217, 164, 65, 0.28);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.access-note-icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  color: var(--accent);
  background: rgba(217, 164, 65, 0.12);
  border: 1px solid rgba(217, 164, 65, 0.25);
}

.access-note-icon svg { width: 20px; height: 20px; }

.access-note p {
  font-size: 0.93rem;
  color: var(--text-muted);
}

.access-note strong {
  color: var(--text);
  font-weight: 600;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(217, 164, 65, 0.35);
  background: var(--surface-hover);
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.project-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
}

.project-tag-live {
  color: #7fe0a8;
  border-color: rgba(127, 224, 168, 0.3);
  background: rgba(127, 224, 168, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.project-tag-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7fe0a8;
}

.project-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-card:hover .project-thumb {
  border-color: rgba(217, 164, 65, 0.35);
  transform: scale(1.03);
}

.project-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.project-based-on {
  font-size: 0.88rem;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.project-based-on a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}
.project-based-on a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.project-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
  flex-grow: 1;
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}
.project-meta li {
  font-size: 0.82rem;
  color: var(--text-faint);
  padding-left: 16px;
  position: relative;
}
.project-meta li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.project-tech span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-teal);
  background: rgba(79, 209, 197, 0.08);
  border: 1px solid rgba(79, 209, 197, 0.2);
  padding: 4px 9px;
  border-radius: 6px;
}

.project-link { align-self: flex-start; }

/* ---------- Media strip ---------- */
.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;
}

.media-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.media-thumb {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-thumb:hover,
.media-thumb:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  outline: none;
}

.media-thumb-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.media-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  width: 0; height: 0;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 8, 10, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lightboxIn 0.18s ease;
}
.lightbox[hidden] { display: none; }

@keyframes lightboxIn { from { opacity: 0; } to { opacity: 1; } }

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  max-height: 100%;
}

.lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(100vh - 130px);
  max-height: calc(100dvh - 130px);
}

/* Width cap is generous; portrait media is limited by height instead, so both
   orientations fill the viewport without distortion. */
.lightbox-stage img,
.lightbox-stage video {
  max-width: min(92vw, 1180px);
  max-height: calc(100vh - 130px);
  max-height: calc(100dvh - 130px);
  width: auto;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}

.lightbox-caption {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 640px;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
}

.lightbox-close {
  top: 18px; right: 18px;
  width: 42px; height: 42px;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  font-size: 1.9rem;
  line-height: 1;
}
.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

@media (max-width: 560px) {
  .lightbox { padding: 12px; }
  .lightbox-nav { width: 40px; height: 40px; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
}

/* Short viewports - mainly a phone held sideways. Trim the chrome around the
   media so the image itself gets the height that just became available. */
@media (max-height: 520px) {
  .lightbox { padding: 10px; }
  .lightbox-figure { gap: 8px; }

  .lightbox-stage {
    max-height: calc(100vh - 72px);
    max-height: calc(100dvh - 72px);
  }
  .lightbox-stage img,
  .lightbox-stage video {
    max-width: min(96vw, 1180px);
    max-height: calc(100vh - 72px);
    max-height: calc(100dvh - 72px);
  }

  .lightbox-caption { font-size: 0.76rem; }

  .lightbox-close {
    top: 8px; right: 8px;
    width: 34px; height: 34px;
    font-size: 1.3rem;
  }
  .lightbox-nav { width: 36px; height: 36px; font-size: 1.5rem; }
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
}

/* ---------- Architecture note ---------- */
.arch-note {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 40px;
  background: linear-gradient(180deg, var(--surface), transparent);
}

.arch-note-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.arch-note-sub {
  display: block;
  margin-top: 6px;
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--text-muted);
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.arch-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.arch-tech span {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-teal);
  background: rgba(79, 209, 197, 0.08);
  border: 1px solid rgba(79, 209, 197, 0.2);
  padding: 5px 10px;
  border-radius: 6px;
}

.arch-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.arch-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.timeline-item { position: relative; }

.timeline-marker {
  position: absolute;
  left: -34px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline-content { position: relative; }

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
  border-radius: 6px;
  transition: color 0.15s ease;
}
.timeline-head::-webkit-details-marker { display: none; }
.timeline-head:hover h3 { color: var(--accent); }
.timeline-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.timeline-head-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  flex: 1;
}

.timeline-head h3 {
  font-size: 1.15rem;
  font-weight: 700;
  transition: color 0.15s ease;
}

/* Plus / minus toggle */
.timeline-toggle {
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: border-color 0.2s ease, transform 0.25s ease;
}
.timeline-toggle::before,
.timeline-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 1.5px;
  background: var(--text-muted);
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease, background 0.2s ease;
}
.timeline-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }

.timeline-head:hover .timeline-toggle { border-color: var(--accent); }
.timeline-head:hover .timeline-toggle::before,
.timeline-head:hover .timeline-toggle::after { background: var(--accent); }

.timeline-content[open] .timeline-toggle::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.timeline-content[open] .timeline-head h3 { color: var(--accent); }

.timeline-content > ul {
  margin-top: 14px;
  animation: timelineReveal 0.25s ease;
}

@keyframes timelineReveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.timeline-company {
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.timeline-content ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 4px;
}

.timeline-content li {
  font-size: 0.94rem;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
}
.timeline-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}

.skill-group h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
}

/* ---------- Contact ---------- */
.contact-section { text-align: left; }

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.contact-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 240px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
a.contact-link:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.contact-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-value {
  font-size: 1.05rem;
  font-weight: 600;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.footer-top { color: var(--text-muted); }
.footer-top:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 720px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .header-inner { justify-content: flex-end; }

  .site-header.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    gap: 18px;
  }
  .site-header.nav-open .nav-cta-mobile {
    display: inline-flex;
    margin-top: 4px;
  }

  .section { padding: 72px 0; }
  .hero { min-height: 90vh; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .contact-link { min-width: 100%; }
}
