:root {
  /* Page 2 has no body class, so this is its default font - edit here to change
     headerText, textEl.textContent, and the rest of page 2's scrolly content in one place. */
  --page2-font: Tahoma, Geneva, Verdana, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--page2-font);
  color: #222;
  background: #fff;
  cursor: url('../assets/images/Pen.png') 2 2, auto !important;
}

/* Times New Roman for page1 and page3 */
body.page1,
body.page3 {
  font-family: "Times New Roman", Times, serif;
}

html *, body * {
  cursor: url('../assets/images/Pen.png') 2 2, auto !important;
}

/* Buttons/inputs/selects don't inherit body font-family by default in browsers -
   force them to match the surrounding page's font instead of the OS UI font */
button, input, select, textarea {
  font-family: inherit;
}

#scrolly-container {
  width: 100%;
  margin: 0;
  padding: 0;
}

.scrolly {
  position: relative;
  width: 100%;
  margin-bottom: 0;
  overflow: visible;
}

/* Transition section between hook and arrests */
.transition-section {
  position: relative;
  width: 100%;
  min-height: 600vh; /* Extended scroll time for the entire transition */
}

.transition-section#transition1 {
  min-height: 100vh; /* Shorter scroll time - starts at darkest state */
  z-index: 5;
}

/* Shorter scroll time for transitions 2 and 3 */
.transition-section#transition2,
.transition-section#transition3 {
  min-height: 300vh; /* Reduced scroll time for faster transitions */
}

.transition-container {
  position: sticky;
  top: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.transition-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 1;
  transition: opacity 0.1s ease-out;
  pointer-events: none; /* Don't block mouse events - overlays are visual only */
}

/* Fixed overlay for transitions 2 and 3 - covers entire viewport */
.transition-section#transition2 .transition-overlay,
.transition-section#transition3 .transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  transition: opacity 0.3s ease-out;
  pointer-events: none; /* Don't block mouse events - overlays are visual only */
}

.transition-content {
  position: relative;
  z-index: 2;
  text-align: center;
  width: 100%;
  max-width: 800px;
  padding: 2rem;
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
}

/* Ensure transition content appears above fixed overlay for transitions 2 and 3 */
.transition-section#transition2 .transition-content,
.transition-section#transition3 .transition-content {
  position: relative;
  z-index: 1001;
}

/* Ensure transition text appears above fixed overlay for transitions 2 and 3 */
.transition-section#transition2 .transition-text,
.transition-section#transition3 .transition-text {
  position: absolute;
  z-index: 1002;
}

.transition-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  color: #fff;
  text-transform: none;
  letter-spacing: 0.1em;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  white-space: nowrap;
}

.transition-subhead {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 30px));
  font-size: clamp(0.875rem, 1.5vw, 1.125rem);
  font-weight: 700;
  color: #fff;
  text-transform: none;
  letter-spacing: 0.05em;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  white-space: nowrap;
  opacity: 0;
}

#transition-text-1 {
  opacity: 0;
}

#transition-text-2 {
  opacity: 0;
}

#transition-text-4 {
  opacity: 0;
  font-size: clamp(1.5rem, 2.5vw, 2.0rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  top: 60%; /* Position below text3 */
  white-space: normal;
  text-align: center;
  max-width: 80%;
}

#transition-text-4 a {
  color: #fff;
  text-decoration: underline;
  transition: opacity 0.3s ease-out;
}

#transition-text-4 a:hover {
  opacity: 0.8;
}

/* Section title cards - positioned at top, above graphic */
.scrolly > .section-title-card {
  position: relative;
  z-index: 20;
  padding: 2rem;
  margin-bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 100%;
}

/* Remove bottom margin/padding from mainviz2 title card */
#mainviz2 .section-title-card {
  margin-bottom: 0;
  padding-bottom: 1.5rem;
}

/* Full screen sticky graphic - positioned behind text */
.graphic {
  position: sticky;
  top: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  background: #fafafa;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Centered scrolling text - overlays the graphic */
.article {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 100vh 2rem;
  pointer-events: none;
}

/* Hook section - reduce top padding and left-align content */
#hook .article {
  padding: 0; /* Remove all padding including side padding */
  align-items: flex-start; /* Left align instead of center */
  text-align: left;
  max-width: 100%; /* Remove max-width constraint */
  margin: 0; /* Remove auto centering */
  width: 100%; /* Full width */
}

/* Add minimal padding to hook content for readability */
#hook .step {
  padding-left: 0;
  padding-right: 0;
}

.article > * {
  pointer-events: auto;
}

.step {
  margin: 0;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  border-left: 4px solid transparent;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  margin-bottom: 50vh;
  font-size: 1rem; /* Smaller font size */
}

