/* Base, shared controls, page frame and sidebar. Colours and type come from tokens.css. */

:root {
  --sb-w: var(--sidebar-w);
  --rail-w: 68px;
  --gutter: clamp(20px, 5vw, 64px);
  --hairline: rgba(207, 174, 120, .5);
  --hairline-soft: rgba(207, 174, 120, .26);
  --rose-line: rgba(212, 104, 124, .7);
  --rose-wash: rgba(232, 142, 160, .14);
  --wood: var(--wood-mid);
  --wood-light: var(--wood-pale);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
  scrollbar-color: rgba(201, 120, 143, .45) transparent;
  background: var(--washi);
}

html.is-locked {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--washi);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, p, figure, ul, ol, blockquote, pre {
  margin: 0;
}

ul, ol {
  padding: 0;
}

img, video, iframe {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
}

input, textarea {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus {
  outline: none;
}

/* one ring everywhere: deep rose, dark enough to show on the pink frame and on paper */
:focus-visible {
  outline: 2px solid var(--beni);
  outline-offset: 3px;
  border-radius: 6px;
}

.main:focus,
.main:focus-visible {
  outline: none;
}

::selection {
  background: rgba(232, 142, 160, .3);
  color: var(--sumi);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  line-height: 0;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: calc(var(--z-overlay) + 12);
  padding: 8px 18px;
  background: var(--kinari);
  color: var(--beni);
  border: 1px solid var(--shu-bright);
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  font-family: var(--font-ui);
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-decoration: none;
  transition: top var(--dur-fast) ease;
}

.skip-link:focus {
  top: 12px;
}

.noscript {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 200;
  padding: 14px 20px;
  background: var(--kasumi-mid);
  color: var(--ink);
  border-top: 1px solid var(--hairline);
  font-family: var(--font-ui);
  text-align: center;
}

/* ---------- buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 22px;
  border: 1px solid var(--paper-edge);
  border-radius: 999px;
  background: var(--kinari);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 6px 14px -10px rgba(120, 78, 96, .4);
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, box-shadow var(--dur-mid) ease, transform var(--dur-mid) var(--ease-brush);
}

.btn:hover {
  border-color: var(--sakura-deep);
  background: #fff;
  color: var(--beni);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 10px 20px -12px rgba(120, 78, 96, .5);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: .55;
}

.btn--primary {
  background: linear-gradient(180deg, #dc7a8d 0%, var(--shu) 45%, #c4586e 100%);
  border-color: #c4586e;
  color: #fff;
  text-shadow: 0 1px 0 rgba(150, 60, 82, .35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 10px 20px -12px rgba(179, 77, 102, .75);
}

.btn--primary:hover {
  background: linear-gradient(180deg, #e2869a 0%, #d87087 45%, #c85d73 100%);
  border-color: #c4586e;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .4) inset, 0 14px 24px -12px rgba(179, 77, 102, .8);
}

.btn--danger {
  background: var(--beni);
  border-color: #a3445c;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 10px 20px -12px rgba(179, 77, 102, .8);
}

.btn--danger:hover {
  background: #a8455e;
  border-color: #963c53;
  color: #fff;
}

.btn--small {
  min-height: 34px;
  padding: 5px 15px;
  font-size: .84rem;
}

/* quiet outline button for coloured bars (kept under its old name) */
.btn--onDark {
  background: rgba(255, 253, 249, .7);
  border-color: rgba(201, 120, 143, .5);
  color: var(--beni);
  box-shadow: none;
}

.btn--onDark:hover {
  background: #fff;
  border-color: var(--shu);
  color: var(--beni);
}

.text-btn {
  position: relative;
  padding: 4px 2px;
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}

.text-btn:hover {
  color: var(--beni);
  border-color: var(--shu-bright);
}

.text-btn--danger {
  color: var(--beni);
}

.text-btn--danger:hover {
  color: var(--shu);
  border-color: var(--shu);
}

/* ---------- form fields ---------- */

.field {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.field__label {
  font-family: var(--font-ui);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field__input {
  width: 100%;
  padding: 11px 15px;
  border: 1px solid var(--paper-edge);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  box-shadow: inset 0 1px 3px rgba(120, 78, 96, .08);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

textarea.field__input {
  resize: vertical;
  min-height: 96px;
}

.field__input::placeholder {
  color: var(--ink-faint);
  opacity: .85;
}

.field__input:focus,
.field__input:focus-visible {
  outline: none;
  border-color: var(--shu-bright);
  box-shadow: var(--ring), inset 0 1px 3px rgba(120, 78, 96, .05);
}

.field__hint {
  font-family: var(--font-ui);
  font-size: .82rem;
  color: var(--ink-faint);
  line-height: 1.5;
}

.form-error {
  min-height: 1.5em;
  margin-top: 14px;
  color: var(--beni);
  font-family: var(--font-ui);
  font-size: .9rem;
  line-height: 1.5;
}

.form-error:empty {
  min-height: 0;
  margin-top: 0;
}

/* ---------- page frame ---------- */

.main {
  position: relative;
  z-index: var(--z-content);
  min-height: 100vh;
  margin-left: var(--sb-w);
  background-color: var(--washi);
  overflow-x: clip;
  transition: margin-left var(--dur-mid) var(--ease-fold);
}

.view {
  min-height: 100vh;
  padding-bottom: clamp(72px, 12vh, 140px);
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.rule {
  height: 1px;
  margin: clamp(26px, 4vw, 44px) 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--kin) 18%, var(--kin-deep) 50%, var(--kin) 82%, transparent);
  opacity: .6;
}

.hint-line {
  padding: 14px 20px;
  border: 1px dashed var(--sakura-deep);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, .6);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: .92rem;
}

/* ---------- sidebar: a tall sheet of washi with a watercolour wash ---------- */

/* registered so the wash can cross-fade when the page theme changes */
@property --sb-a { syntax: "<color>"; inherits: true; initial-value: #fdeef0; }
@property --sb-b { syntax: "<color>"; inherits: true; initial-value: #f8e1ea; }
@property --sb-c { syntax: "<color>"; inherits: true; initial-value: #e9e0f4; }
@property --sb-bloom { syntax: "<color>"; inherits: true; initial-value: #f6d3e0; }
@property --hill-1 { syntax: "<color>"; inherits: true; initial-value: #d6cbec; }
@property --hill-2 { syntax: "<color>"; inherits: true; initial-value: #cdb9e0; }
@property --hill-3 { syntax: "<color>"; inherits: true; initial-value: #e6b3c8; }
@property --hill-4 { syntax: "<color>"; inherits: true; initial-value: #dd9bb3; }

.sidebar {
  --sb-a: var(--kasumi-top);
  --sb-b: var(--kasumi-mid);
  --sb-c: var(--kasumi-low);
  --sb-bloom: #f6d3e0;
  --hill-1: #d6cbec;
  --hill-2: #cdb9e0;
  --hill-3: #e6b3c8;
  --hill-4: #dd9bb3;
  --sunago: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='520'%3E%3Cpolygon points='136.1,290.4 136.7,288.8 136.3,291.0 137.7,288.4' fill='%23d9b98a' fill-opacity='0.51'/%3E%3Cpolygon points='161.5,457.9 161.0,459.3 161.7,458.8 162.5,456.6' fill='%23cfae78' fill-opacity='0.54'/%3E%3Cpolygon points='75.5,22.4 75.7,21.8 75.7,21.8 75.5,20.5' fill='%23cfae78' fill-opacity='0.77'/%3E%3Cpolygon points='95.6,123.4 96.5,123.6 96.5,123.9 97.8,121.3' fill='%23e2c48c' fill-opacity='0.87'/%3E%3Cpolygon points='20.7,197.0 19.8,197.5 20.4,195.9 19.0,196.4' fill='%23cfae78' fill-opacity='0.51'/%3E%3Cpolygon points='209.6,12.2 208.6,11.6 211.3,12.5 209.3,11.2' fill='%23f3e3bf' fill-opacity='0.64'/%3E%3Cpolygon points='68.9,142.1 69.3,141.6 66.8,144.9 68.0,141.0' fill='%23e2c48c' fill-opacity='0.55'/%3E%3Cpolygon points='79.8,397.3 79.2,398.8 79.6,398.8 80.0,398.4' fill='%23f3e3bf' fill-opacity='0.82'/%3E%3Cpolygon points='44.3,201.1 45.5,203.0 43.7,202.6 45.3,202.9' fill='%23f3e3bf' fill-opacity='0.85'/%3E%3Cpolygon points='178.8,221.1 179.3,220.5 179.3,220.8 180.0,219.7' fill='%23e2c48c' fill-opacity='0.87'/%3E%3Cpolygon points='288.0,70.6 286.0,69.2 288.9,71.1 285.9,69.9' fill='%23e2c48c' fill-opacity='0.48'/%3E%3Cpolygon points='55.4,192.8 58.2,195.1 57.3,194.1 57.1,192.0' fill='%23cfae78' fill-opacity='0.87'/%3E%3Cpolygon points='141.4,187.9 141.5,186.4 142.2,186.6 141.5,187.5' fill='%23d9b98a' fill-opacity='0.78'/%3E%3Cpolygon points='266.5,382.2 264.6,381.2 266.9,382.0 264.9,381.7' fill='%23f3e3bf' fill-opacity='0.71'/%3E%3Cpolygon points='186.4,198.6 186.5,202.1 187.4,201.1 185.6,201.1' fill='%23f3e3bf' fill-opacity='0.65'/%3E%3Cpolygon points='245.4,49.0 247.4,47.4 248.3,48.5 247.9,50.4' fill='%23d9b98a' fill-opacity='0.85'/%3E%3Cpolygon points='112.0,79.7 111.4,80.4 112.0,77.8 111.6,77.8' fill='%23f3e3bf' fill-opacity='0.81'/%3E%3Cpolygon points='222.6,108.8 222.6,106.8 223.0,108.7 222.2,106.6' fill='%23d9b98a' fill-opacity='0.82'/%3E%3Cpolygon points='40.1,244.9 38.6,246.3 39.6,247.1 39.1,244.6' fill='%23cfae78' fill-opacity='0.58'/%3E%3Cpolygon points='180.6,351.0 181.2,350.9 180.7,349.7 181.7,349.9' fill='%23e2c48c' fill-opacity='0.81'/%3E%3Ccircle cx='291.3' cy='63.0' r='0.40' fill='%23cfae78' fill-opacity='0.61'/%3E%3Ccircle cx='190.9' cy='192.8' r='0.39' fill='%23cfae78' fill-opacity='0.48'/%3E%3Ccircle cx='244.6' cy='135.1' r='0.67' fill='%23cfae78' fill-opacity='0.70'/%3E%3Ccircle cx='160.2' cy='22.5' r='0.45' fill='%23cfae78' fill-opacity='0.71'/%3E%3Ccircle cx='161.6' cy='488.8' r='0.58' fill='%23cfae78' fill-opacity='0.80'/%3E%3Ccircle cx='50.5' cy='438.6' r='0.66' fill='%23cfae78' fill-opacity='0.49'/%3E%3Ccircle cx='123.9' cy='461.0' r='0.52' fill='%23cfae78' fill-opacity='0.58'/%3E%3Ccircle cx='61.5' cy='458.3' r='0.35' fill='%23cfae78' fill-opacity='0.62'/%3E%3Ccircle cx='194.6' cy='261.4' r='0.72' fill='%23cfae78' fill-opacity='0.54'/%3E%3Ccircle cx='99.3' cy='507.0' r='0.39' fill='%23cfae78' fill-opacity='0.75'/%3E%3Ccircle cx='237.1' cy='477.2' r='0.41' fill='%23cfae78' fill-opacity='0.50'/%3E%3Ccircle cx='117.9' cy='49.0' r='0.49' fill='%23cfae78' fill-opacity='0.79'/%3E%3Ccircle cx='276.2' cy='138.1' r='0.67' fill='%23cfae78' fill-opacity='0.41'/%3E%3Ccircle cx='151.4' cy='23.0' r='0.50' fill='%23cfae78' fill-opacity='0.57'/%3E%3Ccircle cx='84.4' cy='474.9' r='0.45' fill='%23cfae78' fill-opacity='0.75'/%3E%3Ccircle cx='129.2' cy='22.0' r='0.59' fill='%23cfae78' fill-opacity='0.67'/%3E%3Ccircle cx='271.5' cy='244.9' r='0.80' fill='%23cfae78' fill-opacity='0.76'/%3E%3Ccircle cx='155.3' cy='351.1' r='0.55' fill='%23cfae78' fill-opacity='0.75'/%3E%3Ccircle cx='173.1' cy='356.8' r='0.69' fill='%23cfae78' fill-opacity='0.58'/%3E%3Ccircle cx='167.2' cy='429.6' r='0.60' fill='%23cfae78' fill-opacity='0.47'/%3E%3Ccircle cx='154.2' cy='468.5' r='0.47' fill='%23cfae78' fill-opacity='0.67'/%3E%3Ccircle cx='282.8' cy='449.5' r='0.62' fill='%23cfae78' fill-opacity='0.52'/%3E%3Ccircle cx='45.2' cy='282.9' r='0.47' fill='%23cfae78' fill-opacity='0.60'/%3E%3Ccircle cx='124.0' cy='62.5' r='0.35' fill='%23cfae78' fill-opacity='0.55'/%3E%3Ccircle cx='161.2' cy='26.5' r='0.76' fill='%23cfae78' fill-opacity='0.62'/%3E%3Ccircle cx='292.9' cy='66.4' r='0.39' fill='%23cfae78' fill-opacity='0.47'/%3E%3C/svg%3E");
  position: fixed;
  inset: 0 auto 0 0;
  z-index: var(--z-sidebar);
  width: var(--sb-w);
  display: flex;
  flex-direction: column;
  background:
    var(--fx-u-fibre) 0 0 / 400px 400px,
    radial-gradient(130% 30% at 18% 0%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 72%),
    radial-gradient(95% 24% at 108% 40%, var(--sb-bloom), transparent 72%),
    radial-gradient(90% 22% at -10% 64%, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 72%),
    linear-gradient(180deg, var(--sb-a) 0%, var(--sb-b) 46%, var(--sb-c) 100%);
  color: var(--ink);
  border-right: 1px solid var(--kin);
  box-shadow: inset -2px 0 0 rgba(255, 253, 249, .7), 16px 0 44px -26px rgba(120, 78, 96, .42);
  transition:
    width var(--dur-mid) var(--ease-fold), transform var(--dur-mid) var(--ease-fold), visibility 0s,
    --sb-a 1.2s ease, --sb-b 1.2s ease, --sb-c 1.2s ease, --sb-bloom 1.2s ease,
    --hill-1 1.2s ease, --hill-2 1.2s ease, --hill-3 1.2s ease, --hill-4 1.2s ease;
}

/* the wash follows the page theme: moss green, or the sand of a dry garden */
html[data-theme="koke"] .sidebar {
  --sb-a: #eef4e4;
  --sb-b: #dfead2;
  --sb-c: #d3e3cf;
  --sb-bloom: #e9f0cf;
  --hill-1: #c9dcc6;
  --hill-2: #b4cfb2;
  --hill-3: #a5c4a2;
  --hill-4: #8fb391;
}

html[data-theme="karesansui"] .sidebar {
  --sb-a: #faf4ea;
  --sb-b: #f1e8da;
  --sb-c: #e9dfd4;
  --sb-bloom: #f6e2da;
  --hill-1: #e2d6cb;
  --hill-2: #d7c7ba;
  --hill-3: #dfc0b6;
  --hill-4: #cbac9f;
}

/* sunago: a sparse scatter of gold-leaf flecks */
.sidebar__flecks {
  position: absolute;
  inset: 0;
  background: var(--sunago) 0 0 / 300px 520px;
  opacity: .8;
  pointer-events: none;
}

.sidebar__head,
.sidebar__nav,
.sidebar__foot {
  position: relative;
}

/* one gold hairline along the top edge; the chime and a wisteria sprig hang from it */
.sidebar__top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 96px;
  overflow: hidden;
  pointer-events: none;
}

.sidebar__top::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--kin-light), var(--kin) 30%, var(--kin-deep) 52%, var(--kin) 74%, var(--kin-light));
  opacity: .9;
}

/* the wind chime: always swaying, ringing when the brand is touched */
.charm {
  position: absolute;
  left: 18px;
  top: 1px;
  width: 30px;
  height: 71px;
  transform-origin: 50% 0;
  filter: drop-shadow(0 4px 4px rgba(120, 78, 96, .22));
  animation: charm-sway 4.2s ease-in-out infinite alternate;
}

.sidebar:has(.brand:hover) .charm .charm-bell,
.sidebar:has(.brand:focus-visible) .charm .charm-bell {
  animation: charm-jingle .2s ease-in-out 8 alternate;
}

.sidebar:has(.brand:hover) .charm .charm-tassel,
.sidebar:has(.brand:focus-visible) .charm .charm-tassel {
  animation: charm-jingle .26s ease-in-out 7 alternate-reverse;
}

.sb-fuji {
  position: absolute;
  right: 50px;
  top: 0;
  width: 46px;
  height: 61px;
}

/* layered hills in mist at the foot, painted wet-on-wet, with a thin moon */
.sidebar__hills {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 210px;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .5) 22%, #000 46%);
  mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .5) 22%, #000 46%);
}

.sidebar__hills svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sb-mist {
  animation: sb-mist 38s ease-in-out infinite alternate;
}

.sb-mist--b {
  animation-duration: 52s;
  animation-direction: alternate-reverse;
}

@keyframes sb-mist {
  from { transform: translateX(-18px); opacity: .65; }
  to { transform: translateX(18px); opacity: 1; }
}

.sidebar__head {
  padding: 36px 22px 24px;
}

.sidebar__head::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--kin) 22%, var(--kin) 78%, transparent);
  opacity: .7;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius);
}

