:root {
  --bg-canvas: #121518;
  --bg-surface: #1a1f24;
  --bg-surface-hover: #222930;
  --bg-surface-card: #1c2228;
  --bg-surface-elevated: #242c34;
  --text-primary: #f3f5f7;
  --text-muted: #9aa8b2;
  --text-subtle: #6b7d8a;
  --accent-primary: #2dd4bf;
  --accent-primary-dark: #14b8a6;
  --accent-primary-glow: rgba(45, 212, 191, 0.16);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.14);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-card: rgba(154, 168, 178, 0.18);
  --border-card-hover: rgba(45, 212, 191, 0.45);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 8px 24px -4px rgba(0, 0, 0, 0.42), 0 2px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-card-hover: 0 16px 36px -6px rgba(0, 0, 0, 0.55), 0 0 20px -2px rgba(45, 212, 191, 0.18);
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, "SF Mono", Menlo, Monaco, monospace;
}

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

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-image: 
    radial-gradient(ellipse 90% 40% at 50% 0%, rgba(45, 212, 191, 0.08) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 85% 70%, rgba(245, 158, 11, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Header & Sticky Navigation */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(18, 21, 24, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-header.scrolled {
  background: rgba(22, 26, 31, 0.96);
  border-bottom-color: var(--border-medium);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: opacity 0.2s ease;
}

.brand-wrapper:hover {
  opacity: 0.9;
}

.brand-mark {
  width: 13px;
  height: 13px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #0d9488 100%);
  border-radius: 3px;
  display: inline-block;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.55);
}

.brand-title {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--text-primary);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s ease;
  padding: 6px 12px;
  border-radius: 4px;
  position: relative;
}

.nav-link:hover, .nav-link:focus-visible {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: var(--accent-primary);
  background: var(--accent-primary-glow);
  font-weight: 600;
}

.mobile-menu-btn {
  display: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.mobile-menu-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
}

/* Main Structure & Column Containers */
main {
  flex: 1 0 auto;
}

.reading-column {
  max-width: 74ch;
  margin-left: auto;
  margin-right: auto;
  padding: clamp(2rem, 4.5vw, 4rem) 1.5rem;
}

.wide-wrapper {
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding: clamp(2rem, 5vw, 4.5rem) 1.5rem;
}

/* Hero Section */
.hero-journal {
  background: linear-gradient(180deg, rgba(26, 31, 36, 0.6) 0%, rgba(18, 21, 24, 0.95) 100%);
  padding: clamp(3.5rem, 8vw, 6.5rem) 1.5rem clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.hero-journal::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 100%;
  background: radial-gradient(circle at 50% 15%, var(--accent-primary-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  max-width: 84ch;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-primary);
  background: var(--accent-primary-glow);
  border: 1px solid rgba(45, 212, 191, 0.28);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
  font-weight: 600;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-primary);
}

.hero-title {
  font-size: clamp(2.1rem, 5.2vw, 3.5rem);
  line-height: 1.14;
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 22px;
  overflow-wrap: anywhere;
}

.hero-lead {
  font-size: clamp(1.08rem, 2.2vw, 1.25rem);
  line-height: 1.68;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 66ch;
}

/* Button UI */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 212, 191, 0.08);
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  border-radius: 6px;
  padding: 11px 24px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(45, 212, 191, 0.12);
}