/* Hook result step - remove box styling and reduce padding */
#hook #hook-result-step {
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  border-radius: 0;
  border-left: none;
  box-shadow: none;
  margin-bottom: 40vh; /* Slightly more padding under last response */
}

/* Remove padding from hook result content */
#hook #hook-result-text {
  margin: 0 auto;
  padding: 0;
  text-align: center;
  width: 100%;
  max-width: 800px;
}

#hook #hook-person-visual {
  margin: 1rem auto 0.5rem auto;
  text-align: center;
  width: 100%;
  max-width: 800px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.step:last-child {
  margin-bottom: 50vh;
}

/* Reduce spacing for solution section */
#solution .step:last-child {
  margin-bottom: 1rem;
}

/* Reduce spacing between centers and solitary sections */
#centers .step:last-child {
  margin-bottom: 20vh;
}

.step.is-active {
  border-left-color: #8b1e3f;
  background: rgba(251, 235, 240, 0.95);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Top 10 flows table */
.top10-flows-table {
  width: 100%;
  margin-top: 1.5rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.top10-flows-table thead {
  background: rgba(0, 0, 0, 0.05);
}

.top10-flows-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.top10-flows-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.top10-flows-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

.top10-flows-table th:nth-child(1),
.top10-flows-table td:nth-child(1) {
  width: 60px;
  text-align: center;
}

.top10-flows-table th:nth-child(4),
.top10-flows-table td:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Remove borders from hook compare step */
#hook #hook-compare-step {
  border-left: none !important;
  border-right: none !important;
  border-top: none !important;
  border-bottom: none !important;
  padding: 0;
  margin-top: 0; /* Reduce gap between person visual and compare text */
  background: transparent !important;
  box-shadow: none !important;
}

/* Remove padding from hook compare text */
#hook #hook-compare-text {
  margin: 0 auto;
  padding: 0;
  text-align: center;
  width: 100%;
  max-width: 800px;
}

/* Left align all hook step content */
#hook .step {
  text-align: left;
  align-items: flex-start;
}

@media (max-width: 800px) {
  .article {
    max-width: 90%;
    padding: 0 1rem;
  }
  
  .step {
    padding: 1.5rem;
    margin: 40vh 0;
  }
  
  .scrolly > .section-title-card {
    padding: 1.5rem;
  }
}

#viz-arrests {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#viz-arrests svg {
  width: 100%;
  height: 100%;
  max-width: 95vw;
  max-height: 90vh;
}

/* Arrests section - graphic is already full screen via .graphic */
#arrests .graphic {
  z-index: 1;
}

/* Detainments section - normal scrolling, centered text */
#detainments .graphic {
  position: static; /* Not sticky */
  height: 30vh; /* Full viewport height for centering */
  min-height: 30vh;
  align-items: center;
  justify-content: center;
  padding-bottom: 2rem; /* Add padding at bottom to prevent text cutoff */
}

#arrests .article {
  z-index: 10;
}

#viz-citizenship {
  width: 100%;
  height: 100%;
  background: #fafafa;
}

#arrests-citizenship .graphic {
  width: 100vw;
  height: 100vh;
  pointer-events: auto; /* Ensure graphic can receive mouse events */
}

/* Allow clicks to pass through step elements to the map, but keep text/table interactive */
#arrests-citizenship .article .step {
  pointer-events: none; /* Allow clicks to pass through to graphic */
}

#arrests-citizenship .article .step p,
#arrests-citizenship .article .step table,
#arrests-citizenship .article .step strong {
  pointer-events: auto; /* But text/table should still be interactive */
}

#deportation-destinations .graphic {
  width: 100vw;
  height: 100vh;
}

#viz-deportation {
  width: 100%;
  height: 100%;
  background: #fafafa;  /* light background so you can see */
}

/* Intro page styling */
#intro-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
}

#intro-page {
  width: 100%;
  max-width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  gap: 0;
}

.intro-graphic {
  width: 100%;
  text-align: center;
}

.intro-graphic .hook-title {
  font-family: "Times New Roman", Times, serif;
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  line-height: 1.25;
  text-align: center;
  margin: 0;
}

.intro-form-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.intro-form-wrapper {
  width: 100%;
  max-width: 520px;
}

.intro-form-wrapper .hook-instructions {
  margin: 0 0 1rem 0;
  text-align: center;
  font-size: 1.1rem;
}

#intro-form {
  display: grid;
  gap: 0.75rem;
  width: 100%;
}

#intro-form label {
  display: grid;
  gap: 0.25rem;
}

