/* ==========================================================================
   ARCHIVE — Section Stylesheets
   Design tokens live in css/hero.css (:root). Components below reuse them.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Section 2 — The Story So Far (The Premise)
   Light editorial section: two containers — text (label, headline, body) and image.
   -------------------------------------------------------------------------- */
.premise {
  position: relative;
  background-color: var(--color-bg);
  min-height: 100vh;
  width: 100%;
  color: var(--color-text-main);
  padding: var(--space-3xl) var(--space-xl) calc(var(--space-3xl) + var(--space-lg));
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.premise::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("../assets/images/wallpaper.webp");
  background-repeat: repeat-y;
  background-position: center center;
  background-size: max(100vw, calc(100vh * 2752 / 1536)) auto;
  background-attachment: fixed;
  opacity: 0.1;
}

/* iOS Safari (WebKit) deliberately ignores background-attachment: fixed —
   the wallpaper scrolls stuck to the content instead of holding still
   behind it (WebKit bug 275247). Emulate the fixed background there with
   a viewport-fixed pseudo clipped back to the section box via clip-path.
   (clip-path does not reparent fixed descendants, and it does not affect
   sticky positioning — unlike overflow: hidden, which would not clip a
   fixed pseudo anyway.) */
@supports (-webkit-touch-callout: none) {
  .premise {
    clip-path: inset(0);
  }

  .premise::before {
    position: fixed;
    background-attachment: scroll;
  }
}

/* Reduced motion: wallpaper anchored to the section so it scrolls with the
   content. Must follow the iOS block above to win the cascade there. */
@media (prefers-reduced-motion: reduce) {
  .premise::before {
    position: absolute;
    background-attachment: scroll;
  }
}

.premise__inner {
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Eyebrow / section label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-dim);
  margin-bottom: var(--space-md);
}

.premise__heading {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--color-text-main);
  max-width: 14ch;
  text-wrap: balance;
  margin-bottom: var(--space-lg);
}

/* Two containers: text (left) and image (right) */
.premise__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--space-lg);
  row-gap: var(--space-xl);
}

.premise__text {
  grid-column: 1 / 6;
  display: flex;
  flex-direction: column;
}

.premise__media {
  grid-column: 7 / 13;
}

.premise__image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top center;
  background-color: var(--color-bg-subtle);
  border-radius: var(--radius-image);
}

.premise__caption {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--color-text-dim);
}

.premise__caption-id {
  flex-shrink: 0;
  color: var(--color-highlight);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.premise__lead {
  font-family: var(--font-body);
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.55;
  color: hsl(0, 0%, 50%);
}

.premise__lead-soft {
  color: hsl(0, 0%, 20%);
}

.premise__support {
  margin-top: auto;
  padding-top: var(--space-2xl);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.9;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-main);
}

/* --------------------------------------------------------------------------
   Scroll-reveal (progressive enhancement — content visible without JS)
   -------------------------------------------------------------------------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

html.js .premise__media[data-reveal] {
  transition-delay: 120ms;
}

/* --------------------------------------------------------------------------
   Section 3 — Four Ways We Tell Our Story (Explore the Collection)
   Editorial numbered index: header, then a list of disciplines.
   -------------------------------------------------------------------------- */
.disciplines {
  position: relative;
  background-color: var(--color-bg);
  color: var(--color-text-main);
  padding: var(--space-3xl) var(--space-xl) calc(var(--space-3xl) + var(--space-lg));
}

.disciplines__inner {
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
}

/* Carousel scaffold.
   Default (no JS / reduced motion): the cards are a plain vertical list.
   With `.is-carousel` (added by js/discipline-carousel.js): a 100vh sticky
   pin holds the header and a horizontal track that vertical scroll drives. */
.disciplines__carousel {
  position: relative;
}

.disciplines__pin {
  position: relative;
}

.disciplines__viewport {
  position: relative;
}

/* Header */
.disciplines__header {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--space-lg);
  row-gap: var(--space-lg);
  margin-bottom: var(--space-3xl);
  background-color: var(--color-bg);
}

.disciplines__header .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.disciplines__heading {
  grid-column: 1 / 7;
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--color-text-main);
  text-wrap: balance;
}

