/* ============================================
   PROCESS PAGE STYLES
   Scrollytelling Journey and Summary Timeline
   ============================================ */

/* Process Header */
.process-header {
  text-align: center;
  padding-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .process-header {
    padding-top: 15vh;
  }
}

@media (min-width: 1024px) {
  .process-header {
    padding-top: calc(var(--section-padding-y) * 1.3);
  }
}

@media (max-width: 767px) {
  .process-header {
    padding-top: calc(var(--section-padding-y) * 2);
  }
}

/* ============================================
   PROCESS JOURNEY - SCROLLYTELLING STAGES
   ============================================ */
.process-journey {
  position: relative;
}

.process-stage {
  position: relative;
  min-height: auto;
  display: grid;
  grid-template-columns: 1fr;
  /* INTENTIONAL: aligned to var(--section-padding-y) instead of the
     fixed var(--space-6) so this section's vertical rhythm matches
     every section-padded section on the rest of the site below
     1024px (where this rule is the one actually governing spacing —
     see the min-width: 1024px override just below, which zeroes this
     to 0 and hands padding to .stage-content-container/.stage-media-
     container instead). Do not extend this change to the desktop
     children's own padding: their space-6/space-10 values are load-
     bearing for the sticky/parallax scroll mechanism, not simple
     section spacing — see the INTENTIONAL comments on those rules. */
  padding: var(--section-padding-y) 0;
}

@media (min-width: 1024px) {
  .process-stage {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    padding: 0;
    min-height: 120vh;
  }
}

/* Stage Media (Sticky on desktop) */
.stage-media-container {
  position: relative;
  width: 100%;
  padding: 0 var(--section-padding-x);
  margin-bottom: var(--space-4);
}

@media (min-width: 1024px) {
  .stage-media-container {
    margin-bottom: 0;
  }
}

@media (min-width: 1024px) {
  .stage-media-container {
    position: sticky;
    top: 100px;
    height: calc(100vh - 200px);
    max-height: 800px;
    display: flex;
    align-items: center;
    padding: var(--space-6) 0 var(--space-6) var(--section-padding-x);
    will-change: transform;
  }
}

.stage-media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: linear-gradient(135deg, #2E2E2E 0%, #121212 100%);
}

/* INTENTIONAL: portrait tablet — single column with height
   cap. Full-width image stays prominent without dominating
   the viewport. aspect-ratio: unset allows max-height to
   take effect. Two-column layout activates at 1024px below.
   Do not remove max-height or aspect-ratio: unset. */
@media (min-width: 768px) and (max-width: 1023px) {
  .stage-media {
    aspect-ratio: 4 / 5;
    width: 85%;
    margin: 0 auto;
  }
}

@media (min-width: 1024px) {
  .stage-media {
    height: 100%;
    max-height: 800px;
    width: auto;
    aspect-ratio: 4 / 5;
  }
}

/* Media-left stages (2 and 4) pull the image toward the outer edge for
   a parallax "off-screen" effect. The full -120px shift needs a wide
   column to absorb it; at 1024-1439px — where iPad Mini, iPad Air, and
   iPad Pro 11" landscape all land (1024/1180/1194px) — that same shift
   pushes the image past the left edge of the viewport and bleeds off
   screen. Scale the offset down for that range; the full effect still
   plays at Wide (>=1440px), where the column is wide enough for it. */
@media (min-width: 1024px) and (max-width: 1439px) {
  .process-stage[data-stage="2"] .stage-media,
  .process-stage[data-stage="4"] .stage-media {
    margin-left: auto;
    transform: translateX(-32px);
  }
}

@media (min-width: 1440px) {
  .process-stage[data-stage="2"] .stage-media,
  .process-stage[data-stage="4"] .stage-media {
    margin-left: auto;
    transform: translateX(-120px);
  }
}

.stage-viewer-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  touch-action: none;
}

.stage-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transform: scale(1);
}

@media (min-width: 1024px) {
  .stage-image {
    opacity: 0;
    transform: scale(1);
    transition: opacity 2.0s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform, opacity;
  }

  .process-stage.in-view .stage-image {
    opacity: 1;
    /* transform is now controlled by JavaScript scroll-driven parallax */
  }
}

