/*
 * LGCY / Analyst portfolio — homepage stylesheet
 * Source of truth for the four homepage cards.
 * Fixed-size geometry is declared ONCE here, not patched at the bottom.
 */
@font-face {
  font-family: Bodoni;
  src: url('assets/fonts/3c8b62bcc4f84247.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: Montserrat;
  src: url('assets/fonts/ef9cf99f0175bef5.ttf') format('truetype');
  font-display: swap;
}
:root {
  --home-card-width: 300px;
  --home-card-height: 510px;
  --home-card-gap: 50px;
  --home-deck-zoom: 1.27;
  --paper: #f9f8f4;
  --paper-surface: linear-gradient(135deg, #fffefa 0%, #faf9f5 38%, #f3f4f0 72%, #fffdfa 100%);
  --accent-red: #b51f2a;
  --ink: #171918;
  --selected-glass-border: #f3faffeb;
  --selected-glass-shadow: inset 0 0 0 1px #ffffff55,
                           inset 0 0 10px #e5f3ff33,
                           0 0 10px 1px #eef8ff88,
                           0 0 24px 3px #c6e2ff40;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  font-family: Montserrat, Arial, sans-serif;
  color: #f2efe7;
  background: #1b1c1c;
}
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Approved desk perspective: JS scales the complete 1680 × 1000 composition. */
.desk-scene {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 1680px;
  height: 1000px;
  transform: translate(-50%, -50%) scale(var(--scene-scale, 1));
  transform-origin: center;
  overflow: hidden;
  background: url('assets/backgrounds/analyst_background.webp') center / cover no-repeat;
}
/* Desktop room fills the viewport independently of the fixed card composition. */
@media (min-width: 1101px) {
  body {
    background: #1b1c1c url('assets/backgrounds/analyst_background.webp') center / var(--room-size,cover) no-repeat;
  }
  .desk-scene {
    background: none;
    left: 50%;
    top: var(--scene-top, 50%);
    overflow: visible;
  }
}
header {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  height: 105px;
  padding: 30px 3.5vw;
  pointer-events: none;
}
.scene-monogram { font: 40px/1 Bodoni, Georgia, serif; }
main { position: absolute; inset: 0; }
.row-scroll {
  position: absolute;
  /* Preserve the 712px tabletop contact line. */
  top: calc(712px - var(--home-card-height) * var(--home-deck-zoom));
  left: -17.5px;
  width: 1680px;
  padding: 0;
  overflow: visible;
}
.cards {
  display: flex;
  align-items: flex-start;
  gap: var(--home-card-gap);
  width: max-content;
  margin: 0 auto;
  padding: 0;
  /* Scale artwork, type, glass and spacing together: 25% above the original .96. */
  zoom: var(--home-deck-zoom);
}
.card {
  /* THE ONLY DESKTOP DECLARATION OF HOME CARD DIMENSIONS. */
  flex: 0 0 var(--home-card-width);
  width: var(--home-card-width);
  height: var(--home-card-height);
  min-width: var(--home-card-width);
  padding: 0;
  position: relative;
  isolation: isolate;
  border: 1px solid #b8bab6;
  background: #ece9e1;
  color: #101213;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 5px 6px -2px #000e, 0 12px 17px -8px #000c;
  transition: transform .4s ease, box-shadow .4s ease;
  -webkit-box-reflect: below 0 linear-gradient(
  to bottom,
  rgba(255,255,255,.24) 0%,
  rgba(255,255,255,.10) 12%,
  transparent 34%
);
}
.card::before {
  content: '';
  position: absolute;
  z-index: 3;
  inset: -20px;
  border: 1px solid #e6f2ff99;
  box-shadow: inset 0 0 0 1px #ffffff1f,
              0 0 7px #d5eaff26;
  background:
    radial-gradient(
      ellipse 60% 29% at 78% 76%,
      rgba(171, 34, 47, 0.08),
      transparent 80%
    ),
    radial-gradient(
      ellipse 70% 16% at 50% 95%,
      rgba(255, 103, 77, 0.035),
      transparent 85%
    );
  transition: border-color .4s ease, box-shadow .4s ease;
  pointer-events: none;
}
.card::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: -8%; right: -8%; bottom: -11px;
  height: 20px;
  filter: blur(4px);
  background: radial-gradient(ellipse, #000d 0%, #0007 36%, transparent 72%);
  pointer-events: none;
}
.card-copy {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  height: 257px;
  padding: 26px 25px 36px;
  background: linear-gradient(135deg, #f4f4f1 0%, #f1f1ed 42%, #eaeae6 74%, #f4f4f1 100%);
  clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
}
.index {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
}
.index i { height: 1px; width: 65px; background: var(--accent-red); }
.card h2 {
  font: 38px/.98 Bodoni, Georgia, serif;
  letter-spacing: -1.8px;
  margin: 25px 0 9px;
}
.card[data-card="2"] h2 { font-size: 38px; }
.card p {
  margin: 0;
  color: #292d2a;
  font: 500 11px/1.9 Montserrat, Arial, sans-serif;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.line {
  display: block;
  height: 2px;
  width: 58px;
  background: var(--accent-red);
  margin-top: 9px;
}
.card > img {
  position: absolute;
  z-index: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 308px;
  object-fit: cover;
  filter: saturate(.86) brightness(1.025);filter: saturate(.92) brightness(1.03) sepia(.06) hue-rotate(-6deg);
}
/* Introduction cover: full-width portrait crop below the red accent rule. */
.card[data-card="0"] .card-copy { height:242px; }
.card[data-card="0"] > img {
 height:318px; object-fit:cover; object-position:center top;
}
/* Card 01 — enhanced portrait and background depth */
.card[data-card="0"] > img {
  filter: contrast(1.10) saturate(.98) brightness(1.015) sepia(.075) hue-rotate(-4deg);
}

/* Card 03 — enhanced archival depth and warmth */
.card[data-card="2"] > img {
  filter: contrast(1.12) saturate(1.00) brightness(1.02) sepia(.095) hue-rotate(-5deg);
}
.card-action {
  position: absolute;
  z-index: 4;
  left: 20px;
  right: 20px;
  bottom: 15px;
  display: flex;
  justify-content: space-between;
  padding: 8px;
  background: #0b101666;
  color: white;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 1px 5px #000;
}
.card:focus-visible { outline: 3px solid #f7edda; outline-offset: 8px; }
.card.touch-opening {
  z-index: 10;
  transform: translateY(-38px);
  border-color: #f5faff;
  box-shadow: 0 0 0 1px #f5faffcc,
              0 3px 9px #0009,
              0 18px 20px -9px #000c,
              0 34px 34px -17px #000d;
}
.card.touch-opening::before, .card.selected::before {
  border-color: var(--selected-glass-border);
  box-shadow: var(--selected-glass-shadow);
}
@media (hover: hover) {
  .card:hover, .card:focus-visible, .card.selected {
    z-index: 10;
    transform: translateY(-38px);
    border-color: #f5faff;
    box-shadow: 0 0 0 1px #f5faffcc,
                0 3px 9px #0009,
                0 18px 20px -9px #000c,
                0 34px 34px -17px #000d;
  }
  .card:hover::before, .card:focus-visible::before {
    border-color: var(--selected-glass-border);
    box-shadow: var(--selected-glass-shadow);
  }
}
.card-pagination { display: none; }
/* Tablet/mobile: same card box, scaled as a complete object by JS. */
@media (max-width: 1100px) {
  .desk-scene {
    inset: 0;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    transform: none;
    background-size: auto 100%;
    background-position: 58% top;
  }
  header { height: 90px; padding: 20px 28px; }
  .row-scroll {
    /* Extra lift/glow clearance; subtract the same amount to keep the cards still. */
    top: calc(var(--deck-top, 120px) - 64px);
    left: 0;
    width: 100%;
    padding: 80px 0 65px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    touch-action: pan-x pinch-zoom;
  }
  .row-scroll::-webkit-scrollbar { display: none; }
  .cards {
    zoom: var(--deck-scale, 1);
    margin: 0;
    padding-inline: max(0px, calc((100vw / var(--deck-scale, 1) - var(--home-card-width)) / 2));
  }
  .card {
    scroll-snap-align: center;
    scroll-snap-stop: always;
    -webkit-box-reflect: below 1px linear-gradient(to bottom, transparent 90%, rgba(255,255,255,.16));
  }
  .card.active { border-color: #e8e1d3; }
  .card.selected { transform: translateY(-15px); }
  .card-pagination {
    position: absolute;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 22px;
    bottom: 12px;
    left: 0;
    right: 0;
  }
  .card-pagination button {
    padding: 10px 2px;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #d1d5d9;
    font: 12px Montserrat, Arial, sans-serif;
    cursor: pointer;
  }
  .card-pagination button[aria-pressed='true'] { border-bottom-color: var(--accent-red); color: white; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none; animation: none; scroll-behavior: auto; }
}