/* ==========================================================================
   Optra — homepage
   Wide asymmetric compositions. The hero is intentionally still.
   ========================================================================== */

.hero,
.tradeoff,
.account,
.modes,
.principle,
.universe { position: relative; }

.tradeoff,
.account,
.modes,
.principle,
.universe { padding-block: clamp(6rem, 13vh, 11.5rem); }

/* --- Hero --------------------------------------------------------------- */
/* Three bands — meta, statement, facts — pinned top / centre / bottom so the
   composition holds the full width rather than stacking in the middle. */

.hero {
  /* Capped: on a tall viewport an uncapped 100svh opens a large void above
     the statement, since the middle row is the flexible one. */
  min-height: min(100svh, 47rem);
  display: flex;
  align-items: stretch;
  padding-top: calc(var(--nav-h) + clamp(1.5rem, 4vh, 3rem));
  padding-bottom: clamp(1.5rem, 4vh, 2.5rem);
}

.hero__inner {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(2rem, 5vh, 4rem);
  width: 100%;
}

.hero__meta {
  display: flex;
  gap: var(--s-5);
  align-items: baseline;
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--line-faint);
}

.hero__body {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: end;
}

.hero__lead { grid-column: 1 / span 9; }

.hero__title {
  font-weight: 600;
  /* Optical correction: large Gabarito sits visually right of the margin. */
  margin-left: -0.045em;
}

.hero__aside {
  grid-column: 10 / -1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-5);
  padding-bottom: 0.6rem;
}


.hero__lede { max-width: 30ch; }

.hero__rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
}

.hero__cell {
  padding: var(--s-5) var(--s-5) 0 0;
  border-right: 1px solid var(--line-faint);
}

.hero__cell:first-child { padding-left: 0; }
.hero__cell:last-child { border-right: 0; }

.hero__cell dt { margin-bottom: 0.5rem; }
.hero__cell dd { font-weight: 500; }

@media (max-width: 1100px) {
  .hero__lead { grid-column: 1 / -1; }
  .hero__aside { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s-5); }
  .hero__lede { max-width: 44ch; flex: 1 1 22rem; }
}

@media (max-width: 720px) {
  .hero { min-height: auto; padding-bottom: var(--s-8); }
  .hero__rail { grid-template-columns: 1fr; }
  .hero__cell { padding: var(--s-4) 0; border-right: 0; border-bottom: 1px solid var(--line-faint); }
  .hero__cell:last-child { border-bottom: 0; }
}

/* --- Tradeoff ----------------------------------------------------------- */
/* Two statements occupying opposite sides of the page; the first recedes as
   the second arrives, so they read as one thought turning over. */

.tradeoff__line { max-width: 18ch; }

.tradeoff__line--a { color: var(--ink-56); }

.tradeoff__line--b {
  margin-top: clamp(2rem, 6vh, 5rem);
  margin-left: auto;
  text-align: right;
  max-width: 20ch;
}

.tradeoff__note {
  margin-top: clamp(2.5rem, 7vh, 5rem);
  margin-left: auto;
  max-width: 46ch;
  font-size: var(--t-body);
}

@media (max-width: 720px) {
  .tradeoff__line--b { text-align: left; margin-left: 0; }
  .tradeoff__note { margin-left: 0; }
}

/* --- Account ------------------------------------------------------------ */

.account__head { margin-bottom: clamp(2.5rem, 6vh, 4.5rem); }
.account__head .meta { margin-bottom: var(--s-4); }

.account__split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 3.5vw, 4rem);
  align-items: stretch;
}

.account__chart {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  background: var(--wash);
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

.account__chartHead {
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5) var(--s-5) var(--s-3);
}

.account__widget {
  flex: 1;
  min-height: clamp(300px, 42vh, 430px);
  padding: 0 var(--s-3) var(--s-3);
}

.account__panel {
  display: flex;
  flex-direction: column;
  padding: var(--s-5);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  background: var(--wash);
  box-shadow: var(--shadow-panel);
}

.account__panelHead {
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--line-soft);
}

.account__note {
  margin-top: auto;
  padding-top: var(--s-5);
  font-size: var(--t-sm);
  max-width: 32ch;
}

@media (max-width: 980px) {
  .account__split { grid-template-columns: 1fr; }
  .account__note { margin-top: var(--s-5); }
}

/* --- Seal --------------------------------------------------------------- */
/* Each row closes as it arrives: the track fills and the state word swaps.
   Both are driven by the row's own slice of --enter, so scrolling back up
   reopens them. */

.seal[data-stagger] > .seal__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(3.5rem, 1.15fr) 4.6rem;
  align-items: center;
  gap: var(--s-4);
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line-faint);
  opacity: 1;
  transform: none;
  will-change: auto;
}