.brand__crest {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 253, 249, .95) 0 58%, rgba(255, 253, 249, 0) 72%);
  color: var(--kin-deep);
  transition: transform var(--dur-slow) var(--ease-brush);
}

.brand:hover .brand__crest {
  transform: rotate(-4deg) scale(1.04);
}

.brand__crest svg {
  width: 100%;
  height: 100%;
}

.brand__text {
  display: grid;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.brand .brand__title {
  font-family: var(--font-latin);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: .24em;
  margin-right: -.24em;
  line-height: 1.35;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  color: var(--beni);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand .brand__title {
    background: var(--rose-ink);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

.brand__tagline {
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.sidebar__nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 12px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 120, 143, .4) transparent;
}

.sidebar__nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(201, 120, 143, .36);
  border-radius: 3px;
}

.sidebar__nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav-list {
  position: relative;
  display: grid;
  gap: 8px;
  list-style: none;
}

.nav-list.is-sorting {
  user-select: none;
  -webkit-user-select: none;
  cursor: grabbing;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

/* a petal resting on the corner of the active slip */
.nav-item::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: -3px;
  top: -4px;
  width: 11px;
  height: 11px;
  border-radius: 0 100% 0 100%;
  background: linear-gradient(135deg, #fbe3e9 0%, var(--sakura-deep) 70%, var(--shu-bright) 100%);
  box-shadow: 0 2px 4px -1px rgba(179, 77, 102, .45);
  opacity: 0;
  transform: translate(-6px, -8px) rotate(-50deg) scale(.4);
  transition: transform var(--dur-slow) var(--ease-brush), opacity var(--dur-mid) ease;
  pointer-events: none;
}

.nav-item.is-active::before {
  opacity: 1;
  transform: rotate(-14deg);
}

/* and a gold dot at its far end */
.nav-item.is-active .nav-link::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: var(--kin-foil);
  box-shadow: 0 0 0 3px rgba(243, 227, 191, .5);
}

.nav-item.is-sortable.is-active .nav-link::after {
  display: none;
}

.nav-link {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 10px 9px 13px;
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .07em;
  line-height: 1.4;
  text-decoration: none;
  transition: color var(--dur-fast) ease, background-color var(--dur-mid) ease, box-shadow var(--dur-mid) ease;
}

.nav-link__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform var(--dur-mid) var(--ease-brush);
}

