/* Moganite — two editorial compositions. */

@font-face {
  font-family: 'Libre Baskerville';
  src: url('../fonts/libre-baskerville-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Libre Baskerville';
  src: url('../fonts/libre-baskerville-latin-400-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --serif: 'Libre Baskerville', 'Baskerville', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', 'Neue Haas Grotesk Text', 'Helvetica Neue', Arial, sans-serif;
  --paper: #efe9dd;
  --ink: #1d2326;
  --ink-soft: #5b5f5d;
  --sky-ink: #fbf7ee;
  --pad: clamp(1rem, 2.6vw, 2.5rem);
  --ease: cubic-bezier(0.22, 0.61, 0.24, 1);
}

@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 520ms; animation-timing-function: var(--ease); }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  min-height: 100dvh;
  height: 100dvh;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- shared chrome: discreet text navigation ---------- */
.nav {
  display: flex; gap: 1.6em;
  font-size: 0.8125rem; letter-spacing: 0.02em; font-weight: 500;
}
.nav a {
  text-decoration: none;
  padding: 0.6em 0;            /* comfortable hit area without visible boxes */
  opacity: 0.78;
  transition: opacity 240ms var(--ease);
}
.nav a:hover, .nav a[aria-current='page'] { opacity: 1; }
.nav a[aria-current='page'] {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.45em;
}
:focus-visible { outline: 1.5px solid currentColor; outline-offset: 4px; }

.placeholder-note {
  margin: 0;
  font-size: 0.6875rem; letter-spacing: 0.04em;
  opacity: 0.72;
}

/* ---------- analog grain: one static tile over everything ---------- */
.grain {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background-image: url('../textures/analog-grain.png');
  background-size: 192px 192px;
  mix-blend-mode: soft-light;
  opacity: 0.3;
}

/* =====================================================================
   HOME — one continuous environment
   ===================================================================== */
.page-home { background: #2e5f97; color: var(--sky-ink); }
.home { position: relative; height: 100dvh; overflow: hidden; }
.home__art, .home__art img {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.home__art img {
  object-fit: cover;
  object-position: 50% 78%;     /* wide screens trim sky, never the landscape */
}
.home__chrome {
  position: absolute; inset: 0 0 auto 0; z-index: 2;
  display: flex; justify-content: flex-end;
  padding: calc(var(--pad) * 0.8) var(--pad);
  text-shadow: 0 1px 14px rgba(18, 42, 74, 0.35);
}
.home__title {
  position: absolute; z-index: 2;
  left: 50%; top: 40%;
  transform: translate(-50%, -50%);
  width: min(92vw, 44rem);
  margin: 0;
  text-align: center;
  text-shadow: 0 1px 28px rgba(16, 40, 72, 0.32);
}
.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, min(8.6vw, 15.5vh), 8.25rem);
  line-height: 1;
  letter-spacing: -0.022em;
  font-feature-settings: 'kern', 'liga';
}
.home__lede {
  text-wrap: balance;
  margin: clamp(1.1rem, 2.6vh, 1.9rem) 0 0;
  font-size: clamp(1.0625rem, 1.25vw, 1.3125rem);
  letter-spacing: 0.005em;
  line-height: 1.35;
}
.home__sub {
  margin: 0.35em 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1rem, 1.12vw, 1.1875rem);
  opacity: 0.92;
}
.home__foot {
  position: absolute; z-index: 2; right: var(--pad); bottom: calc(var(--pad) * 0.7);
  color: var(--sky-ink);
  text-shadow: 0 1px 8px rgba(20, 30, 10, 0.55);
}

/* portrait screens use the dedicated portrait composition */
@media (max-aspect-ratio: 4/5) {
  .home__art img { object-position: 50% 100%; }
  .home__title { top: 38%; }
  .wordmark { font-size: clamp(3.2rem, 17vw, 6.5rem); }
  .home__lede { max-width: 15em; margin-inline: auto; }
  .home__chrome { justify-content: center; }
  .home__foot { right: 0; left: 0; text-align: center; }
}

