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

:root {
  --bg:         #F9F8F5;
  --bg-alt:     #F3F2EE;
  --surface:    #FFFFFF;
  --text:       #0E0E0C;
  --text-2:     #3B3A35;   /* body copy — 10.7:1 on --bg */
  --muted:      #6B6A63;   /* meta text — 5.1:1 on --bg, passes WCAG AA */
  --faint:      #C5C4BC;   /* decoration only — too light for text */
  --border:     #E2E0D8;
  --accent:     #0055FF;
  --accent-t:   rgba(0, 85, 255, 0.07);
  --accent-s:   rgba(0, 85, 255, 0.12);
  --live:       #22A55B;
  --danger:     #C0392B;
  --danger-t:   rgba(192, 57, 43, 0.08);
  --sans:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:       'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --display:    'Space Grotesk', 'Inter', sans-serif;
  --page-w:     1240px;   /* desktop two-column layout */
  --read-w:     68ch;     /* comfortable paragraph line length */
  --gutter:     1.25rem;  /* side padding; grows from 720px */
  --tabbar-h:   64px;
  --radius-sm:  6px;
  --radius:     14px;
  --radius-lg:  22px;
  --radius-full:9999px;
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.04), 0 4px 14px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 8px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.09);
}

@media (min-width: 720px) {
  :root { --gutter: 2.5rem; }
}

html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* keep keyboard-focused elements clear of the tab bar */
@media (max-width: 1023px) {
  html { scroll-padding-bottom: calc(var(--tabbar-h) + 1.5rem); }
}

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

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

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 2px; }

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 400;
  background: var(--text);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-decoration: none;
}

.skip-link:focus { top: 1rem; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 300;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ============================================================
   BACKDROP — dot grid + soft glow, fixed behind everything
   ============================================================ */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.backdrop::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--faint) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 0% 0%, #000 20%, transparent 70%);
          mask-image: radial-gradient(ellipse 80% 70% at 0% 0%, #000 20%, transparent 70%);
}

.backdrop::after {
  content: '';
  position: absolute;
  top: -20%;
  left: -15%;
  width: min(760px, 110vw);
  height: min(760px, 110vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,85,255,0.09) 0%, transparent 65%);
  filter: blur(60px);
}

/* ============================================================
   LAYOUT
   phones:   one column, tab bar at the bottom
   ≥720px:   wider gutters, two-up card grids
   ≥1024px:  intro pinned in a left column, content scrolls on the right
   ============================================================ */
.layout {
  max-width: calc(720px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 1024px) {
  .layout {
    max-width: var(--page-w);
    display: grid;
    grid-template-columns: clamp(300px, 30vw, 420px) minmax(0, 1fr);
    column-gap: clamp(3rem, 5vw, 5rem);
  }
}

/* ============================================================
   INTRO — hero on phones, sticky sidebar on desktop
   ============================================================ */
.intro {
  padding: calc(3.25rem + env(safe-area-inset-top)) 0 1.5rem;
}

@media (min-width: 720px) {
  .intro { padding-top: 6rem; }
}

@media (min-width: 1024px) {
  .intro {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 5.5rem 4px 2.5rem;
    margin: 0 -4px;          /* room for focus rings inside the scroll box */
    overflow-y: auto;        /* short laptop screens */
    scrollbar-width: none;
  }

  .intro::-webkit-scrollbar { display: none; }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.85rem 0.35rem 0.7rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--live);
  animation: status-pulse 2.4s ease-out infinite;
}

@keyframes status-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 165, 91, 0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(34, 165, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 165, 91, 0); }
}

.hero-name {
  font-family: var(--display);
  /* "Ziyamukhamedov" renders ~7.9em wide — these sizes keep it on one line */
  font-size: clamp(2rem, 10.8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.93;
  color: var(--text);
}

@media (min-width: 1024px) {
  .hero-name { font-size: clamp(2.25rem, 3.4vw, 3.25rem); }
}

.hero-rule {
  width: 100%;
  height: 2px;
  background: var(--text);
  margin: 1.4rem 0 1rem;
}

.hero-role-wrap {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-2);
  min-height: 1.75rem;
}

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

@keyframes blink { 50% { opacity: 0; } }

/* --- side nav (desktop only) --- */
.side-nav { display: none; }

@media (min-width: 1024px) {
  .side-nav {
    display: block;
    margin: 2.75rem 0 2rem;
  }

  .side-nav ol {
    list-style: none;
    display: flex;
    flex-direction: column;
  }

  .side-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.5rem 0;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
  }

  .side-line {
    width: 1.75rem;
    height: 1px;
    background: currentColor;
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .side-nav a:hover,
  .side-nav a.active { color: var(--text); }

  .side-nav a:hover .side-line,
  .side-nav a.active .side-line { width: 3.75rem; }

  .side-nav a.active .side-num { color: var(--accent); }
}

