/* ═══════════════════════════════════════════
   HOME PAGE STYLES — index.html only
   Shared base styles: styles.css
═══════════════════════════════════════════ */

/* ===== WELCOME OVERLAY ===== */
.welcome-overlay {
  position: fixed;
  inset: 0;
  background: var(--background);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
  animation: welcomeFadeIn 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.welcome-overlay.closing {
  animation: welcomeFadeOut 0.5s ease forwards;
  pointer-events: none;
}

@keyframes welcomeFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes welcomeFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.welcome-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 560px;
  width: 100%;
  animation: welcomeSlideUp 1s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

@keyframes welcomeSlideUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-logo {
  width: 120px;
  height: auto;
  margin-bottom: 2rem;
  opacity: 0.9;
  filter: brightness(0);
  transition: all 0.3s ease;
}

.welcome-logo:hover {
  transform: scale(1.04);
}

.welcome-eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-massive);
  text-transform: uppercase;
  color: var(--dark-blue);
  margin-bottom: 1.4rem;
}

.welcome-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--ls-wide);
  font-size: var(--fs-display);
  color: var(--primary);
  line-height: 1.05;
  margin-bottom: 1.6rem;
}

.welcome-title em {
  color: var(--dark-blue);
  font-style: normal;
}

.welcome-divider {
  width: 56px;
  height: 1px;
  background: var(--border);
  margin: 0 auto 1.6rem;
}

.welcome-tagline {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0.7;
  margin-bottom: 1.8rem;
}

.welcome-description {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  line-height: 1.85;
  color: var(--primary);
  margin-bottom: 2.8rem;
  max-width: 50ch;
}

.welcome-btn {
  background: var(--blue);
  color: var(--paper);
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.9rem 2.6rem;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  cursor: pointer;
  min-height: 44px;
  transition:
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.welcome-btn:hover {
  background: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--bs-heavy);
}

.welcome-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

@media (max-width: 480px) {
  .welcome-logo {
    width: 56px;
    margin-bottom: 1.6rem;
  }

  .welcome-description {
    font-size: var(--fs-xs);
    margin-bottom: 2.2rem;
  }

  .welcome-btn {
    padding: 0.8rem 2rem;
  }
}

/* ===== BASE LAYOUT ===== */
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== HEADER ===== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* ── PAGE WATERMARK ── */
header::before {
  content: "Reflections & Insights";
  font-size: var(--fs-watermark);
}

/* ===== PREFACE OVERLAY ===== */
.preface-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preface-overlay.visible {
  display: flex;
  opacity: 1;
}

.preface-overlay.hidden {
  display: none;
}

.preface-modal {
  background: var(--border-light, #eaf4f8);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.8rem;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
}

.preface-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--muted, #888);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.preface-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
}

