/* stefanzlatev.com — v1 landing page
   Palette: fog light grey + ink. Monochrome on purpose. */

:root {
  --fog: #e4e4e0;
  --fog-deep: #cfcfca;
  --fog-light: #f1f1ee;
  --ink: #141414;
  --ink-soft: #3a3a38;
  --muted: #6b6b67;
  --rule: rgba(20, 20, 20, 0.14);
  --max: 1120px;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 300;
  color: var(--ink);
  background: var(--fog);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.7; }

/* --- background scene --- */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}
.fog-fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: none;
  background:
    radial-gradient(60% 50% at 70% 40%, var(--fog-light) 0%, transparent 70%),
    radial-gradient(50% 60% at 20% 80%, var(--fog-deep) 0%, transparent 70%),
    var(--fog);
}
body.no-webgl #scene { display: none; }
body.no-webgl .fog-fallback { display: block; }

/* --- nav --- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem var(--pad);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  mix-blend-mode: multiply;
}
.nav-name { font-weight: 500; }
.nav nav a { margin-left: 1.6rem; color: var(--ink-soft); }

main { position: relative; z-index: 1; }

/* --- hero --- */
.hero {
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: 0 var(--pad);
  position: relative;
}
.hero-text {
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}
.hero h1 {
  font-weight: 300;
  font-size: clamp(2.6rem, 7vw, 5.4rem);
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 0 0 0.6rem;
}
.hero-sub {
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  font-weight: 400;
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
}
.hero-line {
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  color: var(--muted);
  max-width: 34rem;
  margin: 0;
}
.scroll-cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.dots { display: grid; gap: 3px; }
.dots i { width: 3px; height: 3px; border-radius: 50%; background: var(--ink); display: block; animation: cue 1.8s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes cue { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: 0.6; } }

/* --- beats (sections) --- */
.beat {
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: clamp(5rem, 12vh, 9rem) var(--pad);
}
.beat-inner {
  max-width: var(--max);
  margin: 0 auto;
  width: 100%;
}
/* Text sits on the scene: a soft fog pool keeps it legible without a box. */
.beat-inner > * { position: relative; }
.beat-inner::before {
  content: "";
  position: absolute;
  inset: -3rem -4rem;
  background: radial-gradient(closest-side, rgba(228, 228, 224, 0.9), rgba(228, 228, 224, 0));
  z-index: -1;
  pointer-events: none;
}
.beat-inner { position: relative; }
.beat-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}
.beat-caption {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  max-width: 36rem;
  margin: 0 0 2.2rem;
  color: var(--ink-soft);
}
.beat-lead {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 1.4rem;
}
.beat-body {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  max-width: 40rem;
  margin: 0 0 2.5rem;
  color: var(--ink-soft);
}

.facts {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1.5rem 2rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
  max-width: 52rem;
}
.facts li { display: grid; gap: 0.2rem; }
.facts strong { font-weight: 400; font-size: 1.6rem; letter-spacing: -0.02em; }
.facts span { font-size: 0.85rem; color: var(--muted); }

/* --- focus: pinned stage, one track across time --- */
.focus { position: relative; height: 640svh; }
.stage {
  position: sticky; top: 0; height: 100svh; overflow: hidden;
  --itemw: clamp(260px, 30vw, 420px);
}
.focus-head {
  position: absolute; left: var(--pad); top: 16svh; z-index: 2;
}
.focus-head::before {
  content: ""; position: absolute; inset: -2rem -3rem;
  background: radial-gradient(closest-side, rgba(228,228,224,0.9), rgba(228,228,224,0));
  z-index: -1;
}
.focus-head .beat-kicker { margin-bottom: 0.4rem; }
.focus-head .year {
  font-size: clamp(3.6rem, 9vw, 7.5rem); line-height: 1; margin: 0; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; color: var(--ink);
  transition: color 0.5s ease;
}
body.colour .focus-head .year { color: var(--accent, var(--ink)); }

