/* ==========================================================================
   Self-hosted fonts — latin-subset variable woff2 in /fonts, no third-party
   requests (re-established 2026-08-07 after the redesign briefly reintroduced
   Google Fonts). unicode-range is Google's latin subset: includes general
   punctuation (em-dash U+2014).
   ========================================================================== */

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces-var.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/plus-jakarta-sans-var.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/plus-jakarta-sans-italic-var.woff2') format('woff2');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-var.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Design System & Theme Tokens
   ========================================================================== */

:root[data-theme="dark"] {
  --bg-main: #14110f;
  --bg-alt: #1a1714;
  --bg-card: rgba(32, 28, 24, 0.65);
  --bg-card-hover: rgba(45, 39, 34, 0.85);
  --border-color: rgba(220, 180, 140, 0.12);
  --border-highlight: rgba(224, 130, 75, 0.35);

  --text-primary: #f5eedc;
  --text-secondary: #c5baa8;
  --text-muted: #8d8374;

  --accent-copper: #e0824b;
  --accent-copper-glow: rgba(224, 130, 75, 0.25);
  --accent-amber: #d99a36;
  --accent-green: #4ade80;
  --accent-blue: #60a5fa;

  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
  --glass-backdrop: blur(16px);
}

:root[data-theme="light"] {
  --bg-main: #faf6ef;
  --bg-alt: #f1ebd9;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --border-color: rgba(140, 100, 60, 0.15);
  --border-highlight: rgba(190, 90, 40, 0.4);

  --text-primary: #211a14;
  --text-secondary: #594d41;
  --text-muted: #8c7d6e;

  --accent-copper: #c86326;
  --accent-copper-glow: rgba(200, 99, 38, 0.2);
  --accent-amber: #b87a1d;
  --accent-green: #16a34a;
  --accent-blue: #2563eb;

  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --shadow-sm: 0 4px 16px rgba(60, 40, 20, 0.06);
  --shadow-lg: 0 12px 32px rgba(60, 40, 20, 0.12);
  --glass-backdrop: blur(16px);
}

/* ==========================================================================
   Global Reset & Base Layout
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Background Ambient Lighting & Atmospheric Sunrise FX (Craig's og-ranch.jpg)
   ========================================================================== */

.hero-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 700px;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-bg-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center; /* Centered vertically & horizontally */
  opacity: 0.92; /* High visibility */
  filter: contrast(1.1) saturate(1.15) brightness(0.98);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.9) 65%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.9) 65%, rgba(0, 0, 0, 0) 100%);
  transition: opacity 0.4s ease;
}

:root[data-theme="light"] .hero-bg-image img {
  opacity: 0.85;
  filter: contrast(1.05) saturate(1.1) brightness(1.02);
}

.hero-bg-overlay {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(to bottom, rgba(20, 17, 15, 0.15) 0%, rgba(20, 17, 15, 0.35) 60%, var(--bg-main) 100%),
    radial-gradient(ellipse at 50% 40%, transparent 55%, var(--bg-main) 98%);
}

:root[data-theme="light"] .hero-bg-overlay {
  background: 
    linear-gradient(to bottom, rgba(250, 246, 239, 0.15) 0%, rgba(250, 246, 239, 0.35) 60%, var(--bg-main) 100%),
    radial-gradient(ellipse at 50% 40%, transparent 55%, var(--bg-main) 98%);
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.bg-glow-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-copper-glow);
  top: -150px;
  right: -100px;
}

.bg-glow-2 {
  width: 600px;
  height: 600px;
  background: rgba(217, 154, 54, 0.12);
  bottom: 10%;
  left: -200px;
}

.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ==========================================================================
   Typography Utilities
   ========================================================================== */

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

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

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

.gradient-text {
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-copper) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--accent-copper);
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 12px;
}