.disciplines__intro {
  grid-column: 8 / 13;
  align-self: end;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* Header curtain reveal: neutralise the block reveal, animate children instead */
html.js .disciplines__header[data-reveal] {
  opacity: 1;
  transform: none;
}

html.js .disciplines__header .eyebrow,
html.js .disciplines__header .disciplines__heading,
html.js .disciplines__header .disciplines__intro {
  opacity: 0;
  transform: translateY(18px);
  clip-path: inset(0 0 100% 0);
  transition:
    opacity 800ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 800ms cubic-bezier(0.16, 1, 0.3, 1),
    clip-path 800ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

html.js .disciplines__header .disciplines__heading {
  transition-delay: 80ms;
}

html.js .disciplines__header .disciplines__intro {
  transition-delay: 160ms;
}

html.js .disciplines__header.is-visible .eyebrow,
html.js .disciplines__header.is-visible .disciplines__heading,
html.js .disciplines__header.is-visible .disciplines__intro {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
}

/* Discipline list */
.disciplines__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---- Carousel mode (added by JS when motion is allowed) ---- */
.disciplines.is-carousel .disciplines__carousel {
  height: calc(100vh + var(--disc-range, 0px));
}

.disciplines.is-carousel .disciplines__pin {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--space-lg);
  overflow: hidden;
}

.disciplines.is-carousel .disciplines__header {
  flex: 0 0 auto;
  margin-bottom: var(--space-lg);
}

.disciplines.is-carousel .disciplines__viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.disciplines.is-carousel .disciplines__list {
  display: flex;
  height: 100%;
  will-change: transform;
  transition: transform 760ms cubic-bezier(0.16, 1, 0.3, 1);
}

.disciplines.is-carousel .discipline {
  flex: 0 0 100%;
  height: 100%;
  padding: var(--space-lg) 0;
}

.discipline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--space-lg);
  align-items: stretch;
  padding: var(--space-2xl) 0;
  background-color: var(--color-bg);
  cursor: pointer;
}

html.js .discipline[data-reveal] {
  opacity: 1;
  transform: none;
  will-change: auto;
}

.discipline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border-subtle);
  transform-origin: left;
  transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

html.js .discipline::before {
  transform: scaleX(0);
}

html.js .discipline.is-visible::before {
  transform: scaleX(1);
}

.discipline:last-child {
  border-bottom: 1px solid var(--color-border-subtle);
}

.discipline__index {
  grid-column: 1 / 2;
  align-self: start;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.1;
  letter-spacing: 0.08em;
  color: var(--color-text-dim);
  transition: color var(--transition-fast), transform var(--transition-smooth);
}

.discipline:hover .discipline__index {
  color: var(--color-highlight);
  transform: translateY(-2px);
}

.discipline__body {
  grid-column: 2 / 7;
  align-self: start;
}

.discipline__title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-text-main);
  margin-bottom: var(--space-xs);
}

.discipline__tagline {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-main);
  margin-bottom: var(--space-sm);
}

.discipline__desc {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-muted);
  max-width: 42ch;
  margin-bottom: var(--space-md);
}

.discipline__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-main);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--color-border-strong);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.discipline__link:hover {
  color: var(--color-highlight);
  border-color: var(--color-highlight);
}

.discipline__link:focus-visible {
  outline: 2px solid var(--color-text-main);
  outline-offset: 3px;
}

/* No ring when focus is returned to the link after a mouse-driven drawer
   close — see js/input-modality.js. Keyboard users keep it. */
html.is-pointer .discipline__link:focus-visible {
  outline: none;
}

.discipline__arrow {
  transition: transform var(--transition-smooth);
}

.discipline__link:hover .discipline__arrow {
  transform: translate(2px, -2px);
}

.discipline__media {
  grid-column: 8 / 13;
  align-self: stretch;
  overflow: hidden;
  border-radius: var(--radius-image);
  background-color: var(--color-bg-subtle);
  transition: clip-path 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

html.js .discipline__media {
  clip-path: inset(0 0 100% 0);
  --reveal-scale: 1.06;
}

html.js .discipline.is-visible .discipline__media {
  clip-path: inset(0 0 0 0);
  --reveal-scale: 1;
}

.discipline__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-image);
  transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