/* short laptop screens — tighten the sidebar so it fits without scrolling */
@media (min-width: 1024px) and (max-height: 760px) {
  .intro { padding-top: 3.5rem; padding-bottom: 1.75rem; }
  .section-about { padding-top: 3.5rem; }
  .side-nav { margin: 1.75rem 0 1.25rem; }
  .side-nav a { padding: 0.35rem 0; }
}

/* --- buttons + socials --- */
.intro-foot { margin-top: 1.75rem; }

@media (min-width: 1024px) {
  .intro-foot { margin-top: auto; }
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0 1.5rem;
  border-radius: var(--radius-full);
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.btn-primary:hover {
  background: #2a2a28;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  color: var(--text-2);
  background: var(--surface);
  text-decoration: none;
  font-size: 0.8rem;
  font-family: var(--mono);
  border: 1px solid var(--border);
  padding: 0 1.3rem;
  border-radius: var(--radius-full);
  transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text);
}

/* phones: two equal, thumb-sized buttons */
@media (max-width: 719px) {
  .hero-links > a { flex: 1 1 0; min-height: 48px; }
}

.hero-social {
  display: flex;
  gap: 1.75rem;
  margin-top: 0.5rem;
}

.social-link {
  display: inline-block;
  padding: 0.7rem 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color 0.15s;
}

.social-link:hover { color: var(--accent); }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: 3rem 0;
  scroll-margin-top: 0.5rem;
}

.section + .section { border-top: 1px solid var(--border); }

@media (min-width: 720px) {
  .section { padding: 4.5rem 0; }
}

@media (min-width: 1024px) {
  .section { padding: 5.5rem 0; }
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.section-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.14em;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* ============================================================
   ABOUT + STATS
   ============================================================ */
.section-about { padding-top: 0.75rem; }

@media (min-width: 1024px) {
  .section-about { padding-top: 5.5rem; }
}

.about-bio {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-2);
  max-width: var(--read-w);
}

@media (min-width: 720px) {
  .about-bio { font-size: 1.15rem; }
}

.about-bio strong {
  color: var(--text);
  font-weight: 600;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
}

@media (min-width: 720px) {
  .hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.stat-num {
  display: block;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================================
   TAG CHIP + BADGE
   ============================================================ */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--text-2);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tag:hover {
  background: var(--accent-t);
  border-color: rgba(0,85,255,0.2);
  color: var(--accent);
}

.badge-current {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-t);
  border: 1px solid rgba(0, 85, 255, 0.22);
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* bolded figures inside descriptions — anchors for scanning */
.metric {
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(transparent 62%, var(--accent-s) 62%);
  padding: 0 0.08em;
  -webkit-box-decoration-break: clone;
          box-decoration-break: clone;
}

/* ============================================================
   EXPERIENCE — timeline of cards
   ============================================================ */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.exp-entry { position: relative; }

.exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.exp-entry.is-current .exp-card {
  box-shadow: inset 3px 0 0 var(--accent), var(--shadow-sm);
}

/* phones: no rail — cards get the full width */
.exp-dot, .exp-entry::before { display: none; }

@media (min-width: 720px) {
  .exp-entry {
    --dot-top: 2rem;
    padding-left: 2rem;
  }

  .exp-card { padding: 1.6rem 1.75rem; }

  .exp-dot {
    display: block;
    position: absolute;
    left: 0;
    top: var(--dot-top);
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--faint);
  }

  /* rail: from this dot down to the next one */
  .exp-entry:not(:last-child)::before {
    content: '';
    display: block;
    position: absolute;
    left: 5px;
    top: calc(var(--dot-top) + 11px);
    bottom: calc(-1rem - var(--dot-top));
    width: 1px;
    background: var(--border);
  }

  .exp-entry.is-current .exp-card { box-shadow: var(--shadow-sm); }

  .exp-entry.is-current .exp-dot {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-s);
  }
}

.exp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.2rem 1rem;
}

.exp-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.exp-company {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text);
}

.exp-date {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* phones: dates sit above the company as an eyebrow */
@media (max-width: 719px) {
  .exp-head .exp-date { order: -1; width: 100%; }
}

.exp-role {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  margin-top: 0.1rem;
}

.exp-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-2);
  margin-top: 0.75rem;
  max-width: var(--read-w);
}

.exp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.9rem;
  max-width: var(--read-w);
}

