html.practice-index-open { overflow: hidden; }
.pi-index, .pi-index *, .pi-reader, .pi-reader *, .pi-reading, .pi-reading * { box-sizing: border-box; }
.pi-index[hidden], .pi-reading[hidden] { display: none !important; }
.pi-index {
  position: fixed;
  z-index: 55;
  inset: 0;
  color: #183c50;
  isolation: isolate;
  background: var(--ice-wall);
  animation: pi-iris .6s cubic-bezier(.16,1,.3,1) both;
}
@keyframes pi-iris { from { clip-path: circle(0 at calc(100% - 68px) 52px); } to { clip-path: circle(150vmax at calc(100% - 68px) 52px); } }
body.practice-index-open :is(.hud-watch, [data-watch-toggle]) { visibility: hidden; pointer-events: none; }
.pi-grid {
  --cw: min(calc((100vw - 94px) / 8.628), calc((100dvh - 180px) / 3.282));
  --u: calc(var(--cw) / 156);
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(8, var(--cw));
  gap: calc(40 * var(--u)) calc(14 * var(--u));
  place-content: center;
  overscroll-behavior: contain;
  overflow: auto;
  padding: 130px 0 50px;
  scrollbar-width: none;
}
.pi-grid::-webkit-scrollbar { display: none; }
.pi-card {
  position: relative;
  display: block;
  width: var(--cw);
  height: calc(236 * var(--u));
  color: inherit;
  text-decoration: none;
  perspective: 1200px;
  outline: none;
}
.pi-paper {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: calc(12 * var(--u));
  background: #f0f9fc;
  transform: rotate(var(--pi-tilt));
  transition: transform .22s cubic-bezier(.25,.85,.4,1), box-shadow .22s;
}
.pi-card:is(:hover, :focus-visible) { z-index: 2; }
.pi-card:is(:hover, :focus-visible) .pi-paper { transform: translateY(calc(-9 * var(--u))) rotate(0deg) scale(1.08); box-shadow: 0 9px 18px #1a4b6545; }
.pi-card:focus-visible .pi-paper { outline: 2px solid #183c50; outline-offset: 3px; }
.pi-card:active .pi-paper { transform: perspective(800px) rotateY(15deg) scale(.99); }
.pi-card.pi-turning { z-index: 3; }
.pi-card.pi-turning .pi-paper { transform-style: preserve-3d; animation: pi-turn .32s cubic-bezier(.3,.08,.24,1) both; }
.pi-card.pi-turning .pi-paper::after { content: ""; position: absolute; inset: 0; border: calc(9 * var(--u)) solid #f0f9fc; border-radius: inherit; background: var(--pi-room); transform: rotateY(180deg) translateZ(1px); backface-visibility: hidden; }
@keyframes pi-turn { from { transform: translateY(-6%) rotateY(0deg) scale(1.06); } to { transform: translateY(-6%) rotateY(180deg) scale(1.06); } }
.pi-wash { position: fixed; z-index: 57; inset: 0; pointer-events: none; }
.pi-card[aria-current]::before { content: ""; position: absolute; left: 50%; top: calc(-21 * var(--u)); width: calc(13 * var(--u)); height: calc(13 * var(--u)); transform: translateX(-50%); border-radius: 50%; background: #0878bd; }
.pi-picture {
  position: absolute;
  display: block;
  left: calc(9 * var(--u));
  top: calc(9 * var(--u));
  width: calc(138 * var(--u));
  height: calc(132 * var(--u));
  overflow: hidden;
  isolation: isolate;
  background: var(--pi-room);
}
.pi-picture::after { content: ""; position: absolute; z-index: 1; inset: 0; border: 1px solid #176287; pointer-events: none; }
.pi-picture img { position: absolute; display: block; max-width: none; height: auto; transform-origin: 50% 65%; user-select: none; pointer-events: none; }
.pi-card:is(:hover, :focus-visible) .pi-picture img { animation: pi-figure .45s ease-out both; }
@keyframes pi-figure { 25% { transform: translateY(-1.5%) rotate(-1deg); } 70% { transform: translateY(-.5%) rotate(1.5deg); } }
.pi-number, .pi-title { position: absolute; left: calc(11 * var(--u)); right: calc(11 * var(--u)); display: block; }
.pi-number { top: calc(141 * var(--u)); font: italic calc(24 * var(--u))/1.33 var(--f-serif, Georgia, serif); color: #176287; }
.pi-title { top: calc(174 * var(--u)); font: 700 calc(11.5 * var(--u))/1.22 var(--f-display, Arial, sans-serif); letter-spacing: -.02em; }

/* Each miniature uses a prop or a person from the practice photographs. */
.pi-picture.visitor img { height: 172%; width: auto; left: 9%; top: 1%; }
.pi-picture.visit img { height: 155%; left: 18%; scale: -1 1; }
.pi-picture.prop img { inset: 10%; width: 80%; height: 80%; object-fit: contain; filter: drop-shadow(1px 3px 2px #37222326); }
.pi-picture.snapshot img { rotate: -6deg; }
.pi-picture.brush img { rotate: -13deg; }
.pi-picture.scanner img { inset: 8%; width: 84%; height: 84%; }
.pi-picture.aligner img { width: 88%; left: 6%; top: 50%; translate: 0 -50%; filter: drop-shadow(2px 8px 5px #291a3a36); }
.pi-picture.consultation img { inset: -3%; width: 106%; height: 106%; object-fit: cover; }
.pi-picture.child img { width: 98%; left: 1%; top: 6%; }
.pi-picture.adult img { width: 213%; left: -87%; top: 0; clip-path: polygon(27% 0,100% 0,100% 33%,99% 40%,97% 42%,97.5% 48%,96% 55%,93.7% 55%,94.1% 52%,93.3% 44%,91.2% 43%,88.1% 48.3%,87% 53%,88.8% 57%,85.6% 55.6%,84.8% 58%,87.1% 60.1%,84% 60.6%,83% 58.9%,81.1% 62%,81.7% 71%,83% 76%,85.4% 80.4%,93.5% 88.5%,96.3% 88%,100% 90.5%,100% 100%,26% 100%,27.1% 95.1%,30% 90.4%,34.3% 87.3%,38.2% 86.9%,39% 84%,43.2% 83.1%,45.1% 85.6%,52.1% 80.6%,55.8% 75.4%,57.5% 69%,57.3% 59.8%,54.7% 58.8%,52.2% 57%,50.7% 57.8%,50.4% 55.2%,49.8% 51%,47.4% 53.5%,46% 54%,46% 50%,43% 49.5%,41% 47.2%,40% 43.1%,38.1% 42%,36.4% 38.1%,31.9% 35%,31% 31.2%,27% 31.4%,29% 28.3%,28.1% 26%,26% 25.3%,26.9% 22.4%,25.8% 19.7%,27.3% 16.2%,26.5% 12%,27.5% 8.4%,26.1% 5.4%); }
.pi-file-mini { display: block; padding: calc(7 * var(--u)); white-space: pre-wrap; overflow-wrap: anywhere; color: #e7f6fb; font: calc(5.5 * var(--u))/1.5 ui-monospace, Consolas, monospace; text-align: left; }
.pi-card:is(:hover,:focus-visible) .pi-file-mini { transform: translateY(-12%); transition: transform .45s cubic-bezier(.3,.08,.24,1); }
.pi-notepad { position: absolute; left: 27%; width: 49%; top: 22%; bottom: 12%; padding-top: 22%; white-space: pre-line; text-align: center; font: italic calc(12 * var(--u))/1.1 var(--f-serif,Georgia,serif); color: #254453; background: repeating-linear-gradient(to bottom,#f6fcfe 0 calc(9 * var(--u)),#b9d2dc calc(10 * var(--u))); box-shadow: 2px 4px #b5ccd6, 4px 6px #7093a3, 5px 10px 8px #224e6733; transform: perspective(160px) rotateX(-7deg) rotate(-2deg); }
.pi-notepad::before { content: ""; position: absolute; left: 5%; right: 5%; top: -4%; height: 10%; background: repeating-linear-gradient(90deg,#3f5a69 0 3%,transparent 4% 14%); }
.pi-envelope { position: absolute; left: 14%; right: 14%; top: 31%; height: 48%; transform: rotate(-12deg); background: linear-gradient(31deg,#d1e3eb 49%,#7492a6 50%,transparent 51%) left/51% 100% no-repeat,linear-gradient(-31deg,#e3f2f8 49%,#7492a6 50%,transparent 51%) right/51% 100% no-repeat,#97b6c4; box-shadow: 2px 6px 7px #17374b73; }
.pi-envelope::after { content: ""; position: absolute; inset: 0; clip-path: polygon(0 0,100% 0,50% 60%); background: linear-gradient(8deg,#bbd9e5,#f7fcff); }

.pi-reader {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 72px max(18px,2.5vw) 40px; border: 0; background: transparent; color: #eef9fc;
}
.pi-reader[open] { display: grid; place-items: center; }
.pi-reader::backdrop { background: #18394ea8; }
.pi-file-window { display: flex; flex-direction: column; min-width: 0; min-height: 0; width: min(820px,100%); height: min(860px,100%); overflow: hidden; border: 1px solid #577785; border-radius: 10px; background: #142e3d; box-shadow: 0 30px 80px #0007; font-family: ui-monospace, Consolas, monospace; animation: pi-page .25s ease-out both; }
@keyframes pi-page { from { opacity: .2; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.pi-file-bar { display: flex; flex: none; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px 0 18px; border-bottom: 1px solid #242322; font: 600 14px/1.2 var(--f-display, sans-serif); }
.pi-file-bar span { margin-right: auto; }
.pi-file-bar button { min-height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #b2afa9; font: inherit; cursor: pointer; }
.pi-file-bar button:is(:hover,:focus-visible) { background: #252422; color: #fff; }
.pi-file-text { flex: auto; overflow: auto; overscroll-behavior: contain; scrollbar-color: #575551 transparent; padding: 26px 34px 56px; font: 17px/1.55 var(--f-display, sans-serif); outline-offset: -3px; }
.pi-file-text :is(h2,p) { white-space: pre-line; overflow-wrap: anywhere; margin: 0 0 1.5em; color: inherit; font: inherit; }
.pi-file-text a, .pi-reading a { color: inherit; text-decoration: underline; text-underline-offset: .2em; }
.pi-file-text .pi-link-row { margin: 0 0 1em; }

html.practice-reading { overflow: auto !important; height: auto !important; background: #183c50; }
html.practice-reading body { display: block; height: auto !important; overflow: visible !important; background: #183c50; color: #eef9fc; }
html.practice-reading body > :not(.pi-reading) { display: none !important; }
.pi-reading { min-height: 100vh; background: #183c50; color: #eef9fc; }
.pi-reading article { max-width: 42em; margin: auto; padding: max(60px,12vh) max(22px,3vw) 15vh; font: clamp(17px,1.3vw,21px)/1.57 var(--f-display,Arial,sans-serif); }
.pi-reading h1 { margin: .3em 0 .25em; color: inherit; font: 700 clamp(60px,11vw,155px)/.95 var(--f-display,Arial,sans-serif); letter-spacing: -.06em; }
.pi-reading h2 { margin: 2.2em 0 .6em; font: 700 1.4em/1.1 var(--f-display,Arial,sans-serif); color: #95d8fb; letter-spacing: -.03em; }
.pi-reading p { white-space: pre-line; margin: .6em 0; }
.pi-reading .pi-byline, .pi-reading blockquote, .pi-reading-back, .pi-reading-download { font: 1em/1.55 var(--f-mono,ui-monospace,monospace); }
.pi-reading blockquote { margin: 0 0 2em; }
.pi-reading-back { display: inline-block; margin: 0 0 2.5em; }
.pi-reading-download { margin-top: 2em; padding: .55em 1em; border: 1px solid #eef9fc; border-radius: 2em; background: transparent; color: inherit; cursor: pointer; }

@media (max-width: 1130px), (max-height: 560px) {
  .pi-grid { --cw: min(calc((100vw - 64px) / 4.27),190px); grid-template-columns: repeat(4,var(--cw)); row-gap: calc(24 * var(--u)); align-content: start; inset-block-start: 90px; padding: 34px 0 60px; }
}
@media (max-width: 600px) {
  .pi-grid { --cw: calc((100vw - 52px) / 2.09); grid-template-columns: repeat(2,var(--cw)); row-gap: calc(18 * var(--u)); inset-block-start: 0; padding-top: 118px; }
  .pi-title { font-size: 14px; line-height: 1.16; }
  .pi-index::after { content: ""; pointer-events: none; position: absolute; inset: 0 0 auto; height: 82px; background: linear-gradient(#c5dce4 67%,transparent); }
  .pi-reader { padding: max(12px,env(safe-area-inset-top)) 10px 10px; }
  .pi-file-bar { min-height: 52px; padding-left: 12px; }
  .pi-file-bar button { min-height: 42px; padding: 0 7px; }
  .pi-file-text { padding: 18px 18px 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .pi-index,.pi-file-window,.pi-card:is(:hover, :focus-visible) .pi-picture img { animation: none; }
  .pi-paper, .pi-card:is(:hover,:focus-visible) .pi-file-mini { transition-duration: 0s; }
}

.pi-reading h1 { font-size:clamp(38px,7.3vw,100px);overflow-wrap:anywhere; }
.pi-file-window { background:#eff8fb;color:var(--ink); }
.pi-file-text, .pi-file-bar { background:#eff8fb;color:var(--ink); }
.pi-file-text h2 { color:#155b83;font-weight:700;margin-bottom:.4em; }
.pi-file-text a { color:#155b83; }
.pi-file-bar { border-bottom:1px solid #abc5d1; }
.pi-file-bar button { color:var(--ink); }
