/* =================================================================
   titovcode.com — design system
   Dark techno / neon. Amber accent matching the photo glow.
   ================================================================= */

:root {
  --bg:        #0a0a0b;
  --bg-alt:    #0e0e11;
  --surface:   #141418;
  --surface-2: #1a1a20;
  --border:    rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text:      #e9e9ee;
  --text-dim:  #9a9aa6;
  --text-mute: #6a6a76;

  --accent:      #ff8c2b;   /* amber — matches the photo halo */
  --accent-soft: #ffb066;
  --accent-2:    #2bd9c4;   /* teal counter-accent */
  --accent-glow: rgba(255, 140, 43, 0.35);

  --font-head: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --container: 1080px;
  --radius:    14px;
  --radius-sm: 9px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.accent { color: var(--accent); }

.link {
  color: var(--accent-soft);
  border-bottom: 1px solid rgba(255, 176, 102, 0.3);
  transition: border-color 0.2s, color 0.2s;
}
.link:hover { color: var(--accent); border-color: var(--accent); }

/* =================================================================
   NAV
   ================================================================= */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.35s var(--ease), border-color 0.35s, backdrop-filter 0.35s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10, 10, 11, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.nav__brand-mark {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--bg);
  background: var(--accent);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  box-shadow: 0 0 18px var(--accent-glow);
}
.nav__brand-text { font-family: var(--font-head); font-weight: 600; letter-spacing: 0.5px; }

.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a {
  font-size: 0.92rem;
  color: var(--text-dim);
  position: relative;
  transition: color 0.2s;
}
.nav__links a:not(.nav__cta)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--text); }
.nav__links a.is-active::after { width: 100%; }

.nav__cta {
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text) !important;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.nav__cta:hover { border-color: var(--accent); background: var(--accent); color: var(--bg) !important; }

/* language switch */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
.lang-switch button,
.lang-switch a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  background: none;
  border: 0;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px 10px;
  transition: background 0.2s, color 0.2s;
}
.lang-switch button.is-active,
.lang-switch a.is-active { background: var(--accent); color: var(--bg); }
.lang-switch button:not(.is-active):hover,
.lang-switch a:not(.is-active):hover { color: var(--text); }

.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__burger span { width: 24px; height: 2px; background: var(--text); transition: transform 0.3s, opacity 0.3s; }
.nav__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =================================================================
   HERO
   ================================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -3;
}
.hero__overlay {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 80% at 50% 30%, rgba(10,10,11,0.35) 0%, rgba(10,10,11,0.8) 60%, var(--bg) 100%),
    linear-gradient(180deg, rgba(10,10,11,0.6), rgba(10,10,11,0.55));
}
.hero__grid {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 0%, transparent 80%);
}
.hero__content { padding-block: 110px 90px; }

.hero__eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 2px;
  margin-bottom: 14px;
  opacity: 0;
  animation: fade-up 0.7s var(--ease) 0.1s forwards;
}
.hero__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -1.5px;
  margin-bottom: 14px;
  opacity: 0;
  animation: fade-up 0.7s var(--ease) 0.2s forwards;
}
.hero__typed {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3.5vw, 1.4rem);
  color: var(--text);
  min-height: 1.6em;
  margin-bottom: 18px;
  opacity: 0;
  animation: fade-up 0.7s var(--ease) 0.32s forwards;
}
.hero__typed .cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
.hero__tagline {
  max-width: 560px;
  margin: 0 auto 34px;
  color: var(--text-dim);
  font-size: 1.05rem;
  overflow-wrap: break-word;
  opacity: 0;
  animation: fade-up 0.7s var(--ease) 0.42s forwards;
}
/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.3s, background 0.2s, border-color 0.2s, color 0.2s;
}
.btn--primary {
  background: var(--accent);
  color: #1a0e00;
  box-shadow: 0 6px 24px var(--accent-glow);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 34px var(--accent-glow); }
.btn--ghost { border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* social row */
.social {
  display: flex; gap: 24px; justify-content: center;
  opacity: 0;
  animation: fade-up 0.7s var(--ease) 0.62s forwards;
}
.social a {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  transition: transform 0.2s var(--ease), color 0.2s, border-color 0.2s, box-shadow 0.3s;
}
.social svg { width: 28px; height: 28px; fill: currentColor; }
.social a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 0 20px var(--accent-glow);
}
/* Habr mascot is a detailed image, not a glyph — render it larger so the
   fluffy ball reads at this size, and tint to accent on hover. */
.social__habr img {
  width: 48px;
  height: 48px;
  opacity: 0.8;
  transition: opacity 0.2s, filter 0.2s;
}
.social__habr:hover img {
  opacity: 1;
  filter: brightness(0) saturate(100%)
    invert(72%) sepia(42%) saturate(1100%) hue-rotate(338deg) brightness(101%) contrast(96%);
}

