/* Winchesters — home page. */

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  background: var(--navy);
  overflow: hidden;
  overflow: clip;
}

.hero__art {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: transform;
}

/* plain-text version of the artwork: shown without JavaScript or WebGL */
.hero__fallback {
  display: none;
  position: absolute;
  top: 44%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  font: 700 1.111vw / 1.02 var(--mono);
  letter-spacing: 0;
  white-space: pre;
  color: var(--gold);
  -webkit-user-select: none;
  user-select: none;
}

.no-js .hero__fallback,
.is-art-fallback .hero__fallback {
  display: block;
}

.hero__zone {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: var(--nav-h);
}

.hero__labels {
  position: absolute;
  inset: clamp(8px, 2vh, 20px) var(--gutter) auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  pointer-events: none;
}

.hero__labels .note:last-child {
  text-align: right;
}

.hero__foot {
  position: relative;
  padding: 0 var(--gutter) clamp(20px, 3.4vh, 40px);
}

/* on very wide screens the name stops growing with the width, so the artwork keeps its room */
.hero__inner {
  max-width: 165vh;
  max-width: 165svh;
  margin-inline: auto;
}

.hero__title {
  margin: 0;
  line-height: 0;
}

.wordmark {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* stroke width is in the drawing's own units; the script keeps it at ~1.15px on screen */
.wordmark path {
  fill: none;
  stroke: var(--white);
  stroke-opacity: 0.88;
  stroke-width: var(--sw, 6);
  stroke-linejoin: round;
}

@media (max-width: 1000px) {
  .wordmark path {
    stroke-width: var(--sw, 10);
  }
}

@media (max-width: 560px) {
  .wordmark path {
    stroke-width: var(--sw, 20);
  }
}

/* before the opening sequence takes over (a failsafe shows these if no script arrives) */
.js.page-home:not(.reduced-motion):not(.is-live) .wordmark,
.js.page-home:not(.reduced-motion):not(.is-live) .nav {
  visibility: hidden;
  animation: wx-failsafe 0s linear 6s forwards;
}

.hero__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-top: clamp(16px, 2.8vh, 30px);
}

.hero__tagline {
  font: 400 clamp(1.0625rem, 0.86rem + 0.84vw, 1.625rem) / 1.2 var(--sans);
  letter-spacing: -0.02em;
}

.hero__cta {
  display: flex;
  flex: none;
  gap: 6px;
}

/* with scripts running, the hero is transparent and the page ground itself moves from navy to black on scroll */
.js.page-home body {
  background-color: var(--navy);
}

.js.page-home .hero {
  background: none;
}

@media (max-width: 720px) {
  .hero__row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__cta .btn {
    flex: 1 1 0;
    padding-inline: 12px;
  }

  .hero__labels .note:last-child {
    display: none;
  }
}

/* upright screens: the giving hand enters from the top right, so that corner stays clear */
@media (max-aspect-ratio: 1/1) {
  .hero__labels .note:last-child {
    display: none;
  }
}

@media (max-height: 640px) and (min-width: 721px) {
  .hero__labels {
    display: none;
  }
}

/* ---------------------------------------------------------------- statement */

.statement {
  padding: clamp(110px, 21vh, 250px) var(--gutter) clamp(80px, 13vh, 170px);
}

.statement__text {
  max-width: 17.5em;
  font-size: clamp(2rem, 0.9rem + 4.1vw, 5rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.statement__text .word {
  display: inline-block;
  will-change: opacity;
}

.statement__aside {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  margin-top: clamp(48px, 9vh, 110px);
}

.statement__copy {
  grid-column: 7 / span 5;
  font-size: var(--t-lead);
  line-height: 1.4;
  letter-spacing: -0.012em;
  color: var(--ink-2);
}

@media (max-width: 860px) {
  .statement__copy {
    grid-column: 1 / -1;
    max-width: 34em;
  }
}

/* ---------------------------------------------------------------- reading the plate */

.reading {
  padding: clamp(48px, 8vh, 110px) var(--gutter) clamp(70px, 11vh, 150px);
}

.reading__title {
  margin-bottom: clamp(36px, 7vh, 88px);
  font-size: var(--t-h2);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.reading__body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(28px, 6vw, 112px);
  align-items: start;
}

.plate {
  position: -webkit-sticky;
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  height: min(74vh, 760px);
  min-height: 380px;
  margin: 0;
  background: var(--navy);
  overflow: hidden;
  overflow: clip;
}

/* without JavaScript or WebGL there is no live detail to show: the notes simply stack */
.no-js .plate,
.no-plate .plate {
  display: none;
}

.no-js .reading__body,
.no-plate .reading__body {
  grid-template-columns: minmax(0, 1fr);
}

.no-js .reading__note,
.no-plate .reading__note {
  min-height: 0;
  opacity: 1;
}

.no-plate .reading__note::before {
  display: none;
}

.plate__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.plate__label {
  position: absolute;
  inset: auto 16px 12px 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.reading__notes {
  display: grid;
}

.reading__note {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 74vh;
  padding-block: 40px;
  transition: opacity 0.6s var(--ease);
}

/* the note that matches the plate is marked with a short gold measure; the others step back a little */
.js .reading__note::before {
  content: "";
  width: 36px;
  height: 1px;
  margin-bottom: 22px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.7s var(--ease);
}

.js .reading__note.is-current::before {
  transform: scaleX(1);
}

.js .reading__note:not(.is-current) {
  opacity: 0.78;
}

.reading__note h3 {
  margin-bottom: 0.6em;
  font-size: var(--t-h3);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.reading__note p {
  max-width: 27em;
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  color: var(--ink-2);
}

.reading__note p + p {
  margin-top: 1em;
}

@media (max-width: 900px) {
  .reading__body {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* the plate stays pinned while the notes pass beneath it */
  .plate {
    top: 0;
    z-index: 2;
    height: 46vh;
    height: 46svh;
    min-height: 260px;
    border-top: 12px solid var(--black);
    background-clip: padding-box;
  }

  .plate__label .note:last-child {
    display: none;
  }

  .reading__note {
    min-height: 62vh;
    min-height: 62svh;
    justify-content: flex-start;
    padding-block: 44px 20px;
  }
}

/* ---------------------------------------------------------------- closing */

.closing {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: clamp(28px, 5vh, 48px);
  align-items: end;
  padding: clamp(90px, 17vh, 210px) var(--gutter) clamp(80px, 14vh, 170px);
}

.closing__title {
  grid-column: 1 / span 8;
  font-size: var(--t-h2);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.closing__side {
  grid-column: 9 / -1;
  display: grid;
  gap: 24px;
  justify-items: start;
}

.closing__copy {
  max-width: 24em;
  color: var(--ink-2);
}

.closing__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 900px) {
  .closing__title,
  .closing__side {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .closing__cta {
    width: 100%;
  }

  .closing__cta .btn {
    flex: 1 1 0;
    padding-inline: 12px;
  }
}
