:root {
  color-scheme: light;
  --ink: #152027;
  --muted: #5f6c72;
  --line: #dbe3e4;
  --panel: #ffffff;
  --soft: #f5f8f7;
  --teal: #087f82;
  --teal-dark: #045b61;
  --amber: #c77816;
  --amber-dark: #8a4c08;
  --amber-soft: #fff7e8;
  --amber-line: #e6b765;
  --blue: #356d9c;
  --graphite: #28313a;
  --shadow: 0 18px 45px rgba(27, 46, 54, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(219, 227, 228, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 760;
  color: var(--graphite);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--graphite);
  color: #fff;
  font-size: 0.9rem;
  letter-spacing: 0;
}

.top-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.top-nav a,
.nav-button {
  border-radius: 8px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a:focus-visible,
.nav-button:hover,
.nav-button:focus-visible {
  background: #eaf2f1;
  color: var(--teal-dark);
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  min-height: calc(100vh - 72px);
  min-height: calc(100svh - 72px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  max-width: 720px;
  overflow: hidden;
  padding: 72px 32px 72px clamp(32px, 7vw, 96px);
}

.eyebrow,
.section-label {
  margin: 0 0 12px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 11ch;
  margin-bottom: 20px;
  overflow-wrap: normal;
  font-size: clamp(3rem, 13cqw, 5.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.lede {
  color: var(--graphite);
  font-size: clamp(1.16rem, 2vw, 1.45rem);
  line-height: 1.45;
}

.hero-copy p:not(.eyebrow) {
  max-width: 64ch;
}

.hero-copy h1 {
  max-width: 14ch;
  word-break: normal;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 17px;
  cursor: pointer;
  font: inherit;
  font-weight: 780;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--teal);
  color: #fff;
  box-shadow: 0 14px 30px rgba(8, 127, 130, 0.24);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: var(--teal-dark);
}

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--graphite);
}

.button.smell-primary {
  background: #ad620d;
  color: #fff;
  box-shadow: 0 14px 30px rgba(173, 98, 13, 0.22);
}

.button.smell-primary:hover,
.button.smell-primary:focus-visible {
  background: var(--amber-dark);
}

.button.smell-secondary {
  border-color: var(--amber-line);
  background: #fffdf8;
  color: var(--amber-dark);
}

.button.smell-secondary:hover,
.button.smell-secondary:focus-visible {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.hero-visual {
  min-width: 0;
  min-height: 440px;
  background:
    linear-gradient(90deg, rgba(245, 248, 247, 0.16), rgba(245, 248, 247, 0.02)),
    url("assets/bp-debugging-hero.png") 58% center / cover no-repeat;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 18px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(8, 127, 130, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(27, 46, 54, 0.12);
  transform: translateX(-50%);
}

.scroll-cue::before {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--teal-dark);
  border-bottom: 2px solid var(--teal-dark);
  content: "";
  transform: translateY(-2px) rotate(45deg);
}

.scroll-cue:hover,
.scroll-cue:focus-visible {
  background: #fff;
  box-shadow: var(--shadow);
}

.info-band,
.acknowledgements,
.catalog-overview,
.page-shell,
.detail-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.catalog-overview {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  gap: 42px;
  padding: 72px 0 30px;
}

.catalog-heading {
  max-width: 380px;
}

.catalog-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.catalog-card {
  display: flex;
  min-width: 0;
  min-height: 250px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(28, 45, 52, 0.06);
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.catalog-card.smell-catalog {
  border-color: var(--amber-line);
  border-top-color: var(--amber);
  background: #fffdf8;
}

.catalog-card:hover,
.catalog-card:focus-visible {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.catalog-card h3 {
  margin: 18px 0 10px;
  font-size: 1.55rem;
  line-height: 1.15;
}

.catalog-card p {
  color: var(--muted);
}

.catalog-kicker,
.catalog-link {
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 820;
  text-transform: uppercase;
}

.smell-catalog .catalog-link {
  color: var(--amber-dark);
}

.smell-catalog h3 {
  margin-top: 0;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.smell-badge {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.smell-badge {
  border: 1px solid var(--amber-line);
  background: var(--amber-soft);
  color: var(--amber-dark);
}

.info-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) 1.35fr;
  gap: 42px;
  padding: 72px 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.info-grid article,
.scenario-card,
.trace-list,
.code-panel,
.contact-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(28, 45, 52, 0.06);
}

.info-grid article {
  padding: 24px;
}

.info-grid p,
.ack-copy p,
.screen-heading p,
.scenario-card p,
.detail-copy p,
.detail-copy li {
  color: var(--muted);
}

.acknowledgements {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 360px);
  gap: 32px;
  align-items: start;
  padding: 0 0 80px;
}

.contact-card {
  display: grid;
  gap: 10px;
  padding: 22px;
  font-style: normal;
}

.email-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
  color: var(--teal-dark);
  font-weight: 720;
  text-decoration: none;
}

.email-button:hover,
.email-button:focus-visible {
  text-decoration: underline;
}

.page-shell {
  padding: 70px 0 88px;
}

.screen-heading {
  min-width: 0;
  max-width: 760px;
  margin-bottom: 28px;
}

.screen-heading h1 {
  max-width: 12ch;
  font-size: clamp(2.65rem, 5vw, 5rem);
}

.screen-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.catalog-assumption {
  max-width: 720px;
  border-left: 4px solid var(--amber);
  margin-top: 22px;
  padding: 14px 16px;
  background: #fffdf8;
  color: var(--graphite);
}

.catalog-assumption strong {
  display: block;
  margin-bottom: 4px;
  color: var(--amber-dark);
}

.catalog-assumption p {
  margin: 0;
}

.scenario-grid {
  display: grid;
  gap: 54px;
}

.scenario-group {
  min-width: 0;
}

.scenario-group-heading {
  max-width: 820px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.category-number {
  display: block;
  margin-bottom: 7px;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.scenario-group-heading h2 {
  margin-bottom: 8px;
  font-size: 1.75rem;
  line-height: 1.15;
}

.scenario-group-heading p {
  max-width: 70ch;
  margin-bottom: 0;
  color: var(--muted);
}

.scenario-group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.smells-view {
  background: #fffaf1;
}

.smell-heading {
  max-width: 820px;
}

.smell-heading .badge-row,
.smell-detail .badge-row {
  margin-bottom: 16px;
}

.smell-heading h1 {
  max-width: 14ch;
}

.smell-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.smell-card {
  display: flex;
  min-width: 0;
  min-height: 310px;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--amber-line);
  border-top: 4px solid var(--amber);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(95, 59, 12, 0.07);
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.smell-card:hover,
.smell-card:focus-visible {
  border-color: #c77b1d;
  box-shadow: 0 18px 42px rgba(95, 59, 12, 0.15);
  transform: translateY(-2px);
}

.smell-index {
  display: block;
  margin-top: 0;
  color: var(--amber-dark);
  font-size: 0.82rem;
  font-weight: 820;
  text-transform: uppercase;
}

.smell-card h2 {
  margin: 10px 0 12px;
  font-size: 1.35rem;
  line-height: 1.16;
}

.smell-card p {
  color: var(--muted);
}

.smell-open-label,
.smell-back-link {
  color: var(--amber-dark);
  font-weight: 800;
}

.scenario-card {
  display: flex;
  min-width: 0;
  min-height: 270px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  text-decoration: none;
}

.scenario-card:hover,
.scenario-card:focus-visible {
  border-color: rgba(8, 127, 130, 0.55);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.scenario-card .index {
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 820;
  text-transform: uppercase;
}

.scenario-card h3 {
  margin: 12px 0;
  font-size: 1.35rem;
  line-height: 1.16;
}

.scenario-card .open-label {
  color: var(--teal-dark);
  font-weight: 800;
}

.related-construct {
  display: grid;
  gap: 3px;
  margin: 18px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--graphite) !important;
}

.related-construct span,
.construct-pill span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.related-construct code,
.construct-pill code {
  overflow-wrap: anywhere;
  color: var(--teal-dark);
  font-weight: 760;
}

.detail-shell {
  padding: 48px 0 88px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 22px;
  color: var(--teal-dark);
  font-weight: 800;
  text-decoration: none;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.4fr);
  gap: 26px;
  align-items: end;
  margin-bottom: 26px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.detail-hero h1 {
  max-width: 15ch;
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
}

.detail-meta {
  display: grid;
  gap: 10px;
}

.meta-pill {
  border-left: 4px solid var(--amber);
  padding: 12px 14px;
  background: #fff;
  color: var(--graphite);
  font-weight: 720;
}

.smell-principle {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.code-stack {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.detail-copy {
  display: grid;
  gap: 18px;
}

.detail-copy section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-copy h2 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.code-panel {
  overflow: hidden;
}

.alternative-code-panel {
  border-color: rgba(8, 127, 130, 0.38);
}

.alternative-code-panel header {
  border-bottom-color: rgba(8, 127, 130, 0.26);
  background: #edf8f6;
  color: var(--teal-dark);
}

.code-panel header,
.trace-list header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
  color: var(--graphite);
  font-size: 0.88rem;
  font-weight: 800;
}

.smell-code-panel {
  border-color: var(--amber-line);
}

.smell-code-panel header {
  border-bottom-color: var(--amber-line);
  background: var(--amber-soft);
  color: var(--amber-dark);
}

.smell-finding {
  border-color: var(--amber-line) !important;
  border-left: 4px solid var(--amber) !important;
  background: #fffdf8 !important;
}

.smell-finding .section-label {
  margin-bottom: 9px;
}

.finding-message {
  margin-bottom: 10px;
  color: var(--ink) !important;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 1rem;
  font-weight: 750;
}

.possible-causes {
  margin-bottom: 0;
  font-size: 0.92rem;
}

.caveat-section {
  border-color: var(--amber-line) !important;
  background: var(--amber-soft) !important;
}

pre {
  margin: 0;
  overflow-x: auto;
  padding: 18px;
  background: #172128;
  color: #edf6f4;
  font-size: 0.9rem;
  line-height: 1.56;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.kw {
  color: #76d2ff;
}

.bp {
  color: #67e0c2;
}

.str {
  color: #ffc46b;
}

.trace-list {
  overflow: hidden;
}

.trace-list ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trace-list li {
  display: grid;
  grid-template-columns: 44px 1fr;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.trace-list li:last-child {
  border-bottom: 0;
}

.trace-list .step {
  display: grid;
  place-items: center;
  background: #eef5f4;
  color: var(--teal-dark);
  font-weight: 850;
}

.trace-list .event {
  overflow-wrap: anywhere;
  padding: 13px 15px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.94rem;
}

.trace-list .trace-outcome .step {
  background: #fff0e5;
  color: #9a3f14;
}

.trace-list .trace-outcome .event {
  background: #fff8f3;
  color: #9a3f14;
  font-weight: 800;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 1160px) {
  .hero,
  .info-band,
  .acknowledgements,
  .catalog-overview,
  .detail-hero,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .hero-copy {
    max-width: none;
    padding-right: 32px;
  }

  .hero-copy h1 {
    max-width: 14ch;
    font-size: clamp(2.7rem, 10vw, 5.2rem);
  }

  .hero-visual {
    min-height: 30vh;
    order: -1;
    background-position: center;
  }

  .scenario-group-grid,
  .smell-grid,
  .catalog-grid,
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
  }

  .top-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    justify-content: flex-start;
  }

  .top-nav a,
  .nav-button {
    width: 100%;
    min-width: 0;
    padding: 8px;
    font-size: 0.86rem;
    text-align: left;
  }

  .hero-copy {
    padding: 30px 24px 34px;
  }

  h1,
  .screen-heading h1,
  .detail-hero h1 {
    max-width: none;
    font-size: 2.28rem;
    line-height: 1.04;
  }

  .hero-actions,
  .site-footer {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .info-band,
  .acknowledgements,
  .catalog-overview,
  .page-shell,
  .detail-shell {
    width: calc(100% - 32px);
    max-width: 1180px;
  }

  .scenario-group-grid,
  .smell-grid,
  .catalog-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .scenario-card {
    min-height: 205px;
  }

  .smell-card,
  .catalog-card {
    min-height: 220px;
  }

  .detail-copy section {
    padding: 20px;
  }
}
