/* Shared by every Clan Info page.
   The page is the scroll from the logo: indigo behind it, parchment paper
   with the logo's outline, and a rolled end at the top and bottom. The
   bottom roll rides the foot of the window, so scrolling unrolls the page.
   Every colour is sampled from the logo. */

:root {
  --indigo: #1E133E;
  --indigo-deep: #120A29;
  --indigo-lift: #2B2050;

  --paper: #F0EECC;
  --paper-hi: #FDFBE6;
  --paper-shade: #E3E1BE;
  --outline: #CDC88F;
  --curl-face: #B7B48B;
  --curl-line: #807C4E;
  --rule: #DAD7AF;

  --ink: var(--indigo);
  --ink-soft: #554C6D;
  --olive-ink: #66623A;
  --on-indigo: #F0EECC;
  --on-indigo-soft: #B5AFC2;
  --rule-on-indigo: #40365D;

  --display: "Lilita One", "Nunito", system-ui, sans-serif;
  --text: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;

  --bar: 60px;
  --roll: 60px;       /* thickness of a full roll */
  --roll-thin: 38px;  /* the bottom roll once everything is unrolled */
  --over: 16px;       /* how far a roll sticks out past the paper */
  --pad: 56px;        /* paper's side padding */
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 20px); scroll-padding-bottom: var(--roll); }
body {
  margin: 0;
  background: var(--indigo);
  color: var(--ink);
  font: 400 17px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; }
p, li, dd { text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--outline); transition: text-decoration-color .15s; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--outline); outline-offset: 3px; border-radius: 4px; }
code { font-family: var(--mono); font-size: .88em; font-weight: 600; white-space: nowrap; }
::selection { background: var(--indigo); color: var(--on-indigo); }