.nav-link:hover {
  color: var(--ink);
}

.nav-link:hover .nav-link__title,
.nav-link:hover .seal {
  transform: translateX(3px) rotate(var(--tilt, 0deg));
}

.nav-item.is-active .nav-link {
  color: var(--sumi);
  background: linear-gradient(100deg, rgba(255, 255, 255, .86), rgba(255, 255, 255, .5));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 0 0 1px rgba(255, 255, 255, .6), 0 12px 24px -16px rgba(120, 78, 96, .5);
}

/* ---------- seals: line-art impressions, each pressed a little askew ---------- */

.seal {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--rose-line);
  border-radius: 8px 6px 9px 7px / 7px 9px 6px 8px;
  background: rgba(255, 253, 249, .36);
  color: var(--shu);
  font-family: var(--font-brush);
  font-size: 1.14rem;
  line-height: 1;
  transform: rotate(var(--tilt, 0deg));
  transition: background-color var(--dur-mid) var(--ease-brush), border-color var(--dur-mid) ease, color var(--dur-mid) ease, box-shadow var(--dur-mid) ease, transform var(--dur-mid) var(--ease-brush);
}

.seal::after {
  content: "";
  position: absolute;
  inset: 2.5px;
  border: 1px solid rgba(212, 104, 124, .38);
  border-radius: 5px 4px 6px 4px / 4px 6px 4px 5px;
  pointer-events: none;
  transition: border-color var(--dur-fast) ease;
}

