@font-face { font-family: Geist; src: url("/fonts/geist-sans.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Serif"; src: url("/fonts/geist-serif.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --canvas: oklch(.191 0 0);
  --surface: oklch(.218 0 0);
  --raised: oklch(.244 0 0);
  --ink: oklch(.946 0 0);
  --muted: #b7adaf;
  --faint: #918186;
  --border: rgb(246 227 233 / .105);
  --brand: oklch(.725 .257 44.5);
  --pink: oklch(.799 .101 7.9);
  --cream: #ffe8de;
  --radius: .625rem;
  --ease: cubic-bezier(.215,.61,.355,1);
  --sans: Geist, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --serif: "Geist Serif", Georgia, serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--canvas);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
button:not([disabled]) { cursor: pointer; }
:where(a, button):focus-visible { outline: 2px solid #ffae83; outline-offset: 4px; }
.sheet { width: min(100% - 96px, 1184px); margin-inline: auto; }
.masthead, .cabinet-label, .footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.masthead { min-height: 76px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; gap: 10px; text-decoration: none; font-size: 15px; font-weight: 590; letter-spacing: -.025em; }
.maker { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.maker svg { width: 17px; height: 17px; color: #fed3be; }
.masthead-date { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; font: 11px/1.35 var(--mono); white-space: nowrap; }
.masthead-date > span { width: 5px; height: 5px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 9px #fe854c55; }

.intro {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 452px; display: grid; align-items: center;
  padding: clamp(32px, 5vw, 65px); border: 1px solid #6f48535e; border-radius: 18px;
  background:
    radial-gradient(ellipse at 74% 44%, #472235 0%, #2c1928 33%, transparent 64%),
    radial-gradient(ellipse at 10% 112%, #392019 0%, transparent 48%),
    #1c151b;
  box-shadow: inset 0 0 0 1px #ffbdad08, 0 12px 40px #00000028;
}
.intro::before {
  content: ""; pointer-events: none; position: absolute; inset: 0; z-index: -2; opacity: .43;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.79' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath d='M0 0h160v160H0z' opacity='.33' filter='url(%23grain)'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
.intro::after {
  content: ""; position: absolute; pointer-events: none; inset: 8px; z-index: -1;
  border: 1px solid #f6a2b11c; border-radius: 12px;
}
.winter-ornament { position: absolute; width: min(62%, 680px); height: auto; right: -1.7%; top: 50%; transform: translateY(-53%); z-index: -1; pointer-events: none; display: block; }
.intro-content { width: fit-content; max-width: 66%; }
.edition { display: flex; align-items: center; gap: 9px; margin: 0 0 21px; color: #fbc0c6; font: 450 11px/1.4 var(--mono); letter-spacing: .095em; text-transform: uppercase; }
.edition svg { flex: none; }
h1 { margin: 0; color: #fff1e9; font: 400 clamp(46px, 6.35vw, 79px)/.97 var(--serif); letter-spacing: -.059em; }
h1 span { color: #ff996c; }
.lede { max-width: 37ch; margin: 21px 0 25px; color: #e4cdd1; font-size: clamp(14px,1.43vw,17px); line-height: 1.55; text-wrap: pretty; }
.today-link { display: inline-flex; align-items: center; gap: 16px; min-height: 44px; padding-inline: 13px 10px; border: 1px solid #ffe6da; border-radius: var(--radius); color: #2e1b21; background: #ffe9e0; box-shadow: 0 1px 2px #190e19a8, inset 0 1px 0 #fff8f1; font-size: 13px; font-weight: 620; text-decoration: none; transition: background 150ms var(--ease), transform 150ms var(--ease); }
.today-link svg { transition: transform 150ms var(--ease); }
.today-link:active { transform: scale(.98); }
@media (hover: hover) {
  .today-link:hover { background: white; }
  .today-link:hover svg { transform: translateX(2px); }
  .brand:hover, .footer a:hover { color: #ffc9b1; }
}

.calendar { scroll-margin-block-start: 18px; margin-block-start: 37px; }
.cabinet-label { align-items: end; padding-block-end: 14px; }
.cabinet-label p { margin: 0; }
.cabinet-label .calendar-date { margin-block-end: 4px; color: var(--faint); font: 450 10px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.cabinet-label h2 { margin: 0; font: 560 clamp(24px, 3vw, 32px)/1.12 var(--sans); letter-spacing: -.055em; }
.progress { width: clamp(84px, 12vw, 130px); padding-block-end: 4px; }
.progress p { color: var(--muted); font: 450 10px/1.4 var(--mono); letter-spacing: .055em; text-align: right; white-space: nowrap; }
.progress-track { display: grid; grid-template-columns: repeat(24,minmax(0,1fr)); gap: 2px; margin-top: 6px; }
.progress-track > span { height: 3px; border-radius: 1px; background: #40343a; }
.progress-track > .filled { background: #ff9a76; box-shadow: 0 0 6px #f6a2b133; }
.drawers { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.slot { min-width: 0; }
.slot--today { grid-column: span 2; grid-row: span 2; }
.drawer {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate;
  width: 100%; height: 100%; min-height: 115px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); text-align: left; box-shadow: inset 0 1px 0 #ffffff07;
}
.drawer--locked { color: #c3b4ba; background: linear-gradient(145deg,#241e23,#1c1a1d 75%); }
.drawer--open { transition: background 150ms var(--ease), border-color 150ms var(--ease), box-shadow 150ms var(--ease), transform 150ms var(--ease); }
.drawer--open:active { transform: scale(.985); }
.drawer:focus-visible { outline-offset: -5px; z-index: 3; }
.drawer-top { display: flex; justify-content: space-between; align-items: start; gap: 4px; }
.drawer-index { font: 400 30px/.95 var(--serif); letter-spacing: -.075em; font-variant-numeric: lining-nums; }
.drawer-icon { width: 14px; height: 14px; flex: none; color: #a38d99; }
.drawer-bottom { display: grid; gap: 6px; justify-items: start; }
.drawer-label, .drawer-date { font: 450 10px/1.3 var(--mono); letter-spacing: .05em; }
.drawer-label { color: #ead0d4; }
.drawer-date { color: #a9979f; }
.drawer-diagram { position: absolute; width: 66%; max-width: 130px; height: 80%; inset: 11% 1% auto auto; z-index: -1; color: #e29aaa; opacity: .29; }
.slot--today .drawer {
  padding: 19px 21px; color: #ffe9dd; border-color: #9c5e70;
  background: radial-gradient(ellipse at 78% 6%, #733b53, transparent 62%), linear-gradient(149deg,#542c3c,#331e2c 64%,#33201d);
  box-shadow: inset 0 1px 0 #ffefdc28, inset 0 0 40px #df7b7733, 0 7px 19px #00000044;
}
.slot--today .drawer::after {
  content: ""; pointer-events: none; position: absolute; z-index: -1; inset: 5px;
  border: 1px solid #efb3bf35; border-radius: 6px;
}
.slot--today .drawer-index { font-size: 61px; }
.slot--today .drawer-diagram { width: 65%; max-width: 242px; height: 74%; inset: 3% -1% auto auto; opacity: .78; color: #ffc5b4; }
.slot--today .drawer-icon { width: 22px; height: 22px; color: #ffd2be; }
.slot--today .drawer-bottom { gap: 7px; }
.slot--today .drawer-label { display: inline-flex; align-items: center; gap: 6px; border-radius: 4px; background: #140c1890; padding: 4px 6px; }
.slot--today .drawer-label::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #ffa476; }
.drawer-title { font: 400 clamp(22px, 3.2vw, 39px)/.97 var(--serif); letter-spacing: -.06em; text-wrap: balance; overflow-wrap: anywhere; max-width: 14ch; }
.drawer-title--past { font-size: clamp(15px,1.8vw,22px); }
@media (hover: hover) {
  .drawer--open:hover { border-color: #ca829684; background-color: var(--raised); }
  .slot--today .drawer:hover { border-color: #ecb0b3; box-shadow: inset 0 1px 0 #ffefdc44, inset 0 0 50px #df7b774c, 0 7px 22px #0007; }
}
@media (min-width: 921px) {
  .drawers:has(.slot--today)::after {
    content: ""; grid-column: span 3; border: 1px dashed #e7afbc2b; border-radius: var(--radius);
    background: url("data:image/svg+xml,%3Csvg width='33' height='33' viewBox='0 0 33 33' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='none' stroke='%237d5668' d='M16.5 2v29M2 16.5h29m-25-10 20 20m0-20-20 20'/%3E%3C/svg%3E") center/20px no-repeat;
  }
}
.footer { align-items: start; min-height: 87px; padding-block-start: 24px; color: var(--muted); font: 12px/1.55 var(--mono); }
.footer a { text-underline-offset: 3px; text-decoration-color: #a9979f7a; }

dialog { width: min(100% - 24px, 660px); max-height: calc(100dvh - 24px); border: 1px solid #65515a; border-radius: 17px; padding: 0; background: #201b20; color: var(--ink); box-shadow: 0 20px 80px #0009, inset 0 1px 0 #f6dec614; }
dialog::backdrop { background: #0e090eca; backdrop-filter: blur(7px); }
body:has(dialog[open]) { overflow: hidden; }
.lesson-sheet { padding: clamp(18px, 4vw, 33px); }
.lesson-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); margin-block-end: 19px; padding-block-end: 5px; }
.lesson-top p { margin: 0; font: 520 11px/1.4 var(--mono); letter-spacing: .07em; color: #f6b6bd; }
.close { display: grid; place-items: center; border: 1px solid transparent; border-radius: var(--radius); background: none; width: 44px; height: 44px; }
.close:hover { background: #332a32; border-color: var(--border); }
.close svg { width: 21px; height: 21px; }
.lesson-sheet h2 { margin: 0; color: #fff0e8; font: 400 clamp(35px, 7vw, 59px)/.99 var(--serif); letter-spacing: -.07em; text-wrap: balance; }
.lesson-text { margin: 13px 0 19px; color: #d7ccd2; font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.demo { margin-bottom: 16px; padding: 17px; border: 1px solid var(--border); border-radius: var(--radius); background: #2b222b; }
.demo-grid { display: grid; gap: 13px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.demo-example { display: grid; justify-items: center; align-content: start; gap: 8px; min-width: 0; }
.demo-example > span { text-align: center; color: #e6d6dd; font: 11px/1.3 var(--mono); }
.sample { min-height: 44px; max-width: 100%; padding: 8px 13px; border: 1px solid #fbe0d5; border-radius: 8px; background: #fbe0d5; color: #311d26; font-weight: 650; box-shadow: inset 0 1px 0 #fff2eb; }
.sample:focus-visible { outline-color: #ffb393; }
.sample.press { transition: transform 110ms ease-out; }
.sample.press.pressing { transform: scale(.96); }
.sample.ring:focus-visible { outline: 2px solid #ffd1a8; outline-offset: 5px; }
.demo-status { min-height: 16px; margin: 11px 0 0; color: #d6bdc8; font: 11px/1.4 var(--mono); text-align: center; }
.number-samples .value { font-family: var(--sans); font-size: 22px; font-variant-numeric: proportional-nums; }
.number-samples .value.tabular { font-variant-numeric: tabular-nums; }
.snippet { overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); background: #171316; color: #f4e3e7; }
.snippet-head { display: flex; justify-content: space-between; align-items: center; gap: 7px; padding-inline: 12px 4px; border-bottom: 1px solid var(--border); color: #d4b8c5; font: 10px/1.4 var(--mono); letter-spacing: .07em; }
.snippet-head button, .lesson-nav button { min-height: 44px; border: 0; border-radius: 6px; background: none; font: 11px var(--mono); }
.snippet-head button { min-width: 55px; }
.snippet-head button:focus-visible { outline-offset: -3px; }
.snippet-head button:not(:disabled):hover, .lesson-nav button:not(:disabled):hover { color: #ffd3bd; }
pre { margin: 0; padding: 13px; overflow-x: auto; font: 12px/1.5 var(--mono); tab-size: 2; }
code { font: inherit; }
.copy-status { min-height: 14px; margin: 5px 0; color: var(--muted); font: 11px/1.4 var(--mono); }
.lesson-nav { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--border); }
.lesson-nav button { padding-inline: 5px; }
.lesson-nav button:disabled { color: #958790; }

@media (max-width: 1060px) {
  .sheet { width: calc(100% - 64px); }
  .intro { min-height: 408px; }
  .winter-ornament { width: min(67%, 640px); right: -4.5%; }
}
@media (max-width: 920px) {
  .drawers { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .intro { min-height: 390px; }
}
@media (max-width: 680px) {
  .sheet { width: calc(100% - 32px); }
  .masthead { min-height: 63px; }
  .intro { display: flex; flex-direction: column; align-items: stretch; min-height: 0; padding: 26px 23px 0; border-radius: 14px; background: radial-gradient(ellipse at 67% 71%,#432239 0%,#271924 42%,transparent 73%),#1c151b; }
  .intro::after { inset: 6px; border-radius: 9px; }
  .intro-content { max-width: 100%; }
  h1 { font-size: clamp(34px, 9.5vw, 62px); }
  .edition { margin-bottom: 14px; font-size: 10px; }
  .lede { max-width: 35ch; margin: 14px 0 15px; }
  .winter-ornament { position: relative; width: calc(100% + 28px); max-width: 420px; margin: -5px auto -6px; right: auto; top: auto; transform: none; }
  .intro-content { order: -1; }
  .calendar { margin-block-start: 26px; }
  .drawers { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
  .drawer { min-height: 93px; padding: 9px 8px; }
  .drawer-index { font-size: 27px; }
  .drawer-date { font-size: 9px; }
  .slot--today .drawer { padding: 13px; }
  .slot--today .drawer-index { font-size: 50px; }
  .slot--today .drawer-diagram { width: 77%; inset-inline-end: -3%; }
  .footer { flex-direction: column; gap: 7px; font-size: 11px; }
}
@media (max-width: 360px) {
  .sheet { width: calc(100% - 24px); }
  .intro { padding-inline: 16px; }
  .masthead-date { padding-inline: 5px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .today-link, .today-link svg, .drawer, .sample.press { transition: none; }
  .today-link:active, .today-link:hover svg, .drawer--open:active, .sample.press.pressing { transform: none; }
}
