/* The wallpapers page. Builds on tokens, base and the Duo model in device.css. */

/* The header is always there on this page: there is no hero to stay out of. */
.wp-page .top-bar { position: sticky; opacity: 1; visibility: visible; transform: none; pointer-events: auto; }

@media (max-width: 640px) { .wp-badge { display: none; } }

/* ---------- Hero ---------- */
.wp-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center; padding-block: clamp(2.5rem, 7vw, 6rem) clamp(2rem, 5vw, 4rem);
}
.wp-hero__text { display: grid; gap: 1.1rem; }
.wp-hero h1 em { font-style: italic; font-weight: 340; }
.wp-hero__stage { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: clamp(1rem, 3vw, 2.4rem); min-height: 18rem; }
.wp-hero__stage .slot--closed { --half-w: clamp(92px, 10.5vw, 152px); }
.wp-hero__stage .slot--open { --half-w: clamp(124px, 15vw, 224px); }
@media (max-width: 860px) {
  .wp-hero { grid-template-columns: minmax(0, 1fr); }
  .wp-hero__stage { min-height: 0; padding-top: 1rem; }
}
@media (max-width: 520px) {
  .wp-hero__stage { gap: 0.9rem; }
  .wp-hero__stage .slot--closed { --half-w: 21vw; }
  .wp-hero__stage .slot--open { --half-w: 33vw; }
}

