/* =============================================================
   Design tokens
   ============================================================= */

:root {
  --bg:           #0a0a0a;
  --bg-alt:       #0e0e0e;
  --bg-card:      #141414;
  --bg-card-hover:#181818;
  --border:       #1f1f1f;
  --border-hover: #2e2e2e;

  --text:         #e6e4e1;
  --text-body:    #a8a6a2;
  --text-muted:   #6a6866;
  --text-subtle:  #333;

  --accent:       #3b82f6;
  --accent-dark:  #2563eb;
  --accent-dim:   rgba(59, 130, 246, 0.08);
  --accent-glow:  rgba(59, 130, 246, 0.15);

  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-h:        60px;
  --radius:       8px;
  --radius-lg:    12px;
  --ease:         0.18s ease;
  --ease-out:     0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============================================================
   Reset
   ============================================================= */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

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

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

/* =============================================================
   Typography scale
   ============================================================= */

h1, h2, h3 {
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}

h1 { font-size: clamp(2.75rem, 6vw, 5rem);   font-weight: 700; letter-spacing: -0.04em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.0625rem; }

p  { color: var(--text-body); line-height: 1.78; }

/* =============================================================
   Layout helpers
   ============================================================= */

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 28px;
}

.section {
  padding: 96px 0;
}

.section-alt {
  background: var(--bg-alt);
}

/* =============================================================
   Navigation
   ============================================================= */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--nav-h);
  transition: background var(--ease), border-color var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(10, 10, 10, 0.88);
  border-bottom-color: var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.nav-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  transition: color var(--ease);
}
.nav-logo:hover { color: var(--accent); }

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

.nav-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--ease);
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

.nav-cta {
  padding: 7px 16px;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius);
  color: var(--text) !important;
  transition: border-color var(--ease), color var(--ease) !important;
}
.nav-cta:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: transform var(--ease), opacity var(--ease), background var(--ease);
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* =============================================================
   Buttons
   ============================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--ease), background var(--ease), color var(--ease), border-color var(--ease), box-shadow var(--ease);
  border: 1px solid transparent;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

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

/* =============================================================
   Section header
   ============================================================= */

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

.label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

/* =============================================================
   Fade-in on scroll
   ============================================================= */

.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* =============================================================
   HERO
   ============================================================= */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
  position: relative;
}

/* Subtle dot grid background */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 40%, transparent 100%);
  pointer-events: none;
}

.hero-content {
  max-width: 680px;
  padding: 64px 0;
}

.hero-name {
  margin-bottom: 24px;
  color: var(--text);
}

.hero-title {
  font-size: clamp(1rem, 2vw, 1.1875rem);
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 28px;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 44px;
  max-width: 520px;
  padding-left: 18px;
  border-left: 2px solid var(--border);
}

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

/* =============================================================
   ABOUT
   ============================================================= */

.about-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 72px;
  align-items: start;
}

.about-text p {
  font-size: 0.9375rem;
  margin-bottom: 20px;
}
.about-text p:last-child { margin-bottom: 0; }

.stack-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack-tags li {
  padding: 5px 11px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color var(--ease), color var(--ease);
  cursor: default;
}
.stack-tags li:hover {
  border-color: var(--border-hover);
  color: var(--text-body);
}

/* =============================================================
   SERVICES
   ============================================================= */

.services-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Row 1: 3 equal cards, 2 columns each (2+2+2 = 6) */
.service-card:nth-child(-n+3) { grid-column: span 2; }

/* Row 2: 2 centered cards, 3 columns each (3+3 = 6) */
.service-card:nth-child(n+4)  { grid-column: span 3; }

.service-card {
  background: var(--bg-alt);
  padding: 32px;
  transition: background var(--ease);
}
.service-card:hover { background: var(--bg-card); }

.service-icon {
  color: var(--accent);
  margin-bottom: 18px;
  display: flex;
}

.service-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.service-card p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-muted);
}

/* =============================================================
   EXPERIENCE TIMELINE
   ============================================================= */

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 48px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -34px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg-alt);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.timeline-header h3 { font-size: 1rem; }

.timeline-period {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.timeline-body p { font-size: 0.9375rem; }

/* =============================================================
   PERSONAL
   ============================================================= */

.personal-intro {
  font-size: 0.9375rem;
  margin-bottom: 36px;
  max-width: 480px;
}

.hobbies-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hobbies-list li {
  padding: 9px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--ease), border-color var(--ease);
  cursor: default;
}
.hobbies-list li:hover {
  color: var(--text-body);
  border-color: var(--border-hover);
}

/* =============================================================
   CONTACT
   ============================================================= */

.contact-intro {
  font-size: 1.0625rem;
  margin-bottom: 40px;
  max-width: 480px;
  color: var(--text-body);
}

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

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--ease);
  width: fit-content;
}
.contact-item:hover { color: var(--accent); }
.contact-item svg { flex-shrink: 0; }

/* =============================================================
   FOOTER
   ============================================================= */

.footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* =============================================================
   Responsive — Tablet
   ============================================================= */

@media (max-width: 860px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  /* 2-column layout: rows of 2 + last card full width */
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .service-card:nth-child(-n+3) { grid-column: span 1; }
  .service-card:nth-child(n+4)  { grid-column: span 1; }
  .service-card:last-child      { grid-column: span 2; }
}

/* =============================================================
   Responsive — Mobile
   ============================================================= */

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

  /* Nav mobile */
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 12px 0 24px;
    background: rgba(9, 9, 9, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--ease-out), opacity var(--ease-out);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 12px 28px;
    font-size: 1rem;
    color: var(--text-body);
  }

  .nav-cta {
    margin: 8px 20px 0;
    width: auto !important;
    padding: 10px 20px !important;
    border-radius: var(--radius) !important;
    border: 1px solid var(--border) !important;
  }

  /* Hero */
  .hero-content { padding: 48px 0; }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  .btn { justify-content: center; }

  /* Services */
  .services-grid { grid-template-columns: 1fr; }
  .service-card:nth-child(-n+3),
  .service-card:nth-child(n+4) { grid-column: span 1; }

  /* Timeline */
  .timeline-header { flex-direction: column; gap: 4px; }

}

/* Hide desktop line-break helper on small screens */
@media (max-width: 640px) {
  .br-desktop { display: none; }
}