/* Stage Content */
.stage-content-container {
  position: relative;
  padding: var(--space-6) var(--section-padding-x);
  display: flex;
  align-items: center;
}

@media (min-width: 1024px) {
  .stage-content-container {
    padding: var(--space-10) var(--section-padding-x) var(--space-10) 0;
  }
}

.stage-content {
  max-width: 600px;
  opacity: 1;
  transform: translateY(0);
}

/* INTENTIONAL: flex column reorder — stage-text paragraphs
   appear above stage-details bullets at tablet and desktop.
   DOM order has bullets before text; order: 1 on .stage-details
   pushes them after all order: 0 siblings (text included).
   Do not remove — mobile is unaffected (collapse/expand still works). */
@media (min-width: 768px) {
  .stage-content {
    display: flex;
    flex-direction: column;
  }

  .stage-details {
    order: 1;
  }
}

@media (min-width: 1024px) {
  .stage-content {
    text-align: left;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
  }

  .process-stage.in-view .stage-content {
    opacity: 1;
    transform: translateY(0);
  }
}

.stage-number {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  color: var(--color-brass);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.stage-title {
  font-family: var(--font-primary);
  font-size: var(--text-2xl);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2);
}

.stage-subtitle {
  font-family: var(--font-secondary);
  font-size: var(--text-lg);
  font-weight: var(--weight-light);
  line-height: var(--leading-snug);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-5);
}

.stage-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

/* Body text is a leftover of a bullet-anchored accordion design that no
   longer exists in the markup (process.html has no .stage-details list
   and no .stage-expand-toggle button — see CLAUDE.md: process.html has
   "no accordion"). The old rule hid .stage-text behind max-height: 0
   below 768px with nothing left in the DOM to add .is-expanded, which
   left mobile portrait (< 768px wide) with no visible body copy at all
   while landscape (>= 768px wide) was unaffected. Text now renders at
   every width using the base .stage-text rules above. */

.stage-text p {
  font-family: var(--font-secondary);
  /* INTENTIONAL: matches .page-subtitle at var(--text-lg).
     2px increase from var(--text-base) improves legibility
     for the target demographic without affecting hierarchy —
     stage number, title, and subtitle carry that work.
     Do not revert to var(--text-base). */
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  margin: 0;
}

.stage-text em {
  color: var(--color-brass);
  font-style: italic;
}

/* Inline link inside movement prose (e.g. "Cape Cod", "Maui"). Follows the
   same brass/no-underline-at-rest convention as .about-statement-link
   (css/about.css) and .piece-availability-link (css/piece.css) — there is
   no single shared sitewide class for this, each page scopes its own. */
.stage-text-link {
  color: var(--color-brass);
  text-decoration: none;
  border-bottom: 1px solid rgba(199, 168, 106, 0.4);
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.stage-text-link:hover,
.stage-text-link:focus-visible {
  border-bottom-color: var(--color-brass);
  opacity: 0.8;
}

/* Movement 1 (Selection) has no media — render as a single full-width
   text column instead of the two-column media/text split, and let it
   size to its content rather than the 120vh sticky-media runway.
   Added for the four-movement rebuild; adjusts only this one case. */
@media (min-width: 1024px) {
  .process-stage[data-stage="1"] {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: var(--space-10) 0;
  }

  .process-stage[data-stage="1"] .stage-content-container {
    padding: 0 var(--section-padding-x);
  }

  .process-stage[data-stage="1"] .stage-content {
    max-width: 700px;
    margin: 0 auto;
  }
}

.stage-details {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

/* INTENTIONAL: hidden at all sizes by default.
   Shown only at max-width: 767px below.
   Do not show on desktop. */
.stage-expand-toggle {
  display: none;
}

/* INTENTIONAL: full opacity and var(--text-sm) weight
   are required for legibility on white background.
   Do not reduce opacity below 1 or font-size below
   var(--text-sm). Do not change color away from brass. */
@media (max-width: 767px) {
  .stage-expand-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-4);
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-brass);
    opacity: 1;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(199, 168, 106, 0.4);
    cursor: pointer;
    padding: 0 0 2px;
    transition: border-bottom-color 0.3s ease;
  }

  .stage-expand-toggle:hover,
  .stage-expand-toggle:focus {
    border-bottom-color: var(--color-brass);
    outline: none;
  }

  .stage-expand-toggle__arrow {
    display: inline-block;
    transition: transform 0.3s ease;
  }

  .stage-expand-toggle.is-expanded .stage-expand-toggle__arrow {
    transform: rotate(180deg);
  }
}