.exp-list li {
  position: relative;
  padding-left: 1.1rem;
  font-size: 0.925rem;
  line-height: 1.65;
  color: var(--text-2);
}

.exp-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.8em;
  width: 6px;
  height: 1.5px;
  border-radius: 1px;
  background: var(--accent);
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 1rem;
}

/* phones: highlights fold away behind a toggle */
.exp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  margin-top: 0.75rem;
  padding: 0 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-t);
  border: 1px solid rgba(0, 85, 255, 0.18);
  border-radius: var(--radius-full);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.exp-toggle::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.25s;
}

.exp-entry.is-open .exp-toggle::after { transform: translateY(1px) rotate(-135deg); }

@media (max-width: 719px) {
  .exp-entry:not(.is-open) .exp-details { display: none; }
}

@media (min-width: 720px) {
  .exp-toggle { display: none; }
}

/* ============================================================
   PROJECTS — swipeable row on phones, bento grid from 720px
   ============================================================ */
.project-grid {
  display: grid;
  gap: 0.85rem;
}

@media (max-width: 719px) {
  .project-grid {
    grid-auto-flow: column;
    grid-auto-columns: 84%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    margin-inline: calc(-1 * var(--gutter));
    padding: 0.25rem var(--gutter) 1rem;
    scrollbar-width: none;
  }

  .project-grid::-webkit-scrollbar { display: none; }

  .proj-card { scroll-snap-align: start; }

  /* cards come into view by swiping, not by the scroll-in fade */
  .project-grid .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}

@media (min-width: 720px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* newest project gets the full width */
  .proj-card:first-child { grid-column: 1 / -1; }
  .proj-card:first-child .proj-title { font-size: 1.3rem; }
}

.carousel-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

@media (min-width: 720px) {
  .carousel-count { display: none; }
}

.proj-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.22s, transform 0.22s;
}

@media (min-width: 720px) {
  .proj-card { padding: 1.5rem; }
}

.proj-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.proj-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.proj-cat::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cat, var(--faint));
}

.proj-card[data-cat="ai_agent"]      { --cat: #0055FF; }
.proj-card[data-cat="stt"]           { --cat: #7C3AED; }
.proj-card[data-cat="deep_learning"] { --cat: #0D9488; }
.proj-card[data-cat="fullstack"]     { --cat: #D97706; }

.proj-num {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.proj-title {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.proj-desc {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.68;
  color: var(--text-2);
}

.proj-foot { margin-top: 1.1rem; }

.proj-stack { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.proj-links { display: flex; gap: 1.25rem; margin-top: 0.75rem; }

.proj-link {
  display: inline-block;
  padding: 0.35rem 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}

.proj-link:hover { opacity: 0.65; }

/* company work with no public code — says why a card has no repo link */
.proj-private {
  display: inline-block;
  padding: 0.35rem 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ============================================================
   EDUCATION
   ============================================================ */
.edu-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 720px) {
  .edu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.edu-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 720px) {
  .edu-card { padding: 1.5rem; }
}

.edu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 1.5rem;
  margin-bottom: 0.75rem;
}

.edu-inst {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text);
}

.edu-degree {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  margin-top: 0.15rem;
}

.edu-field {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 0.5rem;
}

.edu-desc {
  font-size: 0.9rem;
  line-height: 1.68;
  color: var(--text-2);
  margin: 0.75rem 0 1rem;
}

.edu-grade {
  align-self: flex-start;
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.7rem;
}

/* ============================================================
   SKILLS
   ============================================================ */
.skills-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 720px) {
  .skills-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.skills-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.skills-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.skills-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ============================================================
   CONTACT — dark closing block
   ============================================================ */
.contact-content {
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-md);
}

@media (min-width: 720px) {
  .contact-content { padding: 2.75rem; }
}

.contact-desc {
  font-size: 1.02rem;
  line-height: 1.7;
  color: #B5B4AC;
  max-width: 54ch;
  margin-bottom: 1.75rem;
}

.contact-email-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.contact-email {
  font-family: var(--display);
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--bg);
  text-decoration: none;
  border-bottom: 2px solid rgba(249, 248, 245, 0.3);
  transition: border-color 0.15s;
}

.contact-email:hover { border-color: var(--bg); }

.copy-btn {
  min-height: 40px;
  padding: 0 1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--bg);
  background: transparent;
  border: 1px solid rgba(249, 248, 245, 0.25);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.copy-btn:hover {
  background: rgba(249, 248, 245, 0.08);
  border-color: rgba(249, 248, 245, 0.55);
}

.contact-social { display: flex; gap: 1.75rem; }

.contact-social a {
  display: inline-block;
  padding: 0.6rem 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #B5B4AC;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.15s;
}

.contact-social a:hover { color: var(--bg); }

/* ============================================================
   REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(8px);
  transition: opacity 0.5s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), filter 0.65s ease;
}

.reveal.visible { opacity: 1; transform: none; filter: none; }

/* ============================================================
   SKELETON LOADERS
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skel {
  display: block;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    var(--bg-alt) 25%,
    rgba(0, 0, 0, 0.04) 50%,
    var(--bg-alt) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 1023px) {
  .footer { padding-bottom: calc(var(--tabbar-h) + 2.5rem + env(safe-area-inset-bottom)); }
}

.sep { opacity: 0.4; }

/* ============================================================
   TAB BAR — phones + tablets
   ============================================================ */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 100;
  width: min(calc(100% - 1.5rem), 480px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.15rem;
  padding: 0.3rem;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
          backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.06);
  transform: translateX(-50%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
}

.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 52px;
  border-radius: 15px;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s, background 0.2s;
}

.tabbar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar a.active {
  color: var(--accent);
  background: var(--accent-t);
}

/* get out of the way while the on-screen keyboard is up */
body:has(.form-input:focus) .tabbar {
  transform: translate(-50%, 160%);
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 1024px) {
  .tabbar { display: none; }
}

/* ============================================================
   KBD HINT — desktop with a mouse only
   ============================================================ */
.kbd-hint {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 32px;
  height: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .kbd-hint { display: flex; }
}

.kbd-hint:hover { border-color: var(--text); color: var(--text); }

/* ============================================================
   SHORTCUTS TOAST
   ============================================================ */
.shortcuts-toast {
  position: fixed;
  bottom: 4rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  z-index: 200;
  min-width: 175px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: var(--shadow-md);
}

.shortcuts-toast.visible { opacity: 1; transform: translateY(0); }

.toast-title {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.toast-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.toast-row:last-child { margin-bottom: 0; }

kbd {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text);
}

/* ============================================================
   COPY TOAST
   ============================================================ */
.copy-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 1.75rem + env(safe-area-inset-bottom));
  z-index: 300;
  background: var(--text);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.copy-toast.visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 1024px) {
  .copy-toast { bottom: 2rem; }
}

