:root {
  --paper: #fff;
  --ink: #1c70dc;
  --ink-soft: #4877ba;
  --line: #7ea9e8;
  --teal: #39c5bb;
  --green: #30c46c;
  --green-text: #21874a;
  --red: #d93a55;
  --dot: #d6f2e1;
  --dot-39: #c9efeb;
  --dot-01: #f8dde2;
  --rule: color-mix(in srgb, var(--line) 45%, transparent);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #18191c;
  --ink: #4f94f0;
  --ink-soft: #6d8db8;
  --line: #6d8db8;
  --teal: #4fd6cb;
  --green: #3ccf78;
  --green-text: #3ccf78;
  --red: #ff6b81;
  --dot: #1c2a22;
  --dot-39: #193230;
  --dot-01: #301d22;
  color-scheme: dark;
}
@property --dot { syntax: "<color>"; inherits: true; initial-value: #d6f2e1; }
:root.m39 { --dot: var(--dot-39); }
:root.m01 { --dot: var(--dot-01); }
@media (prefers-reduced-motion: no-preference) {
  :root.dot-fade { transition: --dot 1.4s ease; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--paper); color: var(--ink);
  font: 15px/1.7 ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif;
  transition: background-color .35s ease, color .35s ease;
}

/* theme switch */
#theme {
  position: fixed; z-index: 2;
  top: max(.75rem, env(safe-area-inset-top)); right: max(.75rem, env(safe-area-inset-right));
  width: 46px; height: 46px; padding: 11px; border: 0; background: none; cursor: pointer;
  color: var(--green); -webkit-tap-highlight-color: transparent;
}
#theme svg { width: 24px; height: 24px; display: block; overflow: visible; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1), opacity .25s; }
#theme .sun, :root[data-theme="dark"] #theme .moon { display: none; }
:root[data-theme="dark"] #theme .sun { display: block; }
#theme:hover svg { transform: rotate(-14deg) scale(1.08); }
#theme:focus-visible { outline: 1px dashed var(--ink-soft); outline-offset: 2px; border-radius: 50%; }
#theme.spin svg { animation: pop .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes pop { from { transform: rotate(-90deg) scale(.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { body, #theme svg { transition: none; } #theme.spin svg { animation: none; } }

#dots { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

h1 { font-size: 1.6rem; font-weight: 500; margin: 0; letter-spacing: .01em; display: inline-flex; align-items: center; gap: .35rem; }
h2 { font-size: .8rem; font-weight: 500; color: var(--green-text); margin: 2.2rem 0 .45rem; letter-spacing: .08em; }
p { margin: 0 0 .85rem; }
b, strong { font-weight: 600; }
.meta { color: var(--ink-soft); font-size: .85rem; margin: .1rem 0 1.6rem; }
/* xx:39 */
.t39 { color: var(--teal); position: relative; display: inline-block; }
.t39 span { position: absolute; left: 50%; bottom: 60%; font-size: .85em; color: var(--teal); opacity: 0; pointer-events: none; }
.t39 span:nth-child(1) { --x: -10px; --r: -15deg; }
.t39 span:nth-child(2) { --x: 8px; --r: 12deg; animation-delay: .9s; }
.t39 span:nth-child(3) { --x: -2px; --r: -6deg; animation-delay: 1.8s; }
@media (prefers-reduced-motion: no-preference) {
  .t39 span { animation: notes 2.6s ease-out infinite; }
  @keyframes notes {
    from { transform: translate(-50%, 0); opacity: 0; }
    15% { opacity: 1; }
    to { transform: translate(calc(-50% + var(--x)), -34px) rotate(var(--r)); opacity: 0; }
  }
}
/* xx:01 */
@font-face {
  font-family: "t01";
  src: url("01.woff2") format("woff2");
  font-display: block;
}
/* the font has one weight and its digits are the same height as the body font's, so no bold and no resizing */
.t01 { font-family: "t01", ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, sans-serif; font-weight: 400; font-synthesis: none; color: var(--red); margin-left: .04em; }
.meta + h2 { margin-top: 1.4rem; }

/* links */
a, .rows .n, .now b {
  color: var(--ink); text-decoration: none; padding-bottom: .2em; outline: none;
  background:
    linear-gradient(var(--teal), var(--teal)) no-repeat 0 100% / 0 1.5px,
    linear-gradient(var(--line), var(--line)) no-repeat 0 100% / 100% 1px;
}
a:hover, a:focus-visible, .rows button:hover .n, .rows button:focus-visible .n, .now button:hover b, .now button:focus-visible b {
  background-size: 100% 1.5px, 100% 1px;
}
@media (prefers-reduced-motion: no-preference) {
  a, .rows .n, .now b { transition: background-size .45s cubic-bezier(.2, .8, .2, 1); }
}
ul, ol { list-style: none; padding: 0; margin: 0; }
li { padding: .12rem 0; }
/* name, then a note lined up in a second column */
.links { display: grid; grid-template-columns: minmax(7.5rem, max-content) 1fr; column-gap: 1.6rem; }
.links li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: baseline; }
.links li > a:first-child { justify-self: start; margin-bottom: -.2em; }
/* sized by the column and the text size, not the screen */
main { container-type: inline-size; }
@container (max-width: 25em) {
  .links { grid-template-columns: max-content 1fr; column-gap: 1em; }
  .page .links { grid-template-columns: minmax(5.5em, max-content) 1fr; }
}
@container (max-width: 17.75em) {
  .links, .page .links { grid-template-columns: 1fr; }
  .links li > a:first-child { margin-bottom: 0; }
  .links li span { margin-bottom: .5em; }
}
.links li span { color: var(--ink-soft); }
.sep { color: var(--ink-soft); margin: 0 .55rem; }
.sep::after { content: "\200b"; }

