/* By The Way — independent concept. Fonts: Cormorant Garamond + Jost (SIL OFL 1.1), preview substitutes. */
@font-face { font-family: "Cormorant Garamond"; src: url("../assets/fonts/cormorant-garamond-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../assets/fonts/cormorant-garamond-latin-300-italic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../assets/fonts/jost-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --paper: #efebe4;
  --ink: #171411;
  --ink-text: #ece8e1;
  --mute: #665e55;
  --mute-dark: #a39b90;
  --green: #4a5e45;
  --green-light: #a9b9a3;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Jost", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --pad: clamp(20px, 4.2vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 18px; line-height: 1.45; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
h1, h2, p, ul { margin: 0; padding: 0; font-weight: inherit; font-size: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
em { font-style: italic; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 60; padding: 12px 16px; background: var(--ink); color: var(--ink-text); font-size: 16px; }
.skip:focus { top: 12px; }

/* ---------- quiet bar ---------- */
.bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 6px var(--pad) 0;
  font-size: 16px; letter-spacing: .06em; color: var(--ink);
  transition: color .4s ease;
}
.js .bar { position: fixed; }
.bar.on-dark { color: var(--ink-text); }
.bar-note { opacity: .78; white-space: nowrap; }
.bar-short { display: none; }
@media (max-width: 360px) { .bar-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .bar-short { display: inline; } }
.bar-links { display: flex; gap: clamp(16px, 2.4vw, 32px); }
.bar a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; white-space: nowrap; }
.bar a:hover { text-decoration: underline; text-underline-offset: 6px; }

/* ---------- shared type ---------- */
.mark {
  display: block; width: min(724px, 52vw); aspect-ratio: 724 / 161;
  background: var(--ink);
  /* the original 724x161 asset used as an alpha mask: exact geometry, ink colour on paper */
  -webkit-mask: url("../assets/brand/btw-wordmark-white-724x161.webp") center / 100% 100% no-repeat;
          mask: url("../assets/brand/btw-wordmark-white-724x161.webp") center / 100% 100% no-repeat;
}
.mark-img { width: min(724px, 52vw); height: auto; }
.w { display: inline-block; overflow: hidden; padding: 0 .04em .12em; margin: 0 -.04em -.12em; vertical-align: bottom; }
.w-in { display: inline-block; }
.gap-line, .big { font-family: var(--serif); font-weight: 300; line-height: .95; letter-spacing: -.02em; white-space: nowrap; }
.p { color: var(--green); }
.cap { font-size: clamp(18px, 1.45vw, 22px); line-height: 1.4; color: var(--mute); max-width: 24ch; }
.kicker { font-size: 16px; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }

/* ---------- STATIC composition (no JS / reduced motion) ---------- */
.journey { position: relative; }
.stage { position: relative; }
.frame { display: none; }
.scene { position: relative; padding: clamp(96px, 12vw, 160px) var(--pad); display: grid; gap: 28px; }
.scene .slot { display: block; position: relative; overflow: hidden; background: #d9d3c9; }
.scene .slot img { width: 100%; height: 100%; object-fit: cover; }
.s0, .s4 { justify-items: center; text-align: center; min-height: 100svh; align-content: center; }
.gap-line { display: flex; align-items: center; justify-content: center; font-size: min(15vw, 27vh); }
.gap-line .slot { flex: none; width: 1.15em; height: 1.7em; margin: 0 .14em;
  clip-path: polygon(23.4% 0, 100% 0, 76.6% 100%, 0 100%); }
.s0 .slot img { object-position: 66% 68%; }
.s4 .gap-line { font-size: min(12vw, 24vh); }
.s4 .slot img { object-position: 62% 60%; }
.s1, .s2, .s3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; column-gap: clamp(24px, 5vw, 80px); }
.s1 .slot { grid-column: 2; grid-row: 1; aspect-ratio: 9 / 15; }
.s1 .words { grid-column: 1; grid-row: 1; }
.s2 .slot { aspect-ratio: 4 / 5; }
.s2 .slot img { object-position: 47% 50%; }
.s3 .slot { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.s3 .slot img { object-position: 50% 64%; }
.s1 .slot img { object-position: 50% 30%; }
.words { display: grid; gap: 18px; }
.big { font-size: min(10.5vw, 19vh); }
.s4 { background: var(--ink); color: var(--ink-text); }
.s4 .kicker { color: var(--mute-dark); text-transform: none; letter-spacing: .04em; font-size: clamp(16px, 1.3vw, 19px); }
.s4 .p, .visit .p { color: var(--green-light); }

/* ---------- MOTION composition (JS, motion allowed) ---------- */
.motion .journey { height: var(--len, 700vh); }
.motion .stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--stage-bg, var(--paper)); }
.motion .frame { display: block; position: absolute; inset: 0; z-index: 1; will-change: clip-path; contain: strict; }
.motion .layer { position: absolute; inset: 0; visibility: hidden; }
.motion .layer img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; will-change: transform; }
.motion .scene { position: absolute; inset: 0; padding: 0; display: block; min-height: 0; z-index: 2; pointer-events: none; --in: 1; --out: 0; background: none; }
.motion .scene .slot { position: absolute; background: none; visibility: hidden; clip-path: none; }
.motion .scene .w-in { transform: translateY(calc((1 - var(--in)) * 112%)); opacity: calc(1 - var(--out)); }
.motion .scene .cap, .motion .scene .kicker { opacity: calc(var(--in) * (1 - var(--out))); transform: translateY(calc((1 - var(--in)) * 18px)); }
.motion .s0 .mark { opacity: calc(1 - var(--out) * 1.6); transform: translateY(calc(var(--out) * -40px)); }
/* opening: the two words part and you pass through the slash */
.motion .s0 .w-left .w-in { transform: translateX(calc(var(--out) * -115%)); opacity: calc(1 - var(--out) * .6); }
.motion .s0 .w-right .w-in { transform: translateX(calc(var(--out) * 115%)); opacity: calc(1 - var(--out) * .6); }
/* closing: they come back together around the open door */
.motion .s4 .w-left .w-in { transform: translateX(calc((1 - var(--in)) * -115%)); }
.motion .s4 .w-right .w-in { transform: translateX(calc((1 - var(--in)) * 115%)); }
.motion .s4 .mark-img { opacity: var(--in); transform: translateY(calc((1 - var(--in)) * 24px)); }
.motion .s4 { color: var(--ink-text); }

