/**
 * Landing page — a separate version of home. Does not touch index.html.
 *
 * The one idea: a single lockup travels from the centre of the hero into the
 * nav slot as you scroll. It is never two elements cross-fading, so there is
 * no moment where the logo appears twice.
 */

.lp {
  --lp-hero-vh: 82;
  --lp-gutter: clamp(1.25rem, 5vw, 4.5rem);
  --lp-section-y: clamp(4rem, 11vh, 8.5rem);
  --lp-rule: 1px solid var(--line);
}

/* The shared shell centres and pads every page; the hero has to bleed, so
   the landing page takes the full width and each section sets its own. */
.if-app.lp {
  max-width: none;
  padding: 0;
  margin: 0;
}

.lp-section,
.lp-footer {
  max-width: 88rem;
  margin-inline: auto;
}

/* ——— hero ——— */

/**
 * The hero is a fixed-height stage: the photograph fills it, and the type
 * sits ON the photograph at the bottom, over a scrim. Height is locked with
 * `height`, not `min-height` — min-height lets the type grow the box and
 * push itself out from under the picture, which is what broke it.
 */
.lp-hero {
  position: relative;
  height: max(460px, calc(var(--lp-hero-vh) * 1vh));
  /* Flex, not grid. A grid gives an absolutely-positioned child its GRID
     AREA as containing block and applies justify-items to it, which
     collapsed the photograph to a strip. In a flex container an abspos
     child is not a flex item at all: its containing block is the padding
     box, so inset:0 stretches, full stop. */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

/* An absolutely-positioned child of a grid is contained by its GRID AREA,
   not the box — auto-placed it lands in row 1 and the photo shrinks to the
   spare space above the type. Span every track explicitly. */
/* Explicit 100% against the hero's definite height, rather than inset:0 —
   one less thing that can resolve against the wrong containing block. */
.lp-hero__media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.lp-hero__media > * {
  width: 100%;
  height: 100%;
}

/* Bottom scrim — the logo and the statement have to read against a
   photograph whose lower half is unpredictable. */
.lp-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 38%,
    color-mix(in srgb, var(--film) 26%, transparent) 62%,
    color-mix(in srgb, var(--film) 72%, transparent) 100%
  );
}

/**
 * Boot: the photograph is already there, and the words arrive into it —
 * mark, then credit, then statement, then the cue. A slow rise, not a pop,
 * so the page opens at the pace the statement asks for.
 */
.lp-hero__type > *,
.lp-hero__scrollcue {
  opacity: 0;
  transform: translateY(14px);
  animation: lp-arrive 1100ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  animation-delay: calc(320ms + var(--i, 0) * 260ms);
}

@keyframes lp-arrive {
  to {
    opacity: 1;
    transform: none;
  }
}

.lp-hero__type {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-align: center;
  color: var(--film-text);
  padding: 0 var(--lp-gutter) clamp(3.5rem, 9vh, 6.5rem);
  text-shadow: 0 1px 24px rgb(0 0 0 / 0.28);
}

.lp-hero__credit {
  font-family: var(--font-brand);
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  opacity: 0.78;
}

.lp-hero__prop {
  margin: 1.15rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.35rem, 3.4vw, 2.35rem);
  line-height: 1.24;
  letter-spacing: -0.01em;
  max-width: 22ch;
  text-wrap: balance;
}

.lp-hero__scrollcue {
  position: absolute;
  bottom: clamp(1.25rem, 4vh, 2.5rem);
  left: 50%;
  translate: -50% 0;
  z-index: 2;
  color: var(--film-text);
  opacity: 0.66;
  font-family: var(--font-brand);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

/**
 * The nav does not exist over the hero. Past it, the bar resolves into
 * focus one element at a time, left to right — brandwrap, then each link,
 * then the burger — rather than fading in as a block.
 */
body[data-page="landing"] .if-nav__brandwrap,
body[data-page="landing"] .if-nav__link,
body[data-page="landing"] .if-nav__now,
body[data-page="landing"] .if-nav__burger {
  opacity: 0;
  filter: blur(7px);
  transition:
    opacity 420ms var(--ease, ease),
    filter 520ms var(--ease, ease);
  transition-delay: calc(var(--sweep, 0) * var(--lp-sweep-ms, 70ms));
}

body[data-page="landing"] .if-nav.is-arrived .if-nav__brandwrap,
body[data-page="landing"] .if-nav.is-arrived .if-nav__link,
body[data-page="landing"] .if-nav.is-arrived .if-nav__now,
body[data-page="landing"] .if-nav.is-arrived .if-nav__burger {
  opacity: 1;
  filter: blur(0);
}

/* The rack-focus paint sets inline filter/opacity on links; it must not
   fight the reveal until the bar has arrived. */
body[data-page="landing"] .if-nav:not(.is-arrived) .if-nav__link {
  filter: blur(7px) !important;
  opacity: 0 !important;
}

body[data-page="landing"] .if-nav__scrim {
  opacity: 0;
  transition: opacity 380ms ease;
}

body[data-page="landing"] .if-nav.is-arrived .if-nav__scrim {
  opacity: 1;
}

body[data-page="landing"] .if-nav__bar {
  pointer-events: none;
}

body[data-page="landing"] .if-nav.is-arrived .if-nav__bar {
  pointer-events: auto;
}

/* ——— hero mark, in flow ——— */

.lp-hero__mark {
  display: block;
  width: var(--lp-lockup-w, 420px);
  max-width: min(78vw, 560px);
  height: auto;
  color: var(--film-text);
}

.lp-hero__mark .if-lockup,
.lp-hero__mark .if-lockup__svg,
.lp-hero__mark .if-lockup__svg svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ——— sections ——— */

.lp-section {
  padding: var(--lp-section-y) var(--lp-gutter);
  border-top: var(--lp-rule);
}

.lp-section:first-of-type {
  border-top: 0;
}

.lp-head {
  display: grid;
  gap: 0.35rem;
  margin-bottom: clamp(1.75rem, 4vh, 3rem);
}

.lp-head__eyebrow {
  font-family: var(--font-brand);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.lp-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.012em;
}

.lp-more {
  display: inline-block;
  margin-top: clamp(1.5rem, 3vh, 2.25rem);
  font-family: var(--font-brand);
  font-size: 0.95rem;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.lp-more:hover {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* ——— three journeys ——— */

.lp-journeys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 2.6vw, 2.25rem);
}

.lp-card {
  display: grid;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.lp-card__frame {
  background: var(--paper-white);
  padding: 5px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 10px 26px rgb(0 0 0 / 0.09);
  overflow: hidden;
}

.lp-card__frame img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: var(--photo-filter);
  transition: transform 700ms var(--ease);
}

.lp-card:hover .lp-card__frame img {
  transform: scale(1.03);
}

.lp-card__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.2;
}