.nav-item:nth-child(3n + 1) .seal { --tilt: -2.2deg; }
.nav-item:nth-child(3n + 2) .seal { --tilt: 1.6deg; }
.nav-item:nth-child(3n) .seal { --tilt: -.8deg; }

.nav-link:hover .seal,
.nav-link:focus-visible .seal {
  border-color: var(--shu);
  background: rgba(255, 253, 249, .85);
  color: var(--beni);
}

.nav-item.is-active .seal {
  border-color: var(--shu);
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .3), transparent 58%),
    var(--shu);
  color: #fff;
  box-shadow: 0 8px 16px -10px rgba(179, 77, 102, .9);
}

.nav-item.is-active .seal::after {
  border-color: rgba(255, 253, 249, .75);
}

.nav-item.is-pending {
  opacity: .55;
  pointer-events: none;
}

.nav-item.is-pending .seal {
  border-style: dashed;
}

.nav-item.is-sortable .nav-link {
  padding-right: 36px;
}

.nav-item.is-dragging {
  opacity: .45;
}

.nav-more {
  position: absolute;
  right: 5px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border-radius: 50%;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity var(--dur-fast) ease, color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}

.nav-item:hover .nav-more,
.nav-item:focus-within .nav-more,
.nav-more[aria-expanded="true"] {
  opacity: 1;
}

