/* ============================================================
   ARCHIVE — draggable infinite canvas of work artifacts.
   Charcoal room, parchment cards, mono captions.
   Loads AFTER style.css (reuses tokens, nav, cursor, grain).
   ============================================================ */

.archive-body {
  --room: #454543;            /* darker charcoal than --ink for the archive room */
  --room-grid: rgba(220, 216, 192, 0.07);
  background: var(--room);
  color: var(--paper);
  overflow: hidden;
  height: 100vh;
}

/* the nav pills keep their paper background, but body color is paper here —
   without this the wordmark/monogram renders paper-on-paper (invisible) */
.archive-body .nav-logo { color: var(--ink); }

/* grid paper flips to charcoal-room lines here */
.archive-body .paper {
  background-image:
    linear-gradient(var(--room-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--room-grid) 1px, transparent 1px);
}

.arc { position: relative; z-index: 1; height: 100vh; }

/* ---------- big background word ---------- */
.arc-explore {
  position: fixed;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(4rem, 16vw, 15rem);
  letter-spacing: -0.02em;
  color: rgba(220, 216, 192, 0.10);
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

/* ---------- field + cards ---------- */
.arc-field {
  position: fixed; inset: 0;
  z-index: 2;
  outline: none;
  touch-action: none;
  overflow: hidden;
}
.arc-field.is-dragging { cursor: grabbing; }

/* borderless — no frame, no shadow; the mockup/image IS the card (Synapser-style) */
.arc-card {
  position: absolute;
  left: 0; top: 0;
  color: var(--paper);
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}
.arc-card img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: saturate(0.9) brightness(0.97);
  transition: filter 0.35s ease;
}
.arc-card:hover img { filter: saturate(1) brightness(1); }