@media (min-width: 768px) {
  .stage-expand-toggle {
    display: none;
  }
}

.stage-details li {
  font-family: var(--font-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-secondary);
  padding-left: var(--space-3);
  position: relative;
}

.stage-details li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--color-brass);
  font-weight: var(--weight-bold);
}

/* INTENTIONAL: center stage number, title, and subtitle
   on mobile only. Body text and bullet lists stay left-aligned.
   display: block on .stage-number is required — without it
   text-align: center has no effect on inline-block elements.
   Do not remove display: block or text-align: center. */
@media (max-width: 1023px) {
  .stage-number {
    display: block;
    text-align: center;
  }

  .stage-title,
  .stage-subtitle {
    text-align: center;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .stage-content {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .stage-number {
    display: block;
    text-align: center;
  }

  .stage-title,
  .stage-subtitle {
    text-align: center;
  }

  .stage-text,
  .stage-details {
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
  }

  .stage-text p {
    text-align: left;
  }

  .stage-details li {
    text-align: left;
    padding-left: var(--space-3);
  }

  .stage-details li::before {
    position: absolute;
    left: 0;
  }
}

/* Alternate layout: Movement 3 (Material) swaps sides from the default
   media-left/content-right arrangement used by Movements 2 and 4.
   Previously driven by :nth-child(even) (stages 2 and 4); changed to
   target data-stage="3" directly once all three were flipped so each
   movement lands on the opposite side from where it started. */
@media (min-width: 1024px) {
  .process-stage[data-stage="3"] {
    grid-template-columns: 1fr 1fr;
  }

  .process-stage[data-stage="3"] .stage-media-container {
    order: 2;
    padding: var(--space-6) var(--section-padding-x) var(--space-6) 0;
  }

  .process-stage[data-stage="3"] .stage-content-container {
    order: 1;
    padding: var(--space-10) 0 var(--space-10) var(--section-padding-x);
  }

  .process-stage[data-stage="3"] .stage-content {
    margin-left: auto;
  }
}

/* ============================================
   PROCESS SUMMARY TIMELINE
   ============================================ */
.process-summary {
  background: var(--color-bg-dark);
}

.process-summary .section-title {
  color: var(--color-text-inverse);
  margin-bottom: var(--space-7);
}

.summary-timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
  .summary-timeline {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* INTENTIONAL: 4-column delayed to 1440px from 1024px.
   At 1024px the four cards are cramped (~235px each).
   2-column at 1024px–1439px gives each card ~460px —
   comfortable for the copy weight inside each card.
   Do not revert 4-column to 1024px. */
@media (min-width: 1440px) {
  .summary-timeline {
    grid-template-columns: repeat(4, 1fr);
  }
}

.summary-item {
  text-align: center;
  padding: var(--space-5) var(--space-3);
  border: 1px solid var(--color-border);
  background: rgba(247, 246, 243, 0.02);
  transition: all 0.3s ease;
}

.process-summary .summary-item.fade-in-scroll {
  transition-duration: 1.6s;
}

.summary-item:hover {
  border-color: var(--color-brass);
  transform: translateY(-4px);
}

.summary-weeks {
  font-family: var(--font-primary);
  font-size: var(--text-xl);
  color: var(--color-brass);
  margin-bottom: var(--space-2);
}

.summary-stage {
  font-family: var(--font-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--color-text-inverse);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-note {
  font-family: var(--font-secondary);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-inverse);
  text-align: center;
  opacity: 0.9;
  margin: 0;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  background: rgba(247, 246, 243, 0.02);
}

.summary-note strong {
  color: var(--color-brass);
}

/* ============================================
   PROCESS SLIDER — Data Crafting (Stage 03)
   ============================================ */
.process-slider {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
/* Static horizontal brass rail near the bottom */
.process-slider::after {
  content: '';
  position: absolute;
  bottom: 8%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--color-brass);
  z-index: 10;
  pointer-events: none;
}
.process-slider__track { position: absolute; inset: 0; }
.process-slider__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.08s linear;
  pointer-events: none;
}
.process-slider__img--1 { z-index: 1; }
.process-slider__img--2 { z-index: 2; }
.process-slider__img--3 { z-index: 3; }
.process-slider__img--4 { z-index: 4; }
/* Zero-size anchor that moves along the rail */
.process-slider__handle {
  position: absolute;
  bottom: 8%;
  left: 0;
  width: 0;
  height: 0;
  z-index: 11;
}
.process-slider__grip {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  width: 2.75rem;
  height: 2.75rem;
  background: var(--color-charcoal);
  border: 1px solid var(--color-brass);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  transition: background 0.2s ease;
  cursor: ew-resize;
}
.process-slider__handle:hover .process-slider__grip,
.process-slider__handle:focus .process-slider__grip { background: #1e1e1e; }
.process-slider__handle:focus { outline: none; }
.process-slider__handle:focus-visible .process-slider__grip { box-shadow: 0 0 0 2px var(--color-brass); }
.process-slider__hint { display: none; }

/* ========================================
   Discovery Interactive: Your Place Reflection
   ======================================== */

.reflection-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: linear-gradient(135deg, 
    rgba(247, 246, 243, 0.70) 0%, 
    rgba(199, 168, 106, 0.10) 100%);
  border-radius: 2px;
  overflow: hidden;
  margin: 0;
  transition: background 1s ease;
}

.background-image {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  transition: opacity 1s ease;
}

.background-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px);
}

