/* ═══════════════════════════════════════════════════════════
   Askar Niroomand — Premium Personal Brand UI v3
   Dark aurora · glass · bento · motion
═══════════════════════════════════════════════════════════ */

:root {
  --bg: #05070f;
  --bg-elevated: #0a0e1a;
  --surface: rgba(16, 22, 38, 0.72);
  --surface-solid: #101626;
  --surface-2: #141c2e;
  --surface-3: #1a2438;
  --primary: #6366f1;
  --primary-2: #818cf8;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --pink: #f472b6;
  --success: #34d399;
  --danger: #f87171;
  --text: #f1f5f9;
  --text-2: #e2e8f0;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
  --glow: 0 0 60px rgba(99, 102, 241, 0.25);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 8px 32px rgba(0, 0, 0, 0.28);
  --radius: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-full: 999px;
  --font: "Vazirmatn", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --header: 72px;
  --container: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
}

/* Aurora background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(34, 211, 238, 0.14), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(167, 139, 250, 0.12), transparent 55%),
    linear-gradient(180deg, #05070f 0%, #070b14 50%, #05070f 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}

img,
svg {
  max-width: 100%;
  display: block;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

::selection {
  background: rgba(99, 102, 241, 0.4);
  color: #fff;
}

.container {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: clamp(64px, 8vw, 110px) 0;
}

.section-muted {
  background: linear-gradient(180deg, rgba(16, 22, 38, 0.5), rgba(16, 22, 38, 0.2));
  border-block: 1px solid var(--border);
}

.muted,
.lead {
  color: var(--muted);
}

.lead {
  max-width: 640px;
  font-size: clamp(1rem, 1.35vw, 1.18rem);
  line-height: 1.85;
}

.skip {
  position: absolute;
  top: -120px;
  right: 16px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.skip:focus {
  top: 16px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  color: var(--text);
  font-weight: 650;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s, background 0.25s, color 0.25s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #7c3aed 100%);
  box-shadow: 0 12px 36px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-primary:hover {
  box-shadow: 0 16px 44px rgba(99, 102, 241, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-strong);
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(129, 140, 248, 0.4);
}

.btn-accent {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(99, 102, 241, 0.15));
  border-color: rgba(34, 211, 238, 0.35);
  color: var(--accent);
}

.btn-sm {
  min-height: 38px;
  padding-inline: 16px;
  font-size: 0.88rem;
}

.btn-block {
  width: 100%;
}

/* ── Tags / Kickers ── */
.eyebrow,
.section-kicker,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(34, 211, 238, 0.08));
  color: #c4b5fd;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.eyebrow::before,
.section-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.eyebrow,
.section-kicker {
  padding: 7px 14px;
}

.tag {
  padding: 5px 12px;
}

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header);
  border-bottom: 1px solid transparent;
  background: transparent;
  transition: background 0.35s, border-color 0.35s, backdrop-filter 0.35s;
}

.header.scrolled {
  background: rgba(5, 7, 15, 0.78);
  border-bottom-color: var(--border);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
}

.nav a {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.nav a.active {
  background: rgba(99, 102, 241, 0.18);
  color: #e0e7ff;
}

.header-cta {
  flex-shrink: 0;
}

.menu-btn {
  display: none;
  margin-right: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-solid);
  cursor: pointer;
  position: relative;
}

.menu-btn span,
.menu-btn span::before,
.menu-btn span::after {
  display: block;
  width: 18px;
  height: 2px;
  margin: auto;
  background: var(--text);
  border-radius: 99px;
  transition: transform 0.25s var(--ease), opacity 0.2s;
}

.menu-btn span::before,
.menu-btn span::after {
  content: "";
  position: absolute;
  left: 50%;
  margin-left: -9px;
}

.menu-btn span::before { top: 14px; }
.menu-btn span::after { bottom: 14px; }
.menu-btn span { position: absolute; inset: 0; margin: auto; height: 2px; }