.btn-outline:hover, .btn-outline:focus-visible {
  background: var(--accent-primary);
  color: #0d1317;
  box-shadow: 0 4px 20px rgba(45, 212, 191, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-medium);
  color: var(--text-primary);
  margin-left: 14px;
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

/* Section Rhythm */
.journal-section {
  padding: clamp(3rem, 6vw, 4.8rem) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.radial-bg {
  background: radial-gradient(ellipse at 85% 50%, rgba(45, 212, 191, 0.05) 0%, transparent 65%);
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-primary);
  display: inline-block;
  margin-bottom: 10px;
  font-weight: 600;
}

h2.section-heading {
  font-size: clamp(1.65rem, 3.5vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #ffffff;
  margin-bottom: 18px;
  line-height: 1.24;
}

h3.sub-heading {
  font-size: 1.26rem;
  color: #ffffff;
  margin: 2rem 0 0.9rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

p {
  margin-bottom: 1.35rem;
  color: var(--text-muted);
}

p strong {
  color: var(--text-primary);
}

/* Editorial Pull Quotes */
.editorial-quote {
  border-left: 4px solid var(--accent-primary);
  padding: 18px 24px;
  margin: 2.4rem 0;
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.07) 0%, rgba(26, 31, 36, 0.5) 100%);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.65;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Breakout Media Containers */
.breakout-media {
  margin: 2.6rem 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

.breakout-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.breakout-media:hover img {
  transform: scale(1.015);
}

.media-annotation {
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}

.media-annotation::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid var(--accent-primary);
  border-radius: 2px;
}

/* Cards & Card Grid Layout */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 2.2rem;
}

.project-panel {
  background: var(--bg-surface-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.project-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-panel:hover {
  transform: translateY(-4px);
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-card-hover);
  background: var(--bg-surface-hover);
}

.project-panel:hover::before {
  opacity: 1;
}

.panel-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
  background: var(--accent-primary-glow);
  display: inline-block;
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 600;
}

.panel-title {
  font-size: 1.24rem;
  font-weight: 650;
  color: #ffffff;
  margin-bottom: 10px;
  line-height: 1.32;
  letter-spacing: -0.015em;
}

.panel-body {
  font-size: 0.94rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 18px;
  line-height: 1.62;
}

.panel-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Process Rail Steps */
.process-rail {
  list-style: none;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.process-step {
  display: flex;
  gap: 18px;
  background: var(--bg-surface-card);
  padding: 20px 22px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.process-step:hover {
  border-color: var(--border-medium);
  background: var(--bg-surface-hover);
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-primary-glow);
  border: 1px solid rgba(45, 212, 191, 0.3);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}

.step-content h4 {
  font-size: 1.05rem;
  font-weight: 650;
  color: #ffffff;
  margin-bottom: 6px;
}

.step-content p {
  margin-bottom: 0;
  font-size: 0.93rem;
  color: var(--text-muted);
}

/* Mistake & Repair Callouts */
.repair-callout {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08) 0%, rgba(28, 34, 40, 0.85) 100%);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-left: 4px solid var(--accent-amber);
  padding: 18px 22px;
  border-radius: 8px;
  margin: 2.2rem 0;
  box-shadow: var(--shadow-sm);
}

.repair-header {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-amber);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.repair-header::before {
  content: "✦";
  font-size: 0.9rem;
}

.repair-callout p {
  margin-bottom: 0;
  font-size: 0.93rem;
  color: var(--text-primary);
}

/* Material Checklist */
.material-checklist {
  list-style: none;
  background: var(--bg-surface-card);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 12px 20px;
  margin: 1.8rem 0;
  box-shadow: var(--shadow-sm);
}

.material-checklist li {
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.material-checklist li:last-child {
  border-bottom: none;
}

.check-box {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--accent-primary);
  border-radius: 3px;
  display: inline-block;
  background: var(--accent-primary-glow);
  flex-shrink: 0;
}

/* Form Styles */
.journal-form {
  background: var(--bg-surface-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 28px;
  margin-top: 1.8rem;
  box-shadow: var(--shadow-card);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.form-control {
  width: 100%;
  background: var(--bg-canvas);
  border: 1px solid var(--border-medium);
  color: #ffffff;
  font-family: var(--font-body);
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 0.96rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
  background: #15191d;
}

textarea.form-control {
  min-height: 128px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* Data Table wrapper */
.table-wrapper {
  overflow-x: auto;
  margin: 1.8rem 0;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface-card);
}

.journal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.journal-table th, .journal-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}

.journal-table th {
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--accent-primary);
  letter-spacing: 0.08em;
  font-weight: 600;
}

.journal-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.journal-table tr:last-child td {
  border-bottom: none;
}

/* Site Footer */
.site-footer {
  background: #0f1215;
  border-top: 1px solid var(--border-medium);
  padding: 3.8rem 1.5rem 2.2rem;
  margin-top: auto;
  font-size: 0.9rem;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 2.4rem;
}

.footer-col h5 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
  font-weight: 700;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s ease;
  font-size: 0.88rem;
}

.footer-links a:hover, .footer-links a:focus-visible {
  color: var(--accent-primary);
  text-decoration: underline;
}

.footer-legal-copy {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.8rem;
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.footer-legal-copy a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* Responsive Rules */
@media (max-width: 820px) {
  .site-header {
    padding: 12px 18px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 14px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65);
    min-width: 220px;
    z-index: 200;
  }

  .site-nav.open {
    display: flex;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}