/* ============================================================
   Mirko Milovanovic Portfolio — Styles
   Design system: Framer-inspired dark canvas (DESIGN.md)
   Fonts: Plus Jakarta Sans (display) · Inter (body)
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

/* ── Reset ────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Custom Properties ────────────────────────────────────── */
:root {
  /* Colors */
  --bg:             #000000;
  --surface:        #090909;
  --text-primary:   #ffffff;
  --text-secondary: #a6a6a6;
  --text-tertiary:  rgba(255, 255, 255, 0.6);
  --accent:         #0099ff;
  --accent-glow:    rgba(0, 153, 255, 0.15);
  --frosted:        rgba(255, 255, 255, 0.1);
  --frosted-hover:  rgba(255, 255, 255, 0.15);

  /* Shadows */
  --shadow-ring:     rgba(0, 153, 255, 0.15) 0px 0px 0px 1px;
  --shadow-elevated: rgba(255, 255, 255, 0.1) 0px 0.5px 0px 0.5px,
                     rgba(0, 0, 0, 0.25) 0px 10px 30px;

  /* Typography */
  --font-display: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-body:    'Inter', -apple-system, system-ui, sans-serif;

  /* Border Radius */
  --radius-pill:  100px;
  --radius-card:  12px;
  --radius-small: 8px;

  /* Layout */
  --section-gap: 120px;
  --container:   1200px;
}

/* ── Base ─────────────────────────────────────────────────── */
body {
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: 'cv11' 1;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.75;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

em {
  font-style: italic;
  color: var(--text-secondary);
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 30px;
}

.section {
  padding: var(--section-gap) 0;
}

/* ── Scroll Reveal ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger siblings */
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal:nth-child(5) { transition-delay: 0.32s; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.15px;
  font-feature-settings: 'cv06' 1, 'cv11' 1, 'dlig' 1, 'ss03' 1;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  transform: scale(0.97);
  opacity: 1;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn--primary {
  background: #ffffff;
  color: #000000;
}

.btn--primary:hover {
  background: rgba(255, 255, 255, 0.88);
  color: #000000;
  opacity: 1;
}

.btn--ghost {
  background: var(--frosted);
  color: #ffffff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn--ghost:hover {
  background: var(--frosted-hover);
  color: #ffffff;
  opacity: 1;
}

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 14px 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.3s ease;
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
  margin-right: auto;
  transition: opacity 0.2s ease;
}

.nav__logo:hover {
  opacity: 0.75;
  color: var(--text-primary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav__links a {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-small);
  letter-spacing: -0.1px;
  font-feature-settings: 'cv06' 1, 'cv11' 1, 'ss03' 1;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--text-primary);
  background: var(--frosted);
  opacity: 1;
}

.nav__cta {
  flex-shrink: 0;
  padding: 8px 18px;
  font-size: 14px;
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
}

.nav__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav__hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav__overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(0, 0, 0, 0.55);
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 100px;
}

.hero__inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 80px;
  align-items: center;
}

.hero__photo-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  align-self: center;
  box-shadow: var(--shadow-ring), var(--shadow-elevated);
  transition: box-shadow 0.35s ease;
}

.hero__photo-wrap:hover {
  box-shadow:
    rgba(0, 153, 255, 0.35) 0px 0px 0px 1px,
    rgba(0, 0, 0, 0.45) 0px 24px 64px;
}

.hero__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.hero__photo-fallback {
  width: 100%;
  height: 100%;
  background: var(--surface);
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 800;
  letter-spacing: -3px;
  color: var(--accent);
}

.hero__content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero__role {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  font-feature-settings: 'cv06' 1, 'cv11' 1, 'ss03' 1;
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(64px, 8vw, 110px);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -5.5px;
  color: var(--text-primary);
}

.hero__about {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 560px;
  font-feature-settings: 'cv01' 1, 'cv05' 1, 'cv09' 1, 'cv11' 1, 'ss03' 1, 'ss07' 1;
}

.hero__ctas {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* ── Section Titles ───────────────────────────────────────── */
.section__title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 62px);
  font-weight: 700;
  letter-spacing: -3.1px;
  line-height: 1.0;
  color: var(--text-primary);
  margin-bottom: 48px;
}

.subsection__title {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-feature-settings: 'cv06' 1, 'cv11' 1, 'ss03' 1;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg);
  border-radius: var(--radius-card);
  padding: 28px 32px;
  box-shadow: var(--shadow-ring);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow:
    rgba(0, 153, 255, 0.28) 0px 0px 0px 1px,
    rgba(0, 0, 0, 0.3) 0px 12px 40px;
}

