/* ═══════════════════════════════════════════════
   Vladimir Ivanov — Personal Site
   Design: dark terminal-meets-editorial
   Fonts: Syne (display) + JetBrains Mono (body)
═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=JetBrains+Mono:wght@300;400;500;600&display=swap');

:root {
  /* Colors */
  --bg:           #09090e;
  --surface:      #0f0f17;
  --surface2:     #171722;
  --surface3:     #1e1e2e;
  --border:       #252535;
  --border-hi:    #3a3a55;
  --text:         #e4e4f0;
  --text-muted:   #8a8aa4;
  --text-dim:     #4a4a64;
  --accent:       #7b6ef6;
  --accent-hi:    #9d93f8;
  --accent-glow:  rgba(123,110,246,0.12);
  --green:        #5ef0a0;
  --green-glow:   rgba(94,240,160,0.10);
  --red:          #f06e6e;
  --red-glow:     rgba(240,110,110,0.10);
  --gold:         #f0c86e;

  /* Typography scale */
  --fs-base:      14px;
  --fs-sm:        13px;
  --fs-xs:        11px;
  --fs-xxs:       10px;
  --fs-tag:       12px;
  --fs-heading:   15px;
  --lh-body:      1.8;

  /* Spacing & shape */
  --radius:       4px;
  --nav-h:        56px;
}

/* RESET */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* GRID BG */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(123,110,246,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123,110,246,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}

/* NOISE OVERLAY */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.4;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(9,9,14,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex; align-items: center;
}

.nav-inner {
  max-width: 960px; margin: 0 auto; padding: 0 24px;
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 16px;
  color: var(--text); text-decoration: none;
  letter-spacing: -0.5px;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex; gap: 28px; list-style: none;
}
.nav-links a {
  font-size: var(--fs-xs); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ''; display: block; height: 1px;
  background: var(--accent); margin-top: 1px;
}

/* ── PAGE WRAPPER ── */
.page { padding-top: calc(var(--nav-h) + 60px); padding-bottom: 120px; }

/* ── SECTION ── */
.section { margin-bottom: 72px; }

.section-label {
  font-size: var(--fs-xxs); letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 24px;
  display: flex; align-items: center; gap: 14px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── TIMELINE ── */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 10px 1fr; gap: 0 22px; }
.tl-dot-col { display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface2); border: 2px solid var(--border);
  flex-shrink: 0; margin-top: 5px;
  transition: border-color 0.2s, background 0.2s;
}
.tl-item:hover .tl-dot { border-color: var(--accent); background: var(--accent-glow); }
.tl-line { width: 1px; flex: 1; background: var(--border); min-height: 14px; }
.tl-item:last-child .tl-line { display: none; }
.tl-content { padding-bottom: 28px; }
.tl-header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 3px; }
.tl-role { font-family: 'Syne', sans-serif; font-size: var(--fs-heading); font-weight: 700; color: var(--text); }
.tl-company { font-size: var(--fs-sm); color: var(--accent); font-weight: 500; }
.tl-period { color: var(--text-dim); font-size: var(--fs-xs); letter-spacing: 0.04em; margin-left: auto; white-space: nowrap; }
.tl-desc { color: var(--text-muted); font-size: var(--fs-sm); line-height: var(--lh-body); margin-top: 5px; }
.tl-note {
  display: inline-block; margin-top: 6px;
  font-size: var(--fs-xxs); letter-spacing: 0.08em;
  color: var(--gold); opacity: 0.8;
}

/* ── TAGS ── */
.tag { position: relative; display: inline-block; }
.tag-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; font-size: var(--fs-tag);
  cursor: pointer; transition: all 0.15s ease; white-space: nowrap;
}
.tag-btn:hover { border-color: var(--border-hi); color: var(--text); background: var(--surface2); }
.tag-dot { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
.tag[data-level="built"]  .tag-dot { background: var(--green); }
.tag[data-level="used"]   .tag-dot { background: var(--accent); }
.tag[data-level="knows"]  .tag-dot { background: var(--text-dim); }
.tag.open[data-level="built"]  .tag-btn { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); background: var(--green-glow); color: var(--text); }
.tag.open[data-level="used"]   .tag-btn { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-glow); color: var(--text); }
.tag.open[data-level="knows"]  .tag-btn { border-color: var(--border-hi); color: var(--text); }
.tag-chevron { font-size: 9px; color: var(--text-dim); transition: transform 0.2s, color 0.15s; }
.tag.open .tag-chevron { transform: rotate(180deg); color: var(--accent); }

