/* =========================================================
   AURUM SEQUENCE — The Compound Library
   Vintage luxury research archive. Loads after style.css.
   ========================================================= */

/* ---------- Theme: second palette ---------- */
:root.theme-lab {
  --abyss: #2B303A;      /* graphite ground */
  --harbor: #343945;
  --steel: #588B8B;      /* teal hairlines */
  --gold: #F28F3B;       /* orange plays the brass */
  --bone: #FFD5C2;       /* peach plays the ivory */
  --rust: #C8553D;
  --ember: #F28F3B;
  --teal: #588B8B;

  --ground-rgb: 43, 48, 58;
  --surface-rgb: 52, 57, 69;
  --bone-rgb: 255, 213, 194;
  --gold-rgb: 242, 143, 59;
  --steel-rgb: 88, 139, 139;
  --footer: #23272F;
  --footer-rgb: 35, 39, 47;
}

.theme-lab .grain { opacity: .1; }
.lab-vignette {
  position: fixed; inset: 0; z-index: 899; pointer-events: none;
  background: radial-gradient(ellipse 90% 80% at 50% 45%, transparent 55%, rgba(12, 13, 16, .45) 100%);
}
.theme-lab .wordmark span { color: var(--rust); }

/* ---------- Archive stage ---------- */
.labhero { position: relative; height: 220vh; }
.is-returning .labhero { height: 160vh; }
.theme-lab .stage__vignette {
  background:
    linear-gradient(90deg, rgba(var(--ground-rgb), .82) 0%, rgba(var(--ground-rgb), .35) 42%, transparent 65%),
    radial-gradient(ellipse 80% 70% at 55% 50%, transparent 45%, rgba(var(--ground-rgb), .7) 100%),
    linear-gradient(180deg, rgba(var(--ground-rgb), .5) 0%, transparent 22%, transparent 65%, rgba(var(--ground-rgb), .9) 100%);
}

.phase--labtitle { display: flex; flex-direction: column; justify-content: flex-end; }
.lab__title {
  font-family: var(--f-serif); font-weight: 400; text-transform: uppercase;
  font-size: clamp(60px, 11.5vw, 210px); line-height: .86; letter-spacing: -.02em;
  margin-bottom: clamp(20px, 3vh, 36px);
  text-shadow: calc(var(--split) * 6px) 0 rgba(200, 85, 61, .55), calc(var(--split) * -6px) 0 rgba(88, 139, 139, .55);
}
.lab__line { display: block; }
.lab__line--serif { padding-left: 9vw; }
.lab__line--serif .serif { text-transform: none; font-size: 1.05em; }
.lab__title .char { display: inline-block; will-change: transform, opacity; }
.lab__foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.lab__sub { max-width: 460px; color: var(--text-2); font-size: clamp(16px, 1.2vw, 19px); text-shadow: 0 2px 16px rgba(var(--ground-rgb), .95); }
.phase--labtitle .lab__foot a { pointer-events: auto; }

.phase--statement { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.lab__statement {
  font-family: var(--f-serif); font-weight: 400; font-size: clamp(48px, 7.5vw, 140px); line-height: .95; letter-spacing: -.02em; max-width: 14ch;
  text-shadow: 0 10px 60px rgba(var(--ground-rgb), .9);
}
.lab__statement .word { display: inline-block; }
.lab__index { margin-top: clamp(24px, 4vh, 40px); color: var(--text-2); padding: 12px 20px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- Catalogue ---------- */
.catalog {
  position: relative;
  /* archival graph paper */
  background:
    repeating-linear-gradient(0deg, rgba(var(--bone-rgb), .025) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(var(--bone-rgb), .025) 0 1px, transparent 1px 48px),
    var(--abyss);
}
.catalog__inner { max-width: var(--max); margin: 0 auto; padding: var(--section) var(--pad); }
.theme-lab .display { font-family: var(--f-serif); font-weight: 400; letter-spacing: -.02em; line-height: .9; }
.theme-lab .display .serif { color: var(--gold); }

.catalog__bar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 0; margin-bottom: clamp(28px, 4vh, 48px);
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text-2); transition: color .3s, border-color .3s, background .3s;
}
.chip b { font-weight: 500; color: var(--text-3); }
.chip:hover { color: var(--bone); border-color: var(--gold); }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--abyss); }
.chip[aria-pressed="true"] b { color: rgba(43, 48, 58, .7); }
.catalog__count { color: var(--text-3); }

/* columns only when each square can be ≥ 460px, so an entry always fits its card */
.catalog__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: clamp(16px, 1.8vw, 28px); perspective: 1400px; }