.lp-card__meta {
  font-family: var(--font-brand);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ——— journal articles ——— */

.lp-articles {
  display: grid;
  gap: 0;
  border-top: var(--lp-rule);
}

.lp-article {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: baseline;
  padding: clamp(1.1rem, 2.6vh, 1.9rem) 0;
  border-bottom: var(--lp-rule);
  color: inherit;
  text-decoration: none;
}

.lp-article:hover .lp-article__title {
  color: var(--accent);
}

.lp-article__kind {
  font-family: var(--font-brand);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.lp-article__title {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.25rem, 2.6vw, 1.8rem);
  line-height: 1.15;
  transition: color 220ms ease;
}

.lp-article__excerpt {
  margin: 0;
  font-family: var(--font-brand);
  color: var(--muted);
  max-width: 56ch;
}

.lp-empty {
  font-family: var(--font-brand);
  color: var(--muted);
  padding: 1.25rem 0;
}

/* ——— featured shop (deliberately small) ——— */

.lp-shop {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.25rem, 4vw, 3rem);
  max-width: 46rem;
}

.lp-product {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.1rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.lp-product__thumb {
  background: var(--paper-white);
  padding: 4px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 8px 20px rgb(0 0 0 / 0.1);
}

.lp-product__thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  filter: var(--photo-filter);
}

.lp-product__kind {
  font-family: var(--font-brand);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lp-product__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 0.15rem 0 0.2rem;
}

.lp-product__meta {
  font-family: var(--font-brand);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ——— about ——— */

.lp-about {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}

.lp-about__body p {
  font-family: var(--font-brand);
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 52ch;
}

.lp-about__media {
  background: var(--paper-white);
  padding: 5px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 12px 30px rgb(0 0 0 / 0.1);
}

.lp-about__media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: var(--photo-filter);
}

/* ——— footer ——— */

.lp-footer {
  padding: var(--lp-section-y) var(--lp-gutter)
    clamp(2rem, 6vh, 3.5rem);
  border-top: var(--lp-rule);
  display: grid;
  gap: 1.5rem;
}

.lp-footer__sig {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  line-height: 1.3;
  max-width: 34ch;
}

.lp-footer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  font-family: var(--font-brand);
  font-size: 0.9rem;
}

.lp-footer__row a {
  color: var(--muted);
  text-decoration: none;
}

.lp-footer__row a:hover {
  color: var(--fg);
}

/* ——— tweak panel ——— */

.lp-tweak {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 90;
  width: 250px;
  max-height: 78vh;
  overflow: auto;
  padding: 0.85rem 0.95rem 1rem;
  background: var(--paper-white);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 34px rgb(0 0 0 / 0.16);
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 11px;
  color: var(--fg);
}

.lp-tweak[hidden] {
  display: none !important;
}

.lp-tweak h4 {
  margin: 0 0 0.6rem;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.lp-tweak label {
  display: grid;
  gap: 3px;
  margin-bottom: 0.6rem;
}

.lp-tweak .row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.lp-tweak input[type="range"] {
  width: 100%;
}

.lp-tweak select,
.lp-tweak button {
  font: inherit;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: inherit;
  cursor: pointer;
}

.lp-tweak__toggle {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 91;
  font-family: var(--font-mono, ui-monospace, Menlo, monospace);
  font-size: 11px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-white);
  color: var(--muted);
  cursor: pointer;
}

/* ——— responsive ——— */

@media (max-width: 899px) {
  .lp-journeys {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .lp-shop {
    grid-template-columns: 1fr;
  }

  .lp-about {
    grid-template-columns: 1fr;
  }

  .lp-about__media {
    order: -1;
  }

  .lp-article {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lp-hero__type > *,
  .lp-hero__scrollcue {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .lp-card__frame img {
    transition: none !important;
    animation: none !important;
  }
}