.nav-more:hover,
.nav-more[aria-expanded="true"] {
  color: var(--beni);
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 4px 10px -6px rgba(120, 78, 96, .5);
}

@media (hover: none) {
  .nav-more {
    opacity: .8;
  }
}

.nav-drop {
  position: absolute;
  left: 6px;
  right: 6px;
  top: -1px;
  height: 2px;
  background: var(--shu-bright);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(232, 142, 160, .8);
  pointer-events: none;
}

/* the "+" strip, a slip of paper waiting for a name */
.nav-new {
  margin-top: 14px;
  padding: 0 2px;
  list-style: none;
}

.tanzaku {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 7px 14px 7px 11px;
  border: 1px dashed rgba(201, 120, 143, .6);
  border-radius: 12px;
  background: rgba(255, 253, 249, .66);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-align: left;
  box-shadow: 0 8px 18px -14px rgba(120, 78, 96, .5);
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, box-shadow var(--dur-mid) ease;
}

.tanzaku:hover {
  color: var(--beni);
  background: #fff;
  border-color: var(--shu);
  box-shadow: 0 12px 22px -14px rgba(120, 78, 96, .6);
}

.tanzaku__plus {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rose-wash);
  color: var(--shu);
}

.tanzaku--editing {
  cursor: text;
  border-style: solid;
  border-color: var(--shu-bright);
  background: #fff;
  box-shadow: var(--ring), 0 8px 18px -14px rgba(120, 78, 96, .5);
}

