/* ============================================================
   Reset & Custom Properties
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:         #080c18;
  --surface:    #0f1524;
  --surface-2:  #141d30;
  --surface-3:  #1c2640;
  --text:       #eef2ff;
  --text-muted: #7a8aaf;
  --text-dim:   #3d4e72;
  --accent:     #e8613a;
  --primary:    #3563e9;
  --primary-h:  #2550cc;
  --green:      #22c55e;
  --border:     rgba(255, 255, 255, 0.07);
  --border-h:   rgba(255, 255, 255, 0.14);
  --radius:     12px;
  --radius-sm:  6px;
  --font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease:       200ms ease;
  --width:      1140px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

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

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 100px 0;
}

.section-header {
  margin-bottom: 56px;
}

.section-title {
  font-size: clamp(1.875rem, 3.5vw, 2.625rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin-bottom: 12px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.5;
}

/* ============================================================
   Navigation
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  transition: background var(--ease), box-shadow var(--ease);
}

.nav.scrolled {
  background: rgba(8, 12, 24, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-emblem {
  width: 30px;
  height: 30px;
  opacity: 0.9;
}

.nav-logo-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.nav-logo-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.nav-logo-sub {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--ease), background var(--ease);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface);
}

.nav-links .nav-cta {
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border);
  margin-left: 4px;
}

.nav-links .nav-cta:hover {
  background: var(--surface-2);
  border-color: var(--border-h);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 250ms ease, opacity 250ms ease;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: all var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--primary-h);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(53, 99, 233, 0.38);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-h);
}

.btn-outline:hover {
  background: var(--surface);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

.btn-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  transition: color var(--ease);
}

.btn-link:hover { color: #7da4ff; }

.btn-link--dim {
  color: var(--text-dim);
}

.btn-link--dim:hover { color: var(--text-muted); }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 100svh;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Background layers */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(150deg, #080c1e 0%, #090d1c 50%, #0a0f1e 100%);
}

.hero-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.hero-bg-glow--1 {
  width: 600px;
  height: 500px;
  top: -10%;
  right: 5%;
  background: radial-gradient(ellipse, rgba(35, 60, 140, 0.28) 0%, transparent 70%);
}

.hero-bg-glow--2 {
  width: 400px;
  height: 400px;
  top: 20%;
  right: 20%;
  background: radial-gradient(ellipse, rgba(55, 90, 180, 0.15) 0%, transparent 70%);
}

.hero-bg-glow--3 {
  width: 300px;
  height: 300px;
  bottom: 0;
  right: 10%;
  background: radial-gradient(ellipse, rgba(255, 160, 60, 0.06) 0%, transparent 70%);
}

/* Desk illustration */
.hero-bg-desk {
  position: absolute;
  right: -2%;
  top: 50%;
  transform: translateY(-50%);
  width: 55%;
  max-width: 680px;
  opacity: 0.6;
  pointer-events: none;
}

.desk-svg {
  width: 100%;
  height: auto;
}

/* Hero content */
.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 120px 32px 80px;
}

.hero-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-h);
}

.hero-heading {
  font-size: clamp(2.75rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: 24px;
  max-width: 700px;
}

.hero-heading em {
  font-style: normal;
  color: var(--accent);
}

.hero-body {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 500px;
  line-height: 1.72;
  margin-bottom: 40px;
}

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

/* Decorative clock emblem */
.hero-emblem {
  position: absolute;
  bottom: 32px;
  right: 32px;
  width: 40px;
  height: 40px;
  opacity: 0.18;
  z-index: 1;
  animation: float 6s ease-in-out infinite;
}

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

/* ============================================================
   Projects
   ============================================================ */
.projects {
  background: var(--surface);
}

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

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.project-card:hover {
  border-color: var(--border-h);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.project-name-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.project-name {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.project-external {
  color: var(--text-dim);
  line-height: 0;
  transition: color var(--ease);
}

.project-external:hover { color: var(--text-muted); }

.project-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.project-description {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  letter-spacing: 0.01em;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-live {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.22);
}

.badge-dev {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.22);
}

.badge-planned {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.22);
}

/* What's Next */
.project-whats-next {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.whats-next-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.whats-next-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.whats-next-list li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
  line-height: 1.5;
}

.whats-next-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--text-dim);
  font-size: 0.75rem;
  top: 2px;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

