:root {
  --bg: #0B0F17;
  --panel: #121826;
  --text: #E6E9EF;
  --muted: #A7B3C2;
  --border: #2A3242;
  --accent: #4EA1FF;
  --radius: 14px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --maxw: 1100px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

/* == Headings: explicit sizes for all levels (global) == */
h1 { font-size: 2rem;    line-height: 1.2; }
h2 { font-size: 1.5rem;  line-height: 1.3; }
h3 { font-size: 1.25rem; line-height: 1.3; }
h4 { font-size: 1.125rem; line-height: 1.35; }
h5 { font-size: 1rem;     line-height: 1.4; }
h6 { font-size: 0.875rem; line-height: 1.4; }

/* == Headings inside semantic containers (the ones Lighthouse checks) == */
:is(section, article, nav, aside, header) h1 { font-size: 2rem;    line-height: 1.2; }
:is(section, article, nav, aside, header) h2 { font-size: 1.5rem;  line-height: 1.3; }
:is(section, article, nav, aside, header) h3 { font-size: 1.25rem; line-height: 1.3; }
:is(section, article, nav, aside, header) h4 { font-size: 1.125rem; line-height: 1.35; }
:is(section, article, nav, aside, header) h5 { font-size: 1rem;     line-height: 1.4; }
:is(section, article, nav, aside, header) h6 { font-size: 0.875rem; line-height: 1.4; }

/* Keep your hero/project overrides as you like */
.hero h1,
.hero-title { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; }
.project-card h3 { font-size: 1.25rem; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.container {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 var(--space-2);
}

.site-header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(120%) blur(6px);
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
}

.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

button,
.btn {
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}

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

.btn.btn-primary:hover {
  filter: brightness(1.08);
}

:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--accent) 70%, transparent);
  outline-offset: 3px;
}

/* ===== Header layout ===== */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
}
.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}
.brand__name { 
  font-weight: 700; 
  letter-spacing: 0.2px; 
  /* Explicit font-size to satisfy Lighthouse */
  font-size: 1.125rem; 
  line-height: 1.1; 
}
.brand__tagline { 
  font-size: 0.9rem; 
  color: var(--muted); 
}

.site-nav .nav-list {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a { padding: 0.4rem 0.2rem; border-radius: 8px; }
.site-nav a:focus-visible { outline-offset: 4px; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(180deg, rgba(78,161,255,0.08), transparent 40%);
}
.hero-inner {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  display: grid;
  gap: 1rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.2;
  margin: 0;
}

.hero .lead {
  color: var(--muted);
  max-width: 60ch;
  margin: 0.4rem 0 0.8rem;
}
.hero-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ===== Sections / cards baseline (used later) ===== */

.section h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  margin: 0 0 0.75rem;
}
.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin: 1rem 0;
}
.project-card h3 { margin-top: 0; }
.project-card ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }

/* ===== Back to top (wired later) ===== */
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  opacity: 0.95;
}

/* ===== Responsive tweaks ===== */
@media (min-width: 800px) {
  .hero-inner { gap: 1.25rem; }
  .site-nav .nav-list { gap: 1.25rem; }
}

/* ===== About ===== */
.about-content {
  display: grid;
  gap: 0.75rem;
  max-width: 65ch;
}
.about-blurb {
  margin: 0;
  color: var(--text);
}
.about-highlights {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}
.about-highlights li { margin: 0.25rem 0; }

/* Desktop: two-column feel later if we expand */
@media (min-width: 900px) {
  .about-content { gap: 0.9rem; }
}


/* ===== Projects grid ===== */
.projects-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr 1fr; /* two columns on desktop */
    gap: 1.25rem;
  }
}

.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  transition: transform 120ms ease, border-color 120ms ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--accent) 25%, var(--border));
}

.project-desc {
  color: var(--text);
  margin: 0.4rem 0;
}

.project-features {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.1rem;
  color: var(--muted);
}
.project-features li { margin: 0.25rem 0; }

.project-links .btn-link {
  display: inline-block;
  padding: 0.4rem 0.6rem;
  border-radius: 10px;
  border: 1px solid transparent;
}
.project-links .btn-link:hover {
  border-color: color-mix(in oklab, var(--accent) 35%, transparent);
  text-decoration: none;
}