.tanzaku__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--paper-edge);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: .04em;
}

.tanzaku__input:focus,
.tanzaku__input:focus-visible {
  outline: none;
  border-bottom-color: var(--shu);
}

.nav-new__hint {
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: .76rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- fold button: a small seal with one brushed stroke ---------- */

.sidebar__toggle {
  position: absolute;
  z-index: 1;
  top: 14px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--rose-line);
  border-radius: 7px 5px 8px 6px / 6px 8px 5px 7px;
  background: rgba(255, 253, 249, .5);
  color: var(--shu);
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-mid) var(--ease-fold);
}

.sidebar__toggle::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(212, 104, 124, .34);
  border-radius: 4px 3px 5px 3px / 3px 5px 3px 4px;
  pointer-events: none;
  transition: border-color var(--dur-fast) ease;
}

.sidebar__toggle:hover,
.sidebar__toggle:focus-visible {
  background: var(--shu);
  border-color: var(--shu);
  color: #fff;
}

.sidebar__toggle:hover::after,
.sidebar__toggle:focus-visible::after {
  border-color: rgba(255, 253, 249, .7);
}

.sidebar__toggle .icon svg {
  width: 16px;
  height: 16px;
}

/* ---------- foot ---------- */

.sidebar__foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 14px 14px 20px;
}