/* =====================================================================
   ABOUT — visual manifesto
   ===================================================================== */
.page-about {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100dvh;
}
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--pad) * 0.55) var(--pad) 0;
}
.masthead__mark {
  font-family: var(--serif); font-size: 1.3125rem; letter-spacing: -0.015em;
  text-decoration: none; line-height: 1;
}
.manifesto {
  min-height: 0;
  display: grid; place-items: center;
  padding: clamp(0.75rem, 2.2vh, 1.75rem) var(--pad);
  container-type: size;
}
.stage {
  --ar-w: 1600; --ar-h: 900;
  position: relative;
  width: min(100cqw, 100cqh * var(--ar-w) / var(--ar-h));
  aspect-ratio: var(--ar-w) / var(--ar-h);
  container-type: inline-size;
}
.footline {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0 var(--pad) calc(var(--pad) * 0.6);
  font-size: 0.6875rem; letter-spacing: 0.04em; color: var(--ink-soft);
}
.footline .placeholder-note { opacity: 1; }
.hint-touch { display: none; }
@media (hover: none) { .hint-touch { display: inline; } .hint-pointer { display: none; } }

/* tiles: positioned from data (wide / tall coordinates) */
.tile {
  position: absolute;
  left: var(--wx); top: var(--wy); width: var(--ww); height: var(--wh);
  margin: 0; padding: 0; border: 0; border-radius: 0;
  background: #d9d2c4;
  cursor: pointer;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  transition: opacity 680ms var(--ease), filter 680ms var(--ease);
}
.tile picture, .tile img { width: 100%; height: 100%; }
.tile img { object-fit: cover; object-position: var(--focus); }

.stage[data-active] .tile { opacity: 0.16; filter: saturate(0.35) contrast(0.9); }
.stage[data-active] .tile.is-active { opacity: 1; filter: none; }
.tile:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 5px; }

/* pillar title: an editorial intervention across the composition */
.pillar-titles {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  display: grid; place-items: center;
}
.pillar-title {
  grid-area: 1 / 1;
  margin: 0;
  width: 100%;
  text-align: center;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 8.4cqw;
  line-height: 0.98;
  letter-spacing: -0.028em;
  color: var(--ink);
  mix-blend-mode: multiply;
  transform: translateY(-3%);
}
.pillar-title::before {
  content: attr(data-index) ' / 03';
  display: block;
  margin-bottom: 1.35cqw;
  font-family: var(--sans); font-size: max(0.6875rem, 0.82cqw); letter-spacing: 0.14em;
  font-weight: 500;
  opacity: 0; transition: opacity 500ms var(--ease);
}
.pillar-title.is-active::before { opacity: 0.75; transition-delay: 160ms; }
.pillar-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.18em);
  transition: opacity 420ms var(--ease), transform 620ms var(--ease);
}
.pillar-title.is-active .pillar-word {
  opacity: 1; transform: none;
  transition-delay: calc(var(--i) * 90ms + 80ms);
  transition-duration: 760ms, 900ms;
}

/* tall composition: portrait screens */
@media (max-aspect-ratio: 5/6) {
  .masthead { padding-top: calc(var(--pad) * 0.8); }
  .stage { --ar-w: 600; --ar-h: 1120; }
  .tile { left: var(--tx); top: var(--ty); width: var(--tw); height: var(--th); }
  .pillar-title { font-size: 15.5cqw; line-height: 1; }
  .pillar-word { display: block; }
  .pillar-title::before { font-size: 2.2cqw; margin-bottom: 3cqw; }
  .footline { flex-direction: column; gap: 0.15rem; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .tile, .pillar-word, .pillar-title::before { transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .pillar-word { transform: none; }
}

/* Wordmark intro (assets/js/wordmark-intro.js) hides the static text while it plays */
.mg-intro .home .wordmark { visibility: hidden; }