.preface-label {
  font-size: var(--fs-xs, 0.72rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 1rem;
}

.preface-quote {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--fs-lg, 1.35rem);
  line-height: 1.55;
  color: var(--primary, #1a1a1a);
  border: none;
  margin: 0 0 1.8rem 0;
  padding: 0 0 1.4rem 0;
  border-bottom: 1px dashed var(--border-light, #ddd);
}

.preface-body p {
  font-size: var(--fs-sm, 0.88rem);
  line-height: 1.85;
  color: var(--text-primary, #3a3530);
  margin-bottom: 1rem;
}

.preface-body p:last-child {
  margin-bottom: 0;
}

.preface-body .preface-highlight {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: var(--fs-base);
  color: var(--primary);
  line-height: 1.6;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  margin-bottom: 1rem;
}

.preface-body .preface-section-intro {
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: var(--ls-wide);
  color: var(--primary);
  text-transform: uppercase;
  margin-top: 1.6rem;
  margin-bottom: 0.8rem;
  opacity: 0.6;
}

.preface-body .preface-sections {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1.4rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.preface-body .preface-section {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
}

.preface-body .preface-section:last-child {
  border-bottom: none;
}

.preface-body .preface-section h3 {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--primary);
  letter-spacing: var(--ls-tight);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.preface-body .preface-section p {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  line-height: 1.75;
  margin-bottom: 0;
}

.preface-body .preface-closing {
  font-style: italic;
  color: var(--primary);
  opacity: 0.8;
  margin-top: 1.4rem;
}

.preface-body .preface-authors {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-massive);
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-light);
}

/* ===== PREFACE TRIGGER BUTTON ===== */
.preface-trigger {
  display: inline-flex;
  align-items: center;
  background: var(--background);
  color: var(--primary);
  border-radius: var(--radius-xl);
  padding: 0.4rem 1rem;
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  border: none;
  outline: none;
  box-shadow: none;
  transition: all 0.15s;
  pointer-events: all;
}

.preface-trigger:hover {
  transform: scale(1.1);
}

/* ===== ADJUSTMENT OVERLAY ===== */
.adjustment-modal {
  max-width: 860px;
}

.adjustment-modal .callout-left--awareness {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* ===== MOBILE WARNING BANNER ===== */
.mobile-warning {
  background-color: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1rem;
  display: none;
  width: 100%;
  box-sizing: border-box;
  animation: slideDownBanner 0.3s ease-out;
}

.mobile-warning .warning-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--primary);
}

.mobile-warning .warning-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.mobile-warning .warning-text {
  flex: 1;
  line-height: 1.4;
}

.mobile-warning .warning-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.mobile-warning .warning-dismiss:hover {
  background-color: var(--background);
  color: var(--primary);
}

.warning-dismiss:active {
  animation: shakeDismiss 0.3s;
}

@media (max-width: 480px) {
  .mobile-warning .warning-content {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .mobile-warning .warning-text {
    width: calc(100% - 2rem);
    order: 1;
  }

  .mobile-warning .warning-dismiss {
    order: 2;
    margin-left: auto;
  }
}

/* ===== GLOBAL HTML SETTINGS ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* ===== SERIES INTRO ===== */
.series-intro {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
}

.series-intro::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.1;
  z-index: -1;
  pointer-events: none;
}

.series-intro .kicker {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-huge);
  text-transform: uppercase;
  line-height: 2;
  color: var(--primary);
  margin-bottom: 1rem;
  display: block;
}

.series-intro h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-xl);
  color: var(--accent-navy);
  letter-spacing: var(--ls-tighter);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.series-intro p {
  max-width: 40ch;
  letter-spacing: var(--ls-huge);
  margin: 0 auto;
  font-size: var(--fs-base);
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
  padding: 0.5rem 1rem;
  margin-top: 1rem;
  border-radius: var(--radius-pill);
}

/* ===== SECTIONS GRID ===== */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 380px));
  justify-content: center;
  gap: 1rem 2rem;
  margin-top: var(--space-4);
  margin-bottom: 3rem;
}

/* ===== SECTION CARD ===== */
.section-card {
  background: var(--paper);
  border-radius: var(--radius-lg);
  box-shadow: var(--bs-medium);
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
  user-select: none;
}

.section-card:hover {
  box-shadow: var(--bs-heavy);
  transform: translateY(-2px);
}

.section-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ── Card header band ── */
.sc-header {
  padding: 1.2rem 1.5rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--paper);
}

.sc-num {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 300;
  line-height: 1;
  opacity: 0.28;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--primary);
}

.sc-meta {
  flex: 1;
  min-width: 0;
}

.sc-title {
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.3rem;
  letter-spacing: var(--ls-tight);
}

.sc-desc {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  line-height: 1.55;
  font-weight: 400;
}

/* ── Topic list ── */
.sc-topic-list {
  padding: 0.5rem 1.5rem 0.75rem;
  flex: 1;
  background: var(--paper);
}

.sc-topic-item {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  text-decoration: none;
  cursor: pointer;
  position: relative;
}

