/* ==========================================================================
   Elbek Abduraximov — personal site
   Palette: night navy, lapis, Samarkand gold, ivory.  Type: Montserrat.
   ========================================================================== */

:root {
  --night: #0a1630;
  --gold: #e3b467;
  --gold-hi: #f6d899;
  --gold-lo: #c88f3e;
  --ivory: #f7f3ea;
  --ok: #3ddc84;

  /* dark theme (default) */
  --bg: #0a1630;
  --bg-alt: #0c1a39;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-solid: #111f44;
  --border: rgba(226, 232, 245, 0.12);
  --border-strong: rgba(226, 232, 245, 0.24);
  --text: #f4efe6;
  --muted: #a9b2c7;
  --accent: #e3b467;
  --chip-bg: rgba(255, 255, 255, 0.05);
  --arch-top: #1a336a;
  --arch-bottom: #0b1736;
  --code-bg: #071129;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.65);

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --container: 1320px;
  --gutter: clamp(20px, 5vw, 72px);
  --nav-h: 104px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23e3b467' stroke-width='1'%3E%3Cpath d='M24 24h32v32H24zM40 17.4 62.6 40 40 62.6 17.4 40zM40 17.4V0M62.6 40H80M40 62.6V80M17.4 40H0M24 24 0 0M56 24 80 0M56 56l24 24M24 56 0 80M10 0 0 10M70 0l10 10M80 70l-10 10M0 70l10 10'/%3E%3Ccircle cx='40' cy='40' r='6'/%3E%3C/g%3E%3C/svg%3E");
}

:root[data-theme="light"] {
  --bg: #f6f1e7;
  --bg-alt: #efe7d8;
  --surface: #fffdf8;
  --surface-solid: #fffdf8;
  --border: rgba(19, 38, 79, 0.12);
  --border-strong: rgba(19, 38, 79, 0.26);
  --text: #12234a;
  --muted: #55607a;
  --accent: #8f5f18;
  --chip-bg: rgba(19, 38, 79, 0.05);
  --shadow: 0 30px 60px -34px rgba(19, 38, 79, 0.35);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(15px, 0.25vw + 14.2px, 17px);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: background-color 0.35s ease, color 0.35s ease;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
[id] { scroll-margin-top: 72px; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.icon { width: 20px; height: 20px; flex: none; }
.icon--sm { width: 17px; height: 17px; }
.icon--xs { width: 14px; height: 14px; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--gold);
  color: #1a1405;
  font-weight: 600;
}
.skip-link:focus { top: 16px; }

.lattice {
  position: absolute;
  pointer-events: none;
  background-image: var(--lattice);
  background-size: 72px 72px;
}

/* ---------- navigation ---------- */
.nav {
  --nav-fg: #f7f3ea;
  --nav-muted: rgba(247, 243, 234, 0.84);
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  color: var(--nav-fg);
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}
.nav.is-scrolled {
  --nav-fg: var(--text);
  --nav-muted: var(--muted);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 1px 0 var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--nav-h);
  transition: height 0.35s var(--ease);
}
.nav.is-scrolled .nav__inner { height: 76px; }

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: none;
  color: var(--nav-fg);
}
.brand__mark { width: 54px; height: 30px; flex: none; }
.brand__divider { width: 1px; height: 42px; background: currentColor; opacity: 0.35; }
.brand__name { font-size: 17px; font-weight: 500; line-height: 1.22; letter-spacing: -0.005em; }

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(2px, 0.6vw, 10px);
  margin-inline: auto;
}
.nav__link {
  position: relative;
  padding: 11px clamp(14px, 1.5vw, 26px);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--nav-muted);
  font-size: 15.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.25s, background-color 0.25s;
}
.nav__link:hover { color: var(--nav-fg); }
.nav__link.is-active {
  color: var(--nav-fg);
  font-weight: 600;
  border-color: color-mix(in srgb, var(--nav-fg) 34%, transparent);
  background: color-mix(in srgb, var(--nav-fg) 5%, transparent);
}
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 44px;
  height: 2.5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-hi), var(--gold));
  transform: translateX(-50%);
}

