/* ─────────────────────────────────────────────────────────────
   Slobodan Cvjeticanin — CV  ·  cv.css
   ───────────────────────────────────────────────────────────── */

/* ── Tokens ────────────────────────────────────────────────── */
:root {
  --bg:      #0A0E15;
  --surface: #12181F;
  --amber:   #C4855A;
  --cloud:   #EAE5DF;
  --smoke:   #6B7E8F;
  --ash:     #232E38;
  --rule:    rgba(196,133,90,0.16);
  --radius:  10px;
  --ease:    0.24s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--cloud);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: inherit; }
ul { list-style: none; }
img, svg { display: block; }

/* ── Container ─────────────────────────────────────────────── */
.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

/* ── Sticky nav ────────────────────────────────────────────── */
#cv-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  background: rgba(10,14,21,0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--ash);
  transform: translateY(-100%);
  transition: transform 0.36s cubic-bezier(0.22, 0.8, 0.32, 1);
}
#cv-nav.is-visible { transform: translateY(0); }

.nav-name {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--cloud);
  letter-spacing: 0.005em;
}
.nav-links {
  display: flex;
  gap: 2rem;
}
.nav-links a {
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--smoke);
  transition: color var(--ease);
}
.nav-links a:hover { color: var(--amber); }

/* ── Hero — full-bleed photo with text overlay ─────────────── */
#hero {
  position: relative;
  height: 100svh;
  min-height: 540px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

/* Photo layer — oversized vertically to allow parallax travel */
.hero-bg {
  position: absolute;
  inset: -18% 0;
  background-color: #1E2E45;
  background-image: url('../images/cv/img-24.jpg');
  background-size: cover;
  background-position: 68% 28%;
  background-repeat: no-repeat;
  will-change: transform;
}

/* Gradient overlay — dark left (text) and dark bottom (ground);
   center and right of the photo breathes naturally */
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to right,
      rgba(10,14,21,0.82)  0%,
      rgba(10,14,21,0.48) 42%,
      rgba(10,14,21,0.16) 72%,
      rgba(10,14,21,0.06) 100%
    ),
    linear-gradient(
      to top,
      rgba(10,14,21,0.92)  0%,
      rgba(10,14,21,0.36) 36%,
      transparent          64%
    );
}

/* Back to portfolio — top-left corner */
.hero-back {
  position: absolute;
  top: clamp(1.5rem, 3vw, 2.5rem);
  left: clamp(2rem, 5vw, 4rem);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(234,229,223,0.45);
  text-decoration: none;
  transition: color var(--ease);
}
.hero-back:hover { color: var(--amber); }
.hero-back svg { flex-shrink: 0; }

/* Text — positioned bottom-left over the dark gradient zone */
.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 clamp(2rem, 5vw, 4rem) clamp(2.5rem, 5vh, 4.5rem);
  max-width: 720px;
}

.hero-role {
  display: inline-block;
  font-size: clamp(0.6rem, 1vw, 0.68rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #0A0E15;
  background: var(--amber);
  padding: 0.35rem 0.85rem;
  border-radius: 3px;
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.hero-name {
  font-family: 'EB Garamond', Georgia, 'Palatino Linotype', serif;
  font-size: clamp(2.6rem, 5.2vw, 5rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.015em;
  color: var(--cloud);
  margin-bottom: 2rem;
}

.hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
}
.hero-contact a,
.hero-contact span {
  font-size: clamp(0.7rem, 1.05vw, 0.8rem);
  color: rgba(234,229,223,0.55);
  text-decoration: none;
  letter-spacing: 0.025em;
  transition: color var(--ease);
}
.hero-contact a:hover { color: var(--amber); }

/* Scroll cue — bottom-right corner */
.hero-scroll {
  position: absolute;
  bottom: clamp(1.5rem, 3vw, 2.5rem);
  right: clamp(2rem, 5vw, 4rem);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}
.scroll-label {
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(234,229,223,0.2);
  writing-mode: vertical-rl;
}
.scroll-line {
  width: 1px;
  height: 36px;
  background: rgba(234,229,223,0.1);
  position: relative;
  overflow: hidden;
}
.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--amber);
  animation: scroll-tick 1.9s ease-in-out infinite;
}
@keyframes scroll-tick {
  0%   { top: -100%; }
  100% { top: 200%; }
}

/* ── Career Stats strip ────────────────────────────────────── */
#stats {
  border-bottom: 1px solid var(--ash);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
}

.stat-tile {
  padding: clamp(1.75rem, 3.5vh, 2.75rem) clamp(1.25rem, 3vw, 2.25rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--surface);
  border-right: 1px solid var(--ash);
}
.stat-tile:last-child { border-right: none; }

.stat-tile--amber {
  background: var(--amber);
  border-right-color: rgba(0,0,0,0.12);
}

.stat-figure {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  line-height: 1;
  margin-bottom: 0.65rem;
}