.sc-topic-item:last-child {
  border-bottom: none;
}

.sc-topic-arrow {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  flex-shrink: 0;
  opacity: 0.4;
  line-height: 1;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.sc-topic-item:hover .sc-topic-arrow {
  opacity: 1;
  transform: translateX(3px);
}

.sc-topic-name {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  line-height: 1.4;
  font-weight: 400;
  transition: color 0.15s ease;
}

.sc-topic-item:hover .sc-topic-name {
  color: var(--accent-navy);
}

/* ===== FLOATING TOPIC TOOLTIP ===== */
.topic-tooltip {
  position: fixed;
  width: 240px;
  background: var(--background);
  color: var(--paper);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  box-shadow: var(--bs-veryheavy);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transform: translateX(-8px) translateY(-5px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.topic-tooltip.visible {
  opacity: 1;
  transform: translateX(0) translateY(-5px);
}

.topic-tooltip.caret-left::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-style: solid;
  border-width: 6px 6px 6px 0;
  border-color: transparent;
}

.topic-tooltip.caret-right::before {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-style: solid;
  border-width: 6px 0 6px 6px;
  border-color: transparent;
}

.tt-subtitle {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--dark-blue);
  margin-bottom: 0.4rem;
  font-weight: 400;
}

.tt-title {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--dark-blue);
  line-height: 1.3;
  margin-bottom: 0.5rem;
  letter-spacing: var(--ls-tight);
}

.tt-desc {
  font-size: var(--fs-xs);
  color: var(--text-dark);
  line-height: 1.65;
}

/* ===== MOBILE TOPIC OVERLAY ===== */
.topic-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.45);
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.topic-overlay.visible .topic-overlay-panel {
  transform: translateY(0);
  opacity: 1;
}

.topic-overlay-panel {
  background: var(--paper);
  width: 100%;
  max-width: 540px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 2rem 1.75rem 2.5rem;
  position: relative;
  transform: translateY(40px);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.25s ease;
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.15);
}

.topic-overlay-panel::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto 1.5rem;
}

.topic-overlay-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--background);
  border: none;
  color: var(--primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s;
}

.topic-overlay-close:hover {
  background: var(--border-light);
}

.to-meta {
  margin-bottom: 1rem;
}

.to-subtitle {
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.to-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-xl);
  color: var(--primary);
  line-height: 1.25;
  margin: 0;
}

.to-desc {
  font-size: var(--fs-sm);
  color: var(--primary);
  line-height: 1.75;
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.to-explore-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: var(--ls-wider);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  transition:
    opacity 0.2s,
    transform 0.15s;
  min-height: 44px;
}

.to-explore-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.to-explore-btn:active {
  transform: translateY(0);
}

@media (min-width: 769px) {
  .topic-overlay {
    display: none !important;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (max-width: 750px) {
  .container {
    padding: 0 1.2rem;
  }

  header h1 {
    font-size: var(--fs-xl);
    line-height: 1.2;
  }

  .series-intro h2 {
    font-size: var(--fs-xl);
    font-weight: 600;
  }

  .series-intro p {
    font-size: var(--fs-sm);
    padding: 0 1rem;
  }
}

@media (max-width: 640px) {
  .sections-grid {
    grid-template-columns: 1fr;
  }

  .topic-tooltip {
    display: none;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  header h1 {
    font-size: var(--fs-lg);
  }

  .series-intro h2 {
    font-size: var(--fs-xl);
    font-weight: 600;
  }

  .series-intro .kicker {
    font-size: var(--fs-xs);
  }

  footer p {
    font-size: var(--fs-xs);
  }
}

@media (max-width: 360px) {
  .series-intro h2 {
    font-size: var(--fs-xl);
  }
}

@media (max-width: 768px) {
  .nav-link {
    -webkit-tap-highlight-color: transparent;
  }

  .section-card {
    -webkit-tap-highlight-color: rgba(26, 82, 118, 0.1);
  }
}