/* scroll cue */
.hero__scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid var(--border-strong);
  border-radius: 14px;
  display: grid; justify-items: center; padding-top: 7px;
  opacity: 0; animation: fade-up 1s var(--ease) 1s forwards;
}
.hero__scroll span { width: 4px; height: 8px; background: var(--accent); border-radius: 2px; animation: scroll-dot 1.6s var(--ease) infinite; }

/* ---------- black-hole avatar (accretion disk + photon ring) ---------- */
.photo-container { margin-bottom: 36px; display: flex; justify-content: center; opacity: 0; animation: fade-up 0.7s var(--ease) forwards; }
.photo-frame {
  position: relative;
  width: 240px; height: 240px;
  border-radius: 50%;
  isolation: isolate;
  /* subtle ambient bloom radiated by the disk */
  box-shadow: 0 0 42px 4px rgba(255,115,40,0.12), 0 0 95px 18px rgba(255,80,16,0.05);
  animation: blackholePulse 7s ease-in-out infinite;
}

/* accretion disk: rotating, hot inner edge, Doppler-bright on one side */
.bh-disk {
  position: absolute; inset: -26px; border-radius: 50%; z-index: -2;
  background: conic-gradient(from 0deg,
    #ffe7c8 0deg, #f7c980 28deg, #ef9d44 68deg, #d96c1d 104deg,
    #973610 150deg, #501a06 188deg, #7a2a0a 212deg, #a8431a 256deg,
    #c97d2e 300deg, #f0caa0 338deg, #ffe7c8 360deg);
  -webkit-mask: radial-gradient(closest-side, transparent 60%, #000 70%, #000 88%, transparent 100%);
          mask: radial-gradient(closest-side, transparent 60%, #000 70%, #000 88%, transparent 100%);
  filter: blur(5px) saturate(1.2) brightness(0.85);
  opacity: 0.66;
  animation: blackholeRotate 9s linear infinite;
}
/* softer counter-rotating layer for depth / shimmer */
.bh-disk--2 {
  inset: -14px; z-index: -1;
  filter: blur(10px) saturate(1.15) brightness(0.85);
  opacity: 0.22;
  animation: blackholeRotate 6s linear infinite reverse;
}

/* event horizon — the photo; faint photon ring hugs its edge */
.profile-photo {
  position: relative; z-index: 1;
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  filter: contrast(1.15) brightness(0.8) saturate(0.7) sepia(0.32);
  box-shadow:
    0 0 0 1px rgba(255,236,208,0.38),
    0 0 6px 1px rgba(255,178,88,0.3),
    0 0 13px 3px rgba(255,120,40,0.15),
    inset 0 0 24px 7px rgba(0,0,0,0.45);
  transition: transform 0.3s, filter 0.3s;
}
.profile-photo:hover { transform: scale(1.03); filter: contrast(1.18) brightness(0.88) saturate(0.85) sepia(0.2); }

/* =================================================================
   SECTIONS (shared)
   ================================================================= */
.section { padding-block: clamp(64px, 11vw, 120px); position: relative; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section__eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.section__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  letter-spacing: -0.5px;
  margin-bottom: 42px;
  line-height: 1.1;
}

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: start; }
.about__text .section__title { margin-bottom: 22px; }
.about__text p { color: var(--text-dim); margin-bottom: 16px; max-width: 56ch; }
.about__facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 18px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.25s, transform 0.25s var(--ease);
}
.fact:hover { border-color: var(--accent); transform: translateY(-3px); }
.fact--wide { grid-column: 1 / -1; }
.fact__num { font-family: var(--font-head); font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.fact__label { font-size: 0.82rem; color: var(--text-mute); font-family: var(--font-mono); letter-spacing: 0.5px; }
.fact__val { font-size: 1.05rem; color: var(--text); }
.fact--loc .loc { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 2px; }
.loc__badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  background: rgba(255, 140, 43, 0.1);
  border: 1px solid rgba(255, 140, 43, 0.35);
  border-radius: 999px;
  padding: 3px 11px;
}
.loc__rest { font-size: 0.92rem; color: var(--text-mute); }
.loc__tz { font-family: var(--font-mono); color: var(--text); }

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: border-color 0.25s;
}
.skill-group:hover { border-color: var(--border-strong); }
.skill-group__title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-mute);
  margin-bottom: 18px;
}
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chips li {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  padding: 7px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-2);
  transition: border-color 0.2s, color 0.2s, transform 0.2s var(--ease), box-shadow 0.3s;
  cursor: default;
}
.chips li:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 16px var(--accent-glow); }