.stat-number {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--cloud);
}
.stat-tile--amber .stat-number { color: #0A0E15; }

.stat-unit {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(1rem, 1.8vw, 1.55rem);
  font-weight: 500;
  color: var(--cloud);
  letter-spacing: 0.02em;
}
.stat-tile--amber .stat-unit { color: #0A0E15; }

.stat-label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--smoke);
}
.stat-tile--amber .stat-label { color: rgba(10,14,21,0.58); }

@media (max-width: 700px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-tile:nth-child(2) { border-right: none; }
  .stat-tile:nth-child(1),
  .stat-tile:nth-child(2) { border-bottom: 1px solid var(--ash); }
  .stat-tile--amber { border-bottom-color: rgba(0,0,0,0.12); }
}

/* ── Summary ────────────────────────────────────────────────── */
#summary {
  position: relative;
  padding: clamp(4rem, 8vh, 7rem) 0;
  border-bottom: 1px solid var(--ash);
  text-align: center;
  overflow: hidden;
}
#summary .container {
  position: relative;
  z-index: 1;
}
#summary .section-heading {
  margin-bottom: clamp(1.5rem, 3vh, 2.5rem);
}

.summary-text {
  margin: 0 auto;
  max-width: 900px;
  font-size: clamp(0.9rem, 1.25vw, 1.05rem);
  color: rgba(234,229,223,0.65);
  line-height: 2.1;
  white-space: nowrap;
}

/* Introduction paragraphs */
.intro-line {
  display: block;
  overflow: hidden;
}
.intro-line-inner { display: block; }

/* Highlighted metrics inside the introduction */
.summary-text .hl {
  font-style: normal;
  color: var(--amber);
}

@media (max-width: 940px) {
  .summary-text { white-space: normal; }
}
@media (max-width: 700px) {
  .summary-text br { display: none; }
}

/* ── CV sections ────────────────────────────────────────────── */
.cv-section {
  padding: clamp(4rem, 8vh, 7rem) 0;
  border-bottom: 1px solid var(--ash);
}
.cv-section:last-of-type { border-bottom: none; }

.section-heading {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(1.6rem, 2.4vw, 2.4rem);
  font-weight: 400;
  font-style: italic;
  color: var(--cloud);
  margin-bottom: clamp(2.5rem, 5vh, 4rem);
  letter-spacing: -0.01em;
}

/* Work experience */
#experience .section-heading { text-align: center; }

/* Group sub-titles — hairline rules either side */
.jobs-group-title {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  white-space: nowrap;
}
.jobs-group-title::before,
.jobs-group-title::after {
  content: '';
  height: 1px;
  flex: 1;
  background: var(--rule);
}
.jobs-group-title--later { margin-top: 2.5rem; }

/* Study gap between the two career chapters */
.gap-row {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.85rem 1.25rem;
  border: 1px dashed rgba(107,126,143,0.35);
  border-radius: var(--radius);
  color: var(--smoke);
}
.gap-row svg { flex-shrink: 0; color: var(--amber); opacity: 0.7; }
.gap-text {
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.gap-years {
  color: var(--amber);
  letter-spacing: 0.08em;
  margin-right: 0.6rem;
}

.jobs {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.row-logo {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: #F2EEE8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.row-logo img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.row-logo--dark { background: #0B0F14; }

.row-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.row-company {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 400;
  color: var(--cloud);
  letter-spacing: -0.005em;
}
.row-role {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--smoke);
}

.row-range {
  font-size: 0.78rem;
  color: var(--smoke);
  letter-spacing: 0.04em;
}

.row-link {
  font-size: 0.76rem;
  color: var(--cloud);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity var(--ease), color var(--ease);
  flex-shrink: 0;
}
.row-link:hover { opacity: 1; color: var(--amber); }

#skills .section-heading,
#competencies .section-heading,
#education .section-heading { text-align: center; }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.comp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.skill-panel,
.comp-panel,
.edu-panel {
  background: var(--surface);
  border: 1px solid var(--ash);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.6rem;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}
.skill-panel:hover,
.comp-panel:hover,
.edu-panel:hover {
  border-color: rgba(196,133,90,0.35);
  background: #151C24;
  transform: translateY(-3px);
}

/* Icon + title header row */
.skill-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}
.skill-head svg {
  color: var(--amber);
  flex-shrink: 0;
  opacity: 0.85;
}
.skill-head h3 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--cloud);
  letter-spacing: -0.005em;
}

.skill-panel ul,
.edu-panel ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.skill-panel li,
.edu-panel li {
  font-size: 0.86rem;
  color: rgba(234,229,223,0.78);
  line-height: 1.55;
  padding-left: 1.1rem;
  position: relative;
}
.skill-panel li::before,
.edu-panel li::before {
  content: '★';
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.58em;
  color: var(--amber);
  line-height: 2.7;
}
.skill-panel a,
.edu-panel a {
  color: var(--amber);
  text-decoration: none;
  transition: opacity var(--ease);
}
.skill-panel a:hover,
.edu-panel a:hover { opacity: 0.75; }