/* each compound is a square archival index card with a double rule */
.compound {
  --mx: 50%; --my: 50%;
  position: relative; aspect-ratio: 1 / 1; display: flex; flex-direction: column; gap: 14px;
  padding: clamp(22px, 2vw, 32px);
  background: linear-gradient(160deg, rgba(var(--surface-rgb), .9), rgba(var(--ground-rgb), .95));
  border: 1px solid rgba(var(--bone-rgb), .14);
  box-shadow: inset 0 0 0 6px var(--abyss), inset 0 0 0 7px rgba(var(--gold-rgb), .22), 0 30px 60px rgba(12, 13, 16, .35);
  /* no overflow clipping: aspect-ratio may then grow the card instead of cutting the ledger */
  transform-style: preserve-3d; will-change: transform; transition: border-color .5s, box-shadow .5s;
}
.compound[hidden] { display: none; }
.compound::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(var(--bone-rgb), .1), transparent 60%);
}
.compound > * { position: relative; z-index: 1; }
.compound:hover { border-color: var(--accent); box-shadow: inset 0 0 0 6px var(--abyss), inset 0 0 0 7px var(--accent), 0 40px 80px rgba(12, 13, 16, .45); }
.compound:hover::before { opacity: 1; }

.compound__hud { display: flex; justify-content: space-between; color: var(--text-3); font-size: 11px; }
.compound__hud span:first-child { color: var(--accent); }
.compound__name {
  font-family: var(--f-serif); font-style: italic; font-weight: 400;
  font-size: clamp(40px, 3.4vw, 64px); line-height: .95; letter-spacing: -.015em; color: var(--bone);
}
.compound__class { color: var(--accent); font-size: 11px; margin-top: 8px; }
.compound__brief { color: var(--text-2); font-size: 15px; line-height: 1.55; }

.ledger { margin-top: auto; display: grid; gap: 6px; }
.ledger__row { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.ledger__row dt { flex: none; color: var(--text-3); font-size: 11px; }
/* dotted leader between label and value, like a vintage table of contents */
.ledger__row::after { content: ""; order: 2; flex: 1; min-width: 16px; border-bottom: 1px dotted var(--line-2); transform: translateY(-4px); transition: border-color .5s; }
.ledger__row dd { order: 3; text-align: right; color: var(--bone); max-width: 64%; }
.compound:hover .ledger__row::after { border-color: var(--accent); }

.compound__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.compound__foot > .mono:first-child { color: var(--text-3); font-size: 11.5px; text-transform: none; letter-spacing: .02em; }
.stamp {
  flex: none; font-size: 11px; color: var(--rust); padding: 4px 8px; border: 1.5px solid var(--rust); border-radius: 2px;
  transform: rotate(-4deg); opacity: .85;
}

.compound--pending { border-style: dashed; background: rgba(var(--surface-rgb), .35); }
.compound--pending .compound__name { color: var(--text-2); }
.compound--pending .compound__name em { color: var(--rust); }
.compound__link { margin-top: auto; align-self: flex-start; color: var(--bone); border-bottom: 1px solid var(--rust); padding-bottom: 4px; }
.compound__link:hover { color: var(--rust); }

/* ---------- Methodology ---------- */
.method {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 48px);
  margin-top: clamp(64px, 10vh, 120px); padding-top: clamp(32px, 5vh, 56px); border-top: 1px solid var(--line-2);
}
.method__num { display: block; font-family: var(--f-serif); font-style: italic; font-size: 44px; line-height: 1; color: var(--rust); margin-bottom: 12px; }
.method__title { font-family: var(--f-serif); font-weight: 400; font-size: clamp(28px, 2.4vw, 40px); line-height: 1; margin-bottom: 12px; }
.method__item p { color: var(--text-2); max-width: 36ch; }

/* ---------- Responsive ---------- */
/* tablet / narrow laptop: auto-fill would give one giant empty square, so use two natural-height cards */
@media (min-width: 768px) and (max-width: 1099px) {
  .catalog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compound { aspect-ratio: auto; }
}
@media (max-width: 767px) {
  .labhero { height: 200vh; }
  .is-returning .labhero { height: 150vh; }
  .lab__title { font-size: clamp(48px, 15vw, 96px); }
  .lab__line--serif { padding-left: 0; }
  .lab__foot .btn { flex: 1 1 auto; }
  .catalog__grid { grid-template-columns: 1fr; }
  .compound { aspect-ratio: auto; }
  .method { grid-template-columns: 1fr; }
}