/* sparkles + loop */
@media (max-width: 759px) { .spark { display: none; } }
.spark { position: absolute; width: 21px; height: 21px; color: var(--green); pointer-events: none; }
.tw { width: 100%; height: 100%; display: block; overflow: visible; transform-origin: 50% 50%; transform: rotate(var(--r, 0deg)); }
h1 .star { display: block; flex: none; width: 20px; height: 20px; color: var(--green); position: relative; top: .14em; }
.loop { display: block; width: 130px; height: 22px; margin: 2.6rem 0 0; color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .tw { animation: twinkle var(--d, 4s) cubic-bezier(.45, 0, .55, 1) var(--o, 0s) infinite; }
  @keyframes twinkle {
    0%, 100% { transform: rotate(var(--r, 0deg)) scale(1); opacity: 1; }
    50% { transform: rotate(calc(var(--r, 0deg) + var(--s, 12deg))) scale(.76); opacity: .7; }
  }
}


/* blog */

.page {
  position: relative; z-index: 1;
  max-width: 34rem; margin: 0 auto;
  padding: max(4.5rem, env(safe-area-inset-top)) 1.5rem 4rem;
}
.page.wide { max-width: 40rem; }
.crumbs { font-size: .85rem; color: var(--ink-soft); margin: 0 0 2.2rem; }
.crumbs .sep { margin: 0 .4rem; }

/* blog index */
.posts li { display: grid; grid-template-columns: 3.4rem 1fr; gap: 1rem; align-items: center; padding: .45rem 0; }
.posts .what { display: block; color: var(--ink-soft); font-size: .85rem; }
.tear { display: block; text-align: center; line-height: 1; border-top: 2px solid var(--ink); padding-top: .2rem; }
.tear .n { display: block; font-size: 1.7rem; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tear .m { display: block; font-size: .62rem; color: var(--ink-soft); letter-spacing: .08em; margin-top: .15rem; }

/* post */
.post { font-size: 16px; line-height: 1.75; }
.post h1 { display: block; font-size: 1.75rem; line-height: 1.25; }
.post h1 .star { display: inline-block; vertical-align: baseline; margin-left: .3rem; top: .12em; }
.dek { font-size: 1.05rem; color: var(--ink-soft); margin: .35rem 0 .3rem; }
.post .meta { margin-bottom: 1.4rem; }
.note {
  position: relative; font-size: .85rem; line-height: 1.6; color: var(--ink-soft);
  padding-left: 1.7rem; margin: 0 0 1.6rem;
}
.note svg { position: absolute; left: 0; top: .1rem; width: 16px; height: 16px; color: var(--green); }
.tldr { margin: 0 0 2rem; }
.tldr h2, .toc h2 { margin-top: 0; }
.toc { margin: 0 0 2.4rem; font-size: .92rem; }
.toc ol { counter-reset: s; }
.toc li { counter-increment: s; padding: .05rem 0; }
.toc li::before { content: counter(s) "."; display: inline-block; width: 1.4rem; color: var(--green-text); font-variant-numeric: tabular-nums; }
.post h3 {
  font-size: 1.15rem; font-weight: 500; line-height: 1.35;
  margin: 3rem 0 .7rem; scroll-margin-top: 1.5rem;
}
.post h3 .n { color: var(--green-text); margin-right: .45rem; font-variant-numeric: tabular-nums; }

.facts { margin: 0 0 1.2rem; }
.facts div { display: grid; grid-template-columns: 6.4rem 1fr; gap: 1rem; padding: .3rem 0; }
.facts dt { color: var(--green-text); font-size: .85rem; padding-top: .2rem; letter-spacing: .02em; }
.facts dd { margin: 0; }
.facts dd p:last-child { margin-bottom: 0; }
@media (max-width: 480px) { .facts div { grid-template-columns: 1fr; gap: 0; } }

.sizes { border-collapse: collapse; margin: .2rem 0 .4rem; font-variant-numeric: tabular-nums; }
.sizes td { padding: .05rem 1.4rem .05rem 0; }
.sizes td + td { color: var(--ink-soft); }

.timeline li { display: grid; grid-template-columns: 6.2rem 1fr; gap: 1rem; padding: .1rem 0; }
.timeline time { color: var(--ink-soft); font-size: .9rem; font-variant-numeric: tabular-nums; padding-top: .05rem; }
.timeline .total { margin-top: .4rem; }
.timeline .total time { color: var(--green-text); }

figure.pic { margin: 1.6rem 0 1.8rem; }
figure.pic img { display: block; width: 100%; height: auto; border-radius: 3px; }
figure.pic figcaption { font-size: .82rem; line-height: 1.55; color: var(--ink-soft); margin-top: .55rem; }

.end { margin-top: 3rem; }
.end .loop { margin: 0 0 1.2rem; }

/* misc */
.page h1 + .links { margin-top: 1.8rem; }

/* page changes */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
#theme { view-transition-name: theme; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none; }
}

