.project-dialog {
  --pd-ink: #f2f5fa;
  --pd-muted: #b7c3d4;
  --pd-blue: #3974ff;
  --pd-line: #263449;
  --pd-edge: 24px;
  --pd-bar-height: 64px;
  box-sizing: border-box;
  width: min(1160px, calc(100vw - var(--pd-edge) * 2));
  max-width: none;
  max-height: calc(100dvh - var(--pd-edge) * 2);
  margin: auto;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  color: var(--pd-ink);
  background: #070a10;
  border: 1px solid #2a3850;
  border-radius: 4px;
  box-shadow: 0 32px 120px #000b, 0 0 70px #1458da0d;
  font-family: Manrope, Arial, sans-serif;
  text-align: left;
  color-scheme: dark;
}
.project-dialog::backdrop { background: #020408d9; backdrop-filter: blur(12px); }
.project-dialog:not([open]) { display: none; }
.project-dialog[open] { display: grid; grid-template-rows: var(--pd-bar-height) minmax(0, 1fr); animation: pd-enter 220ms ease-out both; }
.project-dialog .dialog-close {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: 100%;
  height: var(--pd-bar-height);
  min-height: 44px;
  margin: 0;
  padding: 16px clamp(22px, 5vw, 64px);
  color: var(--pd-ink);
  background: #0b101b;
  border: 0;
  border-bottom: 1px solid var(--pd-line);
  border-radius: 0;
  font: 600 13px/1.3 Manrope, Arial, sans-serif;
  cursor: pointer;
}
.project-dialog .dialog-close::before { content: 'PROJECT NOTES'; margin-right: auto; color: #94a6bd; font-size: 11px; font-weight: 600; letter-spacing: .12em; }
.project-dialog .dialog-close:hover { background: #111b2c; color: #9abcff; }
.project-detail {
  box-sizing: border-box;
  min-height: 0;
  max-height: calc(100dvh - var(--pd-edge) * 2 - var(--pd-bar-height) - 2px);
  padding: 46px clamp(22px, 5vw, 64px) 54px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: #3a5274 #0b101b;
  scroll-padding-block: 28px;
  font-family: Manrope, Arial, sans-serif;
}
.project-detail *, .project-detail *::before, .project-detail *::after { box-sizing: border-box; }
.project-detail .pd-heading { margin: 0 0 30px; }
.project-detail .pd-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: 0 0 24px;
  color: var(--pd-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.6;
}
.project-detail .pd-status { border-left: 1px solid #3d5476; padding-left: 20px; letter-spacing: .02em; text-transform: none; }
.project-detail h2 {
  margin: 0 0 18px;
  max-width: 930px;
  color: var(--pd-ink);
  font: 500 clamp(38px, 5.8vw, 72px)/1.07 Manrope, Arial, sans-serif;
  letter-spacing: -.05em;
  text-wrap: balance;
}
.project-detail h2:focus { outline: none; }
.project-detail h3 { margin: 0 0 14px; font: 600 21px/1.35 Manrope, Arial, sans-serif; letter-spacing: -.025em; color: var(--pd-ink); }
.project-detail p { margin: 0 0 18px; font-size: 16px; line-height: 1.7; color: var(--pd-muted); max-width: none; }
.project-detail strong { color: var(--pd-ink); }
.project-detail .pd-intro { max-width: 760px; font-size: clamp(18px, 2vw, 21px); line-height: 1.6; color: #c2cedf; }
.project-detail .pd-disclosure { margin-bottom: 30px; padding: 17px 20px; background: #0d1524; border-left: 2px solid var(--pd-blue); font-size: 14px; color: #c2cedf; }
.project-detail .pd-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 30px 0;
  padding: 4px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--pd-line);
  border-radius: 7px;
  background: #0b111d;
}
.project-detail .pd-tabs button {
  appearance: none;
  min-height: 44px;
  padding: 12px 17px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #b7c3d4;
  font: 600 13px/1.35 Manrope, Arial, sans-serif;
  letter-spacing: -.01em;
  cursor: pointer;
}
.project-detail .pd-tabs button:hover { background: #15243b; color: #f2f5fa; }
.project-detail .pd-tabs button[aria-selected='true'] { background: #2357c8; color: #fff; border-color: #4377e7; }
.project-detail :is(button, a, input):focus-visible { outline: 2px solid #8bb3ff; outline-offset: 4px; }
.project-dialog .dialog-close:focus-visible { outline: 2px solid #8bb3ff; outline-offset: -6px; }
.project-detail .pd-panel:focus-visible { outline: 2px solid #8bb3ff; outline-offset: 6px; }
.project-detail .pd-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(22px, 4vw, 48px); align-items: start; }
.project-detail .pd-grid > * { min-width: 0; }
.project-detail .pd-experiment { background: #0d1524; padding: clamp(22px, 3vw, 32px); border: 1px solid var(--pd-line); border-radius: 3px; }
.project-detail .pd-label { display: block; color: #97b8f4; font-size: 11px; font-weight: 600; line-height: 1.6; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 16px; }
.project-detail .pd-big-number { font: 500 clamp(64px, 8vw, 96px)/1.08 Manrope, Arial, sans-serif; letter-spacing: -.06em; color: var(--pd-ink); font-variant-numeric: lining-nums tabular-nums; margin-bottom: 16px; }
.project-detail .pd-equation { font-size: 13px; font-variant-numeric: tabular-nums; color: #aabdd8; }
.project-detail .pd-rule { height: 1px; background: var(--pd-line); margin: 26px 0; }
.project-detail .pd-note { color: #9cacbf; font-size: 13px; line-height: 1.7; }
.project-detail table { width: 100%; border-collapse: collapse; color: #c2cedf; font-size: 13px; font-variant-numeric: tabular-nums; }
.project-detail table caption { text-align: left; padding: 0 0 18px; font-size: 14px; font-weight: 600; color: #e2eaf6; }
.project-detail table th, .project-detail table td { padding: 13px 6px; border-bottom: 1px solid var(--pd-line); text-align: left; vertical-align: middle; }
.project-detail table th { font-weight: 600; }
.project-detail table thead th { color: #9cacbf; font-size: 11px; }
.project-detail table tbody th { font-size: 12px; color: #aabbd1; }
.project-detail .pd-unobserved { color: #aabbd1; font-style: italic; }
.project-detail .pd-excluded { background: #0c111b; color: #9cacbf; }
.project-detail .pd-footnote { margin-top: 42px; padding-top: 32px; border-top: 1px solid var(--pd-line); }
.project-detail .pd-footnote h3 { font-size: 20px; }
.project-detail .pd-footnote p { font-size: 15px; max-width: 870px; }
.project-detail .pd-link { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 9px 0; color: #8db4ff; text-decoration: underline; text-decoration-color: #4f75b7; text-underline-offset: 5px; font-size: 14px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.project-detail .pd-link:hover { color: #c1d7ff; text-decoration-color: currentColor; }
.project-detail .pd-source-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.project-detail .pd-footnote .pd-credit { margin: 24px 0 0; color: #94a6bd; font-size: 13px; line-height: 1.7; }
.project-detail .pd-credit a { color: #b4c8e9; text-decoration: underline; text-decoration-color: #526b91; text-underline-offset: 3px; }
.project-detail .pd-credit a:hover { color: #f2f5fa; }
.project-detail .pd-code-example { min-width: 0; margin-top: 42px; padding-top: 32px; border-top: 1px solid var(--pd-line); }
.project-detail .pd-code-example .pd-label { margin-bottom: 12px; }
.project-detail .pd-code { display: block; max-width: 100%; margin: 22px 0 18px; padding: 22px; overflow-x: auto; border: 1px solid var(--pd-line); background: #0a111d; color: #d5e2f4; font: 400 14px/1.85 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; tab-size: 4; scrollbar-color: #3a5274 #0b101b; }
.project-detail .pd-code code { font: inherit; color: inherit; }
.project-detail .pd-code:focus-visible { outline: 2px solid #8bb3ff; outline-offset: 4px; }
.project-detail .pd-subtitle { font-family: Manrope, Arial, sans-serif; font-size: clamp(27px, 3.2vw, 38px); line-height: 1.22; font-weight: 500; letter-spacing: -.035em; margin-bottom: 24px; }
.project-detail .pd-flow { display: grid; gap: 20px; margin: 0; padding: 0; list-style: none; }
.project-detail .pd-flow li { display: flex; gap: 16px; align-items: center; position: relative; padding: 18px; border: 1px solid var(--pd-line); border-radius: 3px; background: #0d1524; }
.project-detail .pd-flow li:not(:last-child)::after { content: '↓'; position: absolute; left: 29px; bottom: -23px; font-size: 16px; color: #789fe0; }
.project-detail .pd-flow-number { color: #94b8f8; font-size: 11px; }
.project-detail .pd-flow strong { display: block; margin-bottom: 6px; font-size: 15px; }
.project-detail .pd-flow li div > span { display: block; font-size: 13px; line-height: 1.6; color: var(--pd-muted); }
.project-detail .pd-plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 22px; }
.project-detail .pd-plan-grid .pd-label { margin-bottom: 8px; }
.project-detail .pd-slider { padding: 6px 0 28px; }
.project-detail .pd-slider label { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 14px; line-height: 1.6; font-weight: 600; color: #c9d5e6; }
.project-detail .pd-slider output { flex: 0 0 auto; font: 500 27px/1.1 Manrope, Arial, sans-serif; color: var(--pd-ink); font-variant-numeric: tabular-nums; }
.project-detail .pd-slider input { appearance: auto; display: block; width: 100%; min-height: 44px; height: 44px; margin: 10px 0 0; accent-color: #548aff; background: transparent; cursor: pointer; }
.project-detail .pd-slider p { font-size: 13px; margin: 0; }
.project-detail .pd-total { display: block; font: 500 clamp(40px, 6vw, 72px)/1.1 Manrope, Arial, sans-serif; letter-spacing: -.05em; color: var(--pd-ink); margin: 10px 0 14px; font-variant-numeric: lining-nums tabular-nums; overflow-wrap: anywhere; }
.project-detail .pd-calculation p:last-child { margin-bottom: 0; }
.project-detail .pd-reset { border: 0; border-bottom: 1px solid #4f75b7; border-radius: 0; background: transparent; color: #8db4ff; padding: 10px 0; min-height: 44px; font: 600 13px/1.4 Manrope, Arial, sans-serif; cursor: pointer; }
.project-detail .pd-reset:hover { color: #c1d7ff; }
.project-detail .pd-reset span { margin-left: 12px; }
.project-detail .pd-facts { display: grid; grid-template-columns: .8fr .8fr 1.4fr; padding: 25px 0; margin: 0 0 24px; border-top: 1px solid var(--pd-line); border-bottom: 1px solid var(--pd-line); gap: 20px; }
.project-detail .pd-facts strong { display: block; font: 500 46px/1.1 Manrope, Arial, sans-serif; color: var(--pd-ink); }
.project-detail .pd-facts span { display: block; margin-top: 9px; color: #aabbd1; font-size: 12px; line-height: 1.6; }
.project-detail .pd-lecture-points { margin: 0; padding: 0; list-style: none; display: grid; gap: 22px; }
.project-detail .pd-lecture-points li { display: flex; gap: 16px; }
.project-detail .pd-lecture-points li > span { color: #94b8f8; font-size: 11px; padding-top: 4px; }
.project-detail .pd-lecture-points strong { font-size: 15px; }
.project-detail .pd-lecture-points p { font-size: 14px; margin: 7px 0 0; }
.project-detail .pd-lecture-note { margin: 30px 0 0; max-width: 700px; }
@keyframes pd-enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 700px) {
  .project-dialog { --pd-edge: 10px; --pd-bar-height: 58px; border-radius: 3px; }
  .project-dialog .dialog-close { padding: 15px 20px; }
  .project-detail { padding: 30px 20px 38px; scrollbar-gutter: auto; }
  .project-detail .pd-eyebrow { gap: 9px; margin-bottom: 20px; }
  .project-detail .pd-status { border-left: 0; padding-left: 0; flex-basis: 100%; }
  .project-detail h2 { font-size: clamp(34px, 9.5vw, 54px); line-height: 1.1; }
  .project-detail .pd-intro { font-size: 18px; }
  .project-detail .pd-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .project-detail .pd-tabs { border-radius: 6px; width: 100%; gap: 4px; margin-block: 26px; }
  .project-detail .pd-tabs button { flex: 1 1 auto; border-radius: 3px; padding: 11px 12px; }
  .project-detail .pd-plan-grid { grid-template-columns: 1fr; gap: 14px; }
  .project-detail .pd-facts { gap: 12px; }
  .project-detail .pd-facts strong { font-size: 37px; }
  .project-detail .pd-footnote { margin-top: 32px; padding-top: 26px; }
  .project-detail .pd-source-links { gap: 4px; flex-direction: column; align-items: flex-start; }
  .project-detail .pd-total { font-size: clamp(45px, 11vw, 65px); }
  .project-detail table th, .project-detail table td { padding-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .project-dialog[open] { animation: none; }
}