.wrap { max-width: 1252px; margin: 0 auto; padding: 0 calc(var(--roll) * .3 + 6px + var(--over) + 3px + var(--pad)); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 64px; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 10; background: var(--indigo); color: var(--on-indigo); }
.bar .wrap { display: flex; align-items: center; height: var(--bar); gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; font: 400 1.4rem/1 var(--display); letter-spacing: .01em; text-decoration: none; }
.brand img { width: 36px; height: 36px; transition: transform .35s var(--ease); }
.brand:hover img { transform: rotate(-10deg); }
.bar ul { display: flex; gap: 28px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.bar ul a {
  font-size: .98rem; font-weight: 700; color: var(--on-indigo-soft); text-decoration: none; padding: 4px 0;
  background: linear-gradient(var(--outline), var(--outline)) 0 100% / 0 2px no-repeat;
  transition: color .15s, background-size .25s var(--ease);
}
.bar ul a:hover, .bar ul a[aria-current] { color: var(--on-indigo); background-size: 100% 2px; }

/* ---------- buttons: parchment with the logo's outline and a lip to press ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 22px; border-radius: 12px; border: 3px solid var(--outline);
  font: 800 1.02rem/1.2 var(--text); text-decoration: none;
  background: var(--on-indigo); color: var(--indigo);
  box-shadow: 0 4px 0 var(--curl-line);
  transition: transform .09s ease-out, box-shadow .09s ease-out, background-color .15s;
}
.btn:hover { background: var(--paper-hi); transform: translateY(-1px); box-shadow: 0 5px 0 var(--curl-line); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--curl-line); }
.btn svg { flex: none; }
.btn-sm { padding: 6px 14px; font-size: .92rem; border-radius: 10px; border-width: 2px; box-shadow: 0 3px 0 var(--curl-line); }
.btn-sm:hover { box-shadow: 0 4px 0 var(--curl-line); }
.btn-sm:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--curl-line); }

.cmdname { font: 600 .92rem/1.4 var(--mono); color: var(--olive-ink); }

/* ---------- the scroll ---------- */
.scroll { position: relative; max-width: 1252px; margin: 0 auto; padding: 4px calc(var(--roll) * .3 + 6px); overflow: clip; }
.paper {
  margin: 0 var(--over);
  /* its edge lines are as heavy as the logo draws them beside the rolls */
  border: solid; border-width: 0 calc((var(--roll) + 6px) * .052); border-color: var(--outline) var(--outline) var(--outline) var(--curl-line);
  /* lit from the right, as in the logo */
  background: linear-gradient(90deg, var(--paper) 68%, #F9F8DF);
  padding: calc(var(--roll) / 2 + 1px) var(--pad) calc(var(--roll) + 8px);
}

.roll { position: relative; z-index: 2; height: var(--roll); --h: var(--roll); --th: calc(var(--h) + 6px); pointer-events: none; }
/* Each roll is cut straight out of the logo, together with what the logo
   draws on the paper beside it: the paper's edge lines and the roll's shade.
   Its two ends keep their shape, and the straight stretch between them is
   drawn out to the width of the paper. */
.tube { position: absolute; border: solid transparent; }
.roll-top .tube {
  top: calc(-3px - var(--th) * .0106); height: calc(var(--th) * 1.4255);
  left: calc(var(--over) - var(--th) * .0728); right: calc(var(--over) - var(--th) * .5435);
  border-width: 0 calc(var(--th) * .7064) 0 calc(var(--th) * 1.1064);
  border-image: url("roll-top.webp") 0 332 0 520 fill stretch;
}
.roll-bottom .tube {
  bottom: calc(-3px - var(--th) * .0156); height: calc(var(--th) * 1.4107);
  left: calc(var(--over) - var(--th) * .0739); right: calc(var(--over) - var(--th) * .4013);
  border-width: 0 calc(var(--th) * .6473) 0 calc(var(--th) * 1.067);
  border-image: url("roll-bottom.webp") 0 290 0 478 fill stretch;
  /* what it draws on the paper above it fades in below what the top roll draws */
  --cut: clamp(0px, calc(var(--th) * .2751 + (var(--roll) + 6px) * .2447 - var(--gap, 100vh)), calc(var(--th) * .2751));
  -webkit-mask-image: linear-gradient(180deg, transparent var(--cut), #000 calc(var(--cut) + var(--th) * .12));
  mask-image: linear-gradient(180deg, transparent var(--cut), #000 calc(var(--cut) + var(--th) * .12));
}

.roll-top { margin-bottom: calc(var(--roll) / -2); }
.roll-bottom {
  position: sticky; bottom: 4px; margin-top: calc(-1 * var(--roll) + var(--roll-thin) / 2);
  --h: calc(var(--roll) - (var(--roll) - var(--roll-thin)) * var(--p, 0));
}
/* behind the bottom roll and below it nothing has been unrolled yet, wherever the window ends */
.roll-bottom::before { content: ""; position: absolute; left: -50vw; right: -50vw; top: calc(100% + 3px - var(--th) * .8371); height: 300vh; background: var(--indigo); }

/* ---------- footer ---------- */
.foot { color: var(--on-indigo-soft); font-size: .94rem; }
.foot .wrap { padding-top: 34px; padding-bottom: 48px; }
.foot .inner { border-top: 1px solid var(--rule-on-indigo); padding-top: 30px; display: grid; gap: 14px; }
.foot .links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.foot .links a { color: var(--on-indigo); text-decoration: none; font-weight: 700; }
.foot .links a:hover { text-decoration: underline; text-decoration-color: var(--outline); }
.foot p { max-width: 78ch; }
.foot p a { text-decoration-color: var(--rule-on-indigo); }

@media (max-width: 900px) {
  :root { --roll: 50px; --roll-thin: 34px; --over: 10px; --pad: 30px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .bar ul { display: none; }
  .bar .wrap { justify-content: space-between; }
}
@media (max-width: 560px) {
  :root { --roll: 44px; --roll-thin: 30px; --over: 6px; --pad: 17px; }
  .scroll { padding: 4px calc(var(--roll) * .3 + 9px); }
  .wrap { padding: 0 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
