/* Field — the scattered moodboard (/field). Always dark: the work is the colour. */
@property --tint { syntax: "<color>"; inherits: true; initial-value: rgb(236 233 226); }
@property --aura-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0a09; color: #f4f2ee; }
body {
  font: 15px/1.4 Inter, -apple-system, BlinkMacSystemFont, sans-serif;
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased;
  overscroll-behavior: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; }

/* ------------------------------------------------------------------ the field */
.field { position: fixed; inset: 0; overflow: hidden; contain: strict; }
.fcard {
  position: absolute; left: 0; top: 0; padding: 0; border: 0; margin: 0;
  border-radius: 10px; overflow: hidden; cursor: pointer; opacity: 0;
  transform-origin: 50% 50%; contain: layout paint;
  -webkit-tap-highlight-color: transparent;
}
.fcard img {
  display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none;
  opacity: 0; transition: opacity 420ms var(--ease-out), filter 200ms var(--ease-out);
}
.fcard.is-loaded img { opacity: 1; }
/* Hover brightens (the card's own transform is the spring's). */
@media (hover: hover) {
  .fcard:hover { z-index: 9000 !important; opacity: 1 !important; }
  .fcard:hover img { filter: brightness(1.06); }
}
.fcard:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.8); outline-offset: 2px; }
/* A soft vignette keeps the edges quiet. */
.field::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 8000;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(11, 10, 9, 0.55) 100%);
}

/* ------------------------------------------------------------------ pill */
.pill {
  --tint: rgb(236 233 226);
  position: fixed; z-index: 9500; left: 50%; top: 50%;
  width: min(560px, calc(100vw - 40px)); height: 58px; margin: 0;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 6px; padding: 0 8px 0 24px;
  border-radius: 29px;
  background: color-mix(in srgb, var(--tint) 34%, rgba(246, 244, 240, 0.62));
  backdrop-filter: blur(22px) saturate(170%); -webkit-backdrop-filter: blur(22px) saturate(170%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22) inset, 0 1px 0 rgba(255, 255, 255, 0.5) inset,
              0 24px 60px -20px rgba(0, 0, 0, 0.7), 0 4px 14px -4px rgba(0, 0, 0, 0.35);
  transition: --tint 900ms var(--ease-out), box-shadow 260ms var(--ease-out);
}
/* The aura, dimmer than on the home page — on black it needs very little. */
.pill::before {
  content: ""; position: absolute; inset: -14px 10px; z-index: -1; border-radius: 40px;
  background: conic-gradient(from var(--aura-a), #ffc2a1, #f7a8d0, #bca7ff, #9fd0ff, #b6ecd2, #ffe0a3, #ffc2a1);
  filter: blur(26px); opacity: 0.2;
  animation: aura-drift 14s linear infinite;
  transition: opacity 600ms var(--ease-out);
}
.pill:focus-within::before { opacity: 0.32; }
@keyframes aura-drift { to { --aura-a: 360deg; } }
.pill input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none;
  font: 500 18px/1 Inter, sans-serif; letter-spacing: -0.015em; color: #16140f;
  caret-color: #16140f;
}
.pill input::placeholder { color: rgba(22, 20, 15, 0.42); }
.pill-status { font-size: 13px; color: rgba(22, 20, 15, 0.5); white-space: nowrap; }
.pill-clear {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 0; border-radius: 18px;
  background: none; color: rgba(22, 20, 15, 0.55); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity 160ms, background 160ms;
}
.pill.has-text .pill-clear { opacity: 1; pointer-events: auto; }
.pill-clear:hover { background: rgba(22, 20, 15, 0.08); color: #16140f; }
.pill-clear svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
/* The image model loading: a hairline that fills along the bottom of the pill. */
.pill::after {
  content: ""; position: absolute; left: 24px; right: 24px; bottom: 9px; height: 1.5px; border-radius: 1px;
  background: rgba(22, 20, 15, 0.35); transform-origin: left; transform: scaleX(var(--warm, 0));
  opacity: 0; transition: opacity 300ms, transform 300ms var(--ease-out);
}
.pill.is-warming.has-text::after { opacity: 1; }

/* ------------------------------------------------------------------ corners */
.field-back, .field-shuffle {
  position: fixed; z-index: 9400; top: 18px; height: 36px;
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 18px;
  background: rgba(20, 19, 17, 0.5); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: rgba(244, 242, 238, 0.82); text-decoration: none; font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset; cursor: pointer;
  opacity: 0; transition: opacity 600ms 300ms, background 160ms, color 160ms;
}
body.is-ready .field-back, body.is-ready .field-shuffle { opacity: 1; }
.field-back { left: 18px; padding: 0 14px 0 11px; }
.field-shuffle { right: 18px; width: 36px; justify-content: center; }
.field-back:hover, .field-shuffle:hover { background: rgba(40, 38, 35, 0.72); color: #fff; }
.field-back svg { width: 16px; height: 16px; fill: currentColor; }
.field-shuffle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ peek */
.peek {
  position: fixed; inset: 0; z-index: 9800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 24px; background: rgba(8, 7, 6, 0); backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0);
  transition: background 320ms var(--ease-out), backdrop-filter 320ms var(--ease-out), -webkit-backdrop-filter 320ms var(--ease-out);
  cursor: zoom-out;
}
.peek[hidden] { display: none; }
.peek.is-open { background: rgba(8, 7, 6, 0.72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.peek-stage {
  position: relative; border-radius: 16px; overflow: hidden; flex: none;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
  transition: transform 380ms var(--ease-drawer);
}
.peek-stage img, .peek-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.peek-stage video { opacity: 0; transition: opacity 300ms; }
.peek-stage video.is-on { opacity: 1; }
.peek-info {
  max-width: min(640px, 100%); text-align: center; cursor: default;
  opacity: 0; transform: translateY(6px); transition: opacity 240ms, transform 320ms var(--ease-out);
}
.peek.is-open .peek-info { opacity: 1; transform: none; transition-delay: 140ms; }
.peek-about { margin: 0; font-size: 16px; font-weight: 500; letter-spacing: -0.01em; color: #f4f2ee; text-wrap: balance; }
.peek-meta { margin: 6px 0 0; font-size: 13px; color: rgba(244, 242, 238, 0.5); }
.peek-acts { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.peek-acts a {
  height: 36px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 18px;
  font-size: 13px; font-weight: 600; text-decoration: none; color: #f4f2ee; background: rgba(255, 255, 255, 0.1);
  transition: background 160ms;
}
.peek-acts a:hover { background: rgba(255, 255, 255, 0.16); }
.peek-acts a.is-primary { background: #f4f2ee; color: #16140f; }
.peek-acts a.is-primary:hover { background: #fff; }

@media (max-width: 699px) {
  .pill { height: 52px; border-radius: 26px; padding-left: 20px; }
  .pill input { font-size: 17px; }
  .field-back, .field-shuffle { top: max(14px, env(safe-area-inset-top)); }
  .field-back { left: 14px; } .field-shuffle { right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .pill::before { animation: none; }
  .peek-stage { transition: none; }
}