/* TAG CARD */
.tag-card {
  display: none;
  position: absolute; top: calc(100% + 8px); left: 0;
  width: 310px;
  background: var(--surface); border: 1px solid var(--border-hi); border-radius: 6px;
  padding: 16px; z-index: 200;
  box-shadow: 0 24px 64px rgba(0,0,0,0.8), 0 0 0 1px rgba(123,110,246,0.08);
  animation: cardIn 0.15s ease;
}
@media (max-width: 600px) {
  .tag-card {
    position: fixed;
    left: 12px; right: 12px;
    top: auto; bottom: 12px;
    width: auto;
    max-height: 70vh;
    overflow-y: auto;
  }
}
.tag.open .tag-card { display: block; }
@keyframes cardIn {
  from { opacity:0; transform: translateY(-4px); }
  to   { opacity:1; transform: translateY(0); }
}
.card-name { font-family:'Syne',sans-serif; font-size:var(--fs-heading); font-weight:700; color:var(--text); margin-bottom:12px; }
.card-field { margin-bottom: 10px; }
.card-field:last-child { margin-bottom: 0; }
.card-field-label { font-size:9px; letter-spacing:0.18em; text-transform:uppercase; color:var(--text-dim); margin-bottom:3px; }
.card-field-val { color:var(--text-muted); font-size:var(--fs-sm); line-height:1.65; }
.level-pill { display:inline-flex; align-items:center; gap:5px; padding:2px 8px; border-radius:2px; font-size:var(--fs-xs); font-weight:500; }
.level-built { background:rgba(94,240,160,0.12); color:var(--green); }
.level-used  { background:rgba(123,110,246,0.15); color:var(--accent-hi); }
.level-knows { background:rgba(255,255,255,0.05); color:var(--text-muted); }
.chip-row { display:flex; flex-wrap:wrap; gap:4px; margin-top:3px; }
.chip { padding:2px 7px; background:var(--surface2); border:1px solid var(--border); border-radius:2px; font-size:var(--fs-xs); color:var(--text-muted); }
.chip-action { padding:2px 7px; background:var(--red-glow); border:1px solid rgba(240,110,110,0.2); border-radius:2px; font-size:var(--fs-xs); color:var(--red); }

/* ── LEGEND ── */
.legend { display:flex; gap:20px; flex-wrap:wrap; margin-bottom:20px; align-items:center; }
.legend-item { display:flex; align-items:center; gap:6px; font-size:var(--fs-xs); color:var(--text-muted); }
.legend-dot { width:6px; height:6px; border-radius:50%; }
.hint { font-size:var(--fs-xxs); color:var(--text-dim); letter-spacing:0.04em; margin-left:auto; }

/* ── DOMAIN GROUP ── */
.domain-group { margin-bottom:32px; }
.domain-label { font-size:var(--fs-xxs); letter-spacing:0.15em; text-transform:uppercase; color:var(--text-dim); margin-bottom:10px; }
.tags-row { display:flex; flex-wrap:wrap; gap:8px; }

/* ── PROJECT CARDS ── */
.project-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap:16px; }
.project-card {
  background: var(--surface); border: 1px solid var(--border); border-radius:6px;
  padding: 24px; text-decoration:none; color:inherit;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; gap: 12px;
}
.project-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.project-card-logo {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.project-card-title { font-family:'Syne',sans-serif; font-size:16px; font-weight:700; color:var(--text); }
.project-card-role { font-size:var(--fs-xs); color:var(--accent); letter-spacing:0.05em; }
.project-card-desc { font-size:var(--fs-sm); color:var(--text-muted); line-height:1.7; flex:1; }
.project-card-meta { display:flex; gap:12px; flex-wrap:wrap; }
.project-meta-chip {
  padding:2px 8px; background:var(--surface2); border:1px solid var(--border);
  border-radius:2px; font-size:var(--fs-xs); color:var(--text-dim);
}
.project-card-arrow { font-size:var(--fs-xs); color:var(--text-dim); margin-top:auto; transition:color 0.15s, transform 0.15s; }
.project-card:hover .project-card-arrow { color:var(--accent); transform:translateX(3px); }

/* ── REFERENCES ── */
.ref-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(210px, 1fr)); gap:14px; }
.ref-card {
  background:var(--surface); border:1px solid var(--border); border-radius:6px;
  padding:20px; display:flex; flex-direction:column; gap:10px;
}
.ref-avatar {
  width:44px; height:44px; border-radius:50%;
  background:var(--surface2); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center;
  font-size:16px; flex-shrink:0;
  overflow: hidden;
}
.ref-avatar img { width:100%; height:100%; object-fit:cover; }
.ref-name { font-family:'Syne',sans-serif; font-size:14px; font-weight:700; color:var(--text); }
.ref-title { font-size:var(--fs-xs); color:var(--accent); }
.ref-company { font-size:var(--fs-xs); color:var(--text-muted); }
.ref-link {
  display:inline-flex; align-items:center; gap:5px;
  font-size:var(--fs-xs); color:var(--text-dim); text-decoration:none;
  transition:color 0.15s; margin-top:auto;
}
.ref-link:hover { color:var(--accent); }

