/* Modern clean design - system fonts, warm neutrals, good spacing */

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

:root {
  --color-bg: #faf9f7;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #5a5a5a;
  --color-text-muted: #8a8a8a;
  --color-accent: #c96442;
  --color-accent-hover: #a84e30;
  --color-border: #e8e4e0;
  --color-border-light: #f0ece8;
  --color-link: #2c5a8a;
  --color-link-hover: #1a3d5c;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --max-width: 740px;
  --max-width-wide: 900px;
}

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

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

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.container-wide {
  max-width: var(--max-width-wide);
}

/* Header */
.site-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
}

.site-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}

.site-header h1 a {
  color: var(--color-text);
  text-decoration: none;
}

.site-header h1 a:hover {
  color: var(--color-accent);
}

.site-header .subtitle {
  font-size: 1rem;
  color: var(--color-text-secondary);
  margin: 0;
  font-weight: 400;
}

.site-header .byline {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0.25rem 0 0;
}

/* Page header for sub-pages */
.page-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.page-header .back-link {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 1rem;
}

.page-header .back-link:hover {
  color: var(--color-accent);
}

.page-header .back-link::before {
  content: "\2190\00a0";
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  color: var(--color-text);
}

h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

p {
  margin: 0 0 1.25rem;
}

/* Links */
a {
  color: var(--color-link);
  text-decoration: none;
}

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

/* Lists */
ul, ol {
  padding-left: 1.5rem;
  margin: 0 0 1.25rem;
}

li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

li li {
  margin-bottom: 0.3rem;
}

/* Hero section (index page) */
.hero {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.hero-photo {
  width: 120px;
  min-width: 120px;
  border-radius: 8px;
}

.hero-contact h4 {
  margin-top: 0;
}

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

.hero-contact li {
  margin-bottom: 0.3rem;
}

/* Sections */
.section {
  margin-bottom: 2.5rem;
}

.section > h2:first-child,
.section > h3:first-child,
.section > h4:first-child {
  margin-top: 0;
}

/* Divider */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.25rem 0;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-border-light);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--color-border-light);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
  margin: 1.25rem 0;
}

pre code {
  background: none;
  padding: 0;
}

/* Blockquotes */
blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--color-accent);
  background: var(--color-border-light);
  border-radius: 0 6px 6px 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Images & Figures */
img {
  max-width: 100%;
  height: auto;
}

figure {
  margin: 1.5rem 0;
  padding: 0;
}

figure img {
  display: block;
  border-radius: 4px;
}

figcaption {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

figcaption a {
  color: var(--color-text-muted);
  text-decoration: underline;
}

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

/* Responsive video */
iframe {
  max-width: 100%;
}

/* Utility */
.text-muted {
  color: var(--color-text-muted);
}

.smallcaps {
  font-variant: small-caps;
}

/* Footer area */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  margin-top: 3rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Mobile responsive */
@media (max-width: 640px) {
  .container {
    padding: 1.25rem 1rem 3rem;
  }

  .site-header {
    padding: 1.5rem 0 1rem;
  }

  .site-header h1 {
    font-size: 1.5rem;
  }

  .page-header h1 {
    font-size: 1.35rem;
  }

  .hero {
    gap: 1.25rem;
  }

  .hero-photo {
    width: 80px;
    min-width: 80px;
  }

  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  pre {
    font-size: 0.75rem;
    padding: 0.75rem 1rem;
  }
}

/* Print */
@media print {
  body {
    background: white;
    color: black;
  }
  .container {
    max-width: 100%;
    padding: 0;
  }
  a { color: black; }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}