.nav__actions { display: flex; align-items: center; gap: 16px; flex: none; margin-left: auto; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 216, 153, 0.28), transparent 68%);
  color: var(--gold-hi);
  cursor: pointer;
  transition: transform 0.3s var(--ease);
}
.theme-toggle:hover { transform: rotate(18deg); }
.theme-toggle .icon { width: 28px; height: 28px; filter: drop-shadow(0 0 8px rgba(246, 216, 153, 0.7)); }
.icon--sun circle { fill: currentColor; }
.icon--moon { display: none; }
[data-theme="light"] .icon--sun { display: none; }
[data-theme="light"] .icon--moon { display: block; }
[data-theme="light"] .nav.is-scrolled .theme-toggle { color: var(--accent); background: none; }
[data-theme="light"] .nav.is-scrolled .theme-toggle .icon { filter: none; }

.lang { position: relative; }
.lang__btn,
.nav__burger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px 0 20px;
  border: 1px solid color-mix(in srgb, var(--nav-fg) 34%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--nav-fg) 4%, transparent);
  color: var(--nav-fg);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.lang__btn:hover, .nav__burger:hover { border-color: color-mix(in srgb, var(--nav-fg) 60%, transparent); }
.lang__btn .icon { transition: transform 0.2s; }
.lang.is-open .lang__btn .icon { transform: rotate(180deg); }

.lang__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.lang.is-open .lang__menu { opacity: 1; visibility: visible; transform: none; }
.lang__menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}
.lang__menu a span { width: 24px; color: var(--accent); font-size: 12px; font-weight: 700; }
.lang__menu a:hover, .lang__menu a[aria-current] { background: var(--chip-bg); }
.lang__menu a[aria-current] { font-weight: 600; }

