/* ═══════════════════════════════════════════════
   Petar Milovanovic — blueprint dark
   ═══════════════════════════════════════════════ */

:root {
  --bg: #0a0a0c;
  --bg-raise: #0e0e11;
  --ink: #f3f2ec;
  --muted: #8c8c84;
  --faint: #55554f;
  --line: rgba(243, 242, 236, 0.1);
  --grid-fine: rgba(243, 242, 236, 0.028);
  --grid-major: rgba(243, 242, 236, 0.055);
  --accent: #c8ff32;
  --accent-dim: rgba(200, 255, 50, 0.14);
  --font-sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --cell: 88px;
  --pad: clamp(20px, 4vw, 64px);
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-fine) 1px, transparent 1px);
  background-size:
    calc(var(--cell) * 4) calc(var(--cell) * 4),
    calc(var(--cell) * 4) calc(var(--cell) * 4),
    var(--cell) var(--cell),
    var(--cell) var(--cell);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 34px; /* room for the fixed ruler */
}

::selection { background: var(--accent); color: var(--bg); }

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

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

.mono-note {
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2.2s ease-in-out infinite;
  vertical-align: middle;
  margin: 0 2px 2px 0;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── reveal animation ─────────────────────────── */
.anim {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--d, 0s);
}
.anim.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .anim { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ── header ───────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border-right: 1px solid var(--line);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s, background 0.3s;
}

.header-right .cell { border-right: 0; border-left: 1px solid var(--line); }

.logo {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 44px);
}
.main-nav a {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}
.main-nav a:hover { color: var(--ink); }

.header-right { display: flex; align-items: stretch; }

.clock { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--faint); }

.cta { color: var(--ink); }
.cta:hover { background: var(--accent); color: var(--bg); }

/* ── hero ─────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

#orb {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: -1;          /* above the body grid, below all content */
  pointer-events: none;
}
#orb.static { position: absolute; height: 100vh; } /* reduced motion: pin to the hero */

.hero-meta {
  position: absolute;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 3;
  white-space: nowrap;
}
.hero-meta .idx { color: var(--faint); font-family: var(--font-mono); font-size: 11px; margin-right: 6px; }
.hero-meta a:hover { color: var(--ink); }

.hm-tl { top: 24vh; left: var(--pad); }
.hm-tr { top: 24vh; right: var(--pad); }
.hm-bl { bottom: 22vh; left: var(--pad); }
.hm-br { bottom: 22vh; right: var(--pad); }

.hero-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  z-index: 2;
  pointer-events: none;
  font-weight: 200;
}

.ht { display: flex; flex-direction: column; }
.ht-right { text-align: right; }

.ht span.l1,
.ht span.l2 {
  display: block;
  text-transform: uppercase;
  font-size: clamp(34px, 4.6vw, 74px);
  letter-spacing: 0.06em;
  line-height: 1.16;
}
.ht span.l1 { color: var(--ink); font-weight: 300; }
.ht span.l2 { color: transparent; -webkit-text-stroke: 1px var(--muted); font-weight: 300; }