/* ===== Contact ===== */
.contact .container {
  max-width: 60ch;
}
#contact a[href^="mailto:"],
#contact a[href^="https://"],
#contact a[href^="http://"] {
  word-break: break-all;
}
#contact p {
  margin: 0.25rem 0;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
}
.site-footer .container {
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.site-footer p {
  margin: 0.25rem 0;
  color: var(--muted);
}

/* ===== Mobile nav behavior ===== */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 40px;
  height: 34px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

.site-nav {
  position: relative;
}

@media (max-width: 799px) {
  /* collapse menu on mobile */
  .site-nav {
    position: absolute;
    right: var(--space-2);
    top: calc(100% + 0.5rem);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem;
    display: none;
    z-index: 50;
  }
  .site-nav[data-open] { display: block; }

  .site-nav .nav-list {
    flex-direction: column;
    gap: 0.25rem;
  }
}

/* desktop: show inline, hide toggle */
@media (min-width: 800px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: block;
    position: static;
    background: transparent;
    border: none;
    padding: 0;
  }
  .site-nav .nav-list { flex-direction: row; }
}

/* active link style */
.site-nav a[aria-current="page"] {
  text-decoration: none;
  border-bottom: 2px solid color-mix(in oklab, var(--accent) 65%, transparent);
}

/* Responsive gutter fix for header and hero at <=1080px */
@media (max-width: 1150px) {
  .site-header .container,
  .hero .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* == Anchor offset so sections don't hide under sticky header == */
main section[id] { scroll-margin-top: 80px; }

/* If your header feels taller on small screens, add a bit more offset */
@media (max-width: 800px) {
  main section[id] { scroll-margin-top: 96px; }
}

/* == Projects: 2-column grid from 700px up (was 900px) == */
@media (min-width: 700px) {
  .projects-grid { grid-template-columns: 1fr 1fr; }
}

/* == Mobile tap targets (nav + back-to-top) == */
@media (max-width: 800px) {
  .site-nav .nav-list a {
    padding: 0.6rem 0.5rem;     /* larger touch area */
    line-height: 1.4;
  }
  .back-to-top {
    padding: 0.8rem 1rem;       /* easier to tap */
    min-width: 44px;            /* WCAG target size */
    min-height: 44px;
  }
  .nav-toggle {
    min-width: 44px;
    min-height: 44px;
  }
}

/* == Respect user's reduced motion preference == */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* == Skip link visibility == */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.6rem 0.8rem;
  background: var(--panel);
  color: var(--text);
  border: 2px solid var(--accent);
  border-radius: 10px;
  z-index: 9999;
}

/* Slightly stronger focus on interactive items */
a:focus-visible,
button:focus-visible,
.site-nav a:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--accent) 75%, transparent);
  outline-offset: 3px;
}

/* == Subtle hover/focus polish == */

/* Links: cleaner underline and slight lift on hover */
a {
  text-underline-offset: 2px;
}
a:hover {
  text-decoration: underline;
}

/* Buttons: gentle brightness + outline on focus */
.btn:hover {
  filter: brightness(1.06);
}
.btn:active {
  transform: translateY(1px);
}
.btn:focus-visible {
  outline: 3px solid color-mix(in oklab, var(--accent) 70%, transparent);
  outline-offset: 3px;
}

/* Project cards: small lift + border tint on hover */
.project-card {
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.project-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--accent) 25%, var(--border));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* Active nav underline: a bit thicker so it's obvious */
.site-nav a[aria-current="page"] {
  border-bottom: 2px solid color-mix(in oklab, var(--accent) 65%, transparent);
}

/* Back-to-top: hover feedback */
.back-to-top:hover {
  filter: brightness(1.08);
}

/* == Project thumbnails == */
.project-thumb {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--border);
  margin: 0 0 0.75rem;
  object-fit: cover;
  background: #0b0f17; /* graceful bg while loading */
}

/* Mobile-friendly adjustments for project thumbnails */
@media (max-width: 600px) {
  .project-thumb {
    max-height: 200px;
    object-fit: contain; /* prevents image cropping on very small screens */
  }
}


/* Contact: match section width to the rest of the site */
.contact .container { max-width: var(--maxw); }

/* Contact links: wrap nicely without breaking words in the middle */
#contact a[href^="mailto:"],
#contact a[href^="https://"],
#contact a[href^="http://"] {
  word-break: normal;
  overflow-wrap: anywhere;  /* allows wrapping at safe points */
}