/* Competency panels — icon above, paragraph body */
.comp-panel svg {
  color: var(--amber);
  opacity: 0.85;
  margin-bottom: 1rem;
}
.comp-panel h3 {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--cloud);
  margin-bottom: 0.6rem;
  letter-spacing: -0.005em;
}
.comp-panel p {
  font-size: 0.86rem;
  color: rgba(234,229,223,0.68);
  line-height: 1.7;
}

/* Education panel paragraphs */
.edu-panel p {
  font-size: 0.9rem;
  color: rgba(234,229,223,0.82);
  line-height: 1.6;
}
.edu-panel p + p { margin-top: 1rem; }
.back-dim {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--smoke);
}

@media (max-width: 900px) {
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .comp-grid { grid-template-columns: 1fr; }
  .edu-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .skills-grid { grid-template-columns: 1fr; }
}

/* ── Footer ─────────────────────────────────────────────────── */
#cv-footer {
  padding: 3rem 0;
  border-top: 1px solid var(--ash);
}
#cv-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-link {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--smoke);
  transition: color var(--ease);
}
.footer-link:hover { color: var(--amber); }
.footer-copy {
  font-size: 0.72rem;
  color: rgba(107,126,143,0.45);
  letter-spacing: 0.04em;
}

/* Mobile layout */
@media (max-width: 700px) {
  .hero-overlay {
    background:
      linear-gradient(to top,
        rgba(10,14,21,0.94)  0%,
        rgba(10,14,21,0.60) 45%,
        rgba(10,14,21,0.22) 100%
      );
  }
  .hero-content {
    max-width: 100%;
    padding-bottom: 2.5rem;
  }
  .hero-scroll { display: none; }
  .nav-links { gap: 1.1rem; }
  .nav-links a { font-size: 0.7rem; letter-spacing: 0.07em; }
}

@media (max-width: 480px) {
  #cv-footer .container { flex-direction: column; align-items: flex-start; }
}

/* ── Print — flat, light, everything visible ────────────────── */
@media print {
  * {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }
  body { background: #fff !important; color: #1a1a1a; }

  /* Chrome that has no meaning on paper */
  #cv-nav, .hero-bg, .hero-overlay, .hero-scroll, .hero-back, #cv-footer {
    display: none !important;
  }

  /* Stats strip */
  #stats { background: #fff !important; }
  .stats-grid { gap: 0.5rem; grid-template-columns: repeat(4, 1fr); }
  .stat-tile {
    background: #f8f8f8 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px;
    padding: 1rem;
  }
  .stat-tile--amber { background: #C4855A !important; }
  .stat-number { color: #111 !important; font-size: 1.9rem; }
  .stat-unit { color: #444 !important; font-size: 0.95rem; }
  .stat-label { color: #666 !important; }
  .stat-tile--amber .stat-number,
  .stat-tile--amber .stat-unit,
  .stat-tile--amber .stat-label { color: #fff !important; }

  /* Hero → simple letterhead */
  #hero {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .hero-content { max-width: none; padding: 0 0 1.25rem; }
  .hero-role { background: #C4855A !important; color: #fff !important; padding: 0.25rem 0.6rem; }
  .hero-name { color: #111; font-size: 2.3rem; margin-bottom: 0.9rem; }
  .hero-contact { border-color: #ccc; padding-top: 0.9rem; }
  .hero-contact a, .hero-contact span { color: #444; }

  /* Sections */
  #summary, .cv-section { padding: 1.4rem 0; border-color: #ddd; }
  .section-heading { color: #111; margin-bottom: 1.2rem; }
  .summary-text { color: #222; white-space: normal; }
  .summary-text .hl { color: #8a5432; }
  .jobs-group-title { color: #8a5432; }
  .jobs-group-title::before,
  .jobs-group-title::after { background: #ddd; }

  /* Experience cards */
  .jobs { gap: 1rem; }
  .row-logo { background: #f2f2f2; }
  .row-company { color: #111; }
  .row-role, .row-range { color: #555; }
  .row-link { color: #555; opacity: 1; }

  .gap-row { border-color: #ccc; color: #555; }
  .gap-years { color: #8a5432; }
  .gap-row svg { color: #8a5432; }

  /* Flat panels */
  .skills-grid, .comp-grid, .edu-grid { gap: 0.9rem; }
  .skill-panel, .comp-panel, .edu-panel {
    background: #fff !important;
    border: 1px solid #ddd;
    break-inside: avoid;
    transform: none;
  }
  .skill-head { border-color: #eee; }
  .skill-head h3, .comp-panel h3 { color: #111; }
  .skill-head svg, .comp-panel svg { color: #8a5432; }
  .skill-panel li, .edu-panel li, .comp-panel p, .edu-panel p { color: #222; }
  .skill-panel li::before, .edu-panel li::before { color: #8a5432; }
  .skill-panel a, .edu-panel a { color: #8a5432; }
  .back-dim { color: #666; }
}