.hero-name {
  position: absolute;
  left: 0; right: 0;
  bottom: 16vh;
  text-align: center;
  z-index: 3;
}
.hero-name .mono-note { font-size: 12px; color: var(--muted); }

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--faint);
  z-index: 3;
}
.scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(var(--muted), transparent);
  animation: drop 2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes drop { 0% { transform: scaleY(0); } 45% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* blueprint registration crosses */
.cross {
  position: absolute;
  width: 17px; height: 17px;
  z-index: 2;
  opacity: 0.5;
}
.cross::before, .cross::after {
  content: "";
  position: absolute;
  background: var(--muted);
}
.cross::before { left: 8px; top: 0; width: 1px; height: 17px; }
.cross::after { top: 8px; left: 0; height: 1px; width: 17px; }
.c-1 { top: 12vh; left: 50%; }
.c-2 { bottom: 34vh; right: 18vw; }

/* ── marquee ──────────────────────────────────── */
.marquee {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  white-space: nowrap;
}
.marquee-track {
  display: inline-block;
  animation: scroll-x 28s linear infinite;
  font-size: 15px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 300;
}
.marquee-track i { font-style: normal; color: var(--accent); margin: 0 18px; }
@keyframes scroll-x { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ── stats ────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: clamp(28px, 4vw, 56px) var(--pad);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat:last-child { border-right: 0; }
.stat strong {
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 200;
  letter-spacing: 0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── sections ─────────────────────────────────── */
.section {
  position: relative;
  padding: clamp(80px, 12vh, 140px) var(--pad);
  border-bottom: 1px solid var(--line);
  max-width: 1680px;
  margin: 0 auto;
}

.section-head { margin-bottom: clamp(40px, 6vw, 80px); }

.sec-num { display: block; margin-bottom: 18px; color: var(--accent); }

.sec-title {
  font-size: clamp(38px, 6vw, 86px);
  font-weight: 200;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--ink);
}

.chip {
  display: inline-block;
  background: var(--ink);
  color: var(--bg);
  padding: 0 0.18em;
  font-weight: 300;
}

.tech-note {
  position: absolute;
  right: var(--pad);
  bottom: 18px;
  opacity: 0.65;
}

/* ── about ────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: minmax(300px, 5fr) 7fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}

.about-text p { margin-bottom: 1.2em; color: var(--muted); font-size: 16px; max-width: 56ch; }
.about-text strong { color: var(--ink); font-weight: 500; }

.about-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.card {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: clamp(22px, 2.5vw, 36px);
  background: transparent;
  transition: background 0.35s;
}
.card:hover { background: var(--bg-raise); }
.card-num { display: block; margin-bottom: 16px; color: var(--accent); }
.card h3 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.card p { font-size: 14px; color: var(--muted); }
.card a { color: var(--accent); border-bottom: 1px solid var(--accent-dim); }
.card a:hover { border-bottom-color: var(--accent); }

/* ── experience ───────────────────────────────── */
.timeline {
  border-top: 1px solid var(--line);
}

.job {
  display: grid;
  grid-template-columns: minmax(220px, 3fr) 9fr;
  gap: clamp(20px, 3vw, 60px);
  padding: clamp(30px, 4vw, 52px) 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.35s;
}
.job:hover { background: linear-gradient(90deg, transparent, var(--bg-raise) 20%, var(--bg-raise) 80%, transparent); }

.job-meta { display: flex; flex-direction: column; gap: 8px; }
.job-date { color: var(--accent); }
.job-co {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.job-body h3 {
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}
.job-body p { color: var(--muted); font-size: 15px; max-width: 78ch; }
.job-body a { color: var(--accent); border-bottom: 1px solid var(--accent-dim); }
.job-body a:hover { border-bottom-color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tags span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 5px 10px;
}

/* ── skills ───────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

/* ── awards ───────────────────────────────────── */
.awards-list { list-style: none; border-top: 1px solid var(--line); }

.awards-list li {
  border-bottom: 1px solid var(--line);
  transition: background 0.35s;
}
.awards-list li:hover { background: var(--bg-raise); }

.awards-list li,
.awards-list .award-link {
  display: grid;
  grid-template-columns: 60px minmax(200px, 1fr) minmax(160px, 40%);
  align-items: baseline;
  gap: 16px;
}
.awards-list li { padding: 22px 8px; }
.awards-list .award-link { grid-column: 1 / -1; margin: -22px -8px; padding: 22px 8px; }

.awards-list strong {
  font-weight: 400;
  font-size: clamp(15px, 1.6vw, 19px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.awards-list em {
  font-style: normal;
  font-size: 13px;
  color: var(--faint);
  text-align: right;
}
.awards-list .award-link:hover strong { color: var(--accent); }

/* ── contact ──────────────────────────────────── */
.contact { text-align: center; }
.contact .section-head { margin-bottom: 30px; }

.contact-title {
  font-size: clamp(42px, 7vw, 100px);
  font-weight: 200;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.12;
  margin-bottom: 28px;
}

.contact-sub {
  color: var(--muted);
  max-width: 52ch;
  margin: 0 auto 48px;
  font-size: 16px;
}

.contact-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--line);
  width: fit-content;
  margin: 0 auto;
}
.contact-actions .big {
  padding: 22px 40px;
  font-size: 14px;
  letter-spacing: 0.12em;
  border-right: 1px solid var(--line);
  border-left: 0;
  color: var(--ink);
}
.contact-actions .big:last-child { border-right: 0; }
.contact-actions .big:hover { background: var(--accent); color: var(--bg); }
.contact-actions .prefix { color: var(--accent); font-size: 13px; }
.contact-actions .big:hover .prefix { color: var(--bg); }

/* ── masking: content sections are opaque cards that slide over the
   fixed orb; the hero and interludes are windows it shows through.
   The viewport-anchored grid keeps the pattern seamless across layers. ── */
.marquee, .stats, .section, .site-footer {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-fine) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-fine) 1px, transparent 1px);
  background-size:
    calc(var(--cell) * 4) calc(var(--cell) * 4),
    calc(var(--cell) * 4) calc(var(--cell) * 4),
    var(--cell) var(--cell),
    var(--cell) var(--cell);
  background-attachment: fixed;
}