.section-title {
  font-size: 2.618rem;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.text-center {
  text-align: center;
}

/* ==========================================================================
   Components & Glassmorphism
   ========================================================================== */

.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.pulse-dot.green {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.pulse-dot.amber {
  background-color: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid currentColor;
  opacity: 0.7;
  animation: pulse 2s infinite ease-out;
}

@keyframes pulse {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
}

.btn-primary {
  background: var(--accent-copper);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--accent-copper-glow);
}

.btn-primary:hover {
  background: var(--accent-amber);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-highlight);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.btn-rss {
  background: rgba(217, 154, 54, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(217, 154, 54, 0.3);
  white-space: nowrap;
}

.btn-rss:hover {
  background: var(--accent-amber);
  color: #ffffff;
}

.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  border-color: var(--border-highlight);
  transform: scale(1.05);
}

/* Theme Icons */
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* ==========================================================================
   Navigation Bar
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 0;
  background: rgba(20, 17, 15, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s ease;
}

:root[data-theme="light"] .navbar {
  background: rgba(250, 246, 239, 0.8);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-mark {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  background: var(--accent-copper);
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--accent-copper);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  padding: 80px 0 50px 0;
  position: relative;
  z-index: 1;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

/* Type scale: golden-ratio half-steps from the 16px body —
   1rem · 1.272 · 1.618 · 2.058 · 2.618 · 3.33 */

.hero-title {
  font-size: 3.33rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  max-width: 850px;
}

.hero-subtitle {
  font-size: 1.272rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin-bottom: 32px;
  line-height: 1.6;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Telemetry Section
   ========================================================================== */

.section-telemetry {
  padding: 20px 0 60px 0;
}

.telemetry-card {
  padding: 24px;
}

.telemetry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.telemetry-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background-color: #ff5f56; }
.terminal-dot.yellow { background-color: #ffbd2e; }
.terminal-dot.green { background-color: #27c93f; }

.telemetry-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-left: 8px;
}

.telemetry-updated {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-copper);
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.telemetry-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.item-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.item-value {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
}

.highlight-copper {
  color: var(--accent-copper);
}

/* ==========================================================================
   Sections Layout
   ========================================================================== */

.section {
  padding: 96px 0;
  position: relative;
  z-index: 1;
}

.section-alt {
  background: var(--bg-alt);
}

/* Golden section: text is the major division, imagery the minor */
.grid-2col {
  display: grid;
  grid-template-columns: 1.618fr 1fr;
  gap: 60px;
  align-items: center;
}

.lead-paragraph {
  font-size: 1.272rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 20px;
  line-height: 1.6;
}

.about-content p {
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.radio-note {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(224, 130, 75, 0.1);
  border-left: 3px solid var(--accent-copper);
  padding: 14px 18px;
  border-radius: 0 12px 12px 0;
  margin-top: 24px;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* ==========================================================================
   About Visual (Craig & Porsche Photo Soft Blending)
   ========================================================================== */

.about-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.image-frame {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
  max-width: 440px;
  width: 100%;
}

.photo-placeholder {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: none;
  border: none;
  background: transparent;
}

.photo-placeholder img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  opacity: 0.88;
  filter: contrast(1.0) saturate(0.96) brightness(0.96);
  transition: opacity 0.4s ease, filter 0.4s ease, transform 0.4s ease;
  border-radius: 24px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 1) 55%, rgba(0, 0, 0, 0.85) 80%, rgba(0, 0, 0, 0.25) 100%);
  mask-image: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 1) 55%, rgba(0, 0, 0, 0.85) 80%, rgba(0, 0, 0, 0.25) 100%);
}

:root[data-theme="light"] .photo-placeholder img {
  opacity: 0.92;
  filter: contrast(1.0) saturate(0.98) brightness(1.0);
}

.photo-placeholder:hover img {
  opacity: 1;
  filter: contrast(1.02) saturate(1.0) brightness(0.99);
  transform: scale(1.01);
}

.photo-caption {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  padding: 14px 0 4px;
}

/* ==========================================================================
   Notes Listing Page Styles
   ========================================================================== */

.nav-links a.active {
  color: var(--accent-copper);
  font-weight: 600;
}

.notes-post-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 840px;
  margin: 0 auto;
}

.note-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.note-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.note-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-copper);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.note-title {
  font-size: 1.618rem;
  line-height: 1.3;
}

.note-title a {
  color: var(--text-primary);
}

.note-title a:hover {
  color: var(--accent-copper);
}

.note-excerpt {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.65;
}

.note-link-row {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   Projects Cards
   ========================================================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 48px;
}

.project-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.project-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-copper-glow);
  color: var(--accent-copper);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(224, 130, 75, 0.2);
}

.project-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.pill-alpha {
  color: var(--accent-amber);
  border-color: rgba(217, 154, 54, 0.3);
}

.pill-green {
  color: var(--accent-green);
  border-color: rgba(74, 222, 128, 0.3);
}