.menu-btn.open span { background: transparent; }
.menu-btn.open span::before { top: 50%; transform: translateY(-50%) rotate(45deg); }
.menu-btn.open span::after { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* ── Hero ── */
.hero-profile {
  padding: clamp(48px, 8vw, 100px) 0 clamp(56px, 8vw, 100px);
  position: relative;
}

.hero-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.hero-copy h1 {
  margin: 16px 0 8px;
  max-width: 720px;
  font-size: clamp(2.6rem, 7vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -0.07em;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 45%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-copy h2 {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.45;
}

.hero-bio {
  max-width: 640px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.9;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.hero-pills span {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.8rem;
  direction: ltr;
}

.dev-signature {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.82rem;
  width: fit-content;
  max-width: 100%;
}

.dev-signature code {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  direction: ltr;
}

.dev-signature span {
  color: var(--muted-2);
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  direction: ltr;
  font-size: 0.75rem;
}

/* Portrait */
.hero-portrait {
  position: relative;
  isolation: isolate;
}

.hero-portrait::before {
  content: "";
  position: absolute;
  inset: 8%;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from 180deg, #6366f1, #22d3ee, #a78bfa, #f472b6, #6366f1);
  filter: blur(60px);
  opacity: 0.45;
  animation: spin-glow 12s linear infinite;
}

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

.avatar-card {
  position: relative;
  overflow: hidden;
  min-height: 440px;
  border: 1px solid var(--border-strong);
  border-radius: 32px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--surface-solid);
  box-shadow: var(--shadow);
}

.avatar-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(145deg, rgba(129, 140, 248, 0.5), transparent 40%, rgba(34, 211, 238, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.profile-photo {
  position: absolute;
  inset: 16px 16px 110px;
  width: calc(100% - 32px);
  height: calc(100% - 126px);
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid var(--border);
}

.avatar-monogram {
  position: absolute;
  inset: 48px 48px 120px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: linear-gradient(145deg, #4f46e5, #0ea5e9);
  color: #fff;
  font-size: clamp(4rem, 8vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.avatar-meta {
  position: absolute;
  right: 20px;
  left: 20px;
  bottom: 20px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(5, 7, 15, 0.85);
  backdrop-filter: blur(16px);
}

.avatar-meta span {
  color: var(--muted);
  font-size: 0.78rem;
}

.avatar-meta strong {
  display: block;
  margin-top: 2px;
  font-size: 0.92rem;
}

.floating-badge {
  position: absolute;
  z-index: 2;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10, 14, 26, 0.9);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  font-size: 0.8rem;
  animation: float-y 4s ease-in-out infinite;
}

.floating-badge.top {
  top: 24px;
  left: -12px;
}

.floating-badge.bottom {
  bottom: 130px;
  right: -8px;
  animation-delay: 1.2s;
}

.floating-badge strong {
  display: block;
  color: var(--accent);
  font-size: 0.95rem;
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ── Spotlight Slider ── */
.home-spotlight-slider .brand-slider {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease);
}

.slide.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

.slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  filter: saturate(1.1);
}

.slide-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 7, 15, 0.92) 0%, rgba(5, 7, 15, 0.4) 100%);
}

.slide-content {
  position: relative;
  z-index: 1;
  padding: clamp(36px, 5vw, 56px);
  max-width: 640px;
}

.slide-content h3 {
  margin: 12px 0 10px;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.04em;
}

.slide-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
  z-index: 2;
}

.slide-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: width 0.3s, background 0.3s;
}

.slide-dots button.active {
  width: 28px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* ── Sections ── */
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.section-title,
.page-head h1 {
  margin: 10px 0 0;
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
  gap: 48px;
  align-items: start;
}

.split h2 {
  margin: 0 0 14px;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  letter-spacing: -0.045em;
}

/* Stats */
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.stat-row > div,
.stat-card {
  min-height: 128px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  transition: border-color 0.25s, transform 0.25s var(--ease);
}

.stat-row > div:hover,
.stat-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-3px);
}

.stat-row strong,
.stat-card strong {
  display: block;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -0.06em;
  background: linear-gradient(135deg, #fff, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-row span,
.stat-card span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Signature / Terminal */
.signature-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.signature-card,
.terminal-card {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface-solid);
}

.signature-card h2 {
  margin: 12px 0 14px;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: -0.04em;
}

.terminal-card {
  background: #070a12;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.9;
  direction: ltr;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.terminal-dots {
  display: flex;
  gap: 7px;
  margin-bottom: 18px;
}

.terminal-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #334155;
}

.terminal-dots i:nth-child(1) { background: #f87171; }
.terminal-dots i:nth-child(2) { background: #fbbf24; }
.terminal-dots i:nth-child(3) { background: #34d399; }

.terminal-card code {
  display: block;
  color: #94a3b8;
}

.terminal-card code:nth-child(odd) {
  color: #67e8f9;
}

/* Skills */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.skill-item {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-solid);
  transition: border-color 0.25s, transform 0.25s var(--ease);
}

.skill-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.skill-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 0.94rem;
}

.skill-head span:last-child {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.4);
  transition: width 1.2s var(--ease);
}

.skill-item.visible .bar i {
  width: var(--level, 80%);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

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

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

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: var(--shadow-sm);
}

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

.card h3 {
  margin: 12px 0 8px;
  font-size: 1.12rem;
  letter-spacing: -0.03em;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(34, 211, 238, 0.12));
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent);
  font-size: 1.15rem;
}

