/* showcase.noahlot.com
   Base styles render a plain scrolling grid (no JS, reduced motion, or the
   Grid toggle). html.fx switches the deck into the 3D coverflow stage.
   Palette and type match noahlot.com: paper, ink, one royal blue. */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --paper: #f4f2ec;
  --panel: #ffffff;
  --line: #cbc9c1;
  --line-strong: #878680;
  --ink: #111111;
  --muted: #65645f;
  --blue: #001e8d;
  --shadow: rgba(17, 17, 17, .16);
}

html { background: var(--paper); }

body {
  font-family: Manrope, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(rgba(17, 17, 17, .045) 1px, transparent 1.3px) 0 0 / 26px 26px,
    var(--paper);
  min-height: 100vh;
  overflow-x: hidden;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  background: var(--blue); color: #fff; padding: 10px 16px;
  border-radius: 0 0 10px 0; font-weight: 600; text-decoration: none;
}
.skip:focus { left: 0; }

#sky { display: none; }
.nebula { display: none; }

/* ---------- header ---------- */

.top { text-align: center; padding: 44px 18px 8px; position: relative; }

.brand {
  font-weight: 800;
  font-size: clamp(2.6rem, 7.5vw, 4.6rem);
  letter-spacing: -.06em;
  color: var(--ink);
}
.brand .dot { color: var(--blue); }

.sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: clamp(.95rem, 2.2vw, 1.15rem);
}

.chips {
  margin: 22px auto 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  max-width: 860px;
}
.chip {
  font: 600 .8rem Manrope, sans-serif;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 14px;
  min-height: 32px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip.on {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}
.chip:focus-visible, .view:focus-visible, .nav:focus-visible,
.meta-link:focus-visible, .foot a:focus-visible, .card a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.view {
  position: absolute; top: 18px; right: 18px;
  font: 600 .8rem Manrope, sans-serif;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 34px;
  cursor: pointer;
}
.view:hover { color: var(--ink); border-color: var(--ink); }
html.nojs .view, html.nojs .chips { display: none; }

/* ---------- plain grid (base mode) ---------- */

.stage-wrap { max-width: 1180px; margin: 26px auto 0; padding: 0 18px; }

.nav, .meta, .scrub { display: none; }

.deck {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 18px;
}

.card a {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card a:hover {
  transform: translateY(-4px);
  border-color: var(--ink);
  box-shadow: 0 14px 30px rgba(17, 17, 17, .14);
}
.card img {
  width: 100%; height: auto; display: block; background: #e8e6df;
  border-bottom: 1px solid var(--line);
}
.card-txt { display: block; padding: 12px 14px 14px; }
.card-name { display: block; font-weight: 800; font-size: .95rem; letter-spacing: -.02em; }
.card-tag {
  display: block; color: var(--blue); margin-top: 3px;
  font: 600 .68rem "IBM Plex Mono", monospace;
  text-transform: uppercase; letter-spacing: .08em;
}
.card-blurb {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted); font-size: .8rem; line-height: 1.45; margin-top: 7px;
}
.card.hide { display: none; }

/* ---------- footer ---------- */

.foot { text-align: center; padding: 40px 18px 34px; }

.foot-line { color: var(--muted); font-size: .8rem; }
.foot-line a { color: var(--blue); }

/* ================= fx mode: the coverflow stage ================= */

html.fx, html.fx body { height: 100%; overflow: hidden; }

html.fx body { display: flex; flex-direction: column; }

html.fx #sky {
  display: block;
  position: fixed; inset: 0; z-index: -2;
}
html.fx .nebula {
  display: block;
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 34% at 50% 0%, rgba(0, 30, 141, .05), transparent 75%);
}

html.fx .top { padding-top: clamp(18px, 3.5vh, 42px); flex: none; }
html.fx .chips { margin-top: clamp(10px, 2vh, 22px); }

html.fx .stage-wrap {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  max-width: none; width: 100%; margin: 0; padding: 0;
}