#intro-form input,
#intro-form select {
  padding: 0.5rem 0.6rem;
  border: 1px solid #222;
  background: rgba(255,255,255,0.9);
  font-family: "Times New Roman", Times, serif;
}

/* Override for legal form inputs - let theme.css handle these */
#intro-form.legal-body .legal-field input,
#intro-form.legal-body .legal-field select {
  padding: 24px 6px 2px 6px !important;
  border: none !important;
  background: #fff !important;
  font-family: "Times New Roman", Times, serif !important;
  margin: 0 !important;
  margin-top: auto !important;
  height: 100% !important;
  min-height: 55px !important;
  line-height: 1.1 !important;
}

#intro-form button {
  width: fit-content;
  padding: 0.5rem 0.9rem;
  border: 1px solid #222;
  background: #fff;
  cursor: url('../assets/images/Pen.png') 2 2, auto !important;
  font-family: "Times New Roman", Times, serif;
  font-size: 1rem;
  margin-top: 0.5rem;
}

#intro-form button:hover {
  background: #f5f5f5;
}

.intro-form-wrapper .hook-certify {
  margin-top: 0.25rem;
}

.intro-form-wrapper .hook-signature {
  display: inline-block;
  margin-left: 0.5rem;
}

@media (max-width: 800px) {
  #intro-page {
    padding: 1.5rem;
    gap: 2rem;
  }
  
  .intro-graphic .hook-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }
}

/* Page navigation button */
.page-navigation {
  position: relative;
  width: 100%;
  padding: 6rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fafafa;
  z-index: 10;
  min-height: 200px;
}

.nav-button {
  display: block;
  width: 100%;
  max-width: 1200px;
  padding: 2.5rem 4rem;
  background: #222;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 3px solid #222;
  transition: all 0.3s ease;
  cursor: url('../assets/images/Pen.png') 2 2, auto !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-button:hover {
  background: #fff;
  color: #222;
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.nav-button:active {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 800px) {
  .page-navigation {
    padding: 4rem 1.5rem;
    min-height: 150px;
  }
  
  .nav-button {
    padding: 2rem 2.5rem;
    max-width: 100%;
  }
}

/* Progress indicator dots - RIGHT SIDE */
.progress-indicator {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  pointer-events: none;
}

.progress-dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  text-decoration: none;
  transition: all 0.3s ease;
  background: none;
  border: none;
  padding: 0;
  cursor: url('../assets/images/Pen.png') 2 2, auto !important;
}

.progress-dot .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  border: 1.5px solid rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  position: relative;
}

.progress-dot.active .dot {
  background: #8B1E3F;
  border-color: #8B1E3F;
  box-shadow: 0 0 0 3px rgba(139, 30, 63, 0.15);
  transform: scale(1.15);
}

.progress-dot:hover .dot {
  background: #8B1E3F;
  border-color: #8B1E3F;
  transform: scale(1.25);
}

.progress-dot .dot-label {
  position: absolute;
  right: calc(100% + 1rem);
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px);
  transition: all 0.3s ease;
  z-index: 10;
}

.progress-dot .dot-label::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: rgba(0, 0, 0, 0.85);
}

.progress-dot:hover .dot-label {
  opacity: 1;
  transform: translateX(0);
}

/* Step sections wrapper - transparent, doesn't affect layout */
.step-section {
  position: relative;
  width: 100%;
}

/* Hide on mobile */
@media (max-width: 800px) {
  .progress-indicator {
    display: none;
  }
}


.story-landing {
  min-height: 100vh;
  max-width: 820px;
  margin: 0 auto;
  padding: 1rem 1.25rem 5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #1f1f1f;
}

.story-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.story-landing h1 {
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 0.95;
  margin: 0 0 1rem;
  font-weight: 800;
}

.story-dek {
  font-size: clamp(1.25rem, 2.2vw, 1.8rem);
  line-height: 1.35;
  max-width: 760px;
  margin: 0 0 1rem;
}

.story-byline {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 3rem;
}

.story-intro-text {
  max-width: 680px;
  font-size: 1.08rem;
  line-height: 1.65;
}

.story-intro-text p {
  margin: 0 0 1.15rem;
}

#intro-page .legal-form-zoom {
  padding-top: 1rem;
  padding-bottom: 0.5rem;
  min-height: auto;
}

.enter-form-btn {
  align-self: flex-start;
  margin-top: 2rem;
  padding: 0.9rem 1.25rem;
  border: 1.5px solid #1f1f1f;
  background: #1f1f1f;
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.enter-form-btn:hover {
  background: transparent;
  color: #1f1f1f;
}

#form-start {
  scroll-margin-top: 2rem;
}