/* mattlab — personal home-lab homepage
   Mobile-first, no external dependencies, WCAG 2.2 AA contrast. */

:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --heading: #f8fafc;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --focus: #7dd3fc;
  --border: #334155;
  --max-width: 42rem;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Keep content from overflowing narrow viewports. */
img,
svg,
video {
  max-width: 100%;
  height: auto;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color 120ms ease;
}

a:hover {
  color: var(--accent-hover);
}

/* Visible focus indicator for keyboard users. */
a:focus-visible,
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Headings */
h1,
h2 {
  color: var(--heading);
  line-height: 1.2;
  margin: 0 0 var(--space-2);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  margin-bottom: var(--space-1);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--border);
}

p {
  margin: 0 0 var(--space-2);
}

/* Header / hero */
.site-header {
  padding: var(--space-4) var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
}

.site-name {
  margin-bottom: var(--space-1);
}

.tagline {
  max-width: 40rem;
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: var(--space-3);
}

/* In-page navigation */
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
  padding: 0.25rem 0;
}

.site-nav a:hover {
  text-decoration: underline;
}

/* Main content */
.site-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4) var(--space-3);
}

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

.section:last-child {
  margin-bottom: 0;
}

/* Focus areas list */
.focus-list {
  margin: var(--space-2) 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: var(--space-1);
}

.focus-list li {
  padding-left: 0.25rem;
}

/* Contact */
.contact-line {
  font-size: 1.125rem;
}

.contact-line a {
  font-weight: 600;
  overflow-wrap: break-word;
}

/* Footer */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background-color: var(--surface);
  padding: var(--space-3);
  text-align: center;
}

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

/* Wider viewports: a touch more breathing room. */
@media (min-width: 48rem) {
  .site-header {
    padding-top: var(--space-5);
  }

  .site-main {
    padding-top: var(--space-5);
    padding-bottom: var(--space-5);
  }
}