.project-title {
  font-size: 1.618rem;
  margin-bottom: 12px;
}

.project-title a {
  color: var(--text-primary);
}

.project-title a:hover {
  color: var(--accent-copper);
}

.project-description {
  color: var(--text-secondary);
  font-size: 0.98rem;
  margin-bottom: 28px;
  line-height: 1.6;
}

.project-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.tech-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.card-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
}

/* ==========================================================================
   Writing Banner & Elsewhere
   ========================================================================== */

.writing-banner {
  padding: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;

}

.writing-info p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 8px;
  max-width: 540px;
}

.writing-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.writing-actions {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.writing-actions .btn {
  white-space: nowrap;
}

.latest-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.links-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.link-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--text-primary);
}

.link-info {
  display: flex;
  flex-direction: column;
}

.link-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.link-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.arrow-icon {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.link-card:hover .arrow-icon {
  transform: translateX(4px);
  color: var(--accent-copper);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.status-now {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Generated pages (notes/404) have no status line — center the identity */
.footer-right:only-child {
  margin-inline: auto;
}

.rss-link {
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   Notes Index / Post Pages (non-home pages, built by tools/templates.py)
   ========================================================================== */

.page-header {
  padding: 0 0 8px;
  margin-bottom: 40px;
}

.backlink {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: inline-block;
  margin-bottom: 24px;
}

.backlink:hover {
  color: var(--accent-copper);
}

.article-card {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 48px;
}

.article-meta {
  margin-bottom: 12px;
}

.article-title {
  font-size: 2.058rem;
  margin-bottom: 28px;
}

.article-body p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
}

.article-body h2 {
  font-size: 1.618rem;
  margin: 36px 0 16px;
}

.article-body h3 {
  font-size: 1.272rem;
  margin: 28px 0 14px;
}

.article-body ul,
.article-body ol {
  color: var(--text-secondary);
  margin: 0 0 20px;
  padding-left: 1.3em;
  line-height: 1.7;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body blockquote {
  border-left: 3px solid var(--accent-copper);
  background: rgba(224, 130, 75, 0.08);
  padding: 4px 20px;
  border-radius: 0 12px 12px 0;
  margin: 0 0 20px;
  color: var(--text-primary);
}

.article-body strong {
  color: var(--text-primary);
}

.article-body figure {
  margin: 32px 0 28px;
}

.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.article-body figcaption {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  padding-top: 12px;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 900px) {
  .hero-title {
    font-size: 2.618rem;
  }

  .section-title {
    font-size: 2.058rem;
  }

  .grid-2col {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .writing-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 2.058rem;
  }

  .badge-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-card {
    padding: 28px 24px;
  }

  .article-title {
    font-size: 1.6rem;
  }
}

/* Home, revised September 2026 — a desert field journal, not a product UI. */
.hero-bg-image { height: 760px; }
.hero-bg-image img { opacity: 0.72; filter: contrast(1.05) saturate(0.82) brightness(0.76); -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 61%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 61%, transparent 100%); }
.hero-bg-overlay { background: linear-gradient(90deg, rgba(18, 14, 10, 0.58) 0%, rgba(18, 14, 10, 0.20) 62%, rgba(18, 14, 10, 0.32) 100%), linear-gradient(to bottom, transparent 44%, var(--bg-main) 96%); }
.navbar { padding: 22px 0; background: linear-gradient(to bottom, rgba(18, 14, 10, 0.74), transparent); border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.logo { gap: 10px; font-family: var(--font-serif); font-weight: 500; }
.logo-mark { width: auto; height: auto; padding-right: 10px; color: var(--accent-copper); background: none; border-radius: 0; border-right: 1px solid currentColor; }
.logo-text { font-size: 1.2rem; }
.nav-right { gap: 24px; }
.nav-links { gap: 20px; }
.nav-links a { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; }
.btn-icon { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 0; }
.hero { padding: 176px 0 126px; min-height: 620px; display: flex; align-items: flex-end; }
.hero-container { align-items: flex-start; }
.hero-kicker { font-family: var(--font-mono); color: #f2d9bb; font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 20px; }
.hero-kicker span { color: var(--accent-copper); padding: 0 0.45rem; }
.hero-title { font-size: clamp(3.8rem, 7.4vw, 6.8rem); line-height: 0.94; letter-spacing: -0.045em; margin-bottom: 24px; max-width: 760px; }
.hero-subtitle { font-family: var(--font-serif); font-size: 1.45rem; line-height: 1.4; color: #eee0ca; max-width: 570px; }
.section { padding: 112px 0; }
.section-alt { background: #201a14; border-top: 1px solid rgba(224, 130, 75, 0.22); border-bottom: 1px solid rgba(224, 130, 75, 0.22); }
.section-title { font-size: clamp(2.6rem, 4vw, 4.2rem); letter-spacing: -0.04em; }
.glass-card { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; border-radius: 0; box-shadow: none; }
.glass-card:hover { background: transparent; border-color: inherit; box-shadow: none; transform: none; }
.grid-2col { grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr); gap: 88px; }
.lead-paragraph { font-family: var(--font-serif); font-size: 1.6rem; line-height: 1.42; font-weight: 400; }
.about-content p:not(.lead-paragraph) { max-width: 42rem; font-size: 1.05rem; }
.image-frame { max-width: 500px; }
.photo-placeholder, .photo-placeholder img { border-radius: 0; }
.photo-placeholder img { height: 520px; opacity: 1; filter: none; -webkit-mask-image: none; mask-image: none; }
.photo-caption { text-align: left; border-top: 1px solid var(--border-color); padding-top: 10px; }
.writing-stack { gap: 36px; }
.writing-banner { padding: 0 0 34px; border-bottom: 1px solid var(--border-highlight); align-items: end; }
.writing-info p { font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.45; max-width: 650px; }
.writing-actions { gap: 10px; }
.btn { border-radius: 0; padding: 10px 0; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; background: transparent; box-shadow: none; }
.btn-primary, .btn-primary:hover { color: var(--accent-copper); background: transparent; box-shadow: none; }
.btn-primary::after, .btn-rss::after { content: ' →'; }
.btn-rss, .btn-rss:hover { background: transparent; color: var(--text-secondary); border: 0; }
.note-card { padding: 0 0 30px; border-bottom: 1px solid var(--border-color); gap: 10px; }
.latest-note .note-title { font-size: 2rem; }
.note-link-row { justify-content: flex-start; margin-top: 4px; }
.card-link { margin-left: 0; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.projects-grid { display: block; margin-top: 22px; border-top: 1px solid var(--border-highlight); }
.project-card { padding: 30px 0 26px; min-height: 0; display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; column-gap: 28px; align-items: start; border-bottom: 1px solid var(--border-color); }
.project-header { margin: 0; }
.project-icon { display: none; }
.project-pill { grid-column: 1; grid-row: 1; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--accent-copper); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.project-title { grid-column: 2; grid-row: 1; font-size: 2rem; margin: 0; }
.project-description { grid-column: 2; grid-row: 2; margin: 8px 0 0; max-width: 640px; }
.project-footer { grid-column: 3; grid-row: 1 / span 2; padding: 7px 0 0; border: 0; }
.links-row { display: block; margin-top: 22px; border-top: 1px solid var(--border-highlight); }
.link-card { padding: 18px 0; border-bottom: 1px solid var(--border-color); border-radius: 0; }
.link-card > svg:first-child { width: 18px; }
.footer { padding: 46px 0; border-top: 1px solid var(--border-highlight); }
@media (max-width: 900px) {
  .hero { padding: 150px 0 100px; }
  /* Single column on small screens. The earlier 900px rule already said so,
     but the unscoped .grid-2col line above re-imposed two columns with a 300px
     minimum and won the cascade — on a 390px phone the text column measured
     0px wide and the About lead wrapped one word per line (found 2026-09-08). */
  .grid-2col { grid-template-columns: 1fr; gap: 52px; }
  .project-card { grid-template-columns: 110px minmax(0, 1fr) auto; gap: 18px; }
  /* The nav used to vanish below 900px (display: none, no menu). Now the links
     drop to a second row under the logo — no JS, nothing to tap open. */
  .nav-content { flex-wrap: wrap; row-gap: 10px; }
  .nav-right { display: contents; }
  .nav-links { display: flex; flex-wrap: wrap; order: 3; flex-basis: 100%; gap: 18px; }
  .nav-links a { font-size: 0.68rem; }
}
@media (max-width: 600px) { .hero-bg-image { height: 650px; } .hero-bg-overlay { background: linear-gradient(90deg, rgba(18, 14, 10, 0.44), rgba(18, 14, 10, 0.08)), linear-gradient(to bottom, transparent 45%, var(--bg-main) 94%); } .navbar { padding: 16px 0; } .logo-text { font-size: 1rem; } .hero { padding: 152px 0 74px; min-height: 560px; } .hero-title { font-size: 3.5rem; } .hero-subtitle { font-size: 1.18rem; max-width: 330px; } .section { padding: 78px 0; } .section-title { font-size: 2.8rem; } .lead-paragraph { font-size: 1.38rem; } .photo-placeholder img { height: 440px; } .writing-banner { padding-bottom: 26px; } .writing-info p { font-size: 1.2rem; } .project-card { display: block; padding: 28px 0; } .project-pill { display: block; margin-bottom: 10px; } .project-title { font-size: 1.72rem; } .project-description { margin: 8px 0 15px; } .project-footer { padding: 0; } }

/* Home: the newest field note sits ahead of the project index — same scale as
   every other section (title, padding, container), with a date column. */
#writing .latest-note { display: grid; grid-template-columns: 130px minmax(0, 1fr); column-gap: 28px; padding: 30px 0 34px; border-top: 2px solid var(--accent-copper); border-bottom: 1px solid var(--border-color); }
#writing .latest-note .note-meta { grid-column: 1; grid-row: 1 / span 3; display: block; padding-top: 6px; }
#writing .latest-note .note-date { display: block; font-size: 0.68rem; line-height: 1.55; }
#writing .latest-note .latest-kicker { display: block; margin-top: 8px; color: var(--accent-copper); }
#writing .latest-note .note-title { grid-column: 2; grid-row: 1; font-size: 2rem; line-height: 1.1; max-width: 640px; }
#writing .latest-note .note-excerpt { grid-column: 2; grid-row: 2; max-width: 640px; margin-top: 8px; }
#writing .latest-note .note-link-row { grid-column: 2; grid-row: 3; margin-top: 14px; }
#writing .latest-note .card-link { color: var(--accent-copper); }

@media (max-width: 700px) {
  #writing .latest-note { display: block; padding-block: 26px 30px; }
  #writing .latest-note .note-meta { padding: 0; display: flex; gap: 12px; align-items: baseline; }
  #writing .latest-note .note-date, #writing .latest-note .latest-kicker { display: inline; }
  #writing .latest-note .latest-kicker { margin: 0; }
  #writing .latest-note .note-title { margin-top: 12px; font-size: 1.72rem; }
  #writing .latest-note .note-excerpt { margin-top: 8px; }
}

/* Palette, tuned 2026-09-05 (second pass): one temperature end to end.
   The hero is a desert sunrise and the portrait is golden grass, so the page
   canvas is a warm ink — not a steel blue — and the copper is a burnished
   metal, not a neon. Text is cream, never pure white, so long paragraphs
   don't glare; borders sit at low alpha so the rules recede behind the type. */
:root[data-theme="dark"] {
  --bg-main: #17140f;
  --bg-alt: #1e1a14;
  --bg-card: #1c1813;
  --bg-card-hover: #262119;
  --border-color: rgba(214, 190, 160, 0.16);
  --border-highlight: rgba(222, 140, 88, 0.46);
  --text-primary: #efe6d5;
  --text-secondary: #c7bba7;
  --text-muted: #978b79;
  --accent-copper: #dd8a55;
  --accent-copper-glow: rgba(221, 138, 85, 0.18);
  --accent-amber: #d9a651;
}

:root[data-theme="light"] {
  --bg-main: #f7f2e8;
  --bg-alt: #efe7d8;
  --bg-card: #fffdf8;
  --bg-card-hover: #ffffff;
  --border-color: rgba(88, 66, 44, 0.18);
  --border-highlight: rgba(170, 82, 34, 0.55);
  --text-primary: #23201b;
  --text-secondary: #4d443a;
  --text-muted: #7a6e60;
  --accent-copper: #ae5320;
  --accent-copper-glow: rgba(174, 83, 32, 0.12);
  --accent-amber: #8a5e10;
}

.section-alt { background: var(--bg-alt); border-color: var(--border-color); }
.bg-glow-2 { background: rgba(217, 166, 81, 0.07); }
.hero-bg-image img { opacity: 0.86; filter: contrast(1.06) saturate(1.0) brightness(0.86); }
.hero-bg-overlay { background: linear-gradient(90deg, rgba(20, 15, 10, 0.72) 0%, rgba(20, 15, 10, 0.34) 58%, rgba(20, 15, 10, 0.46) 100%), linear-gradient(to bottom, rgba(20, 15, 10, 0.04) 38%, var(--bg-main) 96%); }
.navbar { background: linear-gradient(to bottom, rgba(20, 15, 10, 0.90), rgba(20, 15, 10, 0.48) 72%, rgba(20, 15, 10, 0)); }
.navbar .logo, .navbar .nav-links a, .navbar .btn-icon { color: #f3eadb; text-shadow: 0 1px 5px rgba(0, 0, 0, 0.6); }
.navbar .nav-links a:hover { color: #f0b98d; }
.navbar .logo-mark { color: #e69a65; }
.hero h1 { color: #f6eee0; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.34); }
.hero-kicker { color: #ead9c2; text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55); }
.hero-kicker span { color: #e69a65; }
.hero-subtitle { color: #ecdfca; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.about-content p:not(.lead-paragraph), .note-excerpt, .project-description, .writing-info p { color: var(--text-secondary); }
.photo-caption, .note-date, .latest-kicker, .project-pill, .card-link { color: var(--accent-copper); }
#writing .latest-note { border-top-color: var(--accent-copper); }

/* Light mode needs a denser hero scrim: sunlight is brighter than the page canvas. */
:root[data-theme="light"] .hero-bg-image img { opacity: 0.92; filter: contrast(1.06) saturate(1.08) brightness(0.94); }
:root[data-theme="light"] .hero-bg-overlay { background: linear-gradient(90deg, rgba(52, 34, 18, 0.74) 0%, rgba(52, 34, 18, 0.44) 60%, rgba(52, 34, 18, 0.52) 100%), linear-gradient(to bottom, rgba(52, 34, 18, 0.08) 34%, var(--bg-main) 96%); }
:root[data-theme="light"] .hero h1 { color: #fbf5ea; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.7), 0 0 14px rgba(0, 0, 0, 0.4); }
:root[data-theme="light"] .hero-subtitle { color: #f6eee0; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.7); }
:root[data-theme="light"] .hero-kicker { color: #f0e2cf; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75); }

/* Light mode: the navbar is sticky, so it rides over paper for most of the
   scroll — give it paper and ink, not the hero's cream-on-dark treatment. */
:root[data-theme="light"] .navbar { background: linear-gradient(to bottom, rgba(247, 242, 232, 0.97), rgba(247, 242, 232, 0.90)); border-bottom: 1px solid var(--border-color); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
:root[data-theme="light"] .navbar .logo, :root[data-theme="light"] .navbar .nav-links a, :root[data-theme="light"] .navbar .btn-icon { color: var(--text-primary); text-shadow: none; }
:root[data-theme="light"] .navbar .logo-mark { color: var(--accent-copper); }
:root[data-theme="light"] .navbar .nav-links a:hover { color: var(--accent-copper); }

/* About page (/about/): editorial single column, photos between sections. */
.about-page .page-header { text-align: left; margin-bottom: 28px; }
.about-page .section-desc { margin-left: 0; max-width: 620px; }
.about-page .article-card { max-width: 760px; }
.about-figure { margin: 8px 0 40px; }
.about-figure img { width: 100%; height: auto; display: block; }
.about-figure figcaption { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-copper); border-top: 1px solid var(--border-color); padding-top: 10px; margin-top: 10px; }
.about-figure.about-figure-side { float: right; width: 44%; margin: 6px 0 24px 36px; }
.about-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 32px; margin: 8px 0 40px; padding: 24px 0; border-top: 1px solid var(--border-highlight); border-bottom: 1px solid var(--border-color); }
.about-facts dt { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent-copper); margin-bottom: 4px; }
.about-facts dd { margin: 0; font-size: 1rem; color: var(--text-primary); }
.about-page .article-body h2 { margin-top: 44px; }
.about-page .article-body h2:first-child { margin-top: 0; }
.about-page .article-body ul { padding-left: 1.2em; }
.about-page .article-body li { margin-bottom: 8px; }
.about-elsewhere { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border-highlight); display: flex; flex-wrap: wrap; gap: 18px 28px; }
.about-elsewhere a { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-copper); }
.about-elsewhere a::after { content: ' \2192'; }
@media (max-width: 600px) {
  .about-figure.about-figure-side { float: none; width: 100%; margin: 6px 0 32px; }
  .about-facts { grid-template-columns: 1fr; }
}