html.fx .stage {
  position: relative;
  flex: 1 1 auto; min-height: 0;
  perspective: 1150px;
  perspective-origin: 50% 42%;
  touch-action: pan-y;
}

/* soft contact shadow under the deck */
html.fx .stage::after {
  content: "";
  position: absolute; left: 50%; bottom: 4%;
  width: min(72vw, 900px); height: 12%;
  transform: translateX(-50%);
  background: radial-gradient(50% 90% at 50% 50%, rgba(17, 17, 17, .13), transparent 72%);
  pointer-events: none;
}

html.fx .deck {
  display: block;
  position: absolute; inset: 0;
  transform-style: preserve-3d;
}

html.fx .card {
  position: absolute;
  left: 50%; top: 44%;
  width: var(--cw, 430px);
  margin-left: calc(var(--cw, 430px) / -2);
  transform: translateY(-50%);
  will-change: transform, opacity;
  display: none;
}
html.fx .card.vis { display: block; }
html.fx .card.hide { display: none; }

html.fx .card a {
  border-radius: 10px;
  border: 1px solid rgba(17, 17, 17, .22);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, .6) inset,
    0 22px 44px var(--shadow);
  background: var(--panel);
}
html.fx .card a:hover { transform: none; }
html.fx .card img {
  border-bottom: 0; border-radius: 9px;
  -webkit-box-reflect: below 10px
    linear-gradient(transparent 74%, rgba(255, 255, 255, .18));
}
html.fx .card-txt { display: none; }
html.fx .card.mid a {
  border-color: var(--blue);
  box-shadow:
    0 0 0 1px var(--blue),
    0 28px 56px rgba(17, 17, 17, .22),
    0 10px 40px rgba(0, 30, 141, .14);
}

html.fx .nav {
  display: grid; place-items: center;
  position: absolute; top: 42%;
  transform: translateY(-50%);
  z-index: 30;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--ink);
  font-size: 26px; line-height: 1;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
html.fx .nav:hover { border-color: var(--blue); color: var(--blue); }
html.fx .prev { left: clamp(8px, 3vw, 44px); }
html.fx .next { right: clamp(8px, 3vw, 44px); }

html.fx .meta {
  display: block;
  flex: none;
  text-align: center;
  padding: 4px 18px 0;
  min-height: 86px;
}
.meta-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.meta-blurb {
  color: var(--muted); font-size: .86rem; max-width: 560px;
  margin: 4px auto 0; line-height: 1.45;
}
.meta-row {
  margin-top: 6px;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 6px 12px;
  max-width: 100%;
}
.meta-tag {
  font: 600 .68rem "IBM Plex Mono", monospace;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--blue);
  border: 1px solid rgba(0, 30, 141, .35);
  border-radius: 999px; padding: 3px 10px;
}
.meta-link {
  color: var(--blue); font-size: .82rem; font-weight: 600;
  overflow-wrap: anywhere; max-width: calc(100vw - 40px);
}

html.fx .scrub {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 10px 18px 4px;
}
.count {
  color: var(--muted);
  font: 600 .74rem "IBM Plex Mono", monospace;
  letter-spacing: .08em;
}
.bar {
  width: min(320px, 40vw); height: 3px;
  background: rgba(17, 17, 17, .14);
  border-radius: 2px; overflow: hidden;
}
.bar-fill {
  height: 100%; width: 0;
  background: var(--blue);
  border-radius: 2px;
  transition: width .25s;
}

html.fx .foot { padding: clamp(8px, 2vh, 22px) 18px clamp(12px, 2.5vh, 26px); }
html.fx .brand, html.fx .sub { animation: rise .7s backwards; }
html.fx .sub { animation-delay: .1s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}


/* small screens: tighter stage, hide blurb to save height */
@media (max-width: 640px) {
  html.fx .meta-blurb { display: none; }
  html.fx .meta { min-height: 64px; }
  html.fx .nav { display: none; }
  .view { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