/* label sits under the image, revealed only on hover (fades + lifts up) */
.arc-cap {
  display: flex; justify-content: space-between; gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  margin-top: 8px;
  color: rgba(220, 216, 192, 0.6);
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.arc-card:hover .arc-cap { opacity: 1; transform: translateY(0); }
.arc-card:hover .arc-cap b { color: var(--accent); }
.arc-cap b { font-weight: 600; color: var(--paper); transition: color 0.25s ease; }

/* lumen card — no screenshot, a tiny on-brand teal mock instead */
.arc-lumen {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #10201f;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: flex-end;
  padding: 14px;
  gap: 6px;
  pointer-events: none;
}
.arc-lumen .lm-dot { width: 8px; height: 8px; background: #37d0b2; }
.arc-lumen .lm-word {
  font-family: var(--font-mono);
  font-size: 1rem; letter-spacing: 0.22em;
  color: #cfe8e2;
}
.arc-lumen .lm-line { width: 60%; height: 1px; background: rgba(55, 208, 178, 0.5); }
.arc-lumen .lm-line + .lm-line { width: 38%; }

/* ---------- drag pill ---------- */
.arc-drag {
  position: fixed; left: 0; top: 0;
  z-index: 5;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--paper);
  background: rgba(69, 69, 67, 0.85);
  border: 1px solid rgba(220, 216, 192, 0.35);
  padding: 0.45rem 0.8rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}
.arc-drag.is-on { opacity: 1; }
@media (hover: none), (pointer: coarse) { .arc-drag { display: none; } }

/* ---------- bottom UI ---------- */
.arc-ui {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(0.9rem, 2vw, 1.5rem) var(--pad);
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
}
.arc-ui > * { pointer-events: auto; }
.arc-ui-left { color: rgba(220, 216, 192, 0.5); }
.arc-ui-right {
  color: var(--paper);
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.arc-ui-right:hover { color: var(--accent); border-color: var(--accent); }

.arc-ui-center { display: flex; gap: 0.6rem; }
.arc-toggle, .arc-zoomctl {
  display: flex;
  border: 1px solid rgba(220, 216, 192, 0.35);
  background: rgba(69, 69, 67, 0.85);
}
.arc-zoomctl .arc-tbtn {
  color: rgba(220, 216, 192, 0.55);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1;
  width: 2.1rem;
  justify-content: center;
  transition: color 0.25s ease;
}
.arc-zoomctl .arc-tbtn:hover { color: var(--paper); }
.arc-list-open .arc-zoomctl { visibility: hidden; }
.arc-tbtn {
  appearance: none; border: 0; background: transparent;
  padding: 0.6rem 0.75rem;
  display: flex; align-items: center;
}
.arc-tbtn svg { width: 15px; height: 15px; fill: rgba(220, 216, 192, 0.45); transition: fill 0.25s ease; }
.arc-tbtn.is-on { background: var(--paper); }
.arc-tbtn.is-on svg { fill: var(--ink); }
.arc-tbtn:not(.is-on):hover svg { fill: var(--paper); }

/* nav artifact counter (right box) */
.nav-side-archive { gap: 0; }
.arc-count { color: var(--accent); font-weight: 600; }
@media (max-width: 880px) { .nav-side-archive { display: none; } }

/* ---------- list view ---------- */
.arc-list {
  position: fixed; inset: 0;
  z-index: 4;
  overflow-y: auto;
  padding: calc(clamp(0.9rem, 2vw, 1.5rem) * 2 + 4rem) var(--pad) 7rem;
  /* rows dissolve before they reach the nav / bottom bar */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 7.5rem, #000 calc(100% - 5.5rem), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 7.5rem, #000 calc(100% - 5.5rem), transparent 100%);
}
.arc-list-inner {
  max-width: 1080px;
  margin: 0 auto;
  border-top: 1px solid rgba(220, 216, 192, 0.25);
}
.arc-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto auto;
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: baseline;
  padding: clamp(1.1rem, 2.5vw, 1.7rem) 0.5rem;
  border-bottom: 1px solid rgba(220, 216, 192, 0.25);
  color: var(--paper);
  transition: background 0.3s ease, color 0.3s ease, padding-left 0.3s ease;
}
.arc-row:hover {
  background: var(--paper);
  color: var(--ink);
  padding-left: 1.2rem;
}
.arc-row-num {
  font-family: var(--font-mono);
  font-size: 0.62rem; letter-spacing: 0.12em;
  opacity: 0.55;
}
.arc-row-title {
  font-weight: 700;
  font-size: clamp(1.3rem, 3.4vw, 2.2rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1.05;
}
.arc-row:hover .arc-row-title { color: var(--accent); }
.arc-row-tag, .arc-row-count {
  font-family: var(--font-mono);
  font-size: 0.62rem; letter-spacing: 0.12em;
  opacity: 0.65;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .arc-row { grid-template-columns: 3rem 1fr auto; }
  .arc-row-tag { display: none; }
}

/* ---------- zoom layer (breathes out while dragging) ---------- */
.arc-zoom {
  position: absolute; inset: 0;
  transform-origin: 50% 50%;
  will-change: transform;
}

/* ---------- preloader: zooming word → ARCHIVE → blends into Explore ---------- */
.arc-pre {
  position: fixed; inset: 0;
  z-index: 400;
  background: var(--room, #454543);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.9s ease;
}
.arc-pre.is-done { opacity: 0; pointer-events: none; }
.arc-pre-word {
  display: flex; align-items: center;
  color: var(--paper);
  /* same voice as the Explore watermark it dissolves into */
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(2.4rem, 8vw, 6.5rem);
  letter-spacing: -0.02em;
  line-height: 1;
  will-change: transform;
  /* the whole word block zooms in continuously while words flash */
  transform: scale(0.72);
  transition: transform 2.4s cubic-bezier(0.3, 0, 0.2, 1);
}
.arc-pre.is-zooming .arc-pre-word { transform: scale(1); }
/* the final dissolve keeps the zoom travelling into the Explore watermark */
.arc-pre.is-done .arc-pre-word {
  transform: scale(1.6);
  transition: transform 0.9s cubic-bezier(0.3, 0, 0.2, 1);
}
.arc-pre-text { display: block; }
/* passing words are quieter; ARCHIVE lands full strength */
.arc-pre-word.is-passing { opacity: 0.4; }
.arc-pre-word.is-final { opacity: 1; }
.arc-pre-dot {
  width: 0.14em; height: 0.14em;
  background: var(--accent);
  align-self: flex-end;
  margin: 0 0 0.06em 0.1em;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.arc-pre.is-set .arc-pre-dot { opacity: 1; }
/* Explore watermark starts hidden and fades in as the preloader dissolves */
.arc-explore {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 1s ease, transform 1s cubic-bezier(0.3, 0, 0.2, 1);
}
.arc-explore.is-in { opacity: 1; transform: scale(1); }
/* after greeting the visitor it slowly dissolves for good */
.arc-explore.is-out { opacity: 0; transition: opacity 3s ease; }
@media (prefers-reduced-motion: reduce) {
  .arc-explore { opacity: 1; transform: none; transition: none; }
}
.arc-pre-foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center;
  padding: var(--pad);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: rgba(220, 216, 192, 0.5);
}
@media (prefers-reduced-motion: reduce) {
  .arc-pre { display: none; }
}

/* entrance */
.arc-card { opacity: 0; }
.arc-card.is-in { opacity: 1; transition: opacity 0.7s ease; }
@media (prefers-reduced-motion: reduce) {
  .arc-card { opacity: 1; transition: none; }
}
