/* =============================================
   LAYOUT — Sections, containers, grid, spacing
   ============================================= */

/* ─── Container ─────────────────────────────── */
.container {
  width: var(--container);
  margin-inline: auto;
}

/* ─── Section ───────────────────────────────── */
section {
  padding-block: var(--section-gap);
}

.section-header {
  margin-bottom: var(--space-16);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  color: var(--muted);
  font-size: var(--text-lg);
}

/* ─── Hero Layout ───────────────────────────── */
#hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding-block: var(--space-32);
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: var(--z-card);
  max-width: 900px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
  border: 1px solid oklch(0.72 0.16 200 / 0.35);
  background: oklch(0.72 0.16 200 / 0.07);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-8);
  letter-spacing: var(--tracking-wide);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero-title {
  font-size: var(--text-hero);
  font-weight: 800;
  letter-spacing: var(--tracking-display);
  line-height: 1.05;
  margin-bottom: var(--space-6);
  color: var(--ink);
}

.hero-title .highlight {
  position: relative;
  display: inline-block;
}

.hero-title .highlight::after {
  content: '';
  position: absolute;
  bottom: 0.05em;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0.7;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--ink-2);
  line-height: var(--leading-loose);
  margin-bottom: var(--space-10);
  max-width: 680px;
  margin-inline: auto;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}

.scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--muted);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-widest);
  animation: scroll-bounce 2s ease-in-out infinite;
}

.scroll-indicator svg {
  width: 18px;
  height: 18px;
}

/* ─── About Layout ──────────────────────────── */
#about .about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: start;
}

.about-text h2 {
  margin-bottom: var(--space-6);
}

.about-text p + p {
  margin-top: var(--space-4);
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-8);
}

.about-visual {
  position: relative;
}

.about-code-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.about-code-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.about-code-dots {
  display: flex;
  gap: var(--space-2);
}

.about-code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.about-code-dots span:nth-child(1) { background: oklch(0.55 0.18 25); }
.about-code-dots span:nth-child(2) { background: oklch(0.75 0.18 85); }
.about-code-dots span:nth-child(3) { background: oklch(0.65 0.16 150); }

.about-code-filename {
  color: var(--muted);
  font-size: var(--text-xs);
  margin-left: var(--space-2);
}

.about-code-body {
  padding: var(--space-6);
  line-height: 1.8;
}

.code-keyword  { color: var(--primary); }
.code-string   { color: oklch(0.75 0.16 145); }
.code-comment  { color: var(--muted); font-style: italic; }
.code-property { color: var(--accent); }
.code-value    { color: oklch(0.78 0.14 35); }

/* ─── Skills Layout ─────────────────────────── */
#skills .skills-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.skill-group h3 {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  margin-bottom: var(--space-5);
}

.skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ─── Projects Layout ───────────────────────── */
#projects .projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--space-6);
}

/* ─── Experience Layout ─────────────────────── */
#experience .timeline {
  position: relative;
  padding-left: var(--space-8);
}

#experience .timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--space-2);
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, var(--primary), transparent);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-10);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-8) - 4px);
  top: var(--space-1);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px oklch(0.65 0.14 265 / 0.2);
}

.timeline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-1);
  flex-wrap: wrap;
}

.timeline-role {
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--ink);
}

.timeline-period {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

.timeline-company {
  font-size: var(--text-base);
  color: var(--accent);
  margin-bottom: var(--space-4);
  font-weight: 500;
}

.timeline-highlights {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.timeline-highlights li {
  color: var(--ink-2);
  padding-left: var(--space-4);
  position: relative;
  line-height: var(--leading-normal);
}

.timeline-highlights li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--subtle);
}

/* ─── Education Layout ──────────────────────── */
#education .edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

/* ─── Contact Layout ────────────────────────── */
#contact {
  text-align: center;
}

#contact .contact-inner {
  max-width: 640px;
  margin-inline: auto;
}

#contact h2 {
  margin-bottom: var(--space-4);
}

#contact .contact-sub {
  color: var(--muted);
  margin-bottom: var(--space-10);
  margin-inline: auto;
}

.contact-email {
  display: inline-block;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-10);
  transition: color var(--duration-base) var(--ease-out-quart);
}

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

.contact-socials {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Footer ────────────────────────────────── */
footer {
  padding-block: var(--space-8);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--muted);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
}

/* ─── Responsive ────────────────────────────── */
@media (max-width: 768px) {
  #about .about-grid {
    grid-template-columns: 1fr;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
  }

  .timeline-header {
    flex-direction: column;
  }
}

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