/* =====================================================================
   Rafael Azizov — portfolio
   Plain CSS, no build step. Design tokens first, then components.
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* light theme */
  --bg: #f7f6f2;
  --bg-alt: #efede7;
  --surface: #ffffff;
  --surface-2: #f3f1eb;
  --border: rgba(16, 24, 40, 0.10);
  --border-strong: rgba(16, 24, 40, 0.18);
  --text: #0f172a;
  --text-2: #475467;
  --text-3: #6b7280;
  --accent: #0b3a6f;          /* deep navy */
  --accent-2: #b8862b;        /* brass */
  --accent-soft: rgba(11, 58, 111, 0.08);
  --accent-2-soft: rgba(184, 134, 43, 0.14);
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 12px 32px -12px rgba(16,24,40,.14);
  --shadow-lg: 0 2px 4px rgba(16,24,40,.05), 0 30px 60px -20px rgba(16,24,40,.22);
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1160px;
  --gutter: 20px;
  --header-h: 72px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

[data-theme="dark"] {
  --bg: #0b1220;
  --bg-alt: #0e1627;
  --surface: #121b2e;
  --surface-2: #172238;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --text: #e6eaf2;
  --text-2: #aab3c5;
  --text-3: #7d879c;
  --accent: #7fb2ff;
  --accent-2: #e0b45a;
  --accent-soft: rgba(127,178,255,0.12);
  --accent-2-soft: rgba(224,180,90,0.14);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px -12px rgba(0,0,0,.5);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.35), 0 30px 60px -20px rgba(0,0,0,.7);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* No horizontal scroll on any device: `hidden` for older Safari, `clip` where supported (keeps sticky header working). */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; }
