/* ══════════════════════════════════════════════════
   ANDREJ BOSNJAK
   Inter for prose · JetBrains Mono for code only
   ══════════════════════════════════════════════════ */

:root {
  --bg:      #111111;
  --border:  #202020;
  --text:    #c2c2c2;
  --muted:   #585858;
  --dimmer:  #2a2a2a;
  --accent:  #6b9ec8;
  --cmt:     #404040;
  --str:     #888888;
  --kw:      #6b9ec8;

  --body:    'Inter', sans-serif;
  --mono:    'JetBrains Mono', monospace;

  --max:     680px;
  --pad:     52px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; cursor: none !important; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
  cursor: none;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--bg); }
a { color: inherit; text-decoration: none; }

/* ── Glow orbs ─────────────────────────────────── */
.glow-orb {
  position: fixed;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  top: var(--oy);
  left: var(--ox);
  transform: translate(-50%, -50%) scale(1);
  background: radial-gradient(circle, rgba(107,158,200,var(--op)) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: orb-breathe var(--os) ease-in-out infinite alternate;
  animation-delay: var(--od);
}

@keyframes orb-breathe {
  0%   { transform: translate(-50%, -50%) scale(0.65); opacity: 0.35; }
  100% { transform: translate(-50%, -50%) scale(1.35); opacity: 1;    }
}

/* ── Particles canvas ──────────────────────────── */
#particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── Scanline ──────────────────────────────────── */
#scanline {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, rgba(107,158,200,0.035) 50%, transparent);
  pointer-events: none;
  z-index: 2;
  animation: scan 9s linear infinite;
}

@keyframes scan {
  0%   { transform: translateY(-140px); }
  100% { transform: translateY(100vh); }
}

/* ── Grain ─────────────────────────────────────── */
#grain {
  position: fixed;
  inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  animation: grain 8s steps(1) infinite;
}

@keyframes grain {
  0%  { transform: translate(0,0); }
  25% { transform: translate(-3%,-4%); }
  50% { transform: translate(4%, 2%); }
  75% { transform: translate(-2%, 5%); }
}

/* ── Boot ──────────────────────────────────────── */
#boot {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
}
#boot.gone { opacity: 0; pointer-events: none; }

.boot-inner { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 320px; }
.boot-line  { display: block; opacity: 0; animation: appear 0.05s forwards; }
@keyframes appear { to { opacity: 1; } }

.boot-muted  { color: var(--cmt); }
.boot-cursor { color: var(--accent); animation: blink 0.9s step-end infinite; }
.boot-skip   { position: absolute; bottom: 28px; right: 28px; font-family: var(--mono); font-size: 10px; color: var(--dimmer); }

@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }

/* ── Cursor ────────────────────────────────────── */
#cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 8999;
  transform: translate(-10px, -10px);
  animation: cursor-pulse 2.5s ease-in-out infinite;
}

#cursor::before,
#cursor::after {
  content: '';
  position: absolute;
  background: var(--accent);
}

#cursor::before {
  width: 100%;
  height: 1px;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

#cursor::after {
  width: 1px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

@keyframes cursor-pulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 0.3; }
}

/* ── Nav ───────────────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  padding: 22px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
#nav.scrolled {
  background: rgba(13,12,10,0.94);
  backdrop-filter: blur(14px);
  border-color: var(--border);
}

.nav-brand  { font-family: var(--mono); color: var(--accent); font-weight: 500; font-size: 13px; letter-spacing: 0.08em; }
.nav-links  { display: flex; gap: 32px; }
.nav-links a { font-size: 13px; color: var(--muted); transition: color 0.2s; }
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

/* ── Hero ──────────────────────────────────────── */
#hero {
  min-height: 100vh;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-eyebrow {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: lowercase;
  margin-bottom: 20px;
}

.hero-name {
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 22px;
}

.hero-tagline {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 420px;
  margin-bottom: 14px;
}

.hero-meta {
  font-size: 12px;
  color: var(--dimmer);
  letter-spacing: 0.08em;
}

/* ── Content sections ──────────────────────────── */
.content-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px var(--pad);
  border-top: 1px solid var(--border);
}

.section-label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 36px;
  opacity: 0.6;
}

/* ── Code blocks (typewriter pre) ──────────────── */
pre.tw {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

pre.tw .c-cmt { color: var(--cmt); }
pre.tw .c-kw  { color: var(--kw); }
pre.tw .c-str { color: var(--str); }

pre.tw .tw-link {
  color: var(--accent);
  border-bottom: 1px solid rgba(107,158,200,0.3);
  transition: border-color 0.2s;
}
pre.tw .tw-link:hover { border-color: var(--accent); }

pre.tw.typing::after {
  content: '█';
  font-family: var(--mono);
  color: var(--accent);
  animation: blink 0.9s step-end infinite;
}
pre.tw.done::after { display: none; }

/* ── Live dot ──────────────────────────────────── */
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #7ab87a;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(122,184,122,0.5);
  animation: live-ping 2.2s ease-out infinite;
}
@keyframes live-ping {
  0%   { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ── Projects ──────────────────────────────────── */
.proj-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.proj {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.proj.visible { opacity: 1; transform: none; }
.proj:first-child { border-top: 1px solid var(--border); }

.proj-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.proj-head code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.proj-head span {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap;
  flex-shrink: 0;
}

.proj p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 14px;
  max-width: 560px;
}

.proj-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.proj-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.proj-tags span {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
  letter-spacing: 0.04em;
}

.proj-foot > a {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.proj-foot > a:hover { opacity: 0.7; }

/* ── Copy toast ────────────────────────────────── */
#copy-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--bg);
  background: var(--text);
  padding: 5px 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 9999;
  letter-spacing: 0.06em;
}
#copy-toast.show { opacity: 1; }

/* ── Footer ────────────────────────────────────── */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px var(--pad) 52px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dimmer);
  border-top: 1px solid var(--border);
}

.muted { color: var(--dimmer); }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 640px) {
  :root { --pad: 20px; }
  body { cursor: auto; }
  #cursor { display: none; }


  .boot-inner { width: calc(100vw - 48px); }
  .boot-skip  { display: none; }

  .hero-name    { font-size: 40px; }
  .hero-tagline { font-size: 14px; }

  .nav-links { gap: 20px; }

  pre.tw { font-size: 11.5px; line-height: 1.8; }

  .proj-head { flex-direction: column; gap: 2px; }
  .content-section { padding: 60px var(--pad); }
}

@media (max-width: 380px) {
  .hero-name { font-size: 34px; }
  .nav-links a { font-size: 12px; }
}
