/* ===== Design tokens ===== */
:root {
  --bg: #09090b;
  --bg-soft: #111114;
  --surface: #16161a;
  --surface-2: #1c1c22;
  --border: #26262e;
  --border-soft: #1f1f26;
  --text: #f4f4f5;
  --text-soft: #a1a1aa;
  --text-mute: #71717a;
  --accent: #3b82f6;
  --accent-2: #6366f1;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --ok: #34d399;

  --maxw: 1120px;
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --font-head: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

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

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

/* ===== Backgrounds ===== */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
.bg-glow {
  position: fixed; top: -20%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 900px; z-index: -1;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  filter: blur(40px); opacity: 0.5; pointer-events: none;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 500; font-size: 0.95rem;
  padding: 12px 22px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.btn svg { transition: transform 0.25s var(--ease); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 6px 24px -8px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 10px 32px -6px var(--accent-glow); transform: translateY(-2px); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost {
  background: var(--surface); color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); border-color: #34343e; transform: translateY(-2px); }
.btn-sm { padding: 9px 16px; font-size: 0.85rem; }
.btn-lg { padding: 15px 28px; font-size: 1rem; }

/* ===== Navbar ===== */
.navbar {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 32px); max-width: var(--maxw); z-index: 50;
  border: 1px solid var(--border-soft); border-radius: 999px;
  background: rgba(17, 17, 20, 0.6); backdrop-filter: blur(16px);
  transition: all 0.3s var(--ease);
}
.navbar.scrolled {
  background: rgba(17, 17, 20, 0.85);
  border-color: var(--border);
  box-shadow: 0 8px 30px -12px rgba(0,0,0,0.6);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 10px 18px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; }
.logo-mark {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 9px; font-size: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
}
.logo-text { font-size: 1.05rem; letter-spacing: -0.01em; }
.accent { color: var(--accent); }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-size: 0.92rem; color: var(--text-soft); padding: 8px 14px;
  border-radius: 999px; transition: all 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-cta { display: inline-flex; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu {
  display: none; flex-direction: column; padding: 8px;
  border-top: 1px solid var(--border-soft); margin-top: 4px;
}
.mobile-menu a { padding: 12px 14px; border-radius: 12px; color: var(--text-soft); }
.mobile-menu a:hover { background: var(--surface-2); color: var(--text); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center; position: relative;
  padding: 120px 0 80px;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-head); font-size: 0.85rem; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border);
  padding: 7px 16px; border-radius: 999px; margin-bottom: 28px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6); animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52,211,153,0.6); }
  70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
.hero-title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 4.4rem); line-height: 1.08;
  letter-spacing: -0.03em; margin-bottom: 24px;
}
.grad-text {
  background: linear-gradient(120deg, var(--accent), var(--accent-2), #a78bfa);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  max-width: 640px; color: var(--text-soft); font-size: clamp(1rem, 2vw, 1.18rem);
  margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 56px; }
.hero-stats {
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap; justify-content: center;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; color: var(--text); }
.stat-label { font-size: 0.82rem; color: var(--text-mute); }
.stat-divider { width: 1px; height: 34px; background: var(--border); }
.scroll-cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: var(--text-mute); animation: bob 2s var(--ease) infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ===== Sections ===== */
.section { padding: 100px 0; position: relative; }
.section-head { margin-bottom: 56px; max-width: 620px; }
.section-tag {
  display: inline-block; font-family: var(--font-head); font-size: 0.8rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.12; letter-spacing: -0.02em;
}

/* ===== About ===== */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }
.about-text p { color: var(--text-soft); margin-bottom: 18px; max-width: 60ch; }
.about-text strong { color: var(--text); font-weight: 600; }
.about-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; position: sticky; top: 100px;
}
.about-card h3 { font-family: var(--font-head); font-size: 1.05rem; margin-bottom: 18px; }
.about-list { list-style: none; display: flex; flex-direction: column; gap: 0; }
.about-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border-soft); font-size: 0.92rem;
}
.about-list li:last-child { border-bottom: none; }
.about-list span { color: var(--text-mute); }
.about-list strong { font-family: var(--font-head); font-weight: 500; color: var(--text); }
.about-list .ok { color: var(--ok); }