/* ── CONTACT ROW ── */
.contact-row {
  display:flex; gap:28px; flex-wrap:wrap;
  padding-top:32px; border-top:1px solid var(--border);
}
.contact-item { font-size:var(--fs-sm); color:var(--text-muted); }
.contact-item span { color:var(--text-dim); margin-right:6px; font-size:var(--fs-xxs); letter-spacing:0.1em; text-transform:uppercase; }
.contact-item a { color:var(--text-muted); text-decoration:none; transition:color 0.15s; }
.contact-item a:hover { color:var(--accent); }

/* ── PROJECT PAGE SPECIFIC ── */
.project-hero {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 56px;
}
.project-logo-placeholder {
  width: 72px; height: 72px; border-radius: 14px;
  background: var(--surface2); border: 2px dashed var(--border-hi);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 24px;
  text-align: center; line-height: 1.4;
}
.project-title-row { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; flex-wrap:wrap; }
.project-title { font-family:'Syne',sans-serif; font-size:clamp(32px,5vw,52px); font-weight:800; letter-spacing:-1.5px; line-height:1; color:var(--text); margin-bottom:10px; }
.project-title span { color:var(--accent); }
.project-subtitle { font-size:var(--fs-base); color:var(--text-muted); margin-bottom:20px; }
.stat-row { display:flex; gap:32px; flex-wrap:wrap; margin-top:24px; }
.stat { text-align:left; }
.stat-num { font-family:'Syne',sans-serif; font-size:28px; font-weight:800; color:var(--accent); line-height:1; }
.stat-label { font-size:var(--fs-xxs); letter-spacing:0.12em; text-transform:uppercase; color:var(--text-dim); margin-top:2px; }
.back-link {
  display:inline-flex; align-items:center; gap:6px;
  font-size:var(--fs-xs); letter-spacing:0.08em; text-transform:uppercase;
  color:var(--text-dim); text-decoration:none;
  transition:color 0.15s; margin-bottom:32px;
}
.back-link:hover { color:var(--accent); }

/* ── CALLOUT ── */
.callout {
  background:var(--surface); border:1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius:var(--radius); padding:16px 20px;
  font-size:var(--fs-sm); color:var(--text-muted); line-height:var(--lh-body);
  margin-bottom:24px;
}
.callout strong { color:var(--text); font-weight:500; }

/* ── PROSE LIST ── */
.prose-list { list-style:none; display:flex; flex-direction:column; gap:8px; }
.prose-list li {
  padding-left:18px; position:relative;
  font-size:var(--fs-sm); color:var(--text-muted); line-height:var(--lh-body);
}
.prose-list li::before { content:'→'; position:absolute; left:0; color:var(--accent); font-size:var(--fs-xxs); top:3px; }
.prose-list strong { color:var(--text); font-weight:500; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}
.fade-up { animation: fadeUp 0.5s ease both; }
.delay-1 { animation-delay:0.1s; }
.delay-2 { animation-delay:0.2s; }
.delay-3 { animation-delay:0.3s; }
.delay-4 { animation-delay:0.4s; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .nav-links { display:none; }
  .stat-row { gap:20px; }
  .project-grid { grid-template-columns:1fr; }
  .ref-grid { grid-template-columns:1fr 1fr; }
}
