/* ============================================================================
   Library Origin — the site landing (/) only.

   Loaded AFTER src/landing.css, which supplies everything structural: the black
   ground, the falling field, the #title lockup frame, the scroll cue, the custom
   cursor, and the whole #page2 reveal (.page2-col's opacity + translate). This
   sheet does two things and nothing else:

     1. dresses the #title lockup as the Library Origin brand mark
     2. lays out the two-poster shelf inside #page2

   /genesis loads landing.css WITHOUT this file, so anything here is safe to
   scope loosely — it cannot reach the per-work landing.
   ========================================================================== */

:root {
  --cream:      #ffedcf;   /* the poster paper — brand ink on black */
  --cream-dim:  rgba(255, 237, 207, 0.62);
  --cream-mute: rgba(255, 237, 207, 0.4);
  --ink-soft:   #16130f;   /* a blank poster sheet */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── screen 1 · the brand lockup inside #title ───────────────────────────────
   #title is `display:grid; place-items:center`, so each grid item would centre
   independently — the mark and the wordmark need one wrapper to stay a unit.
   #title is also pointer-events:none, which is fine: nothing here is clickable. */

.lo-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.1rem, 2.6vw, 2rem);
  /* lift off dead centre so the scroll cue has room underneath */
  transform: translateY(-3vh);
}

.lo-mark {
  display: block;
  width: clamp(62px, 8vw, 112px);
  height: auto;
  filter: drop-shadow(0 2px 30px rgba(0, 0, 0, 0.85));
}

.lo-wordmark {
  margin: 0;
  font-family: "Abril Fatface", "Playfair Display", serif;
  font-weight: 400;
  font-size: clamp(2.4rem, 8vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.005em;
  text-transform: none;      /* landing.css uppercases #title span; we are not one */
  color: var(--cream);
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.85);
}

/* ── screen 2 · the two-poster shelf ─────────────────────────────────────────
   Exactly two columns, centred, at every width. html/body are overflow:hidden
   (landing.css), so anything that does not fit is simply gone — there is no
   scrollbar to fall back on. The column is therefore sized against the HEIGHT
   budget as well as the width budget, whichever binds first. */

/* landing.css top-aligns #page2 under (max-width:1024px) and (orientation:portrait).
   Media queries add no specificity and this sheet loads second, so this wins. */
#page2 {
  align-items: center;
  flex-direction: column;
}

.lo-grid {
  --pad:  clamp(0.9rem, 4vw, 3.5rem);    /* viewport side margin      */
  --gap:  clamp(0.75rem, 3vw, 3rem);     /* gutter between the sheets */
  --padY: clamp(1rem, 5vh, 3rem);        /* top/bottom breathing room */
  --capH: clamp(3.2rem, 7vh, 4.6rem);    /* the caption under a sheet */

  /* width binds on phones; height binds on short landscape windows; 360px caps
     it so a sheet never outgrows poster size on a large display */
  --byW: calc((100vw - 2 * var(--pad) - var(--gap)) / 2);
  --byH: calc((100dvh - 2 * var(--padY) - var(--capH)) * 1548 / 2000);
  --col: min(var(--byW), var(--byH), 360px);

  display: grid;
  grid-template-columns: repeat(2, var(--col));   /* exactly two, always */
  justify-content: center;
  align-items: start;
  column-gap: var(--gap);
  width: 100%;
}

/* .page2-col brings display:flex + the reveal transform from landing.css */
.lo-cell { min-width: 0; }

.poster {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.5s var(--ease-out);
}
a.poster:hover { transform: translateY(-8px); }
a.poster:focus-visible { outline: 2px solid var(--cream); outline-offset: 8px; }

/* The sheet. Genesis is the printed poster file — its cream border, title,
   credit and mark are all part of the image; nothing is drawn over it. */
.poster__plate {
  position: relative;
  aspect-ratio: 1548 / 2000;    /* the poster artboard, uncropped */
  container-type: inline-size;
  overflow: hidden;
  background: var(--ink-soft);
  isolation: isolate;
  box-shadow: 0 22px 46px -20px rgba(0, 0, 0, 0.9);
  transition: box-shadow 0.5s var(--ease-out);
}
a.poster:hover .poster__plate { box-shadow: 0 38px 68px -22px rgba(0, 0, 0, 1); }

.poster__art {
  width: 100%;
  height: 100%;
  object-fit: contain;          /* never crop the artwork */
  display: block;
}

/* Hover affordance: a wash over the whole sheet, so it cannot collide with the
   printed lockup in any corner. */
