/* ==========================================================================
   Museum of Fantasy Sports — case study

   Shares the portfolio's typefaces and structural rhythm, but inverts the
   surface: the portfolio is paper in daylight, this is a gallery after closing
   time. Brass is the only added colour, used for catalog numbers and rules.

   This page describes the app; it is not the app. The application itself is a
   separate Next.js deployment mounted at /fantasy.
   ========================================================================== */

.museum {
  --surface: #0d0f1c;
  --surface-raised: #141728;
  --surface-plinth: #1a1e33;
  --gild: var(--brass);
  --hairline: rgba(216, 178, 94, 0.22);
  --hairline-soft: rgba(247, 241, 230, 0.13);

  --focus-ring: var(--acid);
  --focus-ring-offset: var(--surface);

  background: var(--surface);
  color: var(--on-ink);
}

.museum ::selection {
  background: var(--gild);
  color: var(--surface);
}

.museum code {
  border: 1px solid var(--hairline-soft);
  padding: 0.1em 0.35em;
  background: var(--surface-raised);
  color: var(--gild);
  font-family: var(--font-mono);
  font-size: 0.86em;
  word-break: break-word;
}

/* ==========================================================================
   Overview
   ========================================================================== */
.entrance {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(6rem, 14vh, 9rem) var(--gutter) var(--section-y);
  isolation: isolate;
}

/* A lit alcove: warm pool of light above, hairline floor grid below. */
.entrance__vault {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(90% 60% at 50% -10%, rgba(216, 178, 94, 0.16), transparent 70%),
    linear-gradient(180deg, transparent 55%, rgba(216, 178, 94, 0.05)),
    var(--surface);
}

.entrance__vault::after {
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background-image:
    linear-gradient(var(--hairline-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline-soft) 1px, transparent 1px);
  background-size: 4.5rem 4.5rem;
  content: '';
  mask-image: linear-gradient(transparent, black);
  opacity: 0.5;
}

.entrance__eyebrow {
  color: var(--gild);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.entrance__title {
  max-width: 14ch;
  margin: clamp(1rem, 3vw, 1.75rem) 0 0;
  color: var(--paper);
  font-size: var(--display-lg);
  font-weight: 700;
  letter-spacing: -0.075em;
  line-height: 0.84;
  text-wrap: balance;
}

.entrance__subtitle {
  max-width: 42rem;
  margin: clamp(1.25rem, 3vw, 2rem) 0 0;
  color: var(--on-ink);
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 0.9rem + 0.7vw, 1.5rem);
  font-style: italic;
  line-height: 1.4;
  text-wrap: pretty;
}

/* --- Fact plinths ---------------------------------------------------------
   The hairlines are a 1px gap showing the container background through it,
   which means an empty cell would render as a solid block of the line colour.
   Flex rather than grid: a trailing item stretches to close its row. */
.plinth-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  border: 1px solid var(--hairline);
  background: var(--hairline);
}

.plinth {
  display: grid;
  flex: 1 1 9rem;
  gap: 0.35rem;
  padding: clamp(1rem, 2.5vw, 1.5rem) clamp(0.75rem, 2vw, 1.25rem);
  background: var(--surface-plinth);
}