.track {
  list-style: none; margin: 0; padding: 0;
  position: absolute; left: 50%; top: 42svh;
  display: flex; align-items: start;
  will-change: transform;
  transition: transform 0.25s linear;
}
.machine {
  --accent: var(--ink);
  width: var(--itemw); flex: 0 0 var(--itemw);
  display: grid; justify-items: center; text-align: center; gap: 0.55rem; position: relative;
  padding: 0 1.2rem;
}
.machine svg { width: 100%; max-width: 170px; height: auto; color: var(--ink); opacity: 0.35; transition: opacity 0.5s ease, transform 0.6s ease; }
.machine svg .m { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.machine svg .hot { transition: stroke 0.6s ease, fill 0.6s ease; }
.machine .label { font-size: 0.95rem; color: var(--muted); transition: color 0.5s ease; }
.machine .desc {
  font-size: 0.9rem; color: var(--ink-soft); max-width: 20rem; line-height: 1.5;
  opacity: 0; transform: translateY(4px); transition: opacity 0.5s ease, transform 0.5s ease;
}
.machine.active svg { opacity: 1; transform: translateY(-6px) scale(1.06); }
.machine.active .label { color: var(--ink); font-weight: 400; }
.machine.active .desc { opacity: 1; transform: none; }
body.colour .machine.active svg .hot { stroke: var(--accent); }
body.colour .machine.active svg circle.hot { fill: var(--accent); }

/* time axis: a line across the stage, a tick and year under each machine */
.axis { position: absolute; left: 0; right: 0; top: calc(42svh + 300px); height: 1px; background: var(--rule); }
.machine .tick { position: absolute; top: 300px; left: 50%; transform: translateX(-50%); display: grid; justify-items: center; gap: 0.5rem; }
.machine .tick i { width: 1px; height: 14px; background: var(--ink); opacity: 0.35; display: block; transform: translateY(-7px); transition: background 0.5s ease, opacity 0.5s ease, height 0.5s ease; }
.machine .tick b { font-weight: 400; font-size: 0.78rem; letter-spacing: 0.06em; color: var(--muted); font-variant-numeric: tabular-nums; }
.machine.active .tick i { opacity: 1; height: 22px; transform: translateY(-11px); }
body.colour .machine.active .tick i { background: var(--accent); }
.machine.active .tick b { color: var(--ink); }

.focus-hint { position: absolute; right: var(--pad); bottom: 2rem; margin: 0; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

@media (max-width: 700px) {
  .focus { height: 700svh; }
  .focus-head { top: 12svh; }
  .track { top: 38svh; }
  .machine .desc { max-width: 15rem; font-size: 0.85rem; }
  .machine svg { max-width: 130px; }
  .axis, .machine .tick { top: calc(38svh + 250px); }
  .machine .tick { top: 250px; }
  .focus-hint { display: none; }
}

/* mock-up only: compare B&W and dynamic colour */
.colour-toggle {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 20;
  font: inherit; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink); background: rgba(228,228,224,0.85); border: 1px solid var(--rule); border-radius: 999px;
  padding: 0.4rem 0.8rem; cursor: pointer;
}

/* now */
.now {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem 2.5rem;
  max-width: var(--max);
}
.now div { border-top: 1px solid var(--rule); padding-top: 1rem; }
.now dt { font-weight: 400; font-size: 1.1rem; margin-bottom: 0.4rem; }
.now dd { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }

/* contact */
.contact .beat-body { margin-bottom: 1.6rem; }
.links { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0; font-size: 1.05rem; }
.links a { border-bottom: 1px solid var(--ink); padding-bottom: 0.1rem; }

/* logos: greyscale, quiet */
.logos { margin: 0 0 2rem; display: flex; gap: 1rem; align-items: center; }
.logos img { display: block; width: 44px; height: 44px; object-fit: contain; filter: grayscale(1); opacity: 0.85; border-radius: 4px; }
.sectors-list {
  list-style: none; margin: 0; padding: 1.4rem 0 0; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.6rem; max-width: 44rem;
}
.sectors-list li {
  font-size: 0.85rem; color: var(--ink-soft); border: 1px solid var(--rule); border-radius: 999px; padding: 0.3rem 0.8rem;
}

/* education: quiet list at the end */
.education { padding: 0 var(--pad) clamp(3rem, 8vh, 5rem); position: relative; z-index: 1; }
.education .beat-inner::before { display: none; }
.edu { list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.edu li {
  display: grid; grid-template-columns: 28px minmax(11rem, 1fr) 2fr; gap: 1rem; align-items: center;
  padding: 0.7rem 0; border-top: 1px solid var(--rule);
  font-size: 0.92rem; color: var(--ink-soft);
}
.edu li span:first-of-type { color: var(--ink); font-weight: 400; }
.edu img { width: 28px; height: 28px; object-fit: contain; filter: grayscale(1); opacity: 0.85; }
@media (max-width: 560px) { .edu li { grid-template-columns: 28px 1fr; gap: 0.15rem 0.8rem; } .edu li span:last-child { grid-column: 2; } }

.icon-link { display: inline-flex; align-items: center; border-bottom: none !important; }
.icon-link img { display: block; opacity: 0.85; }

footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 2rem var(--pad) 2.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

/* --- reveal on scroll --- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 640px) {
  .nav nav a { margin-left: 1rem; }
  .nav nav a:nth-child(3), .nav nav a:nth-child(4) { display: none; }
}