/* ── interludes: the orb's own stage between sections ── */
.interlude {
  position: relative;
  height: 82vh;
  border-bottom: 1px solid var(--line);
}
.il-tl { position: absolute; top: 28px; left: var(--pad); }
.il-br { position: absolute; bottom: 24px; right: var(--pad); }
.il-c1 { top: 16%; left: 22%; }
.il-c2 { bottom: 18%; right: 24%; }

/* ── footer ───────────────────────────────────── */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 26px var(--pad);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── ruler ────────────────────────────────────── */
.ruler {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 34px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  z-index: 60;
}
#ruler-canvas { width: 100%; height: 100%; display: block; }
.ruler-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: var(--accent);
  transition: left 0.08s linear;
}

/* ═══ responsive ═══════════════════════════════ */
@media (max-width: 1000px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .job { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 720px) {
  :root { --cell: 56px; }

  .main-nav { display: none; }
  .clock { display: none; }
  .site-header { height: 56px; }

  .hero-title {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    text-align: center;
  }
  .ht, .ht-right { text-align: center; }
  .ht span.l1, .ht span.l2 { font-size: clamp(36px, 10.5vw, 52px); }

  .hm-tl { top: 11vh; }
  .hm-tr { top: calc(11vh + 26px); right: auto; left: var(--pad); }
  .hm-bl { bottom: 18vh; }
  .hm-br { bottom: calc(18vh - 26px); right: auto; left: var(--pad); }
  .hero-meta { font-size: 10px; }
  .hero-name { bottom: 5.5vh; padding: 0 16px; }
  .hero-name .mono-note { font-size: 10px; white-space: normal; }
  .scroll-hint { display: none; }
  .c-2 { display: none; }

  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2n) { border-right: 0; }
  .stat { border-bottom: 1px solid var(--line); }
  .stat:nth-child(n+3) { border-bottom: 0; }

  .skills-grid, .about-cards { grid-template-columns: 1fr; }

  .awards-list li,
  .awards-list .award-link {
    grid-template-columns: 40px 1fr;
    gap: 4px 14px;
  }
  .awards-list em { grid-column: 2; text-align: left; }

  .contact-actions { flex-direction: column; width: 100%; }
  .contact-actions .big { border-right: 0; border-bottom: 1px solid var(--line); justify-content: center; }
  .contact-actions .big:last-child { border-bottom: 0; }

  .site-footer { justify-content: center; text-align: center; }
  .tech-note { display: none; }
  .interlude { height: 58vh; }
  .il-br { right: auto; left: var(--pad); }
}
