/* =========================
   Theme tokens
   ========================= */
:root {
  --bg:          #dcd1ff;
  --bg-contrast: #ebe4ff;
  --ink:         #1a1337;
  --ink-muted:   #635f80;
  --primary:     #2d33ff;
  --shadow:      rgba(0, 0, 0, .12);

  --radius:  10px;
  --gap:     18px;
  --outline: 2px solid var(--primary);
  --mono:    "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
             "Liberation Mono", monospace;
}

/* =========================
   Reset & base
   ========================= */
*, *::before, *::after { box-sizing: border-box; }

html {
  height: 100%;
  overflow: hidden;
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-contrast) 100%);
  background-attachment: fixed;
}

body {
  height: 100%;
  overflow: hidden;
  transition: opacity 0.35s ease;
  margin: 0;
  font-family: var(--mono);
  color: var(--ink);
  background: inherit;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

/* =========================
   Header bar
   ========================= */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  margin: 12px;
  border: var(--outline);
  background: #f6f4ff;
  box-shadow: 6px 6px 0 var(--shadow);
  height: 60px;
}

.brand {
  font-size: .85rem;
  letter-spacing: .14em;
  font-weight: 500;
}

.nav { display: flex; gap: 18px; }
.nav-link {
  color: inherit;
  font-size: .85rem;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color .15s;
}
.nav-link:hover { border-bottom-color: currentColor; }

/* =========================
   Hero layout
   ========================= */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 84px);
  overflow: hidden;
  padding: clamp(12px, 3vh, 28px) 16px clamp(12px, 3vh, 28px);
  gap: 16px;
}

/* =========================
   Deck dots
   ========================= */
.deck-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 16px;
}

.deck-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-muted);
  opacity: .35;
  transition: opacity .3s, background .3s, transform .3s;
}

.deck-dot.is-active {
  background: var(--primary);
  opacity: 1;
  transform: scale(1.25);
}

/* =========================
   Deck container
   ========================= */
.deck-container {
  position: relative;
  width: 100%;
  max-width: 624px;
  /* Tall enough for the fixed card height + peek offsets */
  min-height: clamp(390px, 70vh, 600px);
  /* Extra bottom space so peeking cards don't clip */
  padding-bottom: clamp(36px, 5vh, 52px);
  cursor: pointer;
}

/* =========================
   Cards
   ========================= */
.deck-card {
  position: absolute;
  inset: 0 0 auto 0;         /* stretch to container width */
  background: #fff;
  border: var(--outline);
  border-radius: var(--radius);
  /* Fluid padding — extra bottom room so hint never overlaps content */
  padding: clamp(20px, 3.5vh, 38px) clamp(18px, 5vw, 34px) clamp(44px, 6vh, 56px);
  /* Fixed height so every card is exactly the same size */
  height: clamp(340px, 62vh, 530px);
  overflow: hidden;
  box-shadow: 8px 8px 0 var(--shadow);
  will-change: transform, opacity;
  transition:
    transform  .5s cubic-bezier(.4, 0, .2, 1),
    opacity    .5s ease,
    box-shadow .5s ease;
}

/* Position states */
.deck-card.is-front {
  transform: translateY(0) scale(1);
  z-index: 3;
  box-shadow: 10px 10px 0 var(--shadow);
}

.deck-card.is-second {
  transform: translateY(14px) scale(.97);
  z-index: 2;
  box-shadow: 7px 7px 0 var(--shadow);
}

.deck-card.is-third {
  transform: translateY(26px) scale(.94);
  z-index: 1;
  box-shadow: 4px 4px 0 var(--shadow);
}

/* 4th+ cards: hidden behind the stack */
.deck-card.is-hidden {
  transform: translateY(34px) scale(.91);
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}

/* Leaving animation: fly out to the left */
.deck-card.is-leaving {
  transform: translateX(-130%) rotate(-8deg) scale(.85);
  opacity: 0;
  z-index: 10;
  pointer-events: none;
}

/* =========================
   Card internals
   ========================= */
.card-eyebrow {
  margin: 0 0 8px;
  font-size: .72rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.card-name {
  margin: 0 0 6px;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.01em;
}

.card-title {
  margin: 0 0 6px;
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  font-weight: 500;
  line-height: 1.2;
}

.card-subtitle {
  margin: 4px 0 0;
  font-size: .95rem;
  color: var(--ink-muted);
}

.card-divider {
  width: 40px;
  height: 2px;
  background: var(--primary);
  margin: 16px 0;
  border-radius: 2px;
}

.card-meta {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.card-meta li {
  font-size: .875rem;
  color: var(--ink-muted);
}

.card-meta li::before {
  content: "— ";
  color: var(--primary);
}

.card-award {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding: 9px 13px;
  border: var(--outline);
  border-radius: 8px;
  font-size: .78rem;
  color: var(--ink);
  background: #f0f0ff;
  line-height: 1.5;
}

.award-icon {
  font-size: .9rem;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.award-label {
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2px;
}

.card-badge {
  display: block;
  margin-top: 28px;
  padding: 14px 20px;
  border: var(--outline);
  border-radius: 8px;
  font-size: 1rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-align: center;
  color: var(--primary);
  background: #f0f0ff;
}

.card-body {
  margin: 0;
  font-size: .9rem;
  line-height: 1.7;
  color: var(--ink-muted);
}

.card-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.card-links li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .88rem;
}

.link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: var(--outline);
  border-radius: 6px;
  font-size: .7rem;
  flex-shrink: 0;
  color: var(--primary);
}

.card-links a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color .15s, color .15s;
}

.card-links a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.card-thesis-btn {
  display: block;
  margin: clamp(50px, 2.5vh, 22px) auto 0; 
  padding: 8px 16px;
  background: none;
  border: var(--outline);
  border-radius: 8px;
  color: var(--primary);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.card-thesis-btn:hover {
  background: var(--primary);
  color: #fff;
}

.card-hint {
  position: absolute;
  bottom: clamp(14px, 3vh, 22px);
  right: clamp(14px, 4vw, 26px);
  margin: 0;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  opacity: .6;
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 660px) {
  .deck-container { max-width: 100%; }
}

/* Phones */
@media (max-width: 480px) {
  .hero { padding: 8px 12px 12px; gap: 10px; }
  .bar { padding: 10px 14px; }
  .brand { font-size: .78rem; }
  .card-name { font-size: clamp(1.3rem, 7vw, 1.7rem); }
  .card-title { font-size: clamp(1rem, 5vw, 1.25rem); line-height: 1.3; }
  .card-eyebrow { font-size: .65rem; }
  .card-subtitle { font-size: .85rem; }
  .card-divider { margin: 10px 0; }
  .card-meta { gap: 4px; }
  .card-meta li { font-size: .78rem; }
  .card-body { font-size: .78rem; line-height: 1.55; }
  .card-links li { font-size: .78rem; gap: 8px; }
  .card-award { margin-top: 12px; padding: 7px 10px; font-size: .72rem; }
  .card-badge { margin-top: 16px; padding: 10px 14px; font-size: .85rem; }
  .card-hint { font-size: .6rem; bottom: 10px; right: 12px; }
  .deck-dots { gap: 6px; }
  .deck-dot { width: 6px; height: 6px; }
}

/* Very small screens (SE, etc.) */
@media (max-width: 360px) {
  .deck-card { border-radius: 8px; }
  .card-name { font-size: 1.2rem; }
  .card-title { font-size: .95rem; }
}