.nav__burger { display: none; width: 44px; padding: 0; justify-content: center; }
.nav__burger .icon--close { display: none; }
.nav.is-menu-open .nav__burger .icon--menu { display: none; }
.nav.is-menu-open .nav__burger .icon--close { display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 64px;
  padding: 0 34px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background-color 0.25s, border-color 0.25s;
}
.btn--sm { height: 50px; padding: 0 24px; font-size: 15px; }
.btn--gold {
  background: linear-gradient(180deg, #f4d290 0%, #e2ae5e 100%);
  color: #1d1606;
  box-shadow: 0 12px 30px -12px rgba(227, 180, 103, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn--gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px -14px rgba(227, 180, 103, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn--gold .icon { opacity: 0.55; }
.btn--gold:disabled { opacity: 0.7; cursor: progress; transform: none; }
.btn--ghost {
  border-color: rgba(247, 243, 234, 0.6);
  background: rgba(8, 18, 42, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #f7f3ea;
}
.btn--ghost:hover { border-color: #fff; background: rgba(8, 18, 42, 0.6); }
.btn--ghost .icon { width: 22px; height: 22px; }

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--night);
  color: #f7f3ea;
}

.hero__media { position: absolute; inset: 0; z-index: -3; }
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 66% 55%;
}
.js .hero__media img { animation: hero-settle 2.6s var(--ease) both; }

.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(7, 17, 40, 0.86) 0%, rgba(7, 17, 40, 0.66) 24%, rgba(7, 17, 40, 0.22) 46%, rgba(7, 17, 40, 0) 60%),
    linear-gradient(0deg, rgba(7, 17, 40, 0.9) 0%, rgba(7, 17, 40, 0.42) 15%, rgba(7, 17, 40, 0) 32%),
    linear-gradient(180deg, rgba(7, 17, 40, 0.55) 0%, rgba(7, 17, 40, 0) 20%);
}

.lattice--hero-top {
  top: 0;
  left: 0;
  z-index: -1;
  width: min(440px, 42vw);
  height: 400px;
  opacity: 0.6;
  -webkit-mask-image: radial-gradient(115% 115% at 0 0, #000 0%, rgba(0, 0, 0, 0.55) 32%, transparent 68%);
  mask-image: radial-gradient(115% 115% at 0 0, #000 0%, rgba(0, 0, 0, 0.55) 32%, transparent 68%);
}
.lattice--hero-bottom {
  bottom: 0;
  left: 0;
  z-index: -1;
  width: min(460px, 44vw);
  height: 380px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(115% 115% at 0 100%, #000 0%, rgba(0, 0, 0, 0.5) 30%, transparent 66%);
  mask-image: radial-gradient(115% 115% at 0 100%, #000 0%, rgba(0, 0, 0, 0.5) 30%, transparent 66%);
}
.hero__arc {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: -1;
  width: min(360px, 36vw);
  height: auto;
  color: var(--gold);
  opacity: 0.45;
  pointer-events: none;
}

.hero__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: calc(var(--nav-h) + 32px);
  padding-bottom: 40px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  margin: 0 0 30px;
  padding: 10px 22px 10px 18px;
  border: 1px solid rgba(247, 243, 234, 0.3);
  border-radius: 999px;
  background: rgba(8, 18, 42, 0.35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}
.badge__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(61, 220, 132, 0.16), 0 0 14px rgba(61, 220, 132, 0.75);
}

.hero__name {
  margin: 0;
  font-size: clamp(3.1rem, 6vw, 7rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.hero__name span { display: block; }
.hero__first { color: #fff; }
.hero__last {
  padding-bottom: 0.06em;
  background: linear-gradient(100deg, #f8dea3 0%, #e9b96c 42%, #d49c4e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin: 26px 0 0;
  color: rgba(247, 243, 234, 0.9);
  font-size: clamp(1.15rem, 1.75vw, 1.9rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.hero__lead em { color: var(--gold); font-style: normal; font-weight: 600; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 46px; }

.hero__bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 32px;
  padding-bottom: 26px;
}

.scroll-cue {
  justify-self: start;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 16px;
  font-size: 14px;
  font-weight: 500;
}
.scroll-cue__mouse {
  position: relative;
  width: 30px;
  height: 46px;
  border: 1.5px solid rgba(247, 243, 234, 0.75);
  border-radius: 16px;
}
.scroll-cue__mouse span {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 3px;
  height: 9px;
  border-radius: 2px;
  background: #fff;
  transform: translateX(-50%);
  animation: wheel 2s ease-in-out infinite;
}
.scroll-cue::after {
  content: "";
  grid-column: 1;
  justify-self: center;
  width: 1px;
  height: 60px;
  margin-top: 10px;
  background: linear-gradient(rgba(247, 243, 234, 0.55), rgba(247, 243, 234, 0));
}

.stats { display: flex; align-items: center; margin: 0 0 6px; padding: 0; list-style: none; }
.stat { display: flex; align-items: center; gap: 18px; padding: 4px clamp(22px, 3vw, 50px); }
.stat:first-child { padding-left: 0; }
.stat:last-child { padding-right: 0; }
.stat + .stat { border-left: 1px solid rgba(247, 243, 234, 0.28); }
.stat__icon { width: 40px; height: 40px; color: var(--gold); stroke-width: 1.7; }
.stat__value {
  margin: 0;
  color: var(--gold);
  font-size: clamp(1.45rem, 1.7vw, 1.9rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__label { margin: 6px 0 0; color: rgba(247, 243, 234, 0.92); font-size: 14px; font-weight: 500; line-height: 1.3; white-space: nowrap; }

.roots { justify-self: end; width: min(340px, 100%); color: var(--gold); }
.skyline { width: 100%; height: auto; }
.roots__label {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 0;
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.24em;
  text-align: center;
  text-transform: uppercase;
}
.roots__label::before, .roots__label::after { content: ""; flex: 1 0 18px; height: 1px; background: currentColor; opacity: 0.55; }

/* hero page-load sequence — the page's single orchestrated moment */
.js [data-intro] { opacity: 0; animation: rise 0.9s var(--ease) forwards; }
.js [data-intro="1"] { animation-delay: 0.15s; }
.js [data-intro="2"] { animation-delay: 0.25s; }
.js [data-intro="3"] { animation-delay: 0.35s; }
.js [data-intro="4"] { animation-delay: 0.5s; }
.js [data-intro="5"] { animation-delay: 0.62s; }
.js [data-intro="6"] { animation-delay: 0.8s; }
.js [data-intro="7"] { animation-delay: 0.86s; }
.js [data-intro="8"] { animation-delay: 0.94s; }
.js [data-intro="9"] { animation-delay: 1.02s; }
.js [data-intro="10"] { animation-delay: 1.1s; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes hero-settle { from { transform: scale(1.07); } to { transform: none; } }
@keyframes wheel {
  0% { opacity: 0; transform: translate(-50%, -2px); }
  30% { opacity: 1; }
  70% { opacity: 1; transform: translate(-50%, 9px); }
  100% { opacity: 0; transform: translate(-50%, 12px); }
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */
.section { position: relative; padding-block: clamp(84px, 11vw, 150px); }

.section__head { max-width: 720px; margin-bottom: clamp(40px, 5vw, 64px); }
.section__title {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 0;
  font-size: clamp(2rem, 3.3vw, 3rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}
.star { width: 0.62em; height: 0.62em; flex: none; margin-top: 0.25em; color: var(--gold); }
.section__intro { max-width: 60ch; margin: 18px 0 0; color: var(--muted); font-size: clamp(1rem, 0.3vw + 0.95rem, 1.15rem); }

/* ---------- about ---------- */
.about { overflow: hidden; }
.lattice--about {
  top: 0;
  right: 0;
  width: 520px;
  height: 520px;
  opacity: 0.22;
  -webkit-mask-image: radial-gradient(100% 100% at 100% 0, #000 0%, transparent 70%);
  mask-image: radial-gradient(100% 100% at 100% 0, #000 0%, transparent 70%);
}
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: center;
}

.arch { position: relative; width: 100%; max-width: 440px; margin: 0; justify-self: center; }
.arch__svg { width: 100%; height: auto; }
.arch__stop-top { stop-color: var(--arch-top); }
.arch__stop-bottom { stop-color: var(--arch-bottom); }
.arch__girih { fill: none; stroke: var(--gold); stroke-width: 0.6; opacity: 0.32; }
.arch__outline { fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: 0.6; }
.arch__disc { fill: var(--arch-bottom); opacity: 0.88; }
.arch__ring { fill: none; stroke: var(--gold); stroke-width: 1; opacity: 0.55; }
.arch__mono { fill: var(--gold); }
.arch__fade-start { stop-color: var(--arch-bottom); stop-opacity: 0; }
.arch__fade-end { stop-color: var(--arch-bottom); stop-opacity: 0.96; }
.arch__edge { fill: none; stroke: var(--gold); stroke-width: 1; opacity: 0.4; }
.arch__photo { image-rendering: auto; }
.arch__skyline { position: absolute; left: 16%; right: 16%; bottom: 5%; color: var(--gold); opacity: 0.7; }

.about__lead {
  max-width: 30ch;
  margin: 24px 0 18px;
  font-size: clamp(1.25rem, 1.6vw, 1.6rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
}
.about__body > p:not(.about__lead) { max-width: 62ch; margin: 0 0 14px; color: var(--muted); }

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
  margin: 34px 0 0;
  border-top: 1px solid var(--border);
}
.fact { padding: 16px 0; border-bottom: 1px solid var(--border); }
.fact dt { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 500; }
.fact dt .icon { color: var(--gold); }
.fact dd { margin: 6px 0 0; font-size: 16px; font-weight: 600; }

.about__skills-title { margin: 34px 0 14px; font-size: 15px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.chips li {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--chip-bg);
  font-size: 14px;
  font-weight: 500;
}
.about__cv { margin-top: 30px; }
.section .btn--ghost {
  border-color: var(--border-strong);
  background: transparent;
  color: var(--text);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.section .btn--ghost:hover { border-color: var(--gold); }

/* ---------- projects ---------- */
.projects { background: var(--bg-alt); }
.projects__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 2.2vw, 30px); }

.projects__grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.project {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface);
  transition: border-color 0.3s;
}
.project:hover { border-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.project--wide { grid-column: 1 / -1; flex-direction: row; }

.project__api {
  position: relative;
  padding: 20px 26px 28px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(227, 180, 103, 0.1), transparent 55%),
    var(--code-bg);
  color: #c9d2e6;
  font-family: var(--mono);
  font-size: 14px;
}
.project--wide .project__api { flex: 1.1; display: flex; flex-direction: column; justify-content: center; padding: 34px 40px 40px; font-size: 15px; }
.project:not(.project--wide) .project__api { min-height: 198px; }
.project__api-bar { display: flex; align-items: center; gap: 7px; margin-bottom: 20px; }
.project__api-bar span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.project__api-icon { margin-left: auto; color: var(--gold); }
.project__api ul { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.project__api li { display: flex; align-items: baseline; gap: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.m { min-width: 56px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.m--get { color: #67cbe2; }
.m--post { color: #ebbd70; }
.m--put, .m--patch { color: #b9a4e6; }
.m--delete { color: #f2907f; }
.m--ok { min-width: 18px; color: #7fe3a9; }
.path { overflow: hidden; color: #e3e8f4; text-overflow: ellipsis; }

.project__body { display: flex; flex: 1; flex-direction: column; padding: 28px 30px 32px; }
.project--wide .project__body { justify-content: center; padding: clamp(30px, 4vw, 56px); }
.project__cat { margin: 0; color: var(--accent); font-size: 13px; font-weight: 600; }
.project__title { margin: 8px 0 10px; font-size: clamp(1.25rem, 1.5vw, 1.55rem); font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
.project--wide .project__title { font-size: clamp(1.45rem, 2.1vw, 2rem); }
.project__text { margin: 0; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.tags li {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--chip-bg);
  font-size: 12.5px;
  font-weight: 600;
}
.project__links { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 24px; }
.project__links a { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 14px; font-weight: 600; }
.project__links a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- services ---------- */
.services__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}
.service {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 36px 32px 40px 0;
  border-bottom: 1px solid var(--border);
}
.service:not(:nth-child(3n + 1)) { padding-left: 32px; border-left: 1px solid var(--border); }
.service__icon { position: relative; display: grid; place-items: center; width: 58px; height: 58px; color: var(--gold); }
.service__icon::before,
.service__icon::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  border-radius: 6px;
}
.service__icon::after { transform: rotate(45deg); }
.service__icon .icon { position: relative; width: 22px; height: 22px; }
.service__title { margin: 0 0 8px; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.service__text { margin: 0; color: var(--muted); }

/* ---------- experience ---------- */
.experience { background: var(--bg-alt); }
.experience__grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.experience .section__head { position: sticky; top: 120px; margin: 0; }

.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 7px;
  width: 1px;
  background: linear-gradient(var(--gold), var(--border) 70%);
}
.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  padding: 0 0 52px 52px;
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 0;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--gold);
  border-radius: 3px;
  background: var(--bg-alt);
  transform: rotate(45deg);
}
.timeline__item.is-current::before {
  background: var(--gold);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 18%, transparent);
}
.timeline__period { margin: 0; color: var(--accent); font-size: 15px; font-weight: 600; white-space: nowrap; }
.timeline__role { margin: 0; font-size: 1.3rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.timeline__place { margin: 4px 0 10px; color: var(--muted); font-size: 15px; font-weight: 500; }
.timeline__text { max-width: 58ch; margin: 0; color: var(--muted); }

/* ---------- contact ---------- */
.contact__panel {
  --text: #f4efe6;
  --muted: #a9b2c7;
  --border: rgba(226, 232, 245, 0.14);
  --accent: #e3b467;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 5vw, 80px);
  overflow: hidden;
  padding: clamp(26px, 5vw, 72px);
  border: 1px solid rgba(227, 180, 103, 0.26);
  border-radius: 36px;
  background: radial-gradient(120% 120% at 0% 0%, #19316a 0%, #0b1736 62%);
  color: var(--text);
}
.lattice--contact {
  top: 0;
  right: 0;
  width: 420px;
  height: 420px;
  opacity: 0.2;
  -webkit-mask-image: radial-gradient(100% 100% at 100% 0, #000, transparent 70%);
  mask-image: radial-gradient(100% 100% at 100% 0, #000, transparent 70%);
}
.contact__info, .form { position: relative; }

.contact__list { display: grid; gap: 12px; margin: 34px 0 0; padding: 0; list-style: none; }
.contact__list a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.2s, background-color 0.2s;
}
.contact__list a:hover { border-color: rgba(227, 180, 103, 0.55); background: rgba(255, 255, 255, 0.03); }
.contact__list .icon { width: 22px; height: 22px; color: var(--gold); }
.contact__list span { display: flex; flex-direction: column; min-width: 0; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.contact__list small { color: var(--muted); font-size: 12.5px; font-weight: 500; }

.socials { display: flex; gap: 12px; margin-top: 24px; }
.socials a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  transition: border-color 0.2s, color 0.2s;
}
.socials a:hover { border-color: var(--gold); color: var(--gold); }

.form {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: clamp(22px, 3vw, 36px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
}
.field label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.field input,
.field textarea {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(4, 11, 28, 0.45);
  color: var(--text);
  font: 500 16px/1.5 var(--font);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(227, 180, 103, 0.16); }
.field [aria-invalid="true"] { border-color: #f2907f; }
.form__submit { justify-self: start; }
.form__status { min-height: 1.5em; margin: 0; font-size: 15px; font-weight: 500; }
.form__status.is-ok { color: #7fe3a9; }
.form__status.is-err { color: #f5a596; }
.form__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer ---------- */
.footer { padding: 72px 0 36px; border-top: 1px solid var(--border); }
.footer__roots { width: min(420px, 80%); margin: 0 auto 48px; color: var(--gold); opacity: 0.55; }
.footer__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; }
.brand--footer { --nav-fg: var(--text); }
.footer__nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer__nav a { color: var(--muted); font-size: 15px; font-weight: 500; transition: color 0.2s; }
.footer__nav a:hover { color: var(--text); }
.footer__top { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 14px; font-weight: 600; }
.footer__copy { margin: 36px 0 0; padding-top: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- 404 ---------- */
.notfound {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 20px) var(--gutter) 60px;
  text-align: center;
}
.notfound__code {
  margin: 0;
  background: linear-gradient(100deg, #f8dea3, #d49c4e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(5rem, 16vw, 10rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}
.notfound h1 { margin: 12px 0 10px; font-size: clamp(1.6rem, 3vw, 2.4rem); }
.notfound p { margin: 0 0 32px; color: var(--muted); }
.notfound .skyline { width: 260px; margin: 0 auto 32px; color: var(--gold); opacity: 0.7; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1360px) {
  .roots { display: none; }
  .hero__bottom { grid-template-columns: auto minmax(0, 1fr); }
  .stats { justify-self: center; }
}

@media (max-width: 1100px) {
  :root { --nav-h: 84px; }
  .projects__grid, .projects__grid--two { grid-template-columns: 1fr; }
  .project { flex-direction: row; }
  .project .project__api { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
  .project .project__body { flex: 1.25; justify-content: center; }
  .nav__burger { display: inline-flex; }
  .nav__links {
    position: absolute;
    top: calc(100% + 6px);
    left: 12px;
    right: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface-solid);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .nav.is-menu-open .nav__links { opacity: 1; visibility: visible; transform: none; }
  .nav__links .nav__link { padding: 14px 18px; border-radius: 12px; color: var(--text); font-size: 16px; }
  .nav__links .nav__link.is-active { border-color: var(--border); background: var(--chip-bg); color: var(--text); }
  .nav__links .nav__link.is-active::after { left: 18px; bottom: 8px; width: 26px; transform: none; }
}

@media (max-width: 960px) {
  .about__grid, .experience__grid { grid-template-columns: 1fr; }
  .arch { max-width: 340px; }
  .experience .section__head { position: static; }
  .services__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service:not(:nth-child(3n + 1)) { padding-left: 0; border-left: 0; }
  .service:nth-child(even) { padding-left: 28px; border-left: 1px solid var(--border); }
  .contact__panel { grid-template-columns: 1fr; }
  .scroll-cue { display: none; }
  .hero__bottom { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .brand__name { font-size: 15px; }
  .brand__mark { width: 46px; height: 26px; }
  .brand { gap: 14px; }
  .brand__divider { height: 34px; }
  .lang__btn { padding: 0 14px 0 16px; }
  .nav__actions { gap: 8px; }
  .theme-toggle { width: 42px; height: 42px; }
  .theme-toggle .icon { width: 24px; height: 24px; }

  .hero { min-height: 0; }
  .hero__content { flex: none; order: 1; padding-top: calc(var(--nav-h) + 24px); padding-bottom: 0; }
  .hero__media {
    position: relative;
    inset: auto;
    order: 2;
    height: clamp(300px, 92vw, 460px);
    margin-top: -24px;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 26%, #000 72%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 26%, #000 72%, transparent 100%);
  }
  .hero__media img { object-position: 98% 62%; }
  .hero__shade { display: none; }
  .hero__arc { display: none; }
  .lattice--hero-top { width: 70vw; height: 320px; opacity: 0.45; }
  .lattice--hero-bottom { display: none; }
  .hero__bottom { order: 3; margin-top: -48px; padding-bottom: 40px; }
  .badge { margin-bottom: 22px; font-size: 14px; }
  .hero__name { font-size: clamp(2.4rem, 12.6vw, 3.6rem); }
  .hero__lead { margin-top: 18px; }
  .hero__actions { gap: 12px; margin-top: 30px; }
  .hero__actions .btn { flex: 1 1 auto; height: 56px; padding: 0 22px; font-size: 16px; }

  .stats { justify-self: stretch; justify-content: space-between; }
  .stat { flex: 1; flex-direction: column; align-items: flex-start; gap: 10px; padding: 0 14px; }
  .stat__icon { width: 28px; height: 28px; }
  .stat__label { font-size: 12px; white-space: normal; }

  .project, .project--wide { flex-direction: column; }
  .project--wide .project__api { padding: 20px 26px 28px; font-size: 14px; }
  .project--wide .project__body { padding: 28px 26px 30px; }
  .services__list { grid-template-columns: 1fr; }
  .service, .service:nth-child(even) { padding: 28px 0 30px; border-left: 0; flex-direction: row; gap: 18px; }
  .service__icon { width: 50px; height: 50px; }

  .timeline__item { grid-template-columns: 1fr; gap: 6px; padding-left: 40px; }
  .facts { grid-template-columns: 1fr; }
  .contact__panel { border-radius: 26px; }
  .form__submit { justify-self: stretch; }
  .footer__row { flex-direction: column; text-align: center; }
  .footer__nav { justify-content: center; }
}

@media (max-width: 400px) {
  .nav__inner { gap: 8px; }
  .brand { gap: 10px; }
  .brand__divider { display: none; }
  .brand__name { font-size: 13.5px; }
  .lang__btn { gap: 6px; padding: 0 12px 0 14px; }
}
@media (max-width: 340px) {
  .brand__name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  .js [data-intro] { opacity: 1; }
}
