/* Wabi-Sabi, for /worlds/avatar-last-airbender/ and /spirit-library/
   (style: wabi-sabi).

   The show is about balance and about mending, and Uncle Iroh and his tea
   are wabi-sabi in person. So both pages are the Jasmine Dragon after
   closing: one lantern still lit, black raku clay, sheets of charcoal
   handmade paper, sumi brushwork, the four nations ground into mineral
   pigment (indigo for Water, celadon for Earth, cinnabar for Fire, ochre
   for Air), and where a thing has broken, a kintsugi seam of gold. The
   seams are the dividers. The signature is on the world page's cycle
   diagram: a gold seam runs over the arc from Air to Water, the hundred
   years Aang spent in the ice, mended.

   One file for the pair, in three parts: what both pages share (the room,
   the pigments, the drawn marks); the world page, the tea shop itself; and
   the Spirit Library, which keeps its tower and its night sky and takes the
   same clay, ink and gold underground, so the shop and the library read as
   one world. Nothing here is spa "zen": no stones stacked for their own
   sake, no bamboo, no ensō for decoration. The brush marks are the show's
   own (its title cards and its opening are ink wash), and every colour is
   one of the four nations.

   Everything is scoped to :root[data-style="wabi-sabi"]. Material rules
   use :where() for that scope, so they weigh what the rule they restyle
   weighs and each page's own hover, focus and open states still win. The
   spec: docs/superpowers/specs/2026-10-11-page-styles-design.md, "Avatar:
   The Last Airbender: Wabi-Sabi", and section 9. */