/* the wallpaper fills the real screens; the inner one spans both halves across the crease */
.wpi { position: absolute; top: 0; bottom: 0; background-size: 100% 100%; background-color: #0f1320; }
.duo__face--outer .wpi { left: 0; right: 0; }
.duo__half--left .duo__face--inner .wpi { left: 0; width: 200%; }
.duo__half--right .duo__face--inner .wpi { left: -100%; width: 200%; }

/* ---------- Search ---------- */
.wp-find { padding-bottom: clamp(3rem, 8vw, 6rem); }
.wp-search { display: grid; gap: 0.7rem; max-width: 46rem; }
.wp-search__field { position: relative; }
.wp-search__icon { position: absolute; left: 1.2rem; top: 50%; width: 1.35rem; height: 1.35rem; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.wp-search input {
  width: 100%; font: inherit; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 1.05rem 7rem 1.05rem 3.3rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.25s var(--ease-page), box-shadow 0.25s var(--ease-page), background 0.25s var(--ease-page);
}
.wp-search input::placeholder { color: var(--ink-faint); }
.wp-search input:placeholder-shown { padding-right: 1.2rem; text-overflow: ellipsis; }
.wp-search input::-webkit-search-cancel-button { display: none; }
.wp-search input:focus { outline: none; background: var(--paper); border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent), 0 10px 30px -18px rgba(0, 0, 0, 0.35); }
.wp-search__clear {
  position: absolute; right: 0.55rem; top: 50%; transform: translateY(-50%);
  font: inherit; font-size: 0.85rem; color: var(--ink-soft); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 0.45rem 0.9rem; cursor: pointer;
}
.wp-search__clear:hover { color: var(--ink); border-color: var(--ink-faint); }

.wp-tools { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-block: 1.4rem 1.6rem; }
.wp-seg { display: inline-flex; padding: 0.25rem; gap: 0.2rem; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2); }
.wp-seg button {
  font: inherit; font-size: 0.9rem; color: var(--ink-soft); background: transparent; border: 0;
  border-radius: 999px; padding: 0.5rem 1rem; cursor: pointer; transition: background 0.25s var(--ease-page), color 0.25s var(--ease-page);
}
.wp-seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.wp-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Grid ---------- */
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: clamp(0.9rem, 1.8vw, 1.4rem); }
.wp-card { list-style: none; animation: wp-in 0.45s var(--ease-lift) both; animation-delay: calc(min(var(--i, 0), 12) * 22ms); }
@keyframes wp-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .wp-card { animation: none; } }
.wp-card button {
  width: 100%; height: 100%; display: grid; gap: 0.9rem; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 1.2rem; padding: 1rem 1rem 1.05rem;
  transition: transform 0.35s var(--ease-lift), box-shadow 0.35s var(--ease-lift), border-color 0.35s var(--ease-lift);
}
.wp-card button:hover { transform: translateY(-3px); box-shadow: 0 18px 38px -24px rgba(0, 0, 0, 0.45); border-color: color-mix(in srgb, var(--ink) 18%, transparent); }
.wp-card button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wp-card__art { display: flex; align-items: flex-end; justify-content: center; gap: 0.7rem; height: 11.5rem; padding-top: 0.4rem; }
.wp-thumb { flex: none; border-radius: 0.65rem; background: #121725 center / cover no-repeat; box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 10px 22px -14px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.12); }
/* Sized by width, not height: the inner (landscape) thumb is 1.42× as wide as it is tall, and
   at the height of the art box it ran past the card's edge. 36% + 58% + the gap fits any card. */
.wp-thumb--outer { aspect-ratio: 466 / 678; height: auto; width: 36%; max-height: 100%; }
.wp-thumb--inner { aspect-ratio: 951 / 669; height: auto; width: 58%; }
.wp-card__name { display: grid; gap: 0.15rem; }
.wp-card__name strong { font-family: var(--font-serif); font-weight: 480; font-size: 1.28rem; letter-spacing: -0.02em; line-height: 1.15; font-variation-settings: "opsz" 48, "SOFT" 40; }
.wp-card__meta { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.wp-card__native { color: var(--ink-faint); font-size: 0.86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-card__swatch { width: 0.85rem; height: 0.85rem; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.wp-card__tag { justify-self: start; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--red); }

.wp-empty { padding: 3rem 0; text-align: center; color: var(--ink-soft); font-size: 1.1rem; }

/* ---------- Sheet ---------- */
.wp-sheet {
  width: min(70rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 1.5rem;
  background: var(--paper); color: var(--ink); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.55);
}
.wp-sheet::backdrop { background: rgba(20, 16, 10, 0.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.wp-sheet[open] { animation: wp-sheet 0.45s var(--ease-lift); }
@keyframes wp-sheet { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
@media (prefers-reduced-motion: reduce) { .wp-sheet[open] { animation: none; } }
.wp-sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: clamp(1.2rem, 3vw, 2rem) clamp(1.2rem, 3vw, 2.2rem) 0; }
.wp-sheet__head .mono { margin-top: 0.5rem; }
.wp-sheet__close { flex: none; width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink); cursor: pointer; }
.wp-sheet__close svg { width: 1.15rem; height: 1.15rem; }
.wp-sheet__body { display: grid; gap: clamp(1.6rem, 3vw, 2.4rem); padding: clamp(1.2rem, 3vw, 2rem) clamp(1.2rem, 3vw, 2.2rem); }
.wp-sheet__how { padding: 0 clamp(1.2rem, 3vw, 2.2rem) clamp(1.2rem, 3vw, 2rem); color: var(--ink-soft); font-size: 0.95rem; }

.wp-idea { display: grid; gap: 1.1rem; }
.wp-idea h3 { font-family: var(--font-mono); font-weight: 500; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); }
.wp-idea__row { display: flex; align-items: flex-end; justify-content: center; gap: clamp(1.5rem, 5vw, 4.5rem); flex-wrap: wrap; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 1.6rem; }
.slot--closed .duo { margin: 0 calc(var(--half-w) * -0.5); }
.wp-idea .slot--closed { --half-w: clamp(96px, 11vw, 132px); }
.wp-idea .slot--open { --half-w: clamp(120px, 17vw, 200px); }
.wp-dl {
  display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--paper); background: var(--ink);
  border-radius: 999px; padding: 0.6rem 1.05rem 0.6rem 0.85rem; line-height: 1.15;
  transition: transform 0.3s var(--ease-lift), box-shadow 0.3s var(--ease-lift);
}
.wp-dl:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.6); }
.wp-dl svg { width: 1.15rem; height: 1.15rem; flex: none; }
.wp-dl strong { display: block; font-size: 0.92rem; font-weight: 600; }
.wp-dl small { display: block; font-size: 0.72rem; opacity: 0.72; font-family: var(--font-mono); letter-spacing: 0.04em; }
@media (max-width: 640px) {
  .wp-sheet { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; margin: 0; }
  .wp-idea__row { justify-content: center; }
}

/* ---------- Footer ---------- */
.wp-foot { display: grid; gap: 1.2rem; padding-block: 2.5rem 3rem; border-top: 1px solid var(--line); }
.wp-foot__meta { display: flex; gap: 0.5rem 1.6rem; flex-wrap: wrap; }