.seal__row:last-child { border-bottom: 0; }

.seal__label {
  font-size: var(--t-sm);
  color: var(--ink-72);
}

.seal__track {
  position: relative;
  height: 11px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  overflow: hidden;
}

.seal__track::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--r-pill);
  background: var(--ink);
  box-shadow: 0 2px 8px rgba(128, 20, 68, 0.35);
  transform: scaleX(var(--local, 1));
  transform-origin: left;
}

.seal__state {
  position: relative;
  height: 1em;
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: right;
}

.seal__state em,
.seal__state b {
  position: absolute;
  inset: 0;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
}

/* The two words share one slot, so they must not be legible at the same time:
   each holds its own half of the travel and they pass on a short vertical
   slide, reading as one word replacing another rather than as an overlap. */
.seal__state em {
  color: var(--ink-40);
  opacity: clamp(0, calc((0.46 - var(--local, 1)) / 0.16), 1);
  transform: translateY(calc(var(--local, 1) * -0.5em));
}

.seal__state b {
  color: var(--ink);
  opacity: clamp(0, calc((var(--local, 1) - 0.54) / 0.16), 1);
  transform: translateY(calc((1 - var(--local, 1)) * 0.5em));
}

@media (prefers-reduced-motion: reduce) {
  .seal__track::after { transform: scaleX(1); }
  .seal__state em { opacity: 0; }
  .seal__state b { opacity: 1; }
}

/* --- Modes -------------------------------------------------------------- */

.modes__head { margin-bottom: clamp(3rem, 8vh, 5.5rem); }
.modes__head .meta { margin-bottom: var(--s-4); }

.modes__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
}

.mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-4);
  padding: clamp(2rem, 4vh, 3rem) clamp(1.25rem, 2.4vw, 2.5rem) clamp(2.5rem, 5vh, 4rem);
  border-right: 1px solid var(--line-faint);
  transition: background-color var(--d-3) var(--e-soft);
}

.mode:first-child { padding-left: 0; }
.mode:last-child { border-right: 0; padding-right: 0; }

.mode:hover { background: var(--wash); }

.mode__index { color: var(--ink-40); }

.mode__glyph {
  width: clamp(48px, 4.4vw, 68px);
  height: auto;
  color: var(--ink);
  filter: drop-shadow(0 6px 16px rgba(128, 20, 68, 0.45));
  transition: transform var(--d-4) var(--e-out);
}

.mode:hover .mode__glyph { transform: rotate(45deg); }

.mode__copy { max-width: 30ch; font-size: var(--t-sm); }

@media (max-width: 900px) {
  .modes__grid { grid-template-columns: 1fr; }
  .mode {
    padding-inline: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-faint);
  }
  .mode:last-child { border-bottom: 0; }
}

/* --- Principle ---------------------------------------------------------- */

.principle__kicker { margin-bottom: var(--s-5); }

.principle__line {
  max-width: 16ch;
  margin-left: -0.045em;
}

.principle__body {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  margin-left: auto;
  max-width: 48ch;
}

.principle__link { margin-top: var(--s-6); margin-left: auto; }

/* Right-hand column sits under the statement on wide screens, creating the
   diagonal the section is built around. */
@media (min-width: 981px) {
  .principle__body,
  .principle__link { margin-right: clamp(0rem, 6vw, 8rem); }
  .principle__link { display: flex; width: fit-content; }
}

@media (max-width: 720px) {
  .principle__body, .principle__link { margin-left: 0; }
}

/* --- Universe ----------------------------------------------------------- */

.universe { padding-bottom: clamp(4rem, 9vh, 7rem); }

.universe__head { margin-bottom: clamp(2.5rem, 6vh, 4rem); }
.universe__head .meta { margin-bottom: var(--s-3); }
.universe__head h2 { max-width: 24ch; }

.marquee {
  overflow: hidden;
  padding-block: var(--s-5);
  border-block: 1px solid var(--line-faint);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.marquee__track {
  display: flex;
  align-items: center;
  gap: clamp(1.75rem, 3vw, 3.25rem);
  width: max-content;
  animation: marquee-drift 68s linear infinite;
  animation-play-state: running;
  /* Independent of `transform`, so scroll momentum composes with the
     keyframed drift instead of overwriting it. */
  translate: var(--shift, 0px) 0;
}

.marquee:hover .marquee__track { animation-play-state: paused; }

@keyframes marquee-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.marquee__item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  white-space: nowrap;
}

.marquee__ticker {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.9vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.marquee__name {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-40);
}

.universe__foot { margin-top: clamp(2rem, 5vh, 3.5rem); }

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
  .marquee {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
}