/* ── 1. shared: the room, the pigments, the marks ─────────────────────── */
:root[data-style="wabi-sabi"] {
  /* the room after closing */
  --ws-clay: #110e0c;               /* black raku, warm, never blue */
  --ws-sheet: #1b1714;              /* charcoal handmade paper */
  --ws-sheet-hi: #221d19;           /* the same sheet nearer the lantern */
  --ws-bone: #efe7d6;               /* undyed paper, for the big type */
  --ws-lantern: #e8a13f;            /* the world's own amber, and the library's */
  --ws-gold: #d4a648;
  --ws-rim: rgba(230, 200, 150, .12);   /* an edge catching lamplight */
  --ws-glaze: inset 0 1px 0 rgba(255, 226, 180, .06);
  --ws-rest: var(--ws-glaze), -5px 18px 30px -22px rgba(0, 0, 0, .95);

  /* Hand-built, not machined: no two corners alike, and three variants so
     neighbouring sheets are not cut from one template either. */
  --ws-hand: 14px 5px 12px 7px / 7px 12px 5px 14px;
  --ws-hand-2: 6px 13px 8px 15px / 12px 6px 14px 5px;
  --ws-hand-3: 11px 8px 15px 4px / 5px 14px 9px 12px;
  --ws-pebble: 4px 8px 5px 9px / 8px 4px 9px 5px;

  /* The four nations as mineral pigment. Deep for washes and glazes, mid
     for an item's own colour, light for text set directly in a pigment. */
  --ws-indigo: #4a6aa8;   --ws-indigo-d: #2b4a85;   --ws-indigo-l: #8fa6d8;
  --ws-celadon: #7fa88c;  --ws-celadon-d: #5e8a6e;  --ws-celadon-l: #a9c9b1;
  --ws-cinnabar: #d0583a; --ws-cinnabar-d: #b23a22; --ws-cinnabar-l: #ee8a6c;
  --ws-ochre: #c99a45;    --ws-ochre-d: #b07f2a;    --ws-ochre-l: #e6bd6a;

  /* the drawn marks, written once here and used by both pages: a kintsugi
     seam (a tile that repeats sideways), a loaded sumi stroke drying out to
     the right, a short upright stroke used as a mask, the cycle's brushed
     ring, the seam over the ice, and handmade paper's cloud and fibre */
  --ws-seam: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='16' fill='none' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M0 8 23 9 57 8 81 9 98 8 125 11 139 6 153 11 182 4 217 12 245 9 261 4 286 4 302 6 315 8 337 11 362 9 386 9 409 6 445 12 477 10 497 6 515 4 546 7 578 7 613 11 625 5 640 8M98 8 105 6 112 4 119 3M261 4 266 5 277 7 283 9M409 6 414 4 422 3' stroke='%235a3f10' stroke-width='3.4'/%3E%3Cpath d='M0 8 23 9 57 8 81 9 98 8 125 11 139 6 153 11 182 4 217 12 245 9 261 4 286 4 302 6 315 8 337 11 362 9 386 9 409 6 445 12 477 10 497 6 515 4 546 7 578 7 613 11 625 5 640 8M98 8 105 6 112 4 119 3M261 4 266 5 277 7 283 9M409 6 414 4 422 3' stroke='%23d4a648' stroke-width='1.9'/%3E%3Cpath d='M0 8 23 9 57 8 81 9 98 8 125 11 139 6 153 11 182 4 217 12 245 9 261 4 286 4 302 6 315 8 337 11 362 9 386 9 409 6 445 12 477 10 497 6 515 4 546 7 578 7 613 11 625 5 640 8' stroke='%23fbe6ad' stroke-width='.7'/%3E%3C/svg%3E");
  --ws-swash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 160' preserveAspectRatio='none'%3E%3Cfilter id='b' x='-2%' y='-20%' width='104%' height='140%'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0025 .11' numOctaves='3' seed='9'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -5 3.1' result='s'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035' numOctaves='2' seed='2'/%3E%3CfeDisplacementMap in='SourceGraphic' scale='9' xChannelSelector='R' yChannelSelector='G'/%3E%3CfeComposite in2='s' operator='in'/%3E%3C/filter%3E%3Cpath d='M24 44 49 42 74 39 99 37 124 43 149 45 174 44 199 46 224 45 250 48 275 52 300 53 325 54 350 52 375 54 400 59 425 57 450 59 475 58 500 62 525 64 550 62 575 61 600 63 625 62 650 64 676 67 701 66 726 68 751 70 776 70 801 67 826 70 851 70 876 73 876 80 851 80 826 86 801 90 776 93 751 91 726 94 701 99 676 101 650 103 625 107 600 109 575 108 550 110 525 113 500 118 475 120 450 120 425 123 400 124 375 122 350 126 325 124 300 125 275 126 250 130 224 128 199 130 174 129 149 129 124 132 99 132 74 135 49 131 24 126 16 123 10 114 6 101 4 85 6 69 10 56 16 47Z' fill='%23e6dac2' filter='url(%23b)'/%3E%3C/svg%3E");
  --ws-stroke: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 200' preserveAspectRatio='none' fill='none' stroke='%23000' stroke-linecap='round'%3E%3Cpath d='M7 6 5 30 5 54 5 78 6 102' stroke-width='2' opacity='0.5'/%3E%3Cpath d='M8 6 6 32 7 57 7 83 7 109 7 134' stroke-width='2.2' opacity='0.9'/%3E%3Cpath d='M9 6 8 34 8 62 8 90 8 118 9 146' stroke-width='2.3' opacity='0.7'/%3E%3Cpath d='M10 6 10 30 10 54 10 77 10 101 10 125 10 149 10 173' stroke-width='2.9' opacity='0.6'/%3E%3Cpath d='M11 6 12 33 12 61 12 88 12 115 12 143' stroke-width='2.1' opacity='0.5'/%3E%3Cpath d='M13 6 14 30 14 54 14 78 13 103 13 127' stroke-width='1.8' opacity='0.6'/%3E%3Cpath d='M14 6 16 32 15 57 15 83 14 108' stroke-width='2.5' opacity='0.6'/%3E%3C/svg%3E");
  --ws-ring: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23e6dac2' stroke-linecap='round'%3E%3Cpath d='M49.8 5.1A44.9 44.9 0 1 1 31.1 90.7' stroke-width='0.44' opacity='0.6'/%3E%3Cpath d='M46.2 4.6A45.6 45.6 0 1 1 19.7 84' stroke-width='0.6' opacity='0.7'/%3E%3Cpath d='M49.2 4.1A45.9 45.9 0 1 1 6.3 36.1' stroke-width='0.41' opacity='0.6'/%3E%3Cpath d='M49.5 3.5A46.5 46.5 0 1 1 14.6 19.9' stroke-width='0.52' opacity='1'/%3E%3Cpath d='M48.1 3.1A46.9 46.9 0 1 1 8.2 28.7' stroke-width='0.55' opacity='0.8'/%3E%3Cpath d='M48.3 2.5A47.5 47.5 0 1 1 3.1 42.3' stroke-width='0.46' opacity='0.5'/%3E%3Cpath d='M47.4 1.9A48.1 48.1 0 1 1 6.6 70.8' stroke-width='0.66' opacity='0.9'/%3E%3Cpath d='M46.4 1.5A48.6 48.6 0 1 1 29.7 94.2' stroke-width='0.46' opacity='0.9'/%3E%3Cpath d='M48.4 1.1A48.9 48.9 0 0 1 84.3 84.9' stroke-width='0.78' opacity='0.7'/%3E%3C/svg%3E");
  --ws-wheel: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M95.4 44.4 97.5 49.8 95.7 54.5 97 60.7 94.5 65.2 91.3 68.2 91.3 73.2 90.1 76.6 86 78.6 85.9 83.2 81.4 86.9 75.2 87.5 72.5 91.3 69.9 94.5 64.6 93.3 59 94.7 53 96.7 47.9 96.4M96.6 44.3 94.5 40.8 91.8 39.4 89.1 37.9M44.3 96.6 42.5 94.2 41.1 91.9 41.6 90.5M86 80.2 85.2 83.9 87.1 84 88.9 84.2M71.3 91.9 73.5 89 69.1 89 68.4 87.3' stroke='%234e360c' stroke-width='1.9'/%3E%3Cpath d='M95.4 44.4 97.5 49.8 95.7 54.5 97 60.7 94.5 65.2 91.3 68.2 91.3 73.2 90.1 76.6 86 78.6 85.9 83.2 81.4 86.9 75.2 87.5 72.5 91.3 69.9 94.5 64.6 93.3 59 94.7 53 96.7 47.9 96.4M96.6 44.3 94.5 40.8 91.8 39.4 89.1 37.9M44.3 96.6 42.5 94.2 41.1 91.9 41.6 90.5M86 80.2 85.2 83.9 87.1 84 88.9 84.2M71.3 91.9 73.5 89 69.1 89 68.4 87.3' stroke='%23d8ab50' stroke-width='1.05'/%3E%3Cpath d='M95.4 44.4 97.5 49.8 95.7 54.5 97 60.7 94.5 65.2 91.3 68.2 91.3 73.2 90.1 76.6 86 78.6 85.9 83.2 81.4 86.9 75.2 87.5 72.5 91.3 69.9 94.5 64.6 93.3 59 94.7 53 96.7 47.9 96.4' stroke='%23fff0c4' stroke-width='.35'/%3E%3C/svg%3E");
  --ws-fibre: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.016' numOctaves='3' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .95 0 0 0 0 .9 0 0 0 0 .8 0 0 0 1.4 -.55' result='m'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.05 .9' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .97 0 0 0 0 .93 0 0 0 0 .84 6 0 0 0 -3.9'/%3E%3CfeComposite in2='m' operator='over'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23p)'/%3E%3C/svg%3E");

  /* the shared components read these (base.css) */
  --s-surface: var(--ws-sheet);
  --s-surface-hi: var(--ws-sheet-hi);
  --s-edge: var(--ws-rim);
  --s-bw: 1px;
  --s-r: var(--ws-hand);
  --s-r-sm: var(--ws-pebble);
  --s-shadow: var(--ws-rest);
  --s-shadow-hi: inset 0 1px 0 rgba(255, 226, 180, .1), -7px 24px 40px -24px #000, 0 0 0 1px rgba(232, 161, 63, .2);
  --s-lift: -2px;
  /* the Spirit Library's own face, asked for the same way on both pages,
     with literal fallbacks because the library defines no --sans */
  --s-display: "Shippori Mincho", "Songti TC", Georgia, serif;
  --s-display-w: 800;
  --s-display-ls: 0.01em;
  /* the library's own ring colour, the lantern's brightest */
  --s-focus: #f6c46f;

  /* the bars: lacquered clay, a gold hairline where the light catches */
  --s-bar: rgba(17, 14, 12, .9);
  --s-bar-edge: rgba(212, 166, 72, .2);
  --s-bar-r: 14px;
  --s-bar-blur: blur(8px);
  --s-bar-shadow: inset 0 1px 0 rgba(255, 226, 180, .07), -6px 18px 36px -16px rgba(0, 0, 0, .85);

  /* The film grain becomes the paper's fibre (below), the circuit field
     and the HUD lattice go (a tea shop has no grid), and the cursor carries
     a little warm light instead of lighting up lines. */
  --s-grain: .06;
  --s-field: 0;
  --hud-grid: transparent;
  --hud-scan: transparent;
  --hud-sweep: transparent;
  --hud-lit: transparent;
  --hud-halo: rgba(232, 161, 63, .06);
}
@media (prefers-reduced-transparency: reduce) {
  :root[data-style="wabi-sabi"] { --s-bar: #110e0c; --s-bar-blur: none; }
}
@media (prefers-contrast: more) {
  :root[data-style="wabi-sabi"] { --ws-rim: rgba(230, 200, 150, .34); --s-bar-edge: rgba(212, 166, 72, .5); }
}

/* the parts of the page nobody draws: selection in the lantern's amber,
   the scrollbar in clay */
:root[data-style="wabi-sabi"] { scrollbar-color: #5a4630 #0f0c0b; }
:root[data-style="wabi-sabi"] ::selection { background: #e8a13f; color: #110e0c; }

/* Handmade paper over everything, where the grain used to be: one fixed
   layer, still (paper does not jitter), so it costs less than the grain did. */
:root[data-style="wabi-sabi"] .grain {
  inset: 0; width: 100%; height: 100%;
  background-image: var(--ws-fibre); background-size: 300px 300px;
  animation: none; will-change: auto;
}

/* ── 2. the world page: the tea shop after closing ─────────────────────── */

/* the tab bar is the one place the world's amber is set page-wide */
:root[data-style="wabi-sabi"] .tabbar { --s-accent: var(--ws-lantern); }
:root[data-style="wabi-sabi"] .tabbar a.is-current,
:root[data-style="wabi-sabi"] .tabbar a.is-going {
  background: rgba(232, 161, 63, .1);
  box-shadow: inset 0 1px 0 rgba(255, 226, 180, .08), inset 0 -8px 14px -10px rgba(0, 0, 0, .6);
}

/* The backdrop, redrawn. The elements still sit in their four quarters
   (air at the top left, water top right, earth and fire below), but as
   pigment washed into dark paper, not light; the lantern's spill comes in
   from the top right; the wheel turns in ink and gold. All of it sits
   under fanpages.css's .36 ceiling. */
:root[data-style="wabi-sabi"] .atla-sky {
  background:
    radial-gradient(46% 36% at 84% 6%, rgba(236, 156, 64, .55), transparent 72%),
    radial-gradient(48% 40% at 8% 16%, rgba(201, 154, 69, .2), transparent 70%),
    radial-gradient(44% 38% at 96% 38%, rgba(74, 106, 168, .26), transparent 70%),
    radial-gradient(48% 40% at 8% 88%, rgba(127, 168, 140, .18), transparent 70%),
    radial-gradient(48% 40% at 92% 86%, rgba(208, 88, 58, .2), transparent 70%),
    #0d0a08;
}
:root[data-style="wabi-sabi"] .atla-air {
  background-image:
    repeating-linear-gradient(96deg, rgba(201, 154, 69, .08) 0 2px, transparent 2px 120px),
    repeating-linear-gradient(84deg, rgba(230, 218, 194, .045) 0 2px, transparent 2px 180px);
}
:root[data-style="wabi-sabi"] .atla-water {
  background: radial-gradient(42% 20% at 84% 32%, rgba(43, 74, 133, .5), transparent 70%);
}
:root[data-style="wabi-sabi"] .atla-earth {
  background-image: repeating-linear-gradient(4deg, rgba(127, 168, 140, .09) 0 3px, transparent 3px 38px);
}
:root[data-style="wabi-sabi"] .atc-ring circle { stroke: #e6dac2; opacity: .4; }
:root[data-style="wabi-sabi"] .atc-yy path { fill: #e6dac2; opacity: .3; }
:root[data-style="wabi-sabi"] .atc-air { stroke: var(--ws-ochre); }
:root[data-style="wabi-sabi"] .atc-water { stroke: var(--ws-indigo); fill: var(--ws-indigo) !important; }
:root[data-style="wabi-sabi"] .atc-earth { stroke: var(--ws-celadon); fill: var(--ws-celadon) !important; }
:root[data-style="wabi-sabi"] .atc-fire { stroke: var(--ws-cinnabar); fill: var(--ws-cinnabar) !important; }
:root[data-style="wabi-sabi"] .atk-black { stroke: var(--ws-indigo); }
/* the floating stone, glazed in celadon like a pot from Ba Sing Se */
:root[data-style="wabi-sabi"] .atla-rocks i {
  background: radial-gradient(circle at 34% 28%, #a9c9b1, #5e8a6e 55%, #263a2d);
  border-color: rgba(169, 201, 177, .3);
}
/* Sozin's Comet as one flick of cinnabar: no glow, a brush leaving the paper */
:root[data-style="wabi-sabi"] .atla-comet i {
  height: 3px; box-shadow: none;
  background: linear-gradient(90deg, transparent, rgba(208, 88, 58, .5) 40%, var(--ws-cinnabar));
}
:root[data-style="wabi-sabi"] .atla-comet i::after { background: var(--ws-cinnabar-l); box-shadow: none; }

/* The lantern: a warm light behind the hero's orb, so the dotted sphere
   reads as the one lantern left burning. Inside the hero's own stacking
   context, under the orb and the words. */
:root[data-style="wabi-sabi"] .fan-hero { position: relative; }
:root[data-style="wabi-sabi"] .fan-hero::after {
  content: ""; position: absolute; z-index: -2; pointer-events: none;
  right: calc(var(--gutter) - 10rem); top: 50%; translate: 0 -48%;
  width: clamp(460px, 54vw, 860px); aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(246, 190, 110, .24), rgba(232, 150, 60, .1) 40%, rgba(232, 140, 50, .03) 66%, transparent);
}
@media (max-width: 760px) {
  :root[data-style="wabi-sabi"] .fan-hero::after { right: -40vw; top: -3rem; translate: 0 0; width: 120vw; }
}

/* The title in the library's own face, bone on the dark, over one loaded
   stroke of ink that dries out as it runs toward the lantern. The page's
   own rule is weightier (body[data-fan] .fan-title), hence the full prefix. */
:root[data-style="wabi-sabi"] body[data-fan="atla"] .fan-title {
  position: relative;
  font-family: var(--s-display); font-weight: 800; letter-spacing: 0.005em;
  font-size: clamp(2.3rem, 6.2vw, 5.2rem); line-height: 1.08;
  color: var(--ws-bone); text-wrap: balance;
}
:root[data-style="wabi-sabi"] :is(.fan-title, .sl-h:not(.sl-h--sm))::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: -3.5%; right: -8%; top: 52%; bottom: -42%;
  background: var(--ws-swash) center / 100% 100% no-repeat;
  opacity: .22;
}

/* paper and clay, on every surface that holds words */
:where(:root[data-style="wabi-sabi"]) :is(.fan-card, .fan-tile, .fan-linkcard, .fan-rankrow, .fan-land, .fan-quote, .fan-intro-when, .wsib-i a) {
  background: var(--ws-sheet);
  border: 1px solid var(--ws-rim);
  border-radius: var(--ws-hand);
  box-shadow: var(--ws-rest);
}
:where(:root[data-style="wabi-sabi"]) :is(.fan-card, .fan-tile, .fan-linkcard, .fan-land, .fan-quote):nth-child(3n+2) { border-radius: var(--ws-hand-2); }
:where(:root[data-style="wabi-sabi"]) :is(.fan-card, .fan-tile, .fan-linkcard, .fan-land, .fan-quote):nth-child(3n) { border-radius: var(--ws-hand-3); }
@media (hover: hover) {
  :where(:root[data-style="wabi-sabi"]) :is(.fan-rankrow, .fan-land, .fan-quote, .wsib-i a):hover {
    background: var(--ws-sheet-hi);
    border-color: color-mix(in srgb, var(--a, #e8a13f) 40%, transparent);
    box-shadow: var(--s-shadow-hi);
  }
}

/* The interface door, its live fragment and the hero links are black raku:
   the Spirit Library's own panels, glazed, with the lantern in the rim. */
:where(:root[data-style="wabi-sabi"]) :is(.fan-iface, .fan-peek, .fan-link) {
  background: var(--ws-clay);
  box-shadow: var(--ws-rest);
}
:where(:root[data-style="wabi-sabi"]) .fan-iface { border-color: rgba(232, 161, 63, .5); }
:where(:root[data-style="wabi-sabi"]) .fan-peek { border-color: rgba(212, 166, 72, .38); }
:where(:root[data-style="wabi-sabi"]) .fan-peek-bar { background: rgba(232, 161, 63, .06); }
:where(:root[data-style="wabi-sabi"]) .fan-peek-dot { border-radius: 40% 60% 45% 55%; box-shadow: none; }
:where(:root[data-style="wabi-sabi"]) .fan-link { border-color: #8a6a35; }
:where(:root[data-style="wabi-sabi"]) .fan-iface-a { border-radius: 44% 56% 50% 50% / 52% 46% 54% 48%; }

/* Headings in the library's face; reading text stays Inter, labels stay
   JetBrains Mono. Iroh's lines are set in it too, the way a proverb hangs
   on a tea-house wall. */
:root[data-style="wabi-sabi"] :is(.fan-card :is(h2, h3, h4, h5), .fan-rankhead b, .fan-tiletext b, .fan-land-head :is(h2, h3, h4, h5), .fan-linkhead b, .wsib-h b, .crest :is(h2, h3, h4, h5), .atla-el b, .atla-core b) {
  font-family: var(--s-display); font-weight: 700; letter-spacing: 0.01em;
}
:root[data-style="wabi-sabi"] .fan-card :is(h2, h3, h4, h5) { font-size: 1.16rem; }
:root[data-style="wabi-sabi"] .fan-quote blockquote {
  font-family: var(--s-display); font-weight: 500; font-size: 1.1rem; line-height: 1.6;
  letter-spacing: 0.01em; color: var(--ws-bone);
}
:root[data-style="wabi-sabi"] .atla-legend :is(h2, h3, h4, h5) {
  font-family: var(--s-display); font-weight: 800; font-size: 1.7rem;
  letter-spacing: 0.01em; color: var(--ws-bone);
}
:root[data-style="wabi-sabi"] .fan-num {
  font-family: var(--s-display); font-weight: 700; font-size: 1.3rem; line-height: 1.2;
  color: color-mix(in srgb, var(--a) 72%, var(--ws-bone)); opacity: 1;
}

/* Section heads as a tea house would letter them: the name in the
   library's face, the note in small ochre mono, and the old hairline
   rule now a kintsugi seam that trails off as the crack does. The bending
   picker's heading (fan-play.js) is lettered the same way. */
:root[data-style="wabi-sabi"] :is(.subsec--fan, .fp-head :is(h2, h3)) {
  font-family: var(--s-display); font-weight: 700; font-size: clamp(1.25rem, 2.3vw, 1.55rem);
  letter-spacing: 0.01em; text-transform: none; color: var(--ws-bone);
}
:root[data-style="wabi-sabi"] .subsec--fan .subsec-yr {
  font-family: var(--mono); font-weight: 400; font-size: 0.7rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: #c9a368;
}
:root[data-style="wabi-sabi"] .subsec--fan::after {
  content: ""; align-self: center; height: 16px;
  background: var(--ws-seam) 0 50% / 640px 16px repeat-x;
  -webkit-mask-image: linear-gradient(90deg, #000 62%, transparent);
  mask-image: linear-gradient(90deg, #000 62%, transparent);
  opacity: .75;
}
/* the foot of the page opens on the same seam */
:where(:root[data-style="wabi-sabi"]) .wsib {
  border-top-color: transparent;
  background: var(--ws-seam) 0 0 / 640px 16px repeat-x;
}

/* Where a coloured bar used to mark a quote, a note or a land, a stroke of
   that item's own pigment: a short upright brush mark for the quotes, the
   note and the game's answer, a loaded sideways one across a land's top. */
:where(:root[data-style="wabi-sabi"]) :is(.fan-quote, .fan-intro-when, .fp-out) {
  position: relative; border-left: 1px solid var(--ws-rim); padding-left: 1.9rem;
}
:root[data-style="wabi-sabi"] :is(.fan-quote, .fan-intro-when, .fp-out)::before {
  content: ""; position: absolute; left: 0.6rem; top: 0.95rem; bottom: 0.95rem; width: 10px;
  background: color-mix(in srgb, var(--a, #e8a13f) 82%, var(--ws-bone));
  -webkit-mask: var(--ws-stroke) center / 100% 100% no-repeat;
  mask: var(--ws-stroke) center / 100% 100% no-repeat;
  pointer-events: none;
}
:where(:root[data-style="wabi-sabi"]) .fan-land-bar {
  inset: 0.45rem 34% auto 1rem; height: 11px;
  background: color-mix(in srgb, var(--a, #e8a13f) 82%, var(--ws-bone));
  -webkit-mask: var(--ws-swash) 0 50% / 100% 100% no-repeat;
  mask: var(--ws-swash) 0 50% / 100% 100% no-repeat;
}
/* a tile's swatch is a dab of ground pigment, not a lit square */
:root[data-style="wabi-sabi"] .fan-swatch {
  border-radius: 46% 54% 40% 60% / 55% 45% 58% 42%; box-shadow: none;
}

/* An item's own colour (a tile's caption, a card's subtitle, its tag,
   Listen link and Play button) sits on paper, and the darker ones (Hama's
   wine, Ozai's red, Jet's moss) were under 4.5:1 on the old ground. Each is
   its colour carried a little toward undyed paper: still its own, and
   readable. :where keeps the shared rules' weight, so hover and play win. */
:root[data-style="wabi-sabi"] :is(.fan-tiletext i, .fan-card .fan-sub) { color: color-mix(in srgb, var(--a) 72%, var(--ws-bone)); opacity: 1; }
:where(:root[data-style="wabi-sabi"]) :is(.fan-tag, .fan-visit, .fan-hear) { color: color-mix(in srgb, var(--a) 72%, var(--ws-bone)); }
/* the same mix lifted to a readable lightness for a deep accent (Water's
   rose was 4.0:1); see READABLE ACCENTS in fanpages.css */
@supports (color: oklch(from red max(l, 0.5) c h)) {
  :root[data-style="wabi-sabi"] :is(.fan-tiletext i, .fan-card .fan-sub) { color: oklch(from color-mix(in srgb, var(--a) 72%, var(--ws-bone)) max(l, 0.7) c h); }
  :where(:root[data-style="wabi-sabi"]) :is(.fan-tag, .fan-visit, .fan-hear) { color: oklch(from color-mix(in srgb, var(--a) 72%, var(--ws-bone)) max(l, 0.7) c h); }
}
/* A card's tag (Gaang, a nation, an element) is a small seal pressed into
   the sheet's top right corner in that same pigment, not a label over the
   name. align-self is for the flex column the cards fall back to without
   subgrid, where it is the cross axis. */
:root[data-style="wabi-sabi"] .fan-card > .fan-tag {
  justify-self: end; align-self: flex-end;
  padding: 0.16rem 0.42rem; border: 1px solid currentColor; border-radius: var(--ws-pebble);
  line-height: 1.3;
}

/* The four nations, wherever the page names one in its own colour, are
   ground into their mineral: the Gaang, the nation cards and tiles, the
   crests and the wheel. These colours arrive inline, hence !important. */
:root[data-style="wabi-sabi"] [style*="--a:#e8c46a"] { --a: var(--ws-ochre) !important; }
:root[data-style="wabi-sabi"] [style*="--a:#4f9fd0"] { --a: var(--ws-indigo) !important; }
:root[data-style="wabi-sabi"] [style*="--a:#4f9a4f"] { --a: var(--ws-celadon) !important; }
:root[data-style="wabi-sabi"] [style*="--a:#d04a2a"] { --a: var(--ws-cinnabar) !important; }
:root[data-style="wabi-sabi"] .crest[style*="#e8c46a"] { --h1: var(--ws-ochre-d) !important; --hl: var(--ws-ochre-l); }
:root[data-style="wabi-sabi"] .crest[style*="#4f9fd0"] { --h1: var(--ws-indigo-d) !important; --hl: var(--ws-indigo-l); }
:root[data-style="wabi-sabi"] .crest[style*="#4f9a4f"] { --h1: var(--ws-celadon-d) !important; --hl: var(--ws-celadon-l); }
:root[data-style="wabi-sabi"] .crest[style*="#d04a2a"] { --h1: var(--ws-cinnabar-d) !important; --hl: var(--ws-cinnabar-l); }
:root[data-style="wabi-sabi"] .atla-el--fire { --e: var(--ws-cinnabar) !important; }
:root[data-style="wabi-sabi"] .atla-el--air { --e: var(--ws-ochre) !important; }
:root[data-style="wabi-sabi"] .atla-el--water { --e: var(--ws-indigo) !important; }
:root[data-style="wabi-sabi"] .atla-el--earth { --e: var(--ws-celadon) !important; }

/* The crests are raku tea bowls: black clay, the nation's glaze pooled at
   the top, matte, no glow. They keep the page's own arched shape. */
:where(:root[data-style="wabi-sabi"]) .crest {
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--h1) 36%, transparent), transparent 64%),
    var(--ws-clay);
  border-color: color-mix(in srgb, var(--h1) 55%, rgba(230, 200, 150, .1));
  box-shadow: var(--ws-rest);
}
@media (hover: hover) {
  :where(:root[data-style="wabi-sabi"]) .crest:hover {
    background:
      radial-gradient(130% 78% at 50% 0%, color-mix(in srgb, var(--h1) 50%, transparent), transparent 68%),
      var(--ws-clay);
    box-shadow: var(--s-shadow-hi);
  }
  :root[data-style="wabi-sabi"] .crest:hover .crest-sigil { filter: none; }
}
:where(:root[data-style="wabi-sabi"]) .crest:focus-visible {
  background:
    radial-gradient(130% 78% at 50% 0%, color-mix(in srgb, var(--h1) 50%, transparent), transparent 68%),
    var(--ws-clay);
}
:root[data-style="wabi-sabi"] .crest :is(h2, h3, h4, h5) { text-shadow: none; font-size: 1.35rem; }
:root[data-style="wabi-sabi"] .crest-sigil { filter: none; }
:where(:root[data-style="wabi-sabi"]) .crest-tags span { border-radius: var(--ws-pebble); background: transparent; }
/* placed like stones on a path, not set on a ruler (wide screens only;
   a phone stacks them as they are) */
@media (min-width: 1100px) {
  :root[data-style="wabi-sabi"] .crest-grid > .crest:nth-child(2) { translate: 0 1.4rem; }
  :root[data-style="wabi-sabi"] .crest-grid > .crest:nth-child(3) { translate: 0 0.5rem; }
  :root[data-style="wabi-sabi"] .crest-grid > .crest:nth-child(4) { translate: 0 2rem; }
  :root[data-style="wabi-sabi"] .crest-grid { margin-bottom: 5.4rem; }
}

/* ── the signature: the cycle, mended ─────────────────────────────────────
   The dashed ring becomes one brushed circle, loaded where it starts at
   Fire and dry by the time it comes round again. Each nation is a disc of
   its pigment. And across the ring from Air to Water (Aang, then Korra)
   runs a crack filled with gold: the hundred years he spent in the ice,
   when the cycle broke and was mended. The crack is drawn twice on the same
   line, dark (::before) and gold (::after); scrolling the wheel into view
   fills it with gold. Opacity only. Under Reduce Motion, and where scroll-
   driven animation is missing, it is simply gold. */
:root[data-style="wabi-sabi"] .atla-wheel { view-timeline-name: --ws-wheel; }
:root[data-style="wabi-sabi"] .atla-wheel > i {
  border: 0; opacity: .6;
  background: var(--ws-ring) center / 100% 100% no-repeat;
}
:root[data-style="wabi-sabi"] .atla-wheel > i::after { border-color: rgba(230, 218, 194, .1); }
:root[data-style="wabi-sabi"] .atla-wheel::before,
:root[data-style="wabi-sabi"] .atla-wheel::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--ws-wheel) center / 100% 100% no-repeat;
}
:root[data-style="wabi-sabi"] .atla-wheel::before { filter: grayscale(1) brightness(.32); }
:root[data-style="wabi-sabi"] :is(.atla-el, .atla-core) { z-index: 1; }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    :root[data-style="wabi-sabi"] .atla-wheel::after {
      animation: ws-mend linear both; animation-timeline: --ws-wheel; animation-range: entry 30% cover 55%;
    }
  }
}
@keyframes ws-mend { from { opacity: 0; } to { opacity: 1; } }

:where(:root[data-style="wabi-sabi"]) .atla-el {
  background: radial-gradient(circle at 36% 30%, color-mix(in srgb, var(--e) 50%, var(--ws-clay)), color-mix(in srgb, var(--e) 24%, var(--ws-clay)) 74%);
  border-color: color-mix(in srgb, var(--e) 62%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 236, 200, .12), -4px 14px 22px -14px #000;
}
:root[data-style="wabi-sabi"] .atla-el b { font-size: 1.08rem; color: color-mix(in srgb, var(--e) 40%, var(--ws-bone)); }
:root[data-style="wabi-sabi"] .atla-el span { color: rgba(239, 231, 214, .8); }
:where(:root[data-style="wabi-sabi"]) .atla-core {
  background: radial-gradient(circle at 40% 34%, #2a231c, var(--ws-clay) 72%);
  border-color: rgba(212, 166, 72, .45);
}
:root[data-style="wabi-sabi"] .atla-core b { font-size: 0.98rem; color: #f3d78f; }

/* The bending game's mat and its pieces: a paper mat, raku tiles, a
   stamped button. */
:where(:root[data-style="wabi-sabi"]) .fp-bar {
  background: var(--ws-sheet); border-color: var(--ws-rim); border-radius: var(--ws-hand);
}
:where(:root[data-style="wabi-sabi"]) .fp-slot {
  background: var(--ws-clay); border-color: rgba(230, 200, 150, .16); color: var(--ws-bone);
  border-radius: var(--ws-pebble); box-shadow: var(--ws-glaze);
}
:where(:root[data-style="wabi-sabi"]) .fp-go { border-radius: var(--ws-pebble); }
:where(:root[data-style="wabi-sabi"]) .fp-out { background: var(--ws-sheet); border-radius: var(--ws-hand); }

/* empty space around the sections, the way a tea room leaves the wall bare */
:root[data-style="wabi-sabi"] :is(.fan-sec, .atla-cycle, .fan-play) { margin-bottom: 4.6rem; }

/* ── 3. the Spirit Library: the same clay, ink and gold, underground ──────
   The tower and the sky over the desert stay exactly as they are, by day,
   dusk or night. Below the sand, the library's ink blue becomes sumi
   black warmed by one lamp, its panels black raku, its shelves divided by
   kintsugi seams, and its nations ground into the same four pigments as
   the world page. The scrolls keep their paper. */
:root[data-style="wabi-sabi"] .sl {
  --ink: #0f0c0b; --ink-2: #16120f; --ink-3: #1f1a16;
  --paper-ink: #1d1814;
  --line: rgba(212, 166, 72, .2);
  --water: #7d97cf; --earth: #93b89e; --fire: #e0735a; --air: #d9b05a; --spirit: #b4a6d6;
  --iw-bg: #0f0c0b;
}
/* one lamp, off to one side, and the paper's fibre on the walls */
:root[data-style="wabi-sabi"] .sl-lamp {
  background:
    radial-gradient(44% 34% at 24% 0%, rgba(232, 161, 63, .14), transparent 72%),
    radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, .6));
}
:root[data-style="wabi-sabi"] .sl-uprights {
  opacity: 1;
  background: repeating-linear-gradient(90deg, rgba(230, 218, 194, .028) 0 2px, transparent 2px 180px);
}
:root[data-style="wabi-sabi"] .sl-field::after {
  content: ""; position: absolute; inset: 0; opacity: .05;
  background: var(--ws-fibre) 0 0 / 300px 300px;
}
/* where the sand gives way to the library, the first seam */
:root[data-style="wabi-sabi"] .sl-strata::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 16px; pointer-events: none;
  background: var(--ws-seam) 30% 50% / 640px 16px repeat-x;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18% 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18% 82%, transparent);
}

/* the shelves: each nation's bay opens on a seam instead of a hairline */
:root[data-style="wabi-sabi"] .sl-bay { position: relative; border-top-color: transparent; }
:root[data-style="wabi-sabi"] .sl-bay::before {
  content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 16px; pointer-events: none;
  background: var(--ws-seam) 0 50% / 640px 16px repeat-x;
  -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent);
  mask-image: linear-gradient(90deg, #000 70%, transparent);
}
/* the big heads take the world page's loaded stroke of ink under them */
:root[data-style="wabi-sabi"] .sl-h:not(.sl-h--sm) { position: relative; isolation: isolate; }
:root[data-style="wabi-sabi"] .sl-h:not(.sl-h--sm)::before { right: auto; width: min(36rem, 92%); }
/* nation emblems in matte pigment, with no glow round them */
:root[data-style="wabi-sabi"] .sl-emblem {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--n) 70%, transparent), -3px 10px 18px -12px #000;
}

/* the big rooms are black raku, cut by hand, glazed where the lamp is */
:where(:root[data-style="wabi-sabi"]) .sl-panel {
  background: var(--ws-clay);
  border-color: rgba(212, 166, 72, .2); border-radius: var(--ws-hand);
  box-shadow: var(--ws-glaze), -8px 26px 44px -30px #000;
}
:where(:root[data-style="wabi-sabi"]) .sl-planet {
  background: radial-gradient(70% 60% at 30% 40%, rgba(232, 161, 63, .05), transparent 70%), var(--ws-clay);
  border-color: rgba(212, 166, 72, .2); border-radius: var(--ws-hand-2);
  box-shadow: var(--ws-glaze), -8px 26px 44px -30px #000;
}
:where(:root[data-style="wabi-sabi"]) .sl-cols > .sl-panel:nth-child(2) { border-radius: var(--ws-hand-3); }
/* the planetarium's brass bezel on the same clay */
:root[data-style="wabi-sabi"] .sl-bezel { fill: #120f0c; stroke: #b8893a; }

/* buttons, readouts and the date field: pebbles, not machined boxes */
:where(:root[data-style="wabi-sabi"]) :is(.sl-btn, .sl-datein, .sl-next div, .sl-ecl-list button, .sl-go) { border-radius: var(--ws-pebble); }
:where(:root[data-style="wabi-sabi"]) .sl-go { background: var(--ws-clay); box-shadow: var(--ws-rest); }

/* the messenger hawks' cubbies: recesses in a clay wall */
:where(:root[data-style="wabi-sabi"]) .sl-cubby {
  background: linear-gradient(180deg, #0b0908, #17130f);
  border-radius: var(--ws-pebble);
}
@media (hover: hover) {
  :root[data-style="wabi-sabi"] .sl-cubby:hover { background: linear-gradient(180deg, #0e0b09, #1d1813); }
}

/* The world button, which interface-world.css paints purple everywhere, is
   a raku tile in the lantern's amber, the same clay as the world page's
   door back here. Its ring is the page's ring; on the day sky, where amber
   would vanish, the header's rings are drawn in ink instead. */
:root[data-style="wabi-sabi"] .sl .iw {
  --iw-a: #e8a13f; --iw-bg: #0f0c0b;
  background: linear-gradient(180deg, #1c1714, #110e0c);
  border-color: rgba(232, 161, 63, .6);
  border-radius: 22px 12px 20px 14px / 16px 22px 12px 20px;
  box-shadow: inset 0 1px 0 rgba(255, 226, 180, .1), -4px 12px 22px -14px rgba(0, 0, 0, .9);
}
:root[data-style="wabi-sabi"] .sl .iw-i { border-radius: 44% 56% 50% 50% / 52% 46% 54% 48%; }
:root[data-style="wabi-sabi"] .sl .iw:focus-visible { outline-color: var(--s-focus); }
:root[data-style="wabi-sabi"] .sl[data-sky="day"] .sl-top { --s-focus: #16203a; }
:root[data-style="wabi-sabi"] .sl[data-sky="day"] .sl-top :focus-visible { outline-color: var(--s-focus); }
