/* CLOVER OOC — HOME ARCHIVE INDEX · aceenvw */

.archive-masthead {
  padding: calc(var(--nav-height) + 1.75rem) 0 4rem;
  border-bottom: 1px solid var(--border);
}

.archive-masthead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.archive-intro { min-width: 0; }

.archive-kicker,
.archive-section-number,
.archive-index-label {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.archive-kicker { margin: 0 0 1.5rem; }

.archive-title {
  max-width: 680px;
  margin: 0 0 1.75rem;
  font-size: clamp(3.8rem, 7.2vw, 7rem);
  font-weight: 400;
  line-height: 0.83;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.archive-title em { color: var(--accent-text); font-weight: 400; }

.archive-lead {
  max-width: 610px;
  margin: 0 0 1.35rem;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  text-wrap: pretty;
}

.archive-byline {
  max-width: 610px;
  margin: 0;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.6;
}

.archive-byline strong { color: var(--text); font-weight: 500; }

.archive-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.archive-text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  transition: color 0.18s, border-color 0.18s;
}

.archive-text-link:hover { color: var(--accent-text); border-color: var(--accent); }

.archive-hero-figure {
  position: relative;
  width: min(100%, 470px);
  min-width: 0;
  justify-self: end;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.archive-hero-figure::before {
  content: '599';
  position: absolute;
  z-index: 2;
  top: -0.42em;
  right: -0.08em;
  color: var(--bg);
  font-family: var(--font-display);
  font-size: clamp(4rem, 7vw, 6.5rem);
  line-height: 1;
  opacity: 0.78;
  pointer-events: none;
}

.archive-hero-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 43 / 24;
  object-fit: contain;
}

.archive-hero-figure figcaption,
.visual-plate figcaption {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  color: var(--text-secondary);
  background: var(--bg);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1.45;
}

.archive-hero-figure figcaption span:first-child,
.visual-plate figcaption > span { color: var(--accent); }

.archive-hero-figure figcaption strong,
.visual-plate figcaption strong { color: var(--text); font-weight: 500; text-align: right; }

.archive-index {
  position: sticky;
  top: var(--nav-height);
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.archive-index-inner {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.archive-index-inner::-webkit-scrollbar { display: none; }
.archive-index-label { flex: 0 0 auto; margin-right: 0.75rem; color: var(--text-dim); }

.archive-index a {
  min-height: 44px;
  padding: 0 0.75rem;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--text-secondary);
  border-bottom: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  white-space: nowrap;
  transition: color 0.18s, border-color 0.18s;
}

.archive-index a:hover { color: var(--text); border-bottom-color: var(--accent); }

#holdings, #visual-index, #featured, #workflow {
  scroll-margin-top: calc(var(--nav-height) + 64px);
}

.archive-section {
  padding: clamp(4rem, 8vw, 7rem) 0;
  border-top: 1px solid var(--border);
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}

.archive-section-heading {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.archive-section-number { padding-top: 0.55rem; }

.archive-section-heading h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -0.025em;
}

.archive-section-heading div > p {
  max-width: 650px;
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
}

.holdings-section { background: var(--bg-surface); }
.holdings-groups { border-top: 2px solid var(--text); }

.holdings-group {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2rem;
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.holdings-group > header {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.holdings-group > header > span {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 0.85;
  opacity: 0.3;
}

.holdings-group h3 { margin: 0 0 0.3rem; font-size: 1.15rem; font-weight: 500; }
.holdings-group header p { margin: 0; color: var(--text-dim); font-size: 0.73rem; line-height: 1.5; }
.holdings-list { list-style: none; border-top: 1px solid var(--border); }
.holdings-list li { border-bottom: 1px solid var(--border); }

.holdings-list a {
  position: relative;
  min-height: 112px;
  padding: 1rem 0.75rem 1rem 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) minmax(100px, auto) 24px;
  gap: 1rem;
  align-items: center;
  overflow: hidden;
  transition: background-color 0.18s, padding-left 0.18s;
}

.holdings-list a:hover { padding-left: 0.75rem; background: var(--accent-faint); }
.holding-index { color: var(--accent); font-family: var(--font-mono); font-size: 0.68rem; }
.holding-name { min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.holding-name strong { font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; }
.holding-name small { color: var(--text-secondary); font-size: 0.78rem; line-height: 1.45; }

.holding-count {
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.8;
  letter-spacing: -0.04em;
  opacity: 0.82;
  font-variant-numeric: tabular-nums;
}

.holding-count-major { color: var(--accent-text); }
.holding-arrow { color: var(--accent); font-size: 1rem; }

.visual-section { background: var(--bg); }

.visual-sheet {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.visual-plate { min-width: 0; background: var(--bg); }
.visual-plate figure { height: 100%; display: flex; flex-direction: column; }

.visual-plate img {
  width: 100%;
  height: 100%;
  min-height: 0;
  flex: 1;
  object-fit: cover;
  filter: saturate(0.92);
  transition: filter 0.25s, opacity 0.25s;
}

.visual-plate:hover img { filter: saturate(1.05); opacity: 0.94; }
.visual-plate-wide { grid-column: span 8; min-height: 300px; }
.visual-plate-dark { grid-column: span 4; min-height: 265px; }
.visual-plate-portrait { grid-column: span 4; min-height: 420px; }
.visual-plate-portrait img { object-position: center top; }
.visual-plate-space { grid-column: span 4; min-height: 300px; }
.visual-plate-motion { grid-column: span 4; min-height: 300px; }
.visual-plate-motion img { object-position: center 30%; }
.visual-plate-outfit-second { grid-column: span 4; min-height: 300px; }

.featured-section { background: var(--bg-surface); }

.featured-grid {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--border);
  border: 1px solid var(--border);
  gap: 1px;
}

.featured-card {
  position: relative;
  min-height: 360px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  color: inherit;
  background: var(--bg);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  cursor: pointer;
  transition: background-color 0.18s;
}

.featured-card:first-child { grid-column: 1 / -1; min-height: 400px; padding: 3rem; }
.featured-card:hover { background: var(--accent-faint); }
.featured-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }

.featured-num {
  position: absolute;
  top: 1rem;
  right: 1.4rem;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: clamp(4rem, 8vw, 7rem);
  line-height: 1;
  opacity: 0.13;
}

.featured-label { margin: 0 0 1rem; color: var(--accent); font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.featured-title { max-width: 75%; margin: 0 0 1rem; font-size: clamp(1.8rem, 4vw, 3.4rem); font-weight: 400; }
.featured-id { display: none; }

.featured-text {
  max-width: 760px;
  margin: 0;
  display: -webkit-box !important;
  overflow: hidden;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.75;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.featured-tags { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }

.featured-copy-hint {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.workflow-section { background: var(--bg); }
.workflow-formula { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; border-top: 2px solid var(--text); border-bottom: 1px solid var(--border); }
.workflow-formula > a, .workflow-formula > div { min-height: 150px; padding: 1.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; transition: background-color 0.18s; }
.workflow-formula > a:hover { background: var(--accent-faint); }
.workflow-step { color: var(--accent); font-family: var(--font-mono); font-size: 0.68rem; }
.workflow-formula strong { max-width: 220px; font-family: var(--font-display); font-size: 1.4rem; font-weight: 500; line-height: 1.2; }
.workflow-arrow { align-self: center; color: var(--accent); font-family: var(--font-mono); }
.workflow-guide { margin: 1.5rem 0 0; color: var(--text-secondary); font-size: 0.82rem; }
.workflow-guide a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 4px; }

@media (width <= 900px) {
  .archive-masthead { padding-top: calc(var(--nav-height) + 1.5rem); }
  .archive-masthead-grid { grid-template-columns: 1fr; gap: 3rem; }
  .archive-intro { max-width: 760px; }
  .archive-hero-figure { justify-self: start; }
  .holdings-group { grid-template-columns: 170px minmax(0, 1fr); }
  .visual-plate-wide { grid-column: span 8; }
  .visual-plate-dark, .visual-plate-motion, .visual-plate-portrait, .visual-plate-space, .visual-plate-outfit-second { grid-column: span 4; }
}

@media (width <= 700px) {
  .archive-masthead { padding: 30px 0 3rem; }
  .archive-title { font-size: clamp(3.25rem, 15vw, 5rem); line-height: 0.86; }
  .archive-hero-figure::before { font-size: 5rem; }
  .archive-index-inner { justify-content: flex-start; padding-inline: 20px; }
  .archive-index-label { display: none; }
  .archive-section { padding: 4rem 0; }
  .archive-section-heading { grid-template-columns: 1fr; gap: 0.75rem; margin-bottom: 2rem; }
  .archive-section-number { padding: 0; }
  .holdings-group { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.5rem 0 2rem; }
  .holdings-group > header > span { font-size: 2.4rem; }
  .holdings-list a { min-height: 96px; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 0.65rem; padding-right: 0; }
  .holding-count { grid-column: 3; font-size: clamp(2.3rem, 13vw, 3.5rem); }
  .holding-arrow { display: none; }
  .holding-name small { font-size: 0.72rem; }
  .visual-sheet { grid-template-columns: 1fr; }
  .visual-plate-wide, .visual-plate-dark, .visual-plate-portrait, .visual-plate-space, .visual-plate-motion, .visual-plate-outfit-second { grid-column: auto; grid-row: auto; min-height: 0; }
  .visual-plate img { aspect-ratio: 16 / 10; min-height: 0; }
  .visual-plate-portrait img { aspect-ratio: 4 / 5; }
  .featured-grid { grid-template-columns: 1fr; }
  .featured-card, .featured-card:first-child { grid-column: auto; min-height: 330px; padding: 1.5rem; }
  .featured-title { max-width: 78%; }
  .workflow-formula { grid-template-columns: 1fr; }
  .workflow-formula > a, .workflow-formula > div { min-height: 120px; border-bottom: 1px solid var(--border); }
  .workflow-arrow { padding: 0.35rem 1.5rem; justify-self: start; transform: rotate(90deg); }
}

@media (width <= 420px) {
  .archive-actions { align-items: stretch; flex-direction: column; }
  .archive-actions .btn, .archive-text-link { justify-content: center; }
  .archive-hero-figure figcaption, .visual-plate figcaption { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .archive-hero-figure figcaption strong, .visual-plate figcaption strong { text-align: left; }
  .holdings-list a { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .holding-count { font-size: 2.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .archive-text-link, .archive-index a, .holdings-list a, .visual-plate img, .featured-card, .workflow-formula > a { transition: none; }
}

@media (prefers-contrast: more) {
  .archive-hero-figure, .visual-sheet, .featured-grid { border-width: 2px; }
  .holding-count, .archive-hero-figure::before { opacity: 1; }
}