/* ============================================================
   KONAMI
   ============================================================ */
.konami-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(249, 248, 245, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.konami-overlay.active { opacity: 1; }

.konami-msg {
  text-align: center;
  font-size: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.konami-msg span {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--accent);
}

/* ============================================================
   ANIMATION UPGRADES
   ============================================================ */

/* --- 01 · intro entrance choreography (pure CSS, plays on load) --- */
.hero-line {
  display: block;
  overflow: hidden;
  /* breathing room so ascenders/descenders survive the overflow mask
     at the hero's tight 0.93 line-height */
  padding: 0.08em 0 0.14em;
  margin: -0.08em 0 -0.14em;
}

.hero-line-inner {
  display: block;
  animation: hero-line-up 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-line:nth-child(2) .hero-line-inner { animation-delay: 0.09s; }

.hero-rule {
  transform-origin: left;
  animation: hero-rule-draw 0.8s cubic-bezier(0.65, 0, 0.35, 1) 0.4s both;
}

.status         { animation: hero-fade-up 0.5s ease both; }
.hero-role-wrap { animation: hero-fade-up 0.6s ease 0.6s both; }
.side-nav       { animation: hero-fade-up 0.6s ease 0.7s both; }
.intro-foot     { animation: hero-fade-up 0.6s ease 0.8s both; }
.about-bio      { animation: hero-fade-up 0.6s ease 0.9s both; }
.hero-stats     { animation: hero-fade-up 0.6s ease 1.1s both; }

@keyframes hero-line-up  { from { transform: translateY(115%); } to { transform: none; } }
@keyframes hero-rule-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes hero-fade-up  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* --- 03 · hover micro-interactions (pointer devices only) --- */
@media (hover: hover) and (pointer: fine) {
  .stat:hover, .exp-card:hover, .proj-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }

  .stat, .exp-card, .proj-card, .edu-card, .skills-group, .demo-card, .contact-content {
    position: relative;
  }

  /* cursor spotlight — JS feeds --spot-x/--spot-y per card */
  .stat::after, .exp-card::after, .proj-card::after, .edu-card::after,
  .skills-group::after, .demo-card::after, .contact-content::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
      240px circle at var(--spot-x, 50%) var(--spot-y, 50%),
      rgba(0, 85, 255, 0.07),
      transparent 65%
    );
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
  }

  .contact-content::after {
    background: radial-gradient(
      320px circle at var(--spot-x, 50%) var(--spot-y, 50%),
      rgba(255, 255, 255, 0.06),
      transparent 65%
    );
  }

  .stat:hover::after, .exp-card:hover::after, .proj-card:hover::after, .edu-card:hover::after,
  .skills-group:hover::after, .demo-card:hover::after, .contact-content:hover::after {
    opacity: 1;
  }

  /* magnetic buttons — transform follows the cursor a few px (JS) */
  .btn-primary, .btn-ghost {
    transition: background 0.15s, box-shadow 0.15s, color 0.15s, border-color 0.15s,
                transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.4);
  }
}

