/* =========================================================
   Максим Пермяков — portfolio
   Dark, minimal, terminal-green
   ========================================================= */

:root {
  --bg: #070a09;
  --bg-soft: #090d0b;
  --surface: #0d1310;
  --surface-2: #111a15;
  --border: rgba(232, 240, 236, 0.08);
  --border-strong: rgba(232, 240, 236, 0.14);
  --text: #e8f0ec;
  --text-soft: #c3d0ca;
  --muted: #8b9c95;
  --muted-2: #788a82;
  --accent: #00e08a;
  --accent-dim: #0bbd78;
  --accent-soft: rgba(0, 224, 138, 0.08);
  --accent-line: rgba(0, 224, 138, 0.28);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 14px;
  --container: 1140px;
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  color-scheme: dark;
}

body {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -5;
  background:
    radial-gradient(ellipse 70% 45% at 50% -10%, rgba(0, 224, 138, 0.07), transparent 70%),
    linear-gradient(180deg, #070a09 0%, #080c0a 55%, #060908 100%);
  pointer-events: none;
}

::selection {
  background: var(--accent);
  color: #04140c;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

img,
svg {
  display: block;
}

svg {
  width: 100%;
  height: 100%;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: break-word;
}

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #070a09;
}

::-webkit-scrollbar-thumb {
  background: #1c2a24;
  border: 2px solid #070a09;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2b3f36;
}

/* ---------- background ---------- */

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(232, 240, 236, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 240, 236, 0.028) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 15%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 15%, transparent 100%);
}

.bg-glow {
  position: fixed;
  z-index: -3;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(130px);
  pointer-events: none;
  opacity: 0.5;
}

.bg-glow--one {
  top: -180px;
  left: -140px;
  background: rgba(0, 224, 138, 0.14);
}

.bg-glow--two {
  top: 38%;
  right: -260px;
  background: rgba(0, 160, 255, 0.05);
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #04140c;
  font-family: var(--mono);
  font-size: 12px;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus-visible {
  transform: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

.mono {
  font-family: var(--mono);
}

.accent {
  color: var(--accent);
}

.status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 224, 138, 0.1);
  animation: pulse 2.6s ease-in-out infinite;
}

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease;
}

.site-header.is-scrolled {
  background: rgba(7, 10, 9, 0.82);
  border-bottom-color: var(--border);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent-line);
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.brand:hover .brand-mark {
  background: rgba(0, 224, 138, 0.14);
  box-shadow: 0 0 24px rgba(0, 224, 138, 0.14);
}

.brand-text {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.01em;
  transition: color 0.25s ease;
}

.brand:hover .brand-text {
  color: var(--text-soft);
}

