/* ─────────────────────────────────────────────────────────────
   drmarjanovic.dev — hand-built, no framework
   ───────────────────────────────────────────────────────────── */

:root {
  --void:      #08090b;
  --ink:       #0e1013;
  --raise:     #14171b;
  --line:      rgba(232, 230, 225, 0.11);
  --line-soft: rgba(232, 230, 225, 0.055);
  --paper:     #e9e7e2;
  --mute:      #8a8d92;
  --faint:     #5d6167;
  --acid:      #c9f24a;
  --ember:     #ff6b3d;

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --gutter: clamp(20px, 6vw, 120px);
  --rule: 1px solid var(--line);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--paper);
  font-family: var(--mono);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 12px 18px;
  background: var(--acid);
  color: var(--void);
  text-decoration: none;
}
.skip:focus { left: 8px; top: 8px; }

/* Film grain — very subtle, keeps flat dark from looking dead */
.grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Top bar ─────────────────────────────────────────────── */

.bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: 46px;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(8, 9, 11, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: var(--rule);
  font-size: 11.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--mute);
}

.bar-id {
  color: var(--paper);
  font-weight: 700;
  letter-spacing: .12em;
}

.bar-mid { color: var(--faint); }

.bar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 0 rgba(201, 242, 74, .5);
  animation: pulse 2.8s ease-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(201, 242, 74, .45); }
  70%  { box-shadow: 0 0 0 7px rgba(201, 242, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 242, 74, 0); }
}

#clock {
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

/* ── Shared section furniture ────────────────────────────── */

main { padding-top: 46px; }

section {
  padding: clamp(64px, 11vh, 140px) var(--gutter);
  border-bottom: var(--rule);
  position: relative;
}

.label {
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 44px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}

/* ── Hero ────────────────────────────────────────────────── */

.hero {
  min-height: calc(100svh - 46px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: clamp(48px, 8vh, 90px);
  padding-bottom: clamp(48px, 8vh, 90px);
}

.query {
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--faint);
  margin-bottom: clamp(24px, 5vh, 48px);
}
.q-verb { color: var(--ember); font-weight: 500; }

.caret {
  display: inline-block;
  width: 7px;
  height: 13px;
  margin-left: 6px;
  vertical-align: -1px;
  background: var(--acid);
  animation: blink 1.15s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.name {
  font-size: clamp(2.9rem, 11.5vw, 9.5rem);
  line-height: .92;
  letter-spacing: -.045em;
  font-weight: 500;
  margin-bottom: clamp(28px, 5vh, 52px);
}
.name span {
  display: block;
}
.name span:last-child { color: var(--mute); }

.lede {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.7vw, 2.05rem);
  line-height: 1.4;
  font-weight: 300;
  max-width: 40ch;
  color: var(--paper);
  margin-bottom: clamp(36px, 6vh, 64px);
}
.lede em {
  font-style: italic;
  color: var(--acid);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: var(--rule);
  margin-bottom: clamp(32px, 5vh, 52px);
}
.facts > div {
  background: var(--void);
  padding: 18px 20px;
}
.facts dt {
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}
.facts dd {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--paper);
}
.facts dd a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color .2s, color .2s;
}
.facts dd a:hover { color: var(--acid); border-color: var(--acid); }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: var(--rule);
  text-decoration: none;
  font-size: 12.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--paper);
  background: transparent;
  transition: background .22s, color .22s, border-color .22s, transform .22s;
}
.btn:hover {
  background: var(--raise);
  border-color: rgba(232, 230, 225, .28);
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--acid);
  border-color: var(--acid);
  color: var(--void);
  font-weight: 500;
}
.btn-primary:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--void);
}

/* ── Signal / metrics ────────────────────────────────────── */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(32px, 4vw, 56px) clamp(28px, 4vw, 56px);
}
.metrics li { max-width: 34ch; }

.metric {
  display: block;
  font-size: clamp(2.6rem, 5.2vw, 4.1rem);
  line-height: 1;
  font-weight: 300;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
  margin-bottom: 14px;
}
.metric-note {
  display: block;
  font-size: 13px;
  line-height: 1.65;
  color: var(--mute);
}
.metric-note a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: color .2s, border-color .2s;
}
.metric-note a:hover { color: var(--acid); border-color: var(--acid); }

