/* ============================================================
   Dean P. Foster — Personal Site Stylesheet
   Modern, responsive, mobile-first
   ============================================================ */

:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #555;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-border: #e2e8f0;
  --color-shadow: rgba(0, 0, 0, 0.06);
  --color-blockquote-bg: #f1f5f9;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
  --max-width: 52rem;
  --radius: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0f172a;
    --color-surface: #1e293b;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-accent: #60a5fa;
    --color-accent-hover: #93bbfd;
    --color-border: #334155;
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-blockquote-bg: #1e293b;
  }
}

/* ---- Reset & Base ---- */

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s;
}

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

/* ---- Layout ---- */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---- Header / Hero ---- */

.hero {
  padding: 2.5rem 0 2rem;
  border-bottom: 1px solid var(--color-border);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.hero-photo {
  width: 160px;
  height: auto;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  object-fit: cover;
  flex-shrink: 0;
}

.hero h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero .subtitle {
  margin: 0.25rem 0 0;
  color: var(--color-text-muted);
  font-size: 1rem;
}

.hero .contact {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.hero .contact a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

@media (min-width: 640px) {
  .hero-inner {
    flex-direction: row;
    text-align: left;
  }
  .hero-photo {
    width: 180px;
  }
  .hero h1 {
    font-size: 2rem;
  }
}

/* ---- Navigation ---- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-inner {
  display: flex;
  gap: 0.25rem;
  flex-wrap: nowrap;
  padding: 0 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav a {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius);
  white-space: nowrap;
  color: var(--color-text-muted);
  transition: background 0.15s, color 0.15s;
}

.nav a:hover, .nav a:focus {
  background: var(--color-surface);
  color: var(--color-accent);
  text-decoration: none;
}

/* ---- Sections ---- */

main {
  padding: 1.5rem 0 3rem;
}

.section {
  margin-bottom: 1.5rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 3px var(--color-shadow);
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-accent);
}

.card ul {
  margin: 0;
  padding-left: 1.25rem;
}

.card li {
  margin-bottom: 0.4rem;
}

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

/* ---- Featured Image ---- */

.featured-image {
  margin: 1.5rem 0;
  text-align: center;
}

.featured-image img {
  max-width: 100%;
  max-height: 500px;
  margin: 0 auto;
  border-radius: var(--radius);
  object-fit: contain;
}

.featured-image figcaption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ---- Blockquote ---- */

blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--color-blockquote-bg);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--color-text-muted);
}

blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---- Footer ---- */

footer {
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* ---- Utility ---- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ---- Back link ---- */

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.back-link::before {
  content: "\2190 ";
}

/* ---- Print ---- */

@media print {
  .nav, .featured-image { display: none; }
  body { background: white; color: black; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