.brand-cursor {
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav > a:not(.nav-cta) {
  position: relative;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav > a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.nav > a:not(.nav-cta):hover,
.nav > a:not(.nav-cta).is-active {
  color: var(--text);
}

.nav > a:not(.nav-cta):hover::after,
.nav > a:not(.nav-cta).is-active::after {
  transform: scaleX(1);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-cta svg {
  width: 13px;
  height: 13px;
  transition: transform 0.2s ease;
}

.nav-cta:hover {
  background: var(--accent-soft);
  border-color: rgba(0, 224, 138, 0.5);
}

.nav-cta:hover svg {
  transform: translateX(2px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.lang-switch {
  display: flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
}

.lang-switch button {
  padding: 4px 8px;
  border-radius: 5px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: color 0.2s ease, background 0.2s ease;
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button.is-active {
  background: var(--accent);
  color: #04140c;
}

.menu-toggle {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-soft);
}

.menu-toggle svg {
  width: 18px;
  height: 18px;
}

.menu-toggle .close-icon {
  display: none;
}

.menu-toggle[aria-expanded="true"] .menu-icon {
  display: none;
}

.menu-toggle[aria-expanded="true"] .close-icon {
  display: block;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding-top: calc(var(--header-h) + 16px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  align-items: center;
  gap: 64px;
  flex: 1;
  padding-top: 48px;
  padding-bottom: 32px;
}

.hero-copy {
  animation: fadeUp 0.8s var(--ease) both;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 26px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-greeting {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-greeting .mono {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.hero-name {
  margin-bottom: 24px;
  color: var(--text);
  font-size: clamp(52px, 7.6vw, 88px);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.hero-dot {
  color: var(--accent);
}

.hero-role {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 500;
}

.hero-role .mono {
  color: var(--muted-2);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-role-divider {
  color: var(--muted-2);
  font-weight: 400;
}

.hero-bio {
  max-width: 55ch;
  margin: 22px 0 32px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.22s var(--ease), box-shadow 0.22s ease;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--accent);
  color: #04140c;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 30px rgba(0, 224, 138, 0.12);
}

.btn-primary:hover {
  background: #22f29d;
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 14px 40px rgba(0, 224, 138, 0.22);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.015);
  color: var(--text-soft);
}

.btn-ghost:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
  transform: translateY(-2px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 46px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.hero-meta dt {
  margin-bottom: 6px;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-meta dd {
  color: var(--muted);
  font-size: 12.5px;
}

.hero-meta dd.mono {
  color: var(--text-soft);
  font-size: 11.5px;
}

.hero-code {
  position: relative;
  animation: fadeUp 0.9s 0.15s var(--ease) both;
}

.hero-code::before {
  content: "";
  position: absolute;
  inset: 12% -6% -10% 6%;
  z-index: -1;
  border-radius: 50%;
  background: rgba(0, 224, 138, 0.1);
  filter: blur(80px);
  pointer-events: none;
}

.code-window {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: #0a0f0d;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: #0c1210;
}

.code-dots {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}

.code-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #28362f;
}

.code-dots i:first-child {
  background: #2f4a3e;
}

.code-path {
  flex: 1;
  color: var(--muted-2);
  font-size: 10.5px;
  text-align: center;
}

.code-badge {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.code {
  counter-reset: line;
  margin: 0;
  padding: 22px 20px;
  overflow-x: auto;
  color: #c7d6cf;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.9;
  tab-size: 2;
}

.code code {
  font: inherit;
}

.code-line {
  position: relative;
  display: block;
  padding-left: 2.3em;
  white-space: pre;
}

.code-line::before {
  counter-increment: line;
  content: counter(line);
  position: absolute;
  left: 0;
  width: 1.45em;
  color: #33443c;
  font-size: 10.5px;
  text-align: right;
  -webkit-user-select: none;
  user-select: none;
}

.tok-key {
  color: #7cf5c4;
}

.tok-var {
  color: #d7e8e0;
}

.tok-str {
  color: #b5dfa2;
}

.tok-bool,
.tok-num {
  color: #ffc27a;
}

.tok-com {
  color: #4e6259;
  font-style: italic;
}

.tok-fn {
  color: #7cd4ff;
}

.tok-dir {
  color: #8ff0c5;
}

.cursor {
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}

.code-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-top: 1px solid var(--border);
  background: #0c1210;
  color: var(--muted);
  font-size: 10px;
}

.code-status .status-dot {
  width: 5px;
  height: 5px;
  flex-basis: 5px;
  animation: none;
}

.code-status-right {
  margin-left: auto;
  color: var(--muted-2);
}

.hero-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 28px;
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-scroll-line {
  width: 70px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-line), transparent);
}

/* ---------- stats ---------- */

.stats {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.012);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  padding: 30px 26px;
  border-left: 1px solid var(--border);
}

.stat:first-child {
  border-left: 0;
  padding-left: 0;
}

.stat-num {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  transition: color 0.25s ease;
}

.stat:hover .stat-num {
  color: var(--accent);
}

.stat-label {
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.4;
}

/* ---------- sections ---------- */

.section {
  position: relative;
  padding: 108px 0;
}

.section-head {
  margin-bottom: 52px;
}

.section-num {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 10.5px;
  letter-spacing: 0.12em;
}

.section-num::before {
  content: "// ";
  color: var(--muted-2);
}

.section-title {
  margin-bottom: 0;
  color: var(--text);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.section-lead {
  max-width: 62ch;
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

/* ---------- about ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 64px;
  align-items: start;
}

.about-text > p {
  max-width: 65ch;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.8;
}

.about-text > p:first-child {
  color: var(--text-soft);
}

.facts {
  margin-top: 38px;
  border-top: 1px solid var(--border);
}

.facts li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 16px;
  padding: 21px 0;
  border-bottom: 1px solid var(--border);
}

.fact-num {
  padding-top: 3px;
  color: var(--accent-dim);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.facts h3 {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.facts p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.fact-note {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.now-card {
  align-self: start;
  padding: 26px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(0, 224, 138, 0.045), transparent 55%),
    var(--surface);
}

.now-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.now-head h3 {
  color: var(--text);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.now-pulse {
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 224, 138, 0.08);
  animation: pulse 2.6s ease-in-out infinite;
}

.now-list li {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.now-list li .mono {
  flex: 0 0 auto;
  padding-top: 1px;
  color: var(--accent-dim);
  font-size: 9.5px;
}

.now-quote {
  margin-top: 20px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.now-quote::before {
  content: "// ";
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
}

/* ---------- featured ---------- */

.featured {
  position: relative;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 52px;
  padding: 44px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background:
    radial-gradient(ellipse 70% 90% at 100% 0%, rgba(0, 224, 138, 0.07), transparent 65%),
    linear-gradient(180deg, #0e1612, #0a100d);
}

.featured::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}

.featured-copy {
  min-width: 0;
}

.featured-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge .status-dot {
  width: 5px;
  height: 5px;
  flex-basis: 5px;
  animation: none;
}

.featured-domain {
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.featured-name {
  margin-bottom: 4px;
  color: var(--text);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.featured-subtitle {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.featured-desc {
  max-width: 56ch;
  margin-bottom: 24px;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.75;
}

.feature-list {
  margin-bottom: 4px;
}

.feature-list li {
  display: flex;
  gap: 10px;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.feature-list svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-top: 3px;
  color: var(--accent);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 24px 0 28px;
}

.tech-tags span {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.01em;
}

.featured-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.featured-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.code-window--tree {
  border-color: var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.code-tree {
  padding: 20px 16px;
  font-size: 11.5px;
  line-height: 2.15;
}

.featured-note {
  display: flex;
  gap: 9px;
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.6;
}

.featured-note .accent {
  flex: 0 0 auto;
}

/* ---------- projects ---------- */

.section-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 38px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-bottom: 4px;
}

.filter {
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.filter:hover {
  border-color: var(--border-strong);
  color: var(--text-soft);
}

.filter.is-active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.3s var(--ease), border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-2);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card.is-hidden {
  display: none;
}

.project-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.project-index {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.project-type {
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-name {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.project-path {
  margin-bottom: 15px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.01em;
}

.project-desc {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.project-points {
  margin-bottom: 20px;
}

.project-points li {
  position: relative;
  margin-bottom: 6px;
  padding-left: 16px;
  color: #a7b8b0;
  font-size: 12px;
  line-height: 1.6;
}

.project-points li::before {
  content: "▸";
  position: absolute;
  top: 1px;
  left: 0;
  color: var(--accent-dim);
  font-size: 10px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  margin-bottom: 20px;
}

.project-tech span {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
}

.project-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11px;
  transition: color 0.2s ease;
}

.project-link svg {
  width: 14px;
  height: 14px;
  color: var(--muted-2);
  transition: color 0.2s ease;
}

.project-link:hover,
.project-link:hover svg {
  color: var(--accent);
}

.project-arrow {
  width: 16px;
  height: 16px;
  color: var(--muted-2);
  transition: transform 0.25s var(--ease), color 0.25s ease;
}

.project-card:hover .project-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* ---------- more repos ---------- */

.more-repos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.more-title {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.more-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.more-list a {
  color: var(--muted);
  font-size: 12.5px;
  transition: color 0.2s ease;
}

.more-list a:hover {
  color: var(--text);
}

.more-list .mono {
  margin-left: 6px;
  color: var(--muted-2);
  font-size: 9.5px;
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--accent);
  font-size: 11px;
  transition: gap 0.2s ease;
}

.more-link svg {
  width: 14px;
  height: 14px;
}

.more-link:hover {
  gap: 11px;
}

/* ---------- stack ---------- */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stack-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.012);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.stack-card:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.stack-head {
  display: flex;
  align-items: baseline;
  gap: 11px;
}

.stack-num {
  color: var(--accent-dim);
  font-size: 9.5px;
}

.stack-head h3 {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.stack-card > p {
  margin: 7px 0 17px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.5;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list li {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.stack-card:hover .tag-list li {
  border-color: rgba(232, 240, 236, 0.1);
  color: var(--text-soft);
}

/* ---------- contact ---------- */

.section--contact {
  padding-bottom: 96px;
}

.contact-panel {
  position: relative;
  padding: 58px 56px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  background:
    radial-gradient(ellipse 55% 70% at 50% 0%, rgba(0, 224, 138, 0.09), transparent 70%),
    linear-gradient(180deg, #0d1411, #090d0b);
  text-align: center;
}

.contact-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}

.contact-panel .section-num {
  margin-bottom: 16px;
}

.contact-title {
  max-width: 24ch;
  margin: 0 auto;
  color: var(--text);
  font-size: clamp(32px, 4.8vw, 52px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.contact-lead {
  max-width: 54ch;
  margin: 18px auto 28px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 42px;
  text-align: left;
}

.contact-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 6px 12px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s var(--ease);
}

.contact-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  background: rgba(0, 224, 138, 0.04);
}

.contact-icon {
  grid-row: span 2;
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.contact-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-card-body strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.contact-card-body em {
  color: var(--muted-2);
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
}

.contact-handle {
  grid-column: 1 / -1;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 9.5px;
}

.contact-note {
  margin-top: 32px;
  color: var(--muted-2);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 26px;
  padding-bottom: 26px;
  color: var(--muted-2);
  font-size: 11.5px;
}

.footer-built {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 9.5px;
}

.footer-top {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  transition: color 0.2s ease;
}

.footer-top svg {
  width: 13px;
  height: 13px;
}

.footer-top:hover {
  color: var(--accent);
}

/* ---------- animation ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s ease, transform 0.75s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 4px rgba(0, 224, 138, 0.1);
  }
  50% {
    opacity: 0.65;
    box-shadow: 0 0 0 7px rgba(0, 224, 138, 0.03);
  }
}

/* ---------- responsive ---------- */

@media (max-width: 1020px) {
  .hero-grid {
    gap: 40px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .now-card {
    max-width: 560px;
  }

  .featured {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 34px;
  }

  .featured-visual {
    max-width: 620px;
  }

  .stack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .menu-toggle {
    display: grid;
  }

  .header-inner {
    position: relative;
  }

  .nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 28px 22px;
    border-bottom: 1px solid var(--border);
    background: rgba(7, 10, 9, 0.98);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s var(--ease), visibility 0.25s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav > a:not(.nav-cta) {
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
  }

  .nav > a:not(.nav-cta)::after {
    display: none;
  }

  .nav-cta {
    justify-content: center;
    margin-top: 16px;
    padding: 12px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
    padding-top: 32px;
    padding-bottom: 20px;
  }

  .hero-copy {
    max-width: 680px;
  }

  .hero-code {
    width: 100%;
    max-width: 620px;
  }

  .hero-foot {
    display: none;
  }

  .hero {
    min-height: 0;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat {
    padding: 24px 22px;
  }

  .stat:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }

  .stat:nth-child(n + 3) {
    border-top: 1px solid var(--border);
  }

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

  .section-head--row {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
  }

  .contact-cards {
    grid-template-columns: 1fr;
  }

  .contact-panel {
    text-align: left;
    padding: 40px 32px;
  }

  .contact-title,
  .contact-lead {
    margin-left: 0;
  }

  .contact-actions {
    justify-content: flex-start;
  }

  .contact-note {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 20px;
  }

  .brand-text {
    display: none;
  }

  .section {
    padding: 72px 0;
  }

  .section-head {
    margin-bottom: 34px;
  }

  .hero-name {
    font-size: clamp(46px, 13vw, 64px);
  }

  .hero-bio {
    font-size: 14.5px;
  }

  .hero-meta {
    gap: 24px 32px;
    margin-top: 36px;
  }

  .hero-meta > div {
    min-width: 92px;
  }

  .code {
    padding: 18px 14px;
    font-size: 11px;
  }

  .code-line {
    padding-left: 2.1em;
  }

  .featured {
    padding: 24px 20px;
    border-radius: 14px;
  }

  .featured-name {
    font-size: 32px;
  }

  .code-tree {
    font-size: 10px;
    line-height: 2;
    padding: 16px 12px;
  }

  .featured-domain {
    display: none;
  }

  .project-card {
    padding: 22px 20px;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }

  .more-repos {
    flex-direction: column;
    align-items: flex-start;
  }

  .more-list {
    flex-direction: column;
    gap: 12px;
  }

  .more-link {
    margin-left: 0;
  }

  .contact-panel {
    padding: 34px 22px;
    border-radius: 16px;
  }

  .contact-title {
    max-width: none;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .footer-top {
    order: -1;
    align-self: flex-end;
  }
}

@media (max-width: 400px) {
  .hero-actions .btn,
  .contact-actions .btn {
    width: 100%;
  }

  .stat-num {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