.link,
.back,
.back-link {
  color: #a5b4fc;
  font-weight: 700;
  transition: color 0.2s;
}

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

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--surface-solid);
  color: var(--text);
  transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 40px rgba(99, 102, 241, 0.1);
}

.project-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0c1220;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  transition: transform 0.5s var(--ease), opacity 0.3s;
}

.project-thumb-empty {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(34, 211, 238, 0.08)),
    var(--surface-2);
}

.project-card:hover .project-thumb img {
  transform: scale(1.05);
  opacity: 1;
}

.project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px;
}

.project-body h2,
.project-body h3 {
  margin: 12px 0 8px;
  font-size: 1.22rem;
  letter-spacing: -0.04em;
}

.project-tech,
.tags,
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

.project-tech span,
.article-tags li {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.76rem;
  direction: ltr;
}

.project-body .link {
  margin-top: auto;
  padding-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-solid);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.table th,
.table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.table th {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.02);
}

.table tr:last-child td {
  border-bottom: 0;
}

.table tr:hover td {
  background: rgba(99, 102, 241, 0.04);
}

/* Banner & CTA */
.banner-block {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface-solid);
  transition: transform 0.3s var(--ease), border-color 0.3s;
}

.banner-block:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.35);
}

.banner-block img {
  width: 100%;
}

.banner-block span {
  display: block;
  padding: 16px 20px;
  font-weight: 650;
}

.cta-inner {
  overflow: hidden;
  position: relative;
  padding: clamp(40px, 6vw, 72px);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 32px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.25), transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(34, 211, 238, 0.12), transparent 45%),
    var(--surface-solid);
  text-align: center;
}

.cta-inner h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.05em;
}

.cta-inner .actions {
  justify-content: center;
  margin-top: 24px;
}

/* FAQ */
.faq-list {
  display: grid;
  gap: 12px;
  max-width: 800px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-solid);
  overflow: hidden;
  transition: border-color 0.25s;
}

.faq-item[open] {
  border-color: rgba(99, 102, 241, 0.35);
}

.faq-item summary {
  padding: 18px 22px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 400;
  transition: transform 0.25s;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0;
  padding: 0 22px 20px;
  color: var(--muted);
  line-height: 1.85;
}

/* Bento / Marquee */
.marquee-wrap {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  border-block: 1px solid var(--border);
  background: rgba(16, 22, 38, 0.4);
  padding: 18px 0;
}

.marquee {
  display: flex;
  gap: 32px;
  width: max-content;
  animation: marquee 28s linear infinite;
  direction: ltr;
}

.marquee span {
  color: var(--muted);
  font-weight: 650;
  font-size: 0.92rem;
  white-space: nowrap;
}

.marquee span::after {
  content: "·";
  margin-right: -20px;
  margin-left: 32px;
  color: var(--primary-2);
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* Pages */
.page-head {
  padding: clamp(56px, 8vw, 100px) 0 28px;
}

.page-head h1 {
  max-width: 760px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .sep {
  opacity: 0.4;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.category-filter button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.category-filter button.active,
.category-filter button:hover {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.14);
  color: var(--text);
}

.search-form input,
.search-form select,
.form input,
.form textarea,
.form select {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  outline: 0;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form input {
  width: min(100%, 340px);
}

.search-form select {
  width: 190px;
}

.form textarea {
  min-height: 130px;
  padding-block: 14px;
  resize: vertical;
}

.search-form input:focus,
.search-form select:focus,
.form input:focus,
.form textarea:focus,
.form select:focus {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.form label {
  display: block;
  margin-bottom: 16px;
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 500;
}

.form-msg {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Contact extras */
.contact-cards {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-solid);
  transition: border-color 0.2s, transform 0.2s;
}

.contact-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateX(-3px);
}

.contact-card .icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.14);
  color: var(--accent);
  flex-shrink: 0;
}

.contact-card strong {
  display: block;
  font-size: 0.95rem;
}

.contact-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

/* Prose */
.prose {
  max-width: 760px;
  color: #d9e2ef;
  font-size: 1.04rem;
}

.prose h2,
.prose h3 {
  margin: 2rem 0 0.75rem;
  color: var(--text);
  letter-spacing: -0.04em;
}

.prose p {
  margin: 0 0 1.1rem;
}

/* Timeline */
.timeline {
  display: grid;
  gap: 0;
  position: relative;
  padding-right: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  right: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent), transparent);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding: 22px 24px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-solid);
  transition: border-color 0.25s, transform 0.25s;
}