html.js .discipline__image {
  transform: scale(var(--reveal-scale, 1));
}

.discipline:hover .discipline__image {
  transform: scale(1.04);
}

/* Staggered reveal within the list */
html.js .disciplines__list .discipline:nth-child(2) {
  transition-delay: 80ms;
}

html.js .disciplines__list .discipline:nth-child(3) {
  transition-delay: 160ms;
}

html.js .disciplines__list .discipline:nth-child(4) {
  transition-delay: 240ms;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .premise__text {
    grid-column: 1 / 7;
  }

  .premise__media {
    grid-column: 7 / 13;
  }

  .disciplines__heading {
    font-size: 3.25rem;
  }
}

@media (max-width: 820px) {
  .premise {
    padding: var(--space-2xl) var(--space-lg);
  }

  .premise__heading {
    max-width: none;
  }

  .premise__grid {
    grid-template-columns: 1fr;
    row-gap: var(--space-lg);
  }

  .premise__text,
  .premise__media {
    grid-column: 1 / -1;
  }

  .premise__image {
    aspect-ratio: 5 / 6;
  }

  .disciplines {
    padding: var(--space-2xl) var(--space-lg);
  }

  .disciplines__header {
    grid-template-columns: 1fr;
    row-gap: var(--space-sm);
    margin-bottom: var(--space-2xl);
  }

  .disciplines__header .eyebrow,
  .disciplines__heading,
  .disciplines__intro {
    grid-column: 1 / -1;
  }

  .disciplines__heading {
    font-size: 2.25rem;
  }

  .disciplines__intro {
    max-width: 60ch;
    font-size: 0.9375rem;
  }

  .discipline {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    padding: var(--space-md) 0;
  }

  .discipline__index {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }

  .discipline__body {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
  }

  .discipline__media {
    grid-column: 1;
    grid-row: 3;
    align-self: stretch;
    margin-top: var(--space-md);
  }

  .discipline__desc {
    max-width: 60ch;
  }

  /* Mobile: the cards are a plain vertical stack, so the scroll-jacked
     pinned track is dropped. js/discipline-carousel.js removes `.is-carousel`
     below this breakpoint; these rules keep the stacked layout even if the
     class lingers (or paints before the script has run). */
  .disciplines.is-carousel .disciplines__carousel {
    height: auto;
  }

  .disciplines.is-carousel .disciplines__pin {
    position: static;
    display: block;
    height: auto;
    padding-top: 0;
    overflow: visible;
  }

  .disciplines.is-carousel .disciplines__header {
    margin-bottom: var(--space-2xl);
  }

  .disciplines.is-carousel .disciplines__viewport {
    overflow: visible;
  }

  .disciplines.is-carousel .disciplines__list {
    display: block;
    height: auto;
    will-change: auto;
    transition: none;
    transform: none !important;
  }

  .disciplines.is-carousel .discipline {
    flex: none;
    height: auto;
    padding: var(--space-md) 0;
  }
}

@media (max-width: 480px) {
  .premise {
    padding: var(--space-xl) var(--space-md);
  }

  .premise__heading {
    font-size: 2.5rem;
  }

  .premise__caption {
    flex-direction: column;
    gap: var(--space-2xs);
  }

  .disciplines {
    padding: var(--space-xl) var(--space-md);
  }

  .disciplines__heading {
    font-size: 1.875rem;
  }

  .discipline__title {
    font-size: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .discipline__image,
  .discipline__arrow {
    transition: none;
  }

  .discipline:hover .discipline__image {
    transform: none;
  }

  .discipline__link:hover .discipline__arrow {
    transform: none;
  }

  .discipline:hover .discipline__index {
    transform: none;
  }

  html.js .discipline__media {
    clip-path: inset(0 0 0 0);
    --reveal-scale: 1;
    transition: none;
  }

  html.js .discipline__image {
    transform: none;
  }

  html.js .discipline::before {
    transform: scaleX(1);
    transition: none;
  }

  html.js .disciplines__header .eyebrow,
  html.js .disciplines__header .disciplines__heading,
  html.js .disciplines__header .disciplines__intro {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 0 0);
    transition: none;
  }
}
