:root {
  --bg-canvas: #fbf1f0;
  --bg-surface: #fff9f6;
  --bg-surface-hover: #f5e6e8;
  --text-primary: #1c1917;
  --text-muted: #574b4f;
  --accent-primary: #6b2155;
  --accent-secondary: #9d3478;
  --border-subtle: rgba(107, 33, 85, 0.18);
  --ease-kinetic: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-elevation: 0 12px 32px -4px rgba(28, 25, 23, 0.12);
  --glow-accent: 0 0 24px -4px rgba(107, 33, 85, 0.35);
  --glass-backdrop: blur(16px) saturate(180%);
  --radius: 20px;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, Consolas, "Courier New", monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-wrap: anywhere;
  hyphens: auto;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
  border-radius: var(--radius);
  object-fit: cover;
  filter: contrast(1.08) brightness(0.94);
}

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.25s var(--ease-kinetic);
}

.link-grow {
  position: relative;
  display: inline-block;
  font-weight: 600;
  color: var(--accent-primary);
}
.link-grow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 2px;
  background-color: var(--accent-primary);
  transition: width 0.3s var(--ease-kinetic);
}
.link-grow:hover::after, .link-grow:focus-visible::after {
  width: 100%;
}

.btn-plum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-primary);
  color: #fff9f6;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--accent-primary);
  cursor: pointer;
  transition: transform 0.35s var(--ease-kinetic), box-shadow 0.35s var(--ease-kinetic), background-color 0.25s ease;
}
.btn-plum:hover, .btn-plum:focus-visible {
  background-color: var(--accent-secondary);
  transform: translateY(-3px) scale(1.015);
  box-shadow: var(--shadow-elevation), var(--glow-accent);
  color: #ffffff;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.prose {
  max-width: 70ch;
  margin: 0 auto;
}
.prose h2, .prose h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}
.prose p, .prose ul, .prose ol {
  margin-bottom: 1.25rem;
}
.prose ul, .prose ol {
  padding-left: 1.5rem;
}

.clue-label, .mono-tag, .step-num, .section-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  font-weight: 700;
}

/* Header: Floating rounded-end box inside margins, non-sticky, brand far left */
.site-header-wrap {
  padding: 1.25rem 1.5rem 0.5rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}
.site-header {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-elevation);
  position: relative;
}
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-right: auto;
  text-align: left;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-secondary), var(--accent-primary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff9f6;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.35rem;
}
.main-nav a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a[aria-current="page"] {
  color: var(--accent-primary);
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* Dotted Background Pattern for Hero & Deduction only */
.bg-dots {
  background-image: radial-gradient(rgba(107, 33, 85, 0.22) 1.25px, transparent 1.25px);
  background-size: 18px 18px;
}

/* Hero Section with 3 Overlapping Photographs */
.hero-section {
  padding: 3.5rem 0 4rem;
  margin-top: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}
.hero-copy h1 {
  font-size: clamp(2.1rem, 4vw, 3.25rem);
  line-height: 1.12;
  margin: 0.5rem 0 1.15rem;
  letter-spacing: -0.02em;
}
.hero-lead {
  font-size: 1.08rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 58ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
}

.hero-collage {
  position: relative;
  min-height: 410px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(12, 32px);
}
.collage-item {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-elevation);
  border: 3px solid var(--bg-surface);
  transition: transform 0.4s var(--ease-kinetic);
}
.collage-item img {
  width: 100%;
  height: 100%;
}
.collage-1 {
  grid-column: 1 / 9;
  grid-row: 1 / 9;
  z-index: 1;
}
.collage-2 {
  grid-column: 5 / 13;
  grid-row: 4 / 11;
  z-index: 2;
}
.collage-3 {
  grid-column: 2 / 8;
  grid-row: 7 / 13;
  z-index: 3;
}
.collage-item:hover {
  transform: translateY(-5px) scale(1.02);
  z-index: 5;
}

/* Sections & Evidence Cabinet Bento Grid */
.section-block {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.section-header {
  margin-bottom: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}
.section-header h2 {
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  line-height: 1.2;
  margin-top: 0.25rem;
}

.bento-cabinet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
@media (min-width: 960px) {
  .bento-cabinet-featured {
    grid-template-columns: repeat(3, 1fr);
  }
  .bento-span-2 {
    grid-column: span 2;
  }
}

.evidence-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-elevation);
  transition: transform 0.35s var(--ease-kinetic), box-shadow 0.35s var(--ease-kinetic), background-color 0.25s ease;
}
.evidence-card:hover {
  transform: translateY(-5px) scale(1.012);
  box-shadow: var(--shadow-elevation), var(--glow-accent);
  background-color: var(--bg-surface-hover);
}

/* Card Media with Overlapping Plum Category Badge on Lower Edge */
.card-photo-wrap {
  position: relative;
  margin-bottom: 1.35rem;
  border-radius: var(--radius);
}
.card-photo-wrap img {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
}
.plum-badge {
  position: absolute;
  bottom: -12px;
  left: 16px;
  background-color: var(--accent-primary);
  color: #fff9f6;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(28, 25, 23, 0.25);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-body h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.card-body p {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin-bottom: 1rem;
}
.card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

/* Numbered Clue Rows & Separate Hint / Answer Disclosures */
.clue-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 1.25rem 0;
}
.clue-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: baseline;
  background-color: var(--bg-canvas);
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
}
.clue-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(107, 33, 85, 0.1);
  padding: 0.15rem 0.55rem;
  border-radius: 8px;
  font-size: 0.82rem;
}

.disclosure-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}
details.clue-drawer {
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 0.75rem 1.1rem;
}
details.clue-drawer summary {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.clue-drawer summary::-webkit-details-marker {
  display: none;
}
details.clue-drawer summary::after {
  content: "+";
  font-size: 1.1rem;
}
details.clue-drawer[open] summary::after {
  content: "−";
}
details.clue-drawer .drawer-content {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.94rem;
  color: var(--text-primary);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}
th, td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
th {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  background-color: rgba(107, 33, 85, 0.06);
  color: var(--accent-primary);
}

/* Forms & Case-Note Tool */
.case-form-panel {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-elevation);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.15rem;
  margin-bottom: 1.15rem;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.form-field label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}
.form-field input, .form-field select, .form-field textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 2px solid var(--accent-primary);
  border-color: transparent;
}
.case-note-preview {
  background-color: var(--bg-canvas);
  border: 1px dashed var(--accent-primary);
  border-radius: var(--radius);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  white-space: pre-wrap;
  margin: 1rem 0;
  min-height: 110px;
}
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

/* Footer */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 2.5rem;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.84rem;
}

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease-kinetic), transform 0.65s var(--ease-kinetic);
}
.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-collage {
    min-height: 320px;
  }
  .mobile-menu-btn {
    display: inline-flex;
  }
  .main-nav {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    box-shadow: var(--shadow-elevation);
    z-index: 50;
  }
  .main-nav.nav-open {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