.sidebar__foot .seal-btn {
  align-self: center;
  width: 44px;
  height: 44px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  font-size: 1.3rem;
  transform: rotate(-3deg);
  box-shadow: inset 0 0 0 2px var(--shu), inset 0 0 0 3.2px rgba(255, 253, 249, .8), 0 0 0 4px rgba(255, 253, 249, .5), 0 12px 20px -12px rgba(179, 77, 102, .9);
  -webkit-mask: none;
  mask: none;
  transition: transform var(--dur-mid) var(--ease-stamp), background-color var(--dur-fast) ease, box-shadow var(--dur-mid) ease;
}

.sidebar__foot .seal-btn:hover,
.sidebar__foot .seal-btn:focus-visible {
  transform: rotate(0deg) scale(1.06);
  background-color: var(--shu-bright);
  box-shadow: inset 0 0 0 2px var(--shu-bright), inset 0 0 0 3.2px rgba(255, 253, 249, .9), 0 0 0 4px rgba(255, 253, 249, .7), 0 14px 24px -12px rgba(179, 77, 102, .9);
}

.foot-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-align: left;
  transition: color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}

.foot-btn .icon {
  color: var(--shu);
}

.foot-btn:hover {
  color: var(--beni);
  background: rgba(255, 253, 249, .62);
}

/* ---------- mobile menu button + scrim ---------- */