/* ===== Skills ===== */
.skills-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.skill-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.skill-card:hover { transform: translateY(-4px); border-color: #34343e; background: var(--surface-2); }
.skill-icon {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, rgba(59,130,246,0.18), rgba(99,102,241,0.12));
  color: var(--accent); border: 1px solid rgba(59,130,246,0.25); margin-bottom: 18px;
}
.skill-card h3 { font-family: var(--font-head); font-size: 1.12rem; margin-bottom: 8px; }
.skill-card p { color: var(--text-soft); font-size: 0.92rem; margin-bottom: 16px; }
.tag-row { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-row li {
  font-family: var(--font-head); font-size: 0.76rem; color: var(--text-soft);
  background: var(--bg-soft); border: 1px solid var(--border);
  padding: 5px 11px; border-radius: 999px;
}

/* ===== Projects ===== */
.projects { display: flex; flex-direction: column; gap: 28px; }
.project {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.project:hover { border-color: #34343e; transform: translateY(-3px); }
.project-media {
  background: radial-gradient(circle at 50% 0%, rgba(59,130,246,0.12), transparent 70%), var(--bg-soft);
  display: grid; place-items: center; padding: 44px; min-height: 320px;
  border-right: 1px solid var(--border);
}
.project.alt { direction: rtl; }
.project.alt .project-info { direction: ltr; }
.project.alt .project-media { direction: ltr; border-right: none; border-left: 1px solid var(--border); }
.project-info { padding: 40px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.project-kind {
  font-family: var(--font-head); font-size: 0.78rem; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.project-info h3 { font-family: var(--font-head); font-size: 1.7rem; letter-spacing: -0.02em; margin-bottom: 14px; }
.project-info p { color: var(--text-soft); font-size: 0.95rem; margin-bottom: 20px; max-width: 50ch; }
.project-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 20px;
  font-family: var(--font-head); font-size: 0.9rem; color: var(--accent);
  transition: gap 0.2s var(--ease);
}
.project-link:hover { gap: 10px; }

/* --- Mockups --- */
.mockup { width: 100%; transition: transform 0.5s var(--ease); }
.project:hover .mockup { transform: scale(1.03) translateY(-4px); }
.mockup-desktop, .mockup-browser {
  background: #0c0c0f; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.7); overflow: hidden; max-width: 380px;
}
.mockup-bar { display: flex; align-items: center; gap: 6px; padding: 11px 13px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mockup-bar > span { width: 10px; height: 10px; border-radius: 50%; background: #3f3f46; }
.mockup-bar > span:first-child { background: #ef5f57; }
.mockup-bar > span:nth-child(2) { background: #febc2e; }
.mockup-bar > span:nth-child(3) { background: #28c840; }
.mockup-bar .url {
  margin-left: 10px; flex: 1; background: var(--bg); border-radius: 6px;
  font-size: 0.68rem; color: var(--text-mute); padding: 4px 10px; font-family: var(--font-head);
}
.mockup-body { padding: 18px; }
.m-title { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; color: var(--accent); margin-bottom: 14px; }
.m-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.m-grid i {
  display: block; height: 46px; border-radius: 8px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
}
.site-hero { height: 64px; border-radius: 8px; background: linear-gradient(120deg, var(--accent), var(--accent-2)); margin-bottom: 10px; opacity: 0.85; }
.site-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 8px; }
.site-row i { height: 34px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }

/* phone */
.mockup-phone {
  width: 190px; height: 380px; background: #0c0c0f; border: 6px solid #1c1c22;
  border-radius: 32px; box-shadow: 0 24px 60px -20px rgba(0,0,0,0.8); position: relative; overflow: hidden;
}
.mockup-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 70px; height: 18px; background: #1c1c22; border-radius: 999px; z-index: 2; }
.mockup-screen { padding: 38px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 18px; height: 100%; }
.p-status { font-family: var(--font-head); font-size: 0.8rem; color: var(--text-mute); letter-spacing: 0.1em; text-transform: uppercase; }
.p-ring { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.p-ring svg { width: 120px; height: 120px; transform: rotate(-90deg); position: absolute; }
.p-ring circle { fill: none; stroke: var(--surface-2); stroke-width: 7; }
.p-ring .p-prog { stroke: url(#g); stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 264; stroke-dashoffset: 90; }
.p-ring span { font-family: var(--font-head); font-weight: 600; font-size: 1.4rem; color: var(--text); }
.p-pill { width: 100%; height: 30px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.p-pill.short { width: 65%; }

/* ===== Contact ===== */
.contact { padding-bottom: 120px; }
.contact-card {
  text-align: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: 28px;
  padding: 64px 32px; position: relative; overflow: hidden;
}
.contact-card::before {
  content: ""; position: absolute; top: -50%; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%);
  opacity: 0.4; pointer-events: none;
}
.contact-card > * { position: relative; }
.contact-title { font-family: var(--font-head); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.02em; margin: 14px 0 16px; }
.contact-sub { color: var(--text-soft); max-width: 480px; margin: 0 auto 32px; }
.contact-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.contact-mail { margin-top: 26px; font-family: var(--font-head); font-size: 0.9rem; color: var(--text-mute); }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border-soft); padding: 28px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 0.86rem; color: var(--text-mute); }
.footer-built { font-family: var(--font-head); }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .mobile-menu.open { display: flex; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
  .about-card { position: static; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .project, .project.alt { grid-template-columns: 1fr; direction: ltr; }
  .project-media { border-right: none; border-bottom: 1px solid var(--border); min-height: 260px; }
  .project.alt .project-media { border-left: none; border-bottom: 1px solid var(--border); }
}
@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .section { padding: 72px 0; }
  .skills-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 18px; }
  .stat-divider { display: none; }
  .project-info { padding: 28px; }
  .contact-card { padding: 44px 22px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