/* ---------- projects ---------- */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 0% 0%, var(--accent-glow), transparent 55%);
  opacity: 0; transition: opacity 0.3s;
}
.card:hover { border-color: var(--accent); transform: translateY(-5px); box-shadow: 0 16px 40px rgba(0,0,0,0.4); }
.card:hover::before { opacity: 0.5; }
.card > * { position: relative; }
.card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card__icon { font-size: 1.6rem; }
.card__links { display: flex; gap: 12px; }
.card__links a {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-mute);
  border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.card__links a:hover { color: var(--accent); border-color: var(--accent); }
.card__title { font-family: var(--font-head); font-size: 1.25rem; font-weight: 600; margin-bottom: 10px; }
.card__desc { color: var(--text-dim); font-size: 0.94rem; margin-bottom: 18px; flex: 1; }
.card__tags { display: flex; flex-wrap: wrap; gap: 7px; }
.card__tags li { font-family: var(--font-mono); font-size: 0.74rem; color: var(--accent-soft); padding: 3px 9px; border: 1px solid rgba(255,176,102,0.25); border-radius: 6px; }

/* ---------- posts ---------- */
.posts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.post-card:hover { border-color: var(--accent); transform: translateY(-5px); box-shadow: 0 16px 40px rgba(0,0,0,0.4); }
.post-card-wrap { position: relative; display: flex; }
.post-card-wrap > .post-card { flex: 1; }
.post-card__media {
  aspect-ratio: 780 / 440;
  background: #0f1b2d;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__habr {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  line-height: 0;
  transition: transform 0.25s var(--ease);
}
.post-card__habr img {
  width: 48px;
  height: 48px;
  opacity: 0.9;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
  transition: opacity 0.25s, filter 0.25s;
}
.post-card__habr:hover { transform: translateY(-2px) scale(1.06); }
.post-card__habr:hover img {
  opacity: 1;
  /* tint the white mascot to the landing accent on hover */
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5))
    brightness(0) saturate(100%)
    invert(72%) sepia(42%) saturate(1100%) hue-rotate(338deg) brightness(101%) contrast(96%);
}
.post-card__body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.post-card__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.post-card__tags span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-soft);
  padding: 3px 9px;
  border: 1px solid rgba(255, 176, 102, 0.25);
  border-radius: 6px;
}
.post-card__title {
  font-family: var(--font-head);
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--text);
}
.post-card__excerpt { color: var(--text-dim); font-size: 0.94rem; margin-bottom: 18px; flex: 1; }
.post-card__excerpt code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
.post-card__more {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  transition: gap 0.2s;
}

/* ---------- experience timeline ---------- */
.timeline { position: relative; padding-left: 28px; max-width: 760px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), transparent); }
.timeline__item { position: relative; padding-bottom: 38px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: ""; position: absolute; left: -28px; top: 6px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.timeline__period { font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent); margin-bottom: 6px; letter-spacing: 0.5px; }
.timeline__role { font-family: var(--font-head); font-size: 1.18rem; font-weight: 600; margin-bottom: 8px; }
.timeline__company { color: var(--text-mute); font-weight: 500; font-size: 0.95rem; }
.timeline__points { display: grid; gap: 6px; }
.timeline__points li { color: var(--text-dim); font-size: 0.95rem; padding-left: 18px; position: relative; }
.timeline__points li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.timeline__points strong { color: var(--text); font-weight: 600; }
.timeline__points code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

/* ---------- certificates (compact pills inside experience) ---------- */
.timeline__certs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.timeline__certs-label { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-mute); }
.cert-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-soft);
  background: rgba(255, 140, 43, 0.07);
  border: 1px solid rgba(255, 140, 43, 0.3);
  border-radius: 999px;
  padding: 5px 11px;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.cert-pill::after { content: "↗"; color: var(--accent); }
.cert-pill:hover { border-color: var(--accent); color: var(--accent); background: rgba(255, 140, 43, 0.14); transform: translateY(-1px); }

.edu {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  max-width: 760px;
}

/* ---------- contact ---------- */
.contact { text-align: center; }
.contact__inner { max-width: 620px; }
.contact__title { font-family: var(--font-head); font-weight: 700; font-size: clamp(2rem, 6vw, 3.2rem); letter-spacing: -1px; margin-bottom: 18px; line-height: 1.05; }
.contact__lead { color: var(--text-dim); font-size: 1.08rem; margin-bottom: 34px; }
.contact__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); padding-block: 28px; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer span { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-mute); }

/* =================================================================
   ANIMATIONS
   ================================================================= */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: 0.06s; }
.reveal:nth-child(3) { transition-delay: 0.12s; }
.reveal:nth-child(4) { transition-delay: 0.18s; }

@keyframes fade-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes scroll-dot { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }
@keyframes blackholePulse {
  0%, 100% { box-shadow: 0 0 38px 3px rgba(255,115,40,0.10), 0 0 90px 16px rgba(255,80,16,0.05); }
  50%      { box-shadow: 0 0 52px 6px rgba(255,130,45,0.16), 0 0 120px 24px rgba(255,90,20,0.08); }
}
@keyframes blackholeRotate { to { transform: rotate(360deg); } }