/* ============================================================
   Coming Soon
   ============================================================ */
.coming-soon {
  background: var(--bg);
}

.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.pipeline-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color var(--ease);
}

.pipeline-item:hover {
  border-color: var(--border-h);
}

.pipeline-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.pipeline-name {
  font-size: 0.9375rem;
  font-weight: 600;
}

.pipeline-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================
   Skills
   ============================================================ */
.skills {
  background: var(--surface);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 32px;
}

.skill-group-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.skill-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.skill-note {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}

/* ============================================================
   About
   ============================================================ */
.about {
  position: relative;
  background: var(--surface-2);
  overflow: hidden;
}

.about-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.about-bg-glow {
  position: absolute;
  top: -20%;
  right: -5%;
  width: 60%;
  height: 140%;
  background: radial-gradient(ellipse at 70% 50%, rgba(30, 55, 130, 0.2) 0%, transparent 65%);
  filter: blur(40px);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 72px;
  align-items: start;
  position: relative;
  z-index: 1;
}

.about-title {
  margin-bottom: 28px;
}

.about-body {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.78;
  margin-bottom: 16px;
}

.about-body:last-child { margin-bottom: 0; }

/* Meet card */
.meet-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.meet-avatar {
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}

.meet-name {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.meet-role {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

.meet-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
  transition: color var(--ease);
}

.meet-link:hover { color: #7da4ff; }

/* ============================================================
   Contact
   ============================================================ */
.contact {
  position: relative;
  background: var(--bg);
  overflow: hidden;
}

.contact-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 110%, rgba(53, 99, 233, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.contact-split {
  position: relative;
  z-index: 1;
  max-width: 580px;
}

.contact-heading {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 16px;
}

.contact-body {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.6;
  margin-bottom: 32px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--ease);
}

.contact-link:hover { color: var(--text); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-emblem {
  width: 24px;
  height: 24px;
  opacity: 0.5;
}

.footer-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.footer-name {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  opacity: 0.6;
}

.footer-sub {
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

/* ============================================================
   Responsive — tablet
   ============================================================ */
@media (max-width: 1024px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

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

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

  .hero-bg-desk {
    width: 70%;
    opacity: 0.35;
  }
}

/* Responsive — mobile */
@media (max-width: 640px) {
  .container {
    padding: 0 20px;
  }

  .section {
    padding: 72px 0;
  }

  /* Nav mobile */
  .nav-inner {
    padding: 0 20px;
    height: 60px;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 60px;
    inset-inline: 0;
    background: rgba(8, 12, 24, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 24px;
    border-bottom: 1px solid var(--border);
    gap: 2px;
    z-index: 199;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 10px 14px;
    font-size: 0.9375rem;
  }

  .nav-links .nav-cta {
    margin-left: 0;
    margin-top: 6px;
    text-align: center;
    justify-content: center;
  }

  /* Hero mobile */
  .hero-content {
    padding: 96px 20px 64px;
  }

  .hero-bg-desk {
    display: none;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-emblem {
    display: none;
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
  }

  /* Pipeline */
  .pipeline-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .hero-heading {
    font-size: 2.5rem;
  }
}

/* ============================================================
   Focus styles (accessibility)
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ============================================================
   Scroll animation (progressive enhancement)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .project-card,
  .pipeline-item,
  .skill-group,
  .meet-card {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 500ms ease, transform 500ms ease, border-color var(--ease), box-shadow var(--ease);
  }

  .project-card.visible,
  .pipeline-item.visible,
  .skill-group.visible,
  .meet-card.visible {
    opacity: 1;
    transform: translateY(0);
  }
}
