:root {
  --bg-canvas: #1c1f24;
  --bg-surface: #292e35;
  --bg-surface-hover: #333a42;
  --text-primary: #e5e7eb;
  --text-muted: #9ca3af;
  --accent-primary: #14b8a6;
  --accent-secondary: #0d9488;
  --accent-dark: #0f766e;
  --border-subtle: #374151;
  --charcoal: #111827;
  --radius-card: 20px;
  --radius-sm: 8px;
  --shadow-editorial: 0 14px 34px -10px rgba(0, 0, 0, 0.45);
  --btn-shadow: 4px 4px 0 #0f766e;
}

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

body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.7;
  font-size: 1.05rem;
  overflow-x: hidden;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover, a:focus-visible {
  color: #5eead4;
  text-decoration: underline;
}

:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--accent-primary);
  color: var(--charcoal);
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  z-index: 999;
}
.skip-link:focus {
  top: 1rem;
}

/* Tagline Bar */
.tagline-bar {
  background: #14171a;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 6px 1.5rem;
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Header & Nav */
.site-header {
  position: static;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 1.5rem;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
}
.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent-primary);
  color: var(--charcoal);
  font-weight: 900;
  font-size: 1rem;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.nav-desktop a {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
}
.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--accent-primary);
  background: rgba(20, 184, 166, 0.1);
}

.nav-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 1.2rem;
  cursor: pointer;
}

.nav-mobile {
  display: none;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 1.5rem;
}
.nav-mobile.is-open {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.nav-mobile a {
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Layout wrappers */
.reading-container {
  max-width: 72ch;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}
.wide-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

/* Hero Section */
.hero-editorial {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  background-color: #0d1117;
  background-image: linear-gradient(rgba(17, 24, 39, 0.82), rgba(28, 31, 36, 0.94)), url('images/vintage-astronomy-armillary-sphere.jpg');
  background-size: cover;
  background-position: center;
}
.hero-content {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.hero-tag {
  display: inline-block;
  background: rgba(20, 184, 166, 0.15);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(2.3rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
  color: #ffffff;
}
.hero-lead {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: #cbd5e1;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Buttons */
.btn-teal {
  display: inline-block;
  background-color: var(--accent-primary);
  color: var(--charcoal);
  font-weight: 800;
  padding: 0.9rem 2rem;
  border-radius: var(--radius-card);
  box-shadow: var(--btn-shadow);
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-teal:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--accent-dark);
  text-decoration: none;
  color: var(--charcoal);
}
.btn-teal:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 transparent;
}

/* Teal Interludes */
.interlude-teal {
  background-color: var(--accent-primary);
  color: var(--charcoal);
  padding: 4rem 1.5rem;
  margin: 3.5rem 0;
}
.interlude-teal h2,
.interlude-teal h3 {
  color: #042f2e;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.interlude-teal p {
  color: #134e4a;
  font-size: 1.15rem;
  max-width: 72ch;
  margin: 0 auto 1.5rem auto;
}
.interlude-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

/* Cards & Previews */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2.5rem 0;
}
.editorial-card {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-editorial);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}
.editorial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
}
.card-image-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.editorial-card:hover .card-image-wrap img {
  transform: scale(1.03);
}
.card-body {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.card-category {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.card-title {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 0.8rem;
}
.card-text {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Pull Quotes & Breakout Images */
.pull-quote {
  border-left: 4px solid var(--accent-primary);
  padding: 1.25rem 1.75rem;
  margin: 2.5rem 0;
  font-size: 1.35rem;
  font-style: italic;
  background: rgba(41, 46, 53, 0.6);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  color: #f3f4f6;
}
.pull-quote cite {
  display: block;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--accent-primary);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.breakout-figure {
  margin: 3rem auto;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-editorial);
  max-width: 960px;
}
.breakout-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.breakout-caption {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.9rem 1.25rem;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

/* Question Disclosures */
.quiz-block {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-editorial);
}
.quiz-question {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: #ffffff;
}
.quiz-context {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 1rem;
}
details.explanation-drawer {
  background: #1f2329;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}
details.explanation-drawer summary {
  padding: 1rem 1.25rem;
  font-weight: 700;
  color: var(--accent-primary);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.explanation-drawer summary::-webkit-details-marker {
  display: none;
}
details.explanation-drawer summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 300;
  transition: transform 0.2s ease;
}
details.explanation-drawer[open] summary::after {
  content: "−";
}
.drawer-content {
  padding: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-primary);
  line-height: 1.65;
  background: rgba(0, 0, 0, 0.15);
}

/* Table wrapper */
.table-scroll-wrapper {
  overflow-x: auto;
  margin: 2.5rem 0;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
table.editorial-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}
table.editorial-table th {
  background: #20242a;
  color: var(--accent-primary);
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
}
table.editorial-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
table.editorial-table tr:last-child td {
  border-bottom: none;
}

/* Forms & Tools */
.tool-box {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: 2.2rem;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-editorial);
}
.form-group {
  margin-bottom: 1.5rem;
}
.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #1a1d22;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
}
.form-control:focus {
  border-color: var(--accent-primary);
  outline: none;
}
textarea.form-control {
  resize: vertical;
  min-height: 140px;
}
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}
.btn-secondary {
  background: #374151;
  color: #ffffff;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-card);
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}
.btn-secondary:hover {
  background: #4b5563;
}
.output-preview {
  margin-top: 1.5rem;
  padding: 1.2rem;
  background: #13161a;
  border-radius: 8px;
  border: 1px dashed var(--border-subtle);
  font-family: monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Footer */
.site-footer {
  background: #14171a;
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem 1.5rem 2.5rem;
  margin-top: 5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-col h4 {
  color: var(--text-primary);
  font-size: 1.05rem;
  margin-bottom: 1rem;
  font-weight: 700;
}
.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 0.5rem;
}
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Micro-interaction scroll reveal */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .nav-desktop {
    display: none;
  }
  .nav-toggle-btn {
    display: block;
  }
}

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