.plinth__value {
  color: var(--gild);
  font-size: clamp(2rem, 1.4rem + 2vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

/* Words rather than numerals need a smaller, tighter setting. */
.plinth__value--text {
  font-size: clamp(1.15rem, 0.95rem + 0.8vw, 1.6rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.plinth__label {
  color: var(--on-ink);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.entrance__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: clamp(2rem, 5vw, 3rem);
}

.button--quiet {
  border-color: var(--hairline);
  background: transparent;
  color: var(--on-ink);
}

.button--quiet:hover {
  border-color: var(--gild);
  background: transparent;
  color: var(--gild);
}

.entrance__floor {
  max-width: 34rem;
  margin-top: clamp(2rem, 5vw, 3rem);
  color: rgba(247, 241, 230, 0.6);
  font-size: var(--text-md);
}

/* ==========================================================================
   Section frame
   ========================================================================== */
.gallery {
  border-top: 1px solid var(--hairline-soft);
  padding: var(--section-y) var(--gutter);
}

.placard {
  max-width: 44rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  border-left: 1px solid var(--gild);
  padding-left: clamp(1rem, 2.5vw, 1.75rem);
}

.placard__catalog {
  color: var(--gild);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.placard__title {
  margin: 0.6rem 0 0.75rem;
  color: var(--paper);
  font-size: var(--display-sm);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
}

.placard__note {
  color: var(--on-ink);
  font-size: var(--text-base);
  text-wrap: pretty;
}

/* ==========================================================================
   Prose
   ========================================================================== */
.prose {
  max-width: 42rem;
}

.prose p {
  color: var(--on-ink);
  font-size: var(--text-base);
  text-wrap: pretty;
}

.prose p + p {
  margin-top: var(--space-sm);
}

.prose__lead {
  color: var(--paper) !important;
  font-size: var(--text-lg) !important;
}

.prose__note {
  margin-top: var(--space-md) !important;
  border-left: 2px solid var(--gild);
  padding-left: var(--space-sm);
  color: rgba(247, 241, 230, 0.62) !important;
  font-size: var(--text-md) !important;
}

/* ==========================================================================
   Data flow
   ========================================================================== */
/* Flex, not grid, for the same reason as .plinth-row: the hairlines are the
   container background showing through a 1px gap, so an empty cell would paint
   as a solid block. Flex closes the last row instead of leaving holes. */
.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  border: 1px solid var(--hairline-soft);
  background: var(--hairline-soft);
}

.flow__step {
  position: relative;
  display: grid;
  flex: 1 1 15rem;
  align-content: start;
  gap: 0.4rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--surface-raised);
}

/* The arrow that carries the eye from one stage to the next. Hidden on the
   final step, and rotated to point down once the row wraps to one column. */
.flow__step::after {
  position: absolute;
  top: 50%;
  right: -0.55rem;
  z-index: 2;
  color: var(--gild);
  content: '→';
  font-size: 0.9rem;
  line-height: 1;
  transform: translateY(-50%);
}

.flow__step--end::after {
  content: none;
}

.flow__index {
  color: var(--gild);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.18em;
}

.flow__step h3 {
  color: var(--paper);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.15;
}

.flow__step p {
  color: var(--on-ink);
  font-size: var(--text-md);
  text-wrap: pretty;
}

/* ==========================================================================
   Tenets
   ========================================================================== */
.tenets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: var(--space-sm);
}

.tenet {
  position: relative;
  border: 1px solid var(--hairline);
  padding: clamp(1.35rem, 3vw, 2rem);
  background: linear-gradient(160deg, var(--surface-plinth), var(--surface-raised));
}

.tenet::after {
  position: absolute;
  inset: 0.4rem;
  border: 1px solid rgba(216, 178, 94, 0.16);
  content: '';
  pointer-events: none;
}

.tenet__title {
  margin-bottom: 0.75rem;
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.65rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.1;
}

.tenet p {
  color: var(--on-ink);
  font-size: var(--text-md);
  text-wrap: pretty;
}

.tenet p + p {
  margin-top: var(--space-sm);
}

.tenet__why {
  border-top: 1px solid var(--hairline-soft);
  padding-top: 0.75rem;
  color: rgba(247, 241, 230, 0.68) !important;
}

.tenet__why strong {
  color: var(--gild);
}

/* ==========================================================================
   Stack
   ========================================================================== */
.stack-list {
  border-top: 1px solid var(--hairline-soft);
  max-width: 52rem;
}

.stack-list li {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-sm);
  border-bottom: 1px solid var(--hairline-soft);
  padding: 0.9rem 0;
}

.stack-list span {
  color: var(--gild);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stack-list strong {
  color: var(--paper);
  font-size: var(--text-base);
  font-weight: 500;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 60rem) {
  /* Once the flow wraps, the connector has to point down the column instead
     of across it, or it aims at nothing. */
  .flow__step::after {
    top: auto;
    right: auto;
    bottom: -0.6rem;
    left: clamp(1.25rem, 3vw, 1.75rem);
    content: '↓';
    transform: none;
  }
}

@media (max-width: 44rem) {
  .stack-list li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }
}

@media (max-width: 30rem) {
  .plinth {
    flex-basis: 40%;
  }
}