body { overflow-x: hidden; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
strong { font-weight: 600; color: var(--text); }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

.skip-link {
  position: absolute; left: 8px; top: -48px; padding: 8px 12px;
  background: var(--accent); color: #fff; border-radius: 8px; z-index: 100;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- Typography ---------- */
.section-index {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em;
  color: var(--accent-2); margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.section-sub { color: var(--text-2); margin-top: 14px; max-width: 42ch; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .04em;
  color: var(--text-2);
}
.hero-topline { margin-bottom: 22px; }
.hero-avatar { display: none; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); }
  70% { box-shadow: 0 0 0 9px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  font-weight: 500; font-size: 15px; line-height: 1;
  border: 1px solid transparent;
  transition: transform .18s var(--ease), background-color .2s, border-color .2s, color .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px var(--accent); }
[data-theme="dark"] .btn-primary { color: #0b1220; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 9px 14px; font-size: 14px; }
.btn-lg { padding: 16px 26px; font-size: 16px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  transition: border-color .2s, color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }


/* ---------- Language switch ---------- */
.lang-switch {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
}
.lang-switch button {
  padding: 6px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--text-3); line-height: 1; transition: color .2s, background-color .2s;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.is-active { background: var(--accent); color: #fff; }
[data-theme="dark"] .lang-switch button.is-active { color: #0b1220; }
.lang-switch-nav { display: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -0.01em; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-serif); font-weight: 600; font-size: 15px; letter-spacing: .02em;
  background: var(--accent); color: #fff;
}
[data-theme="dark"] .brand-mark { color: #0b1220; }

.site-nav ul { display: flex; gap: 6px; }
.site-nav a {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  font-size: 15px; color: var(--text-2); transition: color .2s, background-color .2s;
}
.site-nav a:hover { color: var(--text); background: var(--accent-soft); }
.site-nav a.is-active { color: var(--accent); background: var(--accent-soft); }

.header-actions { display: flex; align-items: center; gap: 10px; }

#theme-toggle .icon-moon { display: none; }
[data-theme="dark"] #theme-toggle .icon-sun { display: none; }
[data-theme="dark"] #theme-toggle .icon-moon { display: block; }

.nav-toggle { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 0; }
.nav-toggle span { flex: 0 0 auto; display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 520px at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(700px 480px at -10% 30%, var(--accent-2-soft), transparent 60%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 20%, transparent 70%);
  opacity: .7;
}

.hero-inner { display: grid; grid-template-columns: 1.25fr .85fr; gap: clamp(32px, 6vw, 80px); align-items: center; }

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.018em;
  max-width: 18ch;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.lead { color: var(--text-2); font-size: clamp(16px, 1.3vw, 18px); max-width: 60ch; margin-top: 24px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.br-lg { display: none; }

.hero-visual { display: flex; justify-content: center; }
.portrait-frame {
  position: relative;
  width: min(100%, 400px);
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  padding: 10px;
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.portrait-frame::before {
  content: ""; position: absolute; inset: -14px; z-index: -1; border-radius: 36px;
  border: 1px dashed var(--border-strong);
}
.portrait { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; border-radius: 20px; }
.portrait-badge {
  position: absolute; left: 22px; bottom: -18px;
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.badge-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.badge-value { font-weight: 600; font-size: 14px; }

/* stats */
.stats {
  margin-top: clamp(48px, 7vw, 88px);
  display: grid; grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; box-shadow: var(--shadow);
}
.stats li {
  padding: 22px 24px; display: flex; flex-direction: column; gap: 4px;
  border-right: 1px solid var(--border);
}
.stats li:last-child { border-right: 0; }
.stat-value {
  font-family: var(--font-serif); font-size: 34px; font-weight: 500; line-height: 1; letter-spacing: -0.01em;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 13px; color: var(--text-2); }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-alt { background: var(--bg-alt); }
.grid-2 { display: grid; grid-template-columns: 300px 1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.section-head { position: sticky; top: calc(var(--header-h) + 32px); }
.section-head-wide { position: static; margin-bottom: 48px; max-width: 640px; }
.section-body > p { color: var(--text-2); font-size: 17px; margin-bottom: 18px; max-width: 68ch; }
.section-body > p:first-child { font-size: clamp(19px, 1.6vw, 22px); color: var(--text); font-family: var(--font-serif); font-weight: 400; line-height: 1.45; }

.principles { margin-top: 36px; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.principles h3 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin-bottom: 18px; }
.principles li { position: relative; padding-left: 22px; color: var(--text-2); margin-bottom: 14px; }
.principles li:last-child { margin-bottom: 0; }
.principles li::before { content: ""; position: absolute; left: 0; top: 10px; width: 8px; height: 8px; border-radius: 2px; background: var(--accent-2); transform: rotate(45deg); }
.principles strong { display: block; margin-bottom: 2px; }

/* ---------- Timeline ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 28px; }
.tl-item { display: grid; grid-template-columns: 180px 1fr; gap: 28px; position: relative; }
.tl-meta { display: flex; flex-direction: column; gap: 4px; padding-top: 26px; font-size: 14px; }
.tl-date { font-family: var(--font-mono); font-size: 13px; color: var(--accent); font-weight: 500; }
.tl-place { color: var(--text-3); }
.tl-note { color: var(--text-3); font-size: 12.5px; }
.tl-card {
  position: relative;
  padding: 26px 28px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.tl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.tl-card::before {
  content: ""; position: absolute; left: -22px; top: 34px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-2); border: 3px solid var(--bg-alt);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.tl-item::after {
  content: ""; position: absolute; left: calc(180px + 28px - 17px); top: 46px; bottom: -28px;
  width: 1px; background: var(--border-strong);
}
.tl-item:last-child::after { display: none; }
.tl-card h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.tl-card .at { color: var(--text-3); font-weight: 400; margin: 0 4px; }
.tl-tag { color: var(--text-3); font-size: 14px; margin-top: 4px; }
.tl-card ul { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.tl-card li { position: relative; padding-left: 18px; color: var(--text-2); font-size: 15px; }
.tl-card li::before { content: ""; position: absolute; left: 0; top: 11px; width: 6px; height: 2px; background: var(--accent-2); }

/* ---------- Work grid ---------- */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; grid-auto-flow: dense; }
.work-card {
  min-width: 0;
  display: flex; flex-direction: column; gap: 16px;
  padding: 28px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.work-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.work-card-featured {
  grid-column: span 2;
  background:
    radial-gradient(600px 300px at 100% 0%, var(--accent-soft), transparent 65%),
    var(--surface);
}

/* ---------- Brand cards (WIT / Wingz / NG) ---------- */
.work-card-brand { position: relative; overflow: hidden; contain: paint; border-color: transparent; isolation: isolate; }
.work-card-brand:hover { border-color: transparent; }
.work-card-brand > * { position: relative; z-index: 1; }
.work-card.work-card-brand .work-kicker,
.work-card.work-card-brand h3,
.work-card.work-card-brand p,
.work-card.work-card-brand .work-facts li,
.work-card.work-card-brand .work-facts span { color: inherit; }
.work-card.work-card-brand .work-kicker { opacity: .78; }
.work-card.work-card-brand p { opacity: .9; }
.work-card.work-card-brand .work-facts li { opacity: .8; }
.work-card.work-card-brand .work-facts span { opacity: 1; }

.brand-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.brand-logo { display: inline-flex; align-items: center; gap: 10px; }
.brand-wordmark { font-weight: 700; font-size: 22px; letter-spacing: -0.02em; line-height: 1; }
.brand-icon { width: 40px; height: 40px; border-radius: 11px; box-shadow: 0 4px 14px -4px rgba(0,0,0,.35); }
.brand-logo-img { height: 26px; width: auto; }
.brand-tile { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: #fff; box-shadow: 0 4px 14px -4px rgba(0,0,0,.35); }
.brand-tile .brand-mark-svg { width: 18px; height: 28px; }
.brand-site {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 500; opacity: .85;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px;
  transition: text-decoration-color .2s, opacity .2s;
}
a.brand-site:hover { opacity: 1; text-decoration-color: currentColor; }
.brand-site-static { text-decoration: none; opacity: .7; }

.brand-watermark {
  position: absolute; z-index: 0; right: -28px; bottom: -36px; pointer-events: none;
  opacity: .14; transform: rotate(-8deg);
}
.brand-watermark .brand-mark-svg { width: 190px; height: 290px; }
.brand-watermark-img img { width: 230px; height: 230px; border-radius: 48px; }
.brand-watermark-img { opacity: .18; mix-blend-mode: luminosity; }

/* WIT: blue gradient from wit.az */
.brand-wit { background: linear-gradient(135deg, #7cb0ff 0%, #3972ee 52%, #3659cb 100%); color: #fff; }
.brand-wit .tags li { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.24); color: #fff; }
.brand-wit .brand-watermark { opacity: .22; }

/* Wingz: brand yellow + near-black */
.brand-wingz { background: linear-gradient(160deg, #ffe033 0%, #facc15 60%, #eab308 100%); color: #0a0a0a; }
.brand-wingz .tags li { background: rgba(0,0,0,.08); border-color: rgba(0,0,0,.16); color: #0a0a0a; }
.brand-wingz .store-btn { background: #0a0a0a; color: #fff; }
.brand-wingz .brand-watermark-img { opacity: .9; mix-blend-mode: multiply; }
.brand-wingz .brand-watermark-img img { border-radius: 0; }

/* NG Scooter: brand green */
.brand-ng { background: linear-gradient(160deg, #14c968 0%, #01b855 55%, #009e48 100%); color: #fff; }
.brand-ng .tags li { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.26); color: #fff; }
.brand-ng .store-btn { background: #fff; color: #0a0a0a; }
.brand-ng .brand-watermark-img { opacity: .9; mix-blend-mode: screen; }
.brand-ng .brand-watermark-img img { border-radius: 0; }

/* Store buttons */
.store-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 14px 8px 12px; border-radius: 11px;
  background: var(--text); color: var(--bg); line-height: 1.05;
  transition: transform .18s var(--ease), box-shadow .2s;
}
.store-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(0,0,0,.5); }
.store-btn small { display: block; font-size: 10px; font-weight: 400; opacity: .72; letter-spacing: .02em; }
.store-btn b { display: block; font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }

.work-kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: var(--accent-2); }
.work-card h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin-top: 8px; }
.work-card-featured h3 { font-size: 24px; }
.work-card p { color: var(--text-2); font-size: 15px; flex: 1; }
.work-facts { display: flex; flex-wrap: wrap; gap: 22px; }
.work-facts li { font-size: 13px; color: var(--text-3); display: flex; align-items: baseline; gap: 6px; }
.work-facts span { font-family: var(--font-serif); font-size: 22px; color: var(--text); font-weight: 500; line-height: 1; }

.work-link {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 13.5px; font-weight: 500; color: var(--accent);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px;
  transition: text-decoration-color .2s; overflow-wrap: anywhere;
}
.work-link:hover { text-decoration-color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-size: 12.5px; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
  font-family: var(--font-mono); letter-spacing: .01em;
}
.tags-lg li { font-size: 13.5px; padding: 8px 14px; background: var(--surface); }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; }
.skill-group h3 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin-bottom: 14px; }

/* ---------- Education ---------- */
.edu { display: flex; flex-direction: column; gap: 20px; }
.edu-card {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 24px 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.edu-card h3 { font-size: 18px; font-weight: 600; }
.edu-card p { color: var(--text-2); margin-top: 4px; }
.edu-date { font-family: var(--font-mono); font-size: 13px; color: var(--accent); white-space: nowrap; }
.langs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.langs li { padding: 18px 20px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.langs .lang { font-weight: 600; }
.langs .level { font-size: 13px; color: var(--text-3); }

/* ---------- Contact ---------- */
.section-contact { padding-top: 0; }
.contact-card {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center;
  padding: clamp(32px, 5vw, 64px);
  border-radius: 28px;
  background:
    radial-gradient(700px 400px at 100% 100%, var(--accent-2-soft), transparent 60%),
    radial-gradient(600px 360px at 0% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.contact-copy .btn { margin-top: 28px; }
.contact-list { display: flex; flex-direction: column; }
.contact-list li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.contact-list li:last-child { border-bottom: 0; }
.contact-label { color: var(--text-3); font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; padding-top: 2px; }
.contact-list a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 4px; transition: text-decoration-color .2s, color .2s; text-align: right; }
.contact-list a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: 14px; color: var(--text-3); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.back-top:hover { color: var(--accent); }

/* ---------- 404 page ---------- */
    .nf { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 40px var(--gutter); }
    .nf-code { font-family: var(--font-mono); font-size: 13px; letter-spacing: .14em; color: var(--accent-2); margin-bottom: 14px; }
    .nf h1 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(32px, 5vw, 52px); line-height: 1.1; letter-spacing: -0.015em; }
    .nf p { color: var(--text-2); margin: 18px auto 30px; max-width: 46ch; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .status-dot { animation: none; }
}

/* ---------- Responsive ---------- */
@media (min-width: 1100px) { .br-lg { display: inline; } }

@media (max-width: 1024px) {
  .work-grid { grid-template-columns: 1fr 1fr; }
  .work-card-featured { grid-column: span 2; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stats li { border-bottom: 1px solid var(--border); }
  .stats li:nth-child(3n) { border-right: 0; }
  .stats li:nth-last-child(-n+2) { border-bottom: 0; }
  .grid-2 { grid-template-columns: 240px 1fr; }
  .langs { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .hero { padding-top: clamp(28px, 6vw, 48px); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .hero-topline { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
  .hero-avatar {
    display: block; flex: 0 0 auto; width: 72px; height: 72px; border-radius: 20px;
    object-fit: cover; object-position: 50% 20%;
    border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  }
  .eyebrow { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 10px; line-height: 1.45; }
  .eyebrow .status-dot { flex: 0 0 auto; margin-top: 5px; }
  .grid-2 { grid-template-columns: 1fr; gap: 32px; }
  .section-head { position: static; }
  .tl-item { grid-template-columns: 1fr; gap: 10px; }
  .tl-meta { padding-top: 0; flex-direction: row; gap: 14px; align-items: baseline; }
  .tl-item::after, .tl-card::before { display: none; }
  .skills { grid-template-columns: 1fr; }
  .contact-card { grid-template-columns: 1fr; gap: 28px; }
  .contact-list a { text-align: left; }
  .contact-list li { flex-direction: column; gap: 4px; }

  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 12px var(--gutter) 20px;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform .25s var(--ease), opacity .2s;
    box-shadow: var(--shadow-lg);
  }
  .site-nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav a { display: block; padding: 12px 14px; font-size: 17px; }
  .nav-toggle { display: inline-flex; }
  .header-actions > .lang-switch { display: none; }
  .lang-switch-nav { display: inline-flex; margin: 12px 14px 0; }
  .lang-switch-nav button { padding: 9px 14px; font-size: 13px; }
}

@media (max-width: 600px) {
  :root { --header-h: 64px; }
  .brand-name { display: none; }
  .header-actions .btn span { display: none; }
  .header-actions .btn-sm { padding: 9px 11px; }
  .hero h1 { font-size: clamp(30px, 8.6vw, 38px); }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats li { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .stats li:nth-child(2n) { border-right: 0; }
  .stats li:nth-child(3n) { border-right: 1px solid var(--border); }
  .stats li:nth-child(6n) { border-right: 0; }
  .stats li:last-child { border-bottom: 0; border-right: 0; grid-column: span 2; }
  .stats li:nth-last-child(2) { border-bottom: 1px solid var(--border); }
  .work-grid { grid-template-columns: 1fr; }
  .work-card-featured { grid-column: span 1; }
  .langs { grid-template-columns: 1fr; }
  .edu-card { flex-direction: column; align-items: flex-start; }
  .contact-copy .btn-lg { width: 100%; justify-content: center; padding-inline: 14px; font-size: 15px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .portrait-badge { left: 14px; }
}