.reflection-container.final {
  background: linear-gradient(135deg, 
    rgba(46, 46, 46, 0.50) 0%,
    rgba(18, 18, 18, 0.60) 100%);
}

.reflection-container.final .background-image {
  opacity: 0.40;
}

.content-area {
  position: relative;
  z-index: 2;
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
  box-sizing: border-box;
}

.prompt-text {
  font-family: 'Libre Baskerville', serif;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.6;
  color: var(--graphite, #2E2E2E);
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeInPrompt 1s ease forwards;
  transition: opacity 1s ease, color 0.4s ease;
  max-width: 700px;
}

.reflection-container.final .prompt-text {
  color: var(--gallery-white, #F7F6F3);
}

@keyframes fadeInPrompt {
  to { opacity: 1; }
}

.nav-button {
  background: var(--brass, #C7A86A);
  color: var(--gallery-white, #F7F6F3);
  border: none;
  padding: 16px 40px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  margin-top: calc(10% + 40px);
  transition: background 0.3s ease, transform 0.3s ease, opacity 1s ease;
  opacity: 0;
  animation: fadeInPrompt 1s ease 0.5s forwards;
}

.nav-button:hover {
  background: var(--graphite, #2E2E2E);
  transform: translateY(-1px);
}

.cta-link {
  display: inline-block;
  margin-top: calc(1rem + 10% + 40px);
  color: var(--brass, #C7A86A);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
  opacity: 0;
  animation: fadeInPrompt 1s ease 1s forwards;
}

.cta-link:hover {
  border-bottom-color: var(--brass, #C7A86A);
}

.progress-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 3;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brass, #C7A86A);
  opacity: 0.3;
  transition: opacity 0.3s ease;
}

.dot.active {
  opacity: 1;
}

/* Responsive */
@media (max-width: 767px) {
  .reflection-container {
    min-height: 100%;
  }

  .content-area {
    padding: 40px 24px;
    min-height: 100%;
  }

  .prompt-text {
    font-size: 1.25rem;
    margin-bottom: 2rem;
  }

  .nav-button {
    padding: 12px 24px;
    font-size: 0.85rem;
  }
}