/* ── Work rows ───────────────────────────────────────────── */

.rows { border-top: var(--rule); }

.row { border-bottom: var(--rule); }

.row > a,
.row-static {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: clamp(16px, 3vw, 40px);
  align-items: start;
  padding: 28px 0;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: padding-left .3s cubic-bezier(.2, .7, .2, 1), color .25s;
}
.row > a::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--gutter));
  right: calc(-1 * var(--gutter));
  background: linear-gradient(90deg, rgba(201, 242, 74, .05), transparent 60%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.row > a:hover::before { opacity: 1; }
.row > a:hover { padding-left: 14px; }

.row-idx {
  font-size: 11.5px;
  letter-spacing: .12em;
  color: var(--faint);
  padding-top: 6px;
}
.row > a:hover .row-idx { color: var(--acid); }

.row-main { display: block; min-width: 0; }
.row-main strong {
  display: block;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 400;
  letter-spacing: -.025em;
  margin-bottom: 10px;
  transition: color .25s;
}
.row > a:hover .row-main strong { color: var(--acid); }

.row-desc {
  display: block;
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--mute);
  max-width: 62ch;
}

.row-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 6px;
}
.row-tags b {
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  border: var(--rule);
  padding: 4px 9px;
  white-space: nowrap;
}

.row-static { cursor: default; }

/* ── Beliefs ─────────────────────────────────────────────── */

.belief-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: var(--rule);
}
.belief-grid article {
  background: var(--void);
  padding: clamp(26px, 3.4vw, 40px);
}
.belief-no {
  display: block;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ember);
  margin-bottom: 20px;
}
.belief-grid h3 {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  line-height: 1.28;
  font-weight: 400;
  letter-spacing: -.01em;
  margin-bottom: 14px;
}
.belief-grid h3 em { font-style: italic; color: var(--acid); }
.belief-grid p {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--mute);
}

/* ── Contact ─────────────────────────────────────────────── */

.contact { border-bottom: none; }

.contact-lede {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.3vw, 1.7rem);
  line-height: 1.42;
  font-weight: 300;
  max-width: 34ch;
  margin-bottom: clamp(32px, 5vh, 52px);
}

.mail {
  display: block;
  font-size: clamp(1.05rem, 3.6vw, 2.4rem);
  letter-spacing: -.03em;
  font-weight: 300;
  text-decoration: none;
  color: var(--paper);
  word-break: break-all;
  transition: color .25s;
  margin-bottom: 20px;
}
.mail:hover { color: var(--acid); }

.copy {
  font: inherit;
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mute);
  background: transparent;
  border: var(--rule);
  padding: 9px 16px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.copy:hover { color: var(--paper); border-color: rgba(232, 230, 225, .3); }
.copy.done { color: var(--acid); border-color: var(--acid); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: clamp(40px, 6vh, 64px);
  padding-top: 28px;
  border-top: var(--rule);
}
.links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--mute);
  transition: color .2s;
}
.links a span { color: var(--faint); transition: transform .2s, color .2s; }
.links a:hover { color: var(--paper); }
.links a:hover span { color: var(--acid); transform: translate(2px, -2px); }

/* ── Footer ──────────────────────────────────────────────── */

.foot {
  padding: 22px var(--gutter);
  border-top: var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
}
.foot a { text-decoration: none; transition: color .2s; }
.foot a:hover { color: var(--acid); }

/* ── Reveal on scroll ────────────────────────────────────── */

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1);
}
[data-reveal].in { opacity: 1; transform: none; }

.name .reveal {
  opacity: 0;
  transform: translateY(.22em);
  animation: rise .9s cubic-bezier(.2, .8, .2, 1) forwards;
}
.name .reveal:nth-child(2) { animation-delay: .09s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 760px) {
  .bar-mid { display: none; }
  .bar-live { display: none; }

  .row > a,
  .row-static {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
  }
  .row-tags {
    grid-column: 2;
    justify-content: flex-start;
    padding-top: 14px;
  }
  .row > a:hover { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .name .reveal { opacity: 1; transform: none; }
}

@media print {
  .bar, .grain, .foot a, .copy { display: none; }
  body { background: #fff; color: #000; }
}