.menu-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: calc(var(--z-sidebar) - 2);
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px 8px 11px 9px / 9px 11px 8px 10px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .3), transparent 58%),
    var(--shu);
  color: #fff;
  box-shadow: inset 0 0 0 2px var(--shu), inset 0 0 0 3.2px rgba(255, 253, 249, .78), 0 0 0 3px rgba(255, 253, 249, .6), 0 12px 22px -12px rgba(179, 77, 102, .9);
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-sidebar) - 1);
  background: var(--scrim);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* ---------- collapsed rail (desktop only) ---------- */

@media (min-width: 861px) {
  html.sb-collapsed {
    --sb-w: var(--rail-w);
  }

  .sb-collapsed .sidebar__head {
    padding: 58px 0 18px;
  }

  .sb-collapsed .sidebar__head::after {
    left: 14px;
    right: 14px;
  }

  .sb-collapsed .brand__crest {
    width: 42px;
    height: 42px;
  }

  .sb-collapsed .brand__text,
  .sb-collapsed .nav-link__title,
  .sb-collapsed .nav-more,
  .sb-collapsed .tanzaku__label,
  .sb-collapsed .nav-new__hint,
  .sb-collapsed .foot-btn__label,
  .sb-collapsed .charm,
  .sb-collapsed .sb-fuji {
    display: none;
  }

  .sb-collapsed .sidebar__toggle {
    right: 50%;
    margin-right: -14px;
    transform: rotate(180deg);
  }

  .sb-collapsed .sidebar__nav {
    padding-inline: 0;
    scrollbar-width: none;
  }

  .sb-collapsed .sidebar__nav::-webkit-scrollbar {
    display: none;
  }

  .sb-collapsed .nav-item::before {
    left: 6px;
  }

  .sb-collapsed .nav-link::after {
    display: none;
  }

  .sb-collapsed .nav-link,
  .sb-collapsed .nav-item.is-sortable .nav-link {
    justify-content: center;
    margin-inline: 8px;
    padding: 8px 0;
  }

  .sb-collapsed .nav-link:hover .seal {
    transform: rotate(var(--tilt, 0deg)) scale(1.06);
  }

  .sb-collapsed .nav-new {
    padding: 0;
    display: grid;
    justify-content: center;
  }

  .sb-collapsed .tanzaku {
    width: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .sb-collapsed .tanzaku__plus {
    background: none;
  }

  .sb-collapsed .sidebar__foot {
    align-items: center;
    padding-inline: 0;
  }

  .sb-collapsed .foot-btn {
    padding: 9px;
  }
}

/* ---------- drawer (narrow screens) ---------- */

@media (max-width: 860px) {
  :root {
    --sb-w: 0px;
  }

  .main {
    margin-left: 0;
  }

  .menu-btn {
    display: grid;
  }

  .sidebar {
    width: min(86vw, 320px);
    transform: translateX(-102%);
    visibility: hidden;
    box-shadow: inset -2px 0 0 rgba(255, 253, 249, .65), 30px 0 70px -30px rgba(120, 78, 96, .6);
    transition: transform var(--dur-mid) var(--ease-fold), visibility 0s linear var(--dur-mid);
  }

  .nav-open .sidebar {
    transform: none;
    visibility: visible;
    transition: transform var(--dur-mid) var(--ease-fold), visibility 0s;
  }

  .sidebar__toggle {
    display: none;
  }

  .sb-fuji {
    right: 22px;
  }

  .nav-more {
    opacity: .8;
  }
}

@media (min-width: 861px) {
  .scrim {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .main,
  .sidebar,
  .sidebar__toggle,
  .nav-item::before,
  .nav-link__title,
  .seal,
  .seal-btn,
  .brand__crest,
  .btn,
  .skip-link {
    transition: none !important;
  }

  .sb-mist {
    animation: none;
  }

  .sidebar:has(.brand:hover) .charm .charm-bell,
  .sidebar:has(.brand:hover) .charm .charm-tassel,
  .sidebar:has(.brand:focus-visible) .charm .charm-bell,
  .sidebar:has(.brand:focus-visible) .charm .charm-tassel {
    animation: none;
  }
}