/* desktop compositions */
@media (min-width: 900px) {
  .motion .s0 .mark, .motion .s4 .mark-img { position: absolute; top: 11%; left: 50%; margin-left: calc(min(724px, 52vw) / -2); }
  .motion .gap-line { position: absolute; left: 0; right: 0; top: 46%; font-size: min(15vw, 27vh); }
  .motion .s4 .gap-line { font-size: min(12.5vw, 24vh); }
  .motion .gap-line .slot { position: relative; }
  .motion .s0 .kicker { position: absolute; left: var(--pad); bottom: 5%; }
  .motion .s4 .kicker { position: absolute; left: 0; right: 0; bottom: 5%; text-align: center; }

  .motion .s1 .slot { left: 58%; top: 11%; width: 30%; height: 80%; }
  .motion .s1 .words { position: absolute; left: 6%; bottom: 11%; width: 48%; }

  .motion .s2 .slot { left: 6%; top: 9%; width: 49%; height: 82%; }
  .motion .s2 .words { position: absolute; left: 61%; bottom: 11%; width: 35%; }
  .motion .s2 .big { font-size: min(12.5vw, 24vh); }

  .motion .s3 .slot { left: 34%; top: 31%; width: 60%; height: 59%; }
  .motion .s3 .words { position: absolute; left: 6%; top: 10%; bottom: 10%; width: 25%; display: flex; flex-direction: column; justify-content: space-between; }
  .motion .s3 .big { font-size: min(11vw, 19vh); }
}

/* phone / narrow compositions */
@media (max-width: 899.98px) {
  .s1, .s2, .s3 { grid-template-columns: 1fr; }
  .s1 .slot, .s1 .words { grid-column: 1; grid-row: auto; }
  .gap-line { font-size: 15vw; }
  .s4 .gap-line { font-size: 11.5vw; }
  .mark, .mark-img { width: min(724px, 84vw); }
  .big { font-size: 15vw; }

  .motion .s0 .mark, .motion .s4 .mark-img { position: absolute; top: 12%; left: 8vw; }
  .motion .gap-line { position: absolute; inset: 0; display: block; }
  .motion .gap-line .w { position: absolute; }
  .motion .s0 .w-left { left: 7%; top: 33%; font-size: min(30vw, 15vh); }
  .motion .s0 .slot { left: 44%; top: 27%; width: 44%; height: 40%; }
  .motion .s0 .w-right { left: 7%; top: 70%; font-size: min(20vw, 10.5vh); }
  .motion .s4 .w-left { right: 7%; top: 33%; font-size: min(17vw, 9vh); }
  .motion .s4 .slot { left: 7%; top: 27%; width: 38%; height: 40%; }
  .motion .s4 .w-right { left: 7%; top: 70%; font-size: min(20vw, 10.5vh); }
  .motion .s0 .kicker { position: absolute; left: 7%; bottom: 4%; }
  .motion .s4 .kicker { position: absolute; left: 7%; right: 7%; bottom: 4%; }

  .motion .s1 .slot { left: 14%; top: 10%; width: 80%; height: 54%; }
  .motion .s1 .words { position: absolute; left: 7%; right: 7%; bottom: 6%; }
  .motion .s1 .big { font-size: min(14.5vw, 8.5vh); }

  .motion .s2 .slot { left: 6%; top: 25%; width: 74%; height: 50%; }
  .motion .s2 .words { position: absolute; left: 7%; right: 7%; top: 11%; bottom: 6%; display: flex; flex-direction: column; justify-content: space-between; }
  .motion .s2 .big { font-size: min(16vw, 9vh); }

  .motion .s3 .slot { left: 6%; top: 35%; width: 88%; height: 34%; }
  .motion .s3 .words { position: absolute; left: 7%; right: 7%; top: 11%; bottom: 7%; display: flex; flex-direction: column; justify-content: space-between; }
  .motion .s3 .big { font-size: min(16vw, 9vh); }
}

/* ---------- visit ---------- */
.visit { background: var(--ink); color: var(--ink-text); padding: clamp(72px, 10vw, 150px) var(--pad) 0; display: grid; gap: clamp(28px, 3.6vw, 48px); }
.visit .kicker { color: var(--mute-dark); }
.branches { font-family: var(--serif); font-weight: 300; font-size: clamp(34px, 6.4vw, 104px); line-height: 1.02; letter-spacing: -.015em; max-width: 14em; text-wrap: balance; }
.links { display: flex; flex-wrap: wrap; gap: 4px 40px; }
.links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 18px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 7px; }
.links a:hover { text-decoration-thickness: 2px; }
.foot { margin-top: clamp(24px, 4vw, 56px); padding: 24px 0 32px; border-top: 1px solid rgba(236,232,225,.18); }
.foot p { font-size: 16px; color: var(--mute-dark); max-width: 76ch; }
