.pf {
  --pf-ink: #202b25;
  --pf-muted: #6b766e;
  --pf-line: #dfe5de;
  --pf-grid: #ebefea;
  --pf-zebra: #f7f9f6;
  --pf-head: #f0f3ef;
  --pf-task: #a9d7b6;
  --pf-task-done: #4e9c68;
  --pf-crit: #f0b2b2;
  --pf-crit-done: #cd545a;
  --pf-sum: #2b332e;
  --pf-paper: #fff;
  --pf-paper-back: #f4f6f3;
  --pf-foot: #9aa39c;
}

:root[data-theme="dark"] .pf {
  --pf-ink: #e6e8e5;
  --pf-muted: #8f959c;
  --pf-line: #2c3035;
  --pf-grid: #23272b;
  --pf-zebra: #1a1d20;
  --pf-head: #1e2125;
  --pf-task: #2f5a3d;
  --pf-task-done: #6cbf87;
  --pf-crit: #5e2f33;
  --pf-crit-done: #e0676d;
  --pf-sum: #d4d8d2;
  --pf-paper: #15171a;
  --pf-paper-back: #1c1f22;
  --pf-foot: #6b7178;
}

.pf-stack { position: relative; min-width: 0; margin: 0; aspect-ratio: 297 / 210; container-type: inline-size; transform: perspective(2200px) rotateY(-9deg) rotateX(3deg); transform-origin: 0% 50%; transition: transform 1.2s var(--ease-out); }
.pf-stack:hover { transform: perspective(2200px) rotateY(-4deg) rotateX(1.5deg); }
.pf-stack--flat, .pf-stack--flat:hover { transform: none; }