.card--featured {
  background: linear-gradient(140deg, rgba(0, 153, 255, 0.07) 0%, #000000 55%);
  box-shadow: rgba(0, 153, 255, 0.28) 0px 0px 0px 1px;
}

.card--featured:hover {
  box-shadow:
    rgba(0, 153, 255, 0.45) 0px 0px 0px 1px,
    rgba(0, 0, 0, 0.35) 0px 16px 48px;
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.card__title {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.8px;
  color: var(--text-primary);
  line-height: 1.2;
  font-feature-settings: 'cv05' 1;
  margin-bottom: 5px;
}

.card__company {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  font-feature-settings: 'cv01' 1, 'cv09' 1, 'cv11' 1;
}

.card__dept {
  color: var(--text-tertiary);
  font-style: italic;
}

.card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.card__badge {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 12px;
  font-feature-settings: 'cv06' 1, 'cv11' 1, 'ss03' 1;
  letter-spacing: 0.01em;
}

.card__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 16px 0;
}

.card__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.card__list li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  padding-left: 18px;
  position: relative;
  font-feature-settings: 'cv01' 1, 'cv11' 1;
}

.card__list li::before {
  content: '·';
  position: absolute;
  left: 5px;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
}

.card__body {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
  font-feature-settings: 'cv01' 1, 'cv11' 1;
}

/* ── Tags ─────────────────────────────────────────────────── */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: var(--frosted);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  font-feature-settings: 'cv06' 1, 'cv11' 1, 'ss03' 1;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.tag:hover {
  background: var(--frosted-hover);
  color: var(--text-primary);
}

.tag--accent {
  background: rgba(0, 153, 255, 0.14);
  color: var(--accent);
  border: 1px solid rgba(0, 153, 255, 0.28);
}

/* ── Skills ───────────────────────────────────────────────── */
.skills__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skill-item__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skill-item__name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  font-feature-settings: 'cv05' 1, 'cv11' 1;
}

.skill-item__level {
  font-size: 12px;
  color: var(--text-secondary);
  font-feature-settings: 'cv06' 1, 'cv11' 1, 'ss03' 1;
}

.skill-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.skill-bar__fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 1.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-bar__fill.animated {
  width: var(--fill);
}

/* ── Card Grids ───────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.cards-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ── About Grid ───────────────────────────────────────────── */
.about__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ── Availability ─────────────────────────────────────────── */
.availability-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.availability-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  font-feature-settings: 'cv01' 1, 'cv11' 1;
}

.availability-icon {
  font-size: 15px;
  flex-shrink: 0;
  line-height: 1;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 56px 0 32px;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.footer__name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.footer__role {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
  font-feature-settings: 'cv11' 1;
}

.footer__links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.footer__link {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.footer__link:hover {
  opacity: 0.75;
}

.footer__link--muted {
  color: var(--text-secondary);
}

.footer__sep {
  color: var(--text-tertiary);
}

.footer__back-top {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 4px;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 24px;
}

.footer__copy {
  font-size: 13px;
  color: var(--text-tertiary);
  font-feature-settings: 'cv11' 1;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */

/* Tablet: ≤ 1100px */
@media (max-width: 1100px) {
  .cards-grid--3 {
    grid-template-columns: 1fr 1fr;
  }

  .cards-grid--3 .card:last-child {
    grid-column: 1 / -1;
  }

  .about__grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Tablet/Mobile: ≤ 900px */
@media (max-width: 900px) {
  :root {
    --section-gap: 80px;
  }

  /* Hero stacks vertically */
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
    justify-items: center;
  }

  .hero__photo-wrap {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }

  .hero__content {
    align-items: center;
  }

  .hero__about {
    max-width: 100%;
    text-align: center;
  }

  .hero__ctas {
    justify-content: center;
  }

  .hero__name {
    letter-spacing: -3.5px;
  }

  /* Skills */
  .skills__grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  /* Cards */
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .cards-grid--3 {
    grid-template-columns: 1fr;
  }

  .cards-grid--3 .card:last-child {
    grid-column: auto;
  }

  .about__grid {
    grid-template-columns: 1fr;
  }

  /* Nav collapses */
  .nav__links,
  .nav__cta {
    display: none;
  }

  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 57px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px 24px 28px;
    gap: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1001;
  }

  .nav__links.open li {
    width: 100%;
  }

  .nav__links.open a {
    display: block;
    padding: 13px 16px;
    font-size: 16px;
    border-radius: var(--radius-small);
  }

  .nav__hamburger {
    display: flex;
  }

  /* Card header adjusts */
  .card__header {
    flex-direction: column;
  }

  .card__meta {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .section__title {
    letter-spacing: -2.5px;
  }
}

/* Mobile: ≤ 600px */
@media (max-width: 600px) {
  .container {
    padding: 0 20px;
  }

  :root {
    --section-gap: 64px;
  }

  .hero {
    padding: 100px 0 72px;
  }

  .hero__name {
    font-size: clamp(52px, 13vw, 80px);
    letter-spacing: -2.5px;
  }

  .section__title {
    font-size: clamp(32px, 9vw, 48px);
    letter-spacing: -2px;
    margin-bottom: 36px;
  }

  .card {
    padding: 22px 20px;
  }

  .footer__inner {
    flex-direction: column;
    gap: 20px;
  }

  .footer__back-top {
    align-self: flex-start;
  }

  .footer__links {
    flex-direction: column;
    gap: 8px;
  }

  .footer__sep {
    display: none;
  }
}