/* =================================================================
   ARTICLE / POST PAGE
   ================================================================= */
.article-page { background: var(--bg); }
.article { padding-block: clamp(96px, 13vw, 132px) clamp(48px, 9vw, 84px); }
.article__inner { max-width: 760px; }

.article__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 28px;
  transition: color 0.2s;
}
.article__back:hover { color: var(--accent); }

.article__header { margin-bottom: 30px; }
.article__eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.article__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: -0.8px;
  margin-bottom: 18px;
}
.article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-mute);
}
.article__dot { color: var(--accent); }

.article__cover {
  margin-bottom: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.article__cover img { width: 100%; height: auto; }

/* ---------- prose (rendered markdown) ---------- */
.prose { color: var(--text-dim); font-size: 1.02rem; line-height: 1.75; }
.prose > * + * { margin-top: 20px; }

.prose h2 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.4rem, 3.5vw, 1.85rem);
  letter-spacing: -0.4px;
  line-height: 1.2;
  color: var(--text);
  margin-top: 56px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 90px;
}
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.12rem, 2.6vw, 1.32rem);
  color: var(--text);
  margin-top: 38px;
  scroll-margin-top: 90px;
}
.prose h4 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.3px;
  color: var(--accent-soft);
  margin-top: 30px;
}
.prose p { color: var(--text-dim); }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--text); font-style: italic; }
.prose a.link { overflow-wrap: anywhere; }

.prose ul, .prose ol { margin-left: 4px; padding-left: 24px; display: grid; gap: 9px; }
.prose ul { list-style: none; padding-left: 22px; }
.prose ol { list-style: decimal; }
.prose ol li::marker { color: var(--accent); font-family: var(--font-mono); font-weight: 700; }
.prose ul li { position: relative; padding-left: 18px; }
.prose ul li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.prose li { color: var(--text-dim); }
.prose li > ul, .prose li > ol { margin-top: 9px; }

/* inline code */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--accent-soft);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  overflow-wrap: anywhere;
}

/* code blocks */
.prose pre.code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
  background: #0c0c0f;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  tab-size: 4;
}
.prose pre.code code {
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  white-space: pre;
  overflow-wrap: normal;
}
/* syntax tokens */
.tok-kw  { color: #ff8c2b; }              /* keywords */
.tok-fn  { color: #2bd9c4; }              /* function names */
.tok-typ { color: #ffb066; }              /* types */
.tok-str { color: #8fd06a; }              /* strings */
.tok-cmt { color: var(--text-mute); font-style: italic; }

/* blockquote */
.prose blockquote {
  border-left: 3px solid var(--accent);
  background: rgba(255, 140, 43, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 20px;
  color: var(--text-dim);
  font-size: 0.97rem;
}
.prose blockquote code { background: rgba(255,255,255,0.05); }

/* diagrams — light SVGs framed as cards so they read on the dark bg */
.prose figure.diagram {
  margin-top: 30px;
  background: #f4f7fb;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.prose figure.diagram img { width: 100%; height: auto; }
.prose figure.diagram figcaption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-mute);
  text-align: center;
}
.prose figure.diagram figcaption code {
  background: var(--surface-2);
  color: var(--accent-soft);
}

/* table */
.prose .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.prose th, .prose td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.prose th {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-mute);
  background: var(--surface);
}
.prose td { color: var(--text-dim); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* article footer CTA */
.article__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; gap: 32px; }
  .projects { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .nav__links {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10,10,11,0.96);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 20px;
    transform: translateY(-120%);
    transition: transform 0.4s var(--ease);
  }
  .nav__links.is-open { transform: none; }
  .nav__links a { padding: 14px 0; width: 100%; border-bottom: 1px solid var(--border); }
  .nav__links a:not(.nav__cta)::after { display: none; }
  .nav__cta { border-radius: 8px; text-align: center; margin-top: 10px; }
  .nav__burger { display: flex; }

  .skills { grid-template-columns: 1fr; }
  .projects { grid-template-columns: 1fr; }
  .posts { grid-template-columns: 1fr; }
  .about__facts { grid-template-columns: 1fr 1fr; }

  .hero__content { padding-inline: 6px; }
  .hero__title { font-size: clamp(2.2rem, 12vw, 3rem); letter-spacing: -1px; }
  .hero__tagline { font-size: 0.96rem; }

  .prose { font-size: 0.98rem; }
  .prose pre.code { font-size: 0.78rem; padding: 14px 14px; }
  .prose figure.diagram { padding: 12px; }
  .article__footer .btn { flex: 1; justify-content: center; }
}

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