.pf-sheet { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 3.4cqw 3.4cqw 2.4cqw; overflow: hidden; border-radius: 1cqw; background: var(--pf-paper); color: var(--pf-ink); font-family: var(--font-text); box-shadow: 0 0 0 1px #20302612, 0 2px 6px #1a2b2010, 0 50px 110px -46px #1a3a2670; }
.pf-sheet--back { background: var(--pf-paper-back); transform: translate(3.2%, -4.6%) rotate(2deg); box-shadow: 0 0 0 1px #20302610, 0 30px 70px -40px #1a3a2650; }
.pf-stack--flat .pf-sheet { box-shadow: 0 0 0 1px var(--line), 0 30px 80px -50px #1a3a2655; }
:root[data-theme="dark"] .pf-sheet { box-shadow: 0 0 0 1px #ffffff14, inset 0 1px 0 #ffffff0d, 0 50px 110px -40px #000000c0; }
:root[data-theme="dark"] .pf-sheet--back { box-shadow: 0 0 0 1px #ffffff0f, 0 30px 70px -36px #000000a0; }

.pf-sheet__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; row-gap: .5cqw; margin-bottom: 2.2cqw; }
.pf-sheet__title { overflow: hidden; font-size: 2.5cqw; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; text-overflow: ellipsis; }
.pf-sheet__meta { grid-column: 1; color: var(--pf-muted); font-size: 1.3cqw; font-variant-numeric: lining-nums proportional-nums; }
.pf-sheet__legend { display: flex; align-items: center; gap: .7cqw; color: var(--pf-muted); font-size: 1.1cqw; }
.pf-key { display: inline-block; width: 2.2cqw; height: 1cqw; margin-left: .9cqw; border-radius: .3cqw; }
.pf-key--task { background: linear-gradient(90deg, var(--pf-task-done) 0 45%, var(--pf-task) 0); }
.pf-key--crit { background: linear-gradient(90deg, var(--pf-crit-done) 0 45%, var(--pf-crit) 0); box-shadow: inset 0 0 0 .14cqw var(--pf-crit-done); }
.pf-key--sum { height: .5cqw; border-radius: 0; background: var(--pf-sum); }
.pf-key--ms { width: 1cqw; height: 1cqw; border-radius: .1cqw; background: var(--pf-sum); transform: rotate(45deg); }

.pf-sheet__table { border: 1px solid var(--pf-line); }
.pf-row { display: grid; grid-template-columns: 4cqw 26cqw minmax(0, 1fr); align-items: center; height: 3.45cqw; font-size: 1.3cqw; }
.pf-row:nth-child(odd):not(.pf-row--scale) { background: var(--pf-zebra); }
.pf-row > span { overflow: hidden; padding: 0 .8cqw; white-space: nowrap; text-overflow: ellipsis; }
.pf-row > span:first-child { padding: 0 .8cqw 0 0; color: var(--pf-muted); text-align: right; }
.pf-row > span:nth-child(2) { border-right: 1px solid var(--pf-line); }
.pf-row--sum > span:nth-child(2) { font-weight: 600; }
.pf-row .pf-l2 { padding-left: 2cqw; }
.pf-row--scale { height: 3.2cqw; border-bottom: 1px solid var(--pf-line); background: var(--pf-head); color: var(--pf-muted); font-size: 1.1cqw; font-weight: 600; }
.pf-row__chart { position: relative; height: 100%; padding: 0 !important; background: repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), var(--pf-grid) calc(12.5% - 1px) 12.5%); }
.pf-months { display: grid !important; grid-template-columns: repeat(8, minmax(0, 1fr)); align-items: center; background: none; }
.pf-months i { padding-left: .6cqw; border-left: 1px solid var(--pf-line); font-style: normal; font-weight: 500; line-height: 3.2cqw; }
.pf-months i:first-child { border-left: 0; }

.pf-bar { position: absolute; top: 50%; left: calc(var(--a) * 1%); width: calc((var(--b) - var(--a)) * 1%); min-width: .5cqw; height: 1.75cqw; border-radius: .4cqw; background: linear-gradient(90deg, var(--pf-task-done) 0 calc(var(--p, 0) * 1%), var(--pf-task) 0); transform: translateY(-50%); }
.pf-bar--crit { background: linear-gradient(90deg, var(--pf-crit-done) 0 calc(var(--p, 0) * 1%), var(--pf-crit) 0); box-shadow: inset 0 0 0 .16cqw var(--pf-crit-done); }
.pf-bar--sum { height: .7cqw; border-radius: 0; background: var(--pf-sum); transform: translateY(-90%); }
.pf-bar--sum::before, .pf-bar--sum::after { content: ""; position: absolute; top: 100%; border-top: .75cqw solid var(--pf-sum); }
.pf-bar--sum::before { left: 0; border-right: .75cqw solid transparent; }
.pf-bar--sum::after { right: 0; border-left: .75cqw solid transparent; }
.pf-ms { position: absolute; top: 50%; left: calc(var(--a) * 1%); width: 1.45cqw; height: 1.45cqw; border-radius: .15cqw; background: var(--pf-sum); transform: translate(-50%, -50%) rotate(45deg); }
.pf-ms--crit { background: var(--pf-crit-done); }

.pf-sheet__foot { display: flex; justify-content: space-between; margin-top: auto; color: var(--pf-foot); font-size: 1.05cqw; font-variant-numeric: lining-nums proportional-nums; }

.pf-anatomy { padding: clamp(80px, 9vw, 128px) var(--home-gutter); border-top: 1px solid var(--line); }
.pf-anatomy__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(40px, 5vw, 80px); align-items: center; }
.pf-anatomy .pf-stack { margin-inline: 18px; }
.pf-mark { position: absolute; top: calc(var(--y) * 1%); left: calc(var(--x) * 1%); display: grid; place-items: center; width: 4.4cqw; height: 4.4cqw; border-radius: 50%; background: var(--main); color: #fff; font-family: var(--font-mono); font-size: 2cqw; font-weight: 600; box-shadow: 0 0 0 .6cqw color-mix(in srgb, var(--main) 22%, transparent), 0 6px 18px -6px #0d2a1880; transform: translate(-50%, -50%); }
:root[data-theme="dark"] .pf-mark { color: #0e1a12; box-shadow: 0 0 0 .6cqw color-mix(in srgb, var(--main) 18%, transparent), 0 6px 18px -6px #000000b0; }
.pf-parts { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.home .pf-parts li { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; margin: 0; padding: 16px 0; border-bottom: 1px dashed var(--border-hover); }
.home .pf-parts li:last-child { border-bottom: 0; }
.pf-parts__n { grid-row: 1 / 3; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--main) 12%, var(--home-surface)); color: var(--main); font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; }
.landing-page .pf-parts h3 { margin: 2px 0 6px; color: var(--text); font-size: 17px; font-weight: 500; letter-spacing: -.015em; }
.home .pf-parts p { margin: 0; color: var(--secondary); font-size: 15px; line-height: 1.7; text-wrap: pretty; }

.pf-papers { padding: clamp(80px, 9vw, 128px) var(--home-gutter); background: var(--bg-secondary); border-block: 1px solid var(--line); }
.pf-papers__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); align-items: start; }
.pf-table { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--home-surface); box-shadow: inset 0 1px 0 var(--glass-shine); }
.pf-table table { width: 100%; border-collapse: collapse; font-variant-numeric: lining-nums proportional-nums; }
.pf-table th, .pf-table td { padding: 16px 18px; border-bottom: 1px solid var(--line); text-align: left; font-size: 15px; }
.pf-table thead th { padding-block: 12px; background: var(--bg-secondary); color: var(--secondary); font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.pf-table tbody tr:last-child > * { border-bottom: 0; }
.pf-table tbody th { color: var(--text); font-weight: 500; }
.pf-paper { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.pf-table td { color: var(--secondary); white-space: nowrap; }
.pf-table td:nth-child(3) { color: var(--text); font-weight: 500; }
.pf-glyph { flex: none; width: 30px; aspect-ratio: calc(var(--w) / var(--h)); border: 1px solid var(--border-hover); border-radius: 3px; background: linear-gradient(var(--main), var(--main)) 24% 32% / 38% 2px no-repeat, linear-gradient(var(--secondary), var(--secondary)) 46% 56% / 32% 2px no-repeat, linear-gradient(var(--main), var(--main)) 64% 78% / 24% 2px no-repeat, var(--home-surface); }
.home .pf-papers__text p { max-width: 54ch; margin: 0 0 18px; color: var(--secondary); font-size: 16px; line-height: 1.8; text-wrap: pretty; }
.home .pf-papers__text p:last-child { margin-bottom: 0; }

.pf-scale { padding: clamp(80px, 9vw, 128px) var(--home-gutter); }
.home .pf-scale__lead, .home .pf-scale__after { max-width: 72ch; margin: 0; color: var(--secondary); font-size: 16.5px; line-height: 1.8; text-wrap: pretty; }
.home .pf-scale__after { margin-top: 36px; }
.pf-scale__after a, .pf-ledger__after a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.pf-scale__list { display: grid; gap: 10px; max-width: 980px; margin: 36px 0 0; padding: 0; list-style: none; }
.home .pf-scale__list li { display: grid; grid-template-columns: 190px minmax(0, 1fr) 260px; align-items: center; gap: 24px; margin: 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--home-surface); box-shadow: inset 0 1px 0 var(--glass-shine); }
.pf-scale__span { color: var(--text); font-size: 15px; font-weight: 500; }
.pf-scale__unit { color: var(--secondary); font-size: 14.5px; }
.pf-ruler { height: 22px; border-bottom: 1.5px solid var(--border-hover); background-repeat: repeat-x; background-position: left bottom; }
.pf-ruler--day { background-image: linear-gradient(90deg, var(--border-hover) 1px, transparent 1px), linear-gradient(90deg, transparent 0 71.4%, color-mix(in srgb, var(--secondary) 14%, transparent) 71.4% 100%); background-size: 9px 9px, 63px 100%; }
.pf-ruler--week { background-image: linear-gradient(90deg, var(--border-hover) 1px, transparent 1px); background-size: 18px 12px; }
.pf-ruler--month { background-image: linear-gradient(90deg, var(--border-hover) 1px, transparent 1px); background-size: 34px 15px; }
.pf-ruler--quarter { background-image: linear-gradient(90deg, var(--border-hover) 1px, transparent 1px); background-size: 64px 18px; }
.pf-ruler--year { background-image: linear-gradient(90deg, var(--border-hover) 1.5px, transparent 1.5px); background-size: 120px 22px; }

.home .pf-ledger__after { max-width: 74ch; margin: 44px 0 0; color: var(--secondary); font-size: 16px; line-height: 1.8; text-wrap: pretty; }

@media (max-width: 1100px) {
  .pf-stack, .pf-stack:hover { transform: none; }
  .pf-anatomy__grid, .pf-papers__grid { grid-template-columns: minmax(0, 1fr); }
  .home .pf-scale__list li { grid-template-columns: 160px minmax(0, 1fr); }
  .pf-scale__unit { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .pf-table th, .pf-table td { padding: 12px 10px; font-size: 13.5px; }
  .pf-table thead th { font-size: 11px; }
  .pf-glyph { width: 22px; }
  .home .pf-scale__list li { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