.timeline-item::before {
  content: "";
  position: absolute;
  right: -26px;
  top: 28px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.2);
}

.timeline-item:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateX(-4px);
}

.timeline-item time {
  color: #a5b4fc;
  font-size: 0.86rem;
  font-weight: 700;
}

.timeline-item h3 {
  margin: 8px 0 6px;
  font-size: 1.1rem;
}

/* Project detail */
.project-header {
  max-width: 850px;
  padding-top: 28px;
}

.project-header h1 {
  margin: 14px 0 10px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -0.06em;
}

.gallery {
  margin: 34px 0 44px;
}

.gallery-main {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--surface-solid);
  cursor: zoom-in;
  box-shadow: var(--shadow);
}

.gallery-main img {
  width: 100%;
  max-height: 680px;
  object-fit: cover;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: none;
  opacity: 0.65;
  transition: opacity 0.2s, border-color 0.2s;
}

.thumb.active,
.thumb:hover {
  opacity: 1;
  border-color: var(--primary);
}

.thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 24px;
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 90vh;
  border-radius: 12px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

/* Education */
.education-stack {
  display: grid;
  gap: 48px;
}

.education-form-head {
  margin-top: 12px;
}

.education-forms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

/* Footer */
.footer {
  margin-top: 40px;
  padding: 56px 0 28px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(16, 22, 38, 0.6));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}

.footer h4 {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--text);
}

.footer-grid > div > a {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.92rem;
  transition: color 0.2s;
}

.footer-grid > div > a:hover {
  color: var(--accent);
}

.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.footer-socials a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  transition: all 0.2s;
}

.footer-socials a:hover {
  color: var(--text);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.1);
}

.footer-socials svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.footer-copy {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

/* Mobile bottom nav */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 90;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: rgba(5, 7, 15, 0.92);
  backdrop-filter: blur(18px);
}

.mobile-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 12px;
  transition: color 0.2s, background 0.2s;
}

.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover {
  color: #c4b5fd;
  background: rgba(99, 102, 241, 0.12);
}

/* Back to top */
.back-top {
  position: fixed;
  bottom: 28px;
  left: 22px;
  z-index: 80;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(16, 22, 38, 0.9);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: var(--shadow-sm);
}

.back-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-top:hover {
  border-color: var(--primary);
  color: var(--accent);
}

/* Reveal animations */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

[data-reveal="left"] {
  transform: translateX(28px);
}

[data-reveal="right"] {
  transform: translateX(-28px);
}

[data-reveal="scale"] {
  transform: scale(0.94);
}

/* Errors */
.error-page {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 80px 20px;
}

.error-page h1 {
  font-size: clamp(4rem, 12vw, 8rem);
  margin: 0;
  letter-spacing: -0.08em;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-profile-grid,
  .split,
  .signature-grid {
    grid-template-columns: 1fr;
  }

  .hero-portrait {
    max-width: 420px;
    margin-inline: auto;
  }

  .floating-badge.top {
    left: 8px;
  }

  .floating-badge.bottom {
    right: 8px;
  }
}

@media (max-width: 860px) {
  .nav {
    position: fixed;
    top: var(--header);
    right: 16px;
    left: 16px;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border-radius: 20px;
    background: rgba(10, 14, 26, 0.96);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s;
    margin: 0;
  }

  .nav.open {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .nav a {
    padding: 12px 14px;
  }

  .menu-btn {
    display: grid;
    place-items: center;
  }

  .header-cta {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  body {
    padding-bottom: 72px;
  }

  .back-top {
    bottom: 88px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(var(--container), calc(100% - 28px));
  }

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

  .avatar-card {
    min-height: 380px;
  }

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

  .hero-copy h1 {
    font-size: clamp(2.2rem, 11vw, 3rem);
  }

  .actions {
    flex-direction: column;
  }

  .actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

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