/* ---------------------------------------------------------------------------
   Global layout and typography — engineering portfolio, minimal, readable
   --------------------------------------------------------------------------- */

:root {
  --bg: #0b1220;
  --bg-alt: #0f172a;
  --text: #e5e7eb;
  --text-muted: #94a3b8;
  --border: #243244;
  --accent: #22d3ee;
  --accent-hover: #67e8f9;
  --header-bg: rgba(11, 18, 32, 0.88);
  --card-bg: #111c31;
  --shadow: 0 0 0 1px rgba(34, 211, 238, 0.08), 0 10px 24px rgba(2, 6, 23, 0.45);
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --space: 1rem;
  --max: 68rem;
  --header-h: 3.5rem;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: radial-gradient(circle at top right, #12223f 0%, var(--bg) 45%);
  padding-top: var(--header-h);
}

/* Screen-reader only helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------------------
   Header & navigation
   --------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 calc(var(--space) * 1.25);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
}

.logo {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo:hover,
.logo:focus-visible {
  color: var(--accent);
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-alt);
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  width: 1.25rem;
  height: 2px;
  margin: 0 auto;
  background: var(--accent);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-nav .nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  align-items: center;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent);
}

@media (max-width: 52rem) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .site-nav.is-open {
    max-height: 24rem;
  }

  .site-nav .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: var(--space) calc(var(--space) * 1.25) calc(var(--space) * 1.25);
    gap: 0;
  }

  .site-nav .nav-list a {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
  }

  .site-nav .nav-list li:last-child a {
    border-bottom: 0;
  }
}

/* ---------------------------------------------------------------------------
   Sections & typography blocks
   --------------------------------------------------------------------------- */

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 calc(var(--space) * 1.25);
}

.container.narrow {
  max-width: 42rem;
}

.section {
  padding: calc(var(--space) * 3.5) 0;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

.section-alt {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.85));
}

.section-title {
  margin: 0 0 calc(var(--space) * 1.25);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Hero */
.section-hero {
  padding-top: calc(var(--space) * 2.5);
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hero-title {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero-tagline {
  margin: 0 0 calc(var(--space) * 1.25);
  font-size: 1.125rem;
  color: var(--accent);
  font-weight: 500;
}

.hero-intro {
  margin: 0 0 calc(var(--space) * 1.75);
  color: var(--text-muted);
  max-width: 38rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: rgba(34, 211, 238, 0.15);
  color: #cffafe;
  border-color: rgba(34, 211, 238, 0.45);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: rgba(34, 211, 238, 0.25);
  border-color: var(--accent-hover);
  color: #ecfeff;
}

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

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* Prose / about */
.prose p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose strong {
  color: var(--text);
}

.two-col {
  column-count: 1;
}

@media (min-width: 48rem) {
  .two-col {
    column-count: 2;
    column-gap: 2.5rem;
  }

  .two-col p {
    break-inside: avoid;
  }
}

/* Skills grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: 1.25rem;
}

.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}

.skill-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.skill-card ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.skill-card li {
  margin-bottom: 0.35rem;
}

/* Projects */
.project-card {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.project-card:first-of-type {
  margin-top: 0.25rem;
}

.project-card:last-child {
  margin-bottom: 0;
}

.project-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
}

.project-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.project-header time {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.project-desc,
.project-contrib,
.project-tech {
  margin: 0 0 0.65rem;
  font-size: 0.96875rem;
  color: var(--text-muted);
}

.project-contrib strong,
.project-tech strong {
  color: var(--text);
}

/* Experience timeline */
.timeline-item {
  display: grid;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.timeline-item:first-of-type {
  margin-top: 0.25rem;
}

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

@media (min-width: 40rem) {
  .timeline-item {
    grid-template-columns: minmax(11rem, 14rem) 1fr;
    gap: 2rem;
  }
}

.timeline-meta h3 {
  margin: 0 0 0.25rem;
  font-size: 1.0625rem;
}

.org {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.dates {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.timeline-body p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.96875rem;
}

/* Education */
.edu-card {
  max-width: 40rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow);
}

.edu-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
}

.edu-degree {
  margin: 0 0 0.35rem;
  font-weight: 500;
  color: var(--text);
}

.edu-detail {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
}

.edu-note {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

/* Highlights list */
.highlight-list {
  margin: 0;
  padding-left: 1.25rem;
  max-width: 42rem;
  color: var(--text-muted);
}

.highlight-list li {
  margin-bottom: 0.65rem;
}

.highlight-list strong {
  color: var(--text);
}

/* Contact */
.contact-invite {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  margin-bottom: 0.65rem;
}

.contact-list a {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: calc(var(--space) * 1.5) 0;
  background: rgba(15, 23, 42, 0.9);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}