.poster__enter {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(11, 10, 8, 0.16), rgba(11, 10, 8, 0.44));
  opacity: 0;
  transition: opacity 0.4s ease;
}
a.poster:hover .poster__enter,
a.poster:focus-visible .poster__enter { opacity: 1; }

.poster__enter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid rgba(255, 237, 207, 0.62);
  border-radius: 999px;
  color: var(--cream);
  font-size: clamp(0.6rem, 2cqw, 0.76rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateY(10px);
  transition: transform 0.55s var(--ease-out);
}
a.poster:hover .poster__enter-pill,
a.poster:focus-visible .poster__enter-pill { transform: translateY(0); }

.poster__enter-arrow { transition: transform 0.4s var(--ease-out); }
a.poster:hover .poster__enter-arrow { transform: translateX(4px); }

/* the pill means nothing on touch and only eats the sheet */
@media (hover: none) { .poster__enter { display: none; } }

/* ── a work with no poster yet: the same sheet, set blank ────────────────── */

.poster__plate--blank {
  background: var(--cream);     /* the cream margin the printed poster carries */
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.85);
}
.poster__blank {
  position: absolute;
  inset: 4.5%;
  overflow: hidden;             /* clips the bleeding title at the plate edge,
                                   not at the edge of the cream sheet */
  background: var(--ink-soft);
  container-type: inline-size;
}
.poster__type, .poster__mark { position: absolute; z-index: 2; }

/* the title lockup, set to bleed off the right edge like the printed sheet */
.poster__type {
  top: 6%;
  left: 9%;
  right: -18%;
  color: rgba(255, 237, 207, 0.32);
  font-family: "Abril Fatface", serif;
  line-height: 1;
  pointer-events: none;
}
.poster__the  { display: block; font-size: 10.5cqw; margin-left: 0.06em; }
.poster__name {
  display: block;
  font-size: 28.5cqw;
  letter-spacing: -0.012em;
  margin-top: -0.06em;
  margin-left: -0.055em;        /* optical: pull the cap off the left margin */
  white-space: nowrap;
}

.poster__mark {
  right: 7%;
  bottom: 6%;
  width: 15%;
  height: auto;
  opacity: 0.24;
}

/* ── caption under the sheet ─────────────────────────────────────────────────
   Stacked and centred: name-left / meta-right cannot work in a ~166px column. */

.poster__caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  text-align: center;
  padding-top: clamp(0.6rem, 1.6vw, 1.1rem);
}

.poster__caption-name {
  font-family: "Abril Fatface", serif;
  font-size: clamp(0.95rem, 3.4vw, 1.22rem);
  letter-spacing: -0.005em;
  color: var(--cream);
}

.poster__caption-meta {
  font-size: clamp(0.62rem, 2.2vw, 0.8rem);
  letter-spacing: 0.06em;
  color: var(--cream-mute);
}

.poster--soon .poster__caption-name { color: var(--cream-dim); }

/* ── credits ─────────────────────────────────────────────────────────────────
   Inside #page2 so it inherits `pointer-events:auto` only once you have
   arrived — it must not be clickable through the falling field. #page2 itself
   has no opacity; only .page2-col is hidden during screen 1, so this has to
   carry its own fade or it floats over the field from first paint. */

.lo-credits {
  opacity: 0;
  transition: opacity 0.6s ease-in-out 0.5s;
  position: absolute;
  right: clamp(1rem, 3vw, 2.4rem);
  bottom: clamp(0.9rem, 2.5vh, 1.8rem);
  font-family: "Playfair Display", serif;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cream-mute);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 237, 207, 0.18);
  padding-bottom: 2px;
}
body.to-page2 .lo-credits { opacity: 1; }
.lo-credits:hover { color: var(--cream); border-color: var(--cream); }

/* ── reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .poster, .poster__plate, .poster__enter, .poster__enter-pill {
    transition-duration: 0.01ms;
  }
}

/* ── Footer links (Aşama 8) ──────────────────────────────────────────────────
   The landing used to carry one absolutely-positioned link ("Image credits").
   It now carries two — the site has accounts on it, so the front door needs a
   way to reach yours — and two absolutely-positioned elements at the same
   corner sit on top of each other. The POSITION moves to the wrapper and the
   links go static inside it; the fade stays on .lo-credits so nothing about
   the original timing changes. */
.lo-footer-links {
  position: absolute;
  right: clamp(1rem, 3vw, 2.4rem);
  bottom: clamp(0.9rem, 2.5vh, 1.8rem);
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 1.8rem);
  align-items: baseline;
}

.lo-footer-links .lo-credits {
  position: static;
  right: auto;
  bottom: auto;
}