/* underline sweep on mono links */
.proj-link, .social-link, .contact-social a { position: relative; }

.proj-link::after, .social-link::after, .contact-social a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: var(--underline-y, -2px);
  height: 1px;
  width: 100%;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}

/* offsets match each link's vertical padding (the padding is for tap size) */
.proj-link        { --underline-y: 0.2rem; }
.social-link      { --underline-y: 0.5rem; }
.contact-social a { --underline-y: 0.4rem; }

.proj-link:hover::after, .social-link:hover::after, .contact-social a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* --- accessibility: kill every upgrade for reduced-motion users --- */
@media (prefers-reduced-motion: reduce) {
  .hero-line-inner, .hero-rule, .status, .status-dot, .hero-role-wrap,
  .side-nav, .intro-foot, .about-bio, .hero-stats { animation: none; }

  .reveal { transition: none; opacity: 1; transform: none; filter: none; }

  .proj-link::after, .social-link::after, .contact-social a::after,
  .exp-toggle::after, .side-line, .tabbar { transition: none; }

  .stat::after, .exp-card::after, .proj-card::after, .edu-card::after,
  .skills-group::after, .demo-card::after, .contact-content::after { display: none; }

  .btn-primary, .btn-ghost {
    transition: background 0.15s, box-shadow 0.15s, color 0.15s, border-color 0.15s;
  }
}

/* ============================================================
   DEMO ACCESS REQUEST
   ============================================================ */
.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 720px) {
  .demo-card { padding: 2.25rem; }
}

.demo-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.demo-name {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
}

.demo-desc {
  font-size: 0.925rem;
  color: var(--text-2);
  line-height: 1.72;
  margin-bottom: 0.875rem;
  max-width: var(--read-w);
}

.demo-desc a {
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.demo-desc a:hover { opacity: 0.65; }

.demo-host {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
}

#demo-form { margin-top: 1.75rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .form-row { grid-template-columns: 1fr 1fr; gap: 0 0.85rem; }
}

.form-field { margin-bottom: 0.65rem; }

.form-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}

.form-count {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: none;
}

.form-count.near-limit { color: var(--danger); }

.form-input {
  width: 100%;
  min-height: 44px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-family: var(--sans);
  /* 16px on phones — anything smaller makes iOS Safari zoom in on focus */
  font-size: 1rem;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

@media (min-width: 720px) {
  .form-input { font-size: 0.9rem; }
}

.form-input::placeholder { color: var(--muted); }

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-t);
}

.form-input[aria-invalid="true"] {
  border-color: var(--danger);
}

.form-input[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px var(--danger-t);
}

.form-textarea { resize: vertical; min-height: 84px; }

/* reserved height so error text never shifts the layout */
.field-error {
  display: block;
  min-height: 1.05rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--danger);
  letter-spacing: 0.02em;
  margin-top: 0.3rem;
}

/* honeypot — parked far off-screen, skipped by tab order */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.form-submit {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  min-width: 158px;
  justify-content: center;
  gap: 0.5rem;
}

@media (max-width: 719px) {
  .form-submit { width: 100%; min-height: 48px; }
}

.form-submit:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

.form-submit:disabled:hover { background: var(--text); }

.form-submit.loading::after {
  content: '';
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: form-spin 0.7s linear infinite;
}

@keyframes form-spin { to { transform: rotate(360deg); } }

/* global (non-field) error line next to the button */
.form-status {
  font-size: 0.78rem;
  color: var(--danger);
  line-height: 1.5;
  max-width: 380px;
}

.form-status a { color: var(--danger); font-weight: 600; }

.form-privacy {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-top: 1.1rem;
}

.form-success {
  margin-top: 1.75rem;
  text-align: left;
}

.form-success.shown { animation: success-in 0.45s ease both; }

@keyframes success-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.success-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--accent-t);
  border: 1px solid rgba(0, 85, 255, 0.22);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.success-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.success-sub {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 420px;
}

@media (prefers-reduced-motion: reduce) {
  .form-success.shown { animation: none; }
  .form-submit.loading::after { animation-duration: 1.4s; }
}