/* peripherals: what's in use now (list or grid), then the collection by type */
.now .head { display: flex; align-items: baseline; justify-content: space-between; }
.views { font-size: .8rem; color: var(--ink-soft); }
.views button { font: inherit; color: var(--ink-soft); background: none; border: 0; padding: 0; cursor: pointer; }
.views button[aria-pressed="true"] { color: var(--ink); }
.views .sep { margin: 0 .4rem; }
.now ul { margin-top: .6rem; }
.now li { padding: 0; }
.now li button { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; width: 100%; }
.now img { display: block; width: 100%; height: auto; }
.now small { display: block; color: var(--green-text); font-size: .75rem; letter-spacing: .06em; }
.now b { font-weight: inherit; justify-self: start; }
.now[data-view="list"] ul { border-top: 1px solid var(--rule); }
.now[data-view="list"] li { border-bottom: 1px solid var(--rule); }
.now[data-view="list"] li button { display: grid; grid-template-columns: 3.4rem 6.5rem 1fr; align-items: center; gap: 1rem; padding: .4rem 0; }
.now[data-view="grid"] ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6rem 1.2rem; }
.now[data-view="grid"] img { aspect-ratio: 1; margin-bottom: .5rem; }
.now[data-view="grid"] b { line-height: 1.35; font-size: .92rem; }
@media (max-width: 600px) {
  .now[data-view="grid"] ul { grid-template-columns: 1fr 1fr; }
  .now[data-view="list"] li button { grid-template-columns: 3rem 5rem 1fr; gap: .8rem; }
}
.coll { margin-top: 3rem; }
.kinds { columns: 2 17rem; column-gap: 2.6rem; }
.kind { break-inside: avoid; margin: 0 0 1.6rem; }
.kind h3 { font-size: .8rem; font-weight: 500; color: var(--green-text); letter-spacing: .08em; margin: 0 0 .4rem; padding-top: .7rem; border-top: 1px solid var(--rule); }
.kind h3 span { color: var(--ink-soft); margin-left: .3rem; }
.rows li { padding: 0; }
.rows button { font: inherit; color: var(--ink); background: none; border: 0; padding: .3rem 0; cursor: pointer; text-align: left; display: grid; grid-template-columns: 2.6rem 1fr; gap: .8rem; align-items: center; width: 100%; }
.rows img { display: block; width: 100%; height: auto; }
.rows small { display: block; color: var(--ink-soft); font-size: .8rem; line-height: 1.3; }
.rows .n { line-height: 1.35; }
.rows .on { display: inline-block; width: 10px; height: 10px; margin-left: .35rem; color: var(--green); vertical-align: .05em; overflow: visible; }
.card { border: 0; padding: 0; background: var(--paper); color: var(--ink); width: min(46rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 55%, transparent), 0 18px 50px -24px rgb(0 0 0 / .25); grid-template-columns: 1fr; }
.card:popover-open { display: grid; }
.card::backdrop { background: color-mix(in srgb, var(--paper) 80%, transparent); backdrop-filter: blur(4px); }
.card .pic { background: color-mix(in srgb, var(--dot) 45%, var(--paper)); display: grid; place-items: center; padding: 1rem; }
.card .pic img { display: block; width: 100%; max-width: 11rem; height: auto; }
.card .txt { position: relative; padding: 1.5rem 1.6rem 1.3rem; }
.card small { color: var(--green-text); font-size: .75rem; letter-spacing: .06em; }
.card h3 { font-size: 1.3rem; font-weight: 500; margin: .15rem 0 0; line-height: 1.3; }
.card .what { color: var(--ink-soft); font-size: .85rem; margin: .15rem 0 1rem; }
.card .notes p { margin: 0 0 .7rem; }
.card .close { all: unset; cursor: pointer; position: absolute; top: 1.3rem; right: 1.4rem; font-size: .8rem; color: var(--ink-soft); }
.card .close:hover, .card .close:focus-visible { color: var(--ink); }
@media (min-width: 640px) {
  .card { overflow: hidden; grid-template-columns: 1fr 1.15fr; min-height: 22rem; }
  .card .pic { padding: 2rem; }
  .card .pic img { max-width: 20rem; }
  .card .txt { max-height: calc(100dvh - 2rem); overflow: auto; padding: 2rem 2rem 1.6rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .card { transition: opacity .22s, translate .3s cubic-bezier(.2, .8, .2, 1), overlay .3s allow-discrete, display .3s allow-discrete; opacity: 0; translate: 0 10px; }
  .card:popover-open { opacity: 1; translate: 0 0; }
  @starting-style { .card:popover-open { opacity: 0; translate: 0 10px; } }
}
