/* Orderette · the selvage: the strip of index tabs across the top of every page. It brings its own faces and colours
   and every rule is scoped under .selvage, so it reads the same over the envelope pages and the site.css pages.
   Manila tabs stand on one ink baseline; the page's own tab is paper-light, opens through the baseline, and carries
   the short red rule the hang tag draws under its number. */
@font-face { font-family: 'Patua One'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/PatuaOne.woff2) format('woff2'); }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(fonts/Archivo-variable.woff2) format('woff2'); }

.selvage {
  --sv-paper: #f2e5cb;
  --sv-kraft: #ebd7b8;
  --sv-tab: #e0c59d;
  --sv-ink: #2a2925;
  --sv-ink-soft: #514f45;
  --sv-red: #c44737;
  --sv-red-press: #a93a2c;
  --sv-line: 1.5px;
  --sv-pad: max(16px, min(3.6vw, 56px));
  position: relative;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: clamp(18px, 2.4vw, 36px);
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 10px max(var(--sv-pad), env(safe-area-inset-right)) 0 max(var(--sv-pad), env(safe-area-inset-left));
  background: var(--sv-kraft);
  border-bottom: var(--sv-line) solid var(--sv-ink);
  color: var(--sv-ink);
  font: 600 13px/1 'Archivo', 'Arial Narrow', sans-serif;
  font-stretch: 80%;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}
.selvage *, .selvage *::before, .selvage *::after { box-sizing: border-box; }
.selvage a { color: inherit; text-decoration: none; }
.selvage a:focus-visible { outline: 2px dashed var(--sv-red); outline-offset: 3px; }

/* keyboard users can step past the tabs straight to the page */
.selvage a.selvage-skip { position: absolute; left: var(--sv-pad); top: 8px; z-index: 2; padding: 10px 14px; border-radius: 6px; background: var(--sv-ink); color: var(--sv-paper); transform: translateY(-160%); }
.selvage a.selvage-skip:focus-visible { transform: none; }

.selvage-mark { align-self: center; margin: 0 0 6px; font: 400 25px/1 'Patua One', 'Rockwell', serif; letter-spacing: -0.02em; white-space: nowrap; transition: color 160ms ease-out; }
.selvage-mark:hover { color: var(--sv-red); }

/* the tabs stand on the strip's baseline: the row sits over it by the width of the line */
.selvage-tabs { position: relative; display: flex; align-items: flex-end; gap: 3px; margin: 0 0 calc(-1 * var(--sv-line)); padding: 0; }
.selvage-tabs a { position: relative; display: inline-flex; align-items: center; height: 38px; padding: 0 15px 1px; border: var(--sv-line) solid var(--sv-ink); border-radius: 7px 7px 0 0; background: var(--sv-tab); color: var(--sv-ink-soft); white-space: nowrap; transition: background-color 160ms ease-out, color 160ms ease-out; }
.selvage-tabs a:hover { background: var(--sv-paper); color: var(--sv-ink); }
.selvage-tabs a[aria-current="page"] { height: 43px; padding-bottom: 4px; background: var(--sv-paper); border-bottom-color: var(--sv-paper); color: var(--sv-ink); }
.selvage-tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 15px; right: calc(15px + 0.16em); bottom: 9px; height: 2px; border-radius: 1px; background: var(--sv-red); }
/* the focus ring is drawn inside the tab, so the scrolling row on narrow screens can never clip it */
.selvage-tabs a:focus-visible { outline-offset: -5px; }

.selvage-account { display: flex; align-items: center; gap: 20px; align-self: center; margin: 0 0 6px auto; }
.selvage-login { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; transition: color 160ms ease-out; }
.selvage-login svg { width: 26px; height: 13px; flex: none; transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1); }
/* small red type on kraft is too faint to read, so the login link stays ink and takes a red underline instead */
.selvage-login:hover, .selvage-login[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--sv-red); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.selvage-login:hover svg { transform: translateX(3px); }
/* the primary action is the world's red cut piece with its stitch sewn inside */
.selvage a.selvage-cta { position: relative; display: inline-block; height: 36px; padding: 0 17px; line-height: 36px; border-radius: 6px; background: var(--sv-red); color: #fff; letter-spacing: 0.14em; white-space: nowrap; transition: background-color 160ms ease-out; }
.selvage-cta::before { content: ""; position: absolute; inset: 4px; border: 1.25px dashed rgba(255, 255, 255, 0.82); border-radius: 3px; pointer-events: none; }
.selvage a.selvage-cta:hover { background: var(--sv-red-press); }

/* narrower screens (the one-line strip needs about 1185px): the mark and the account links share the top line, the tabs get the whole second line and
   scroll sideways when they run out of room; tabs.js brings the page's own tab into view and feathers the edge
   that has more tabs past it */
@media (max-width: 1199px) {
  .selvage { row-gap: 8px; padding-top: 12px; }
  .selvage-mark { order: 1; margin: 0; }
  .selvage-account { order: 2; margin: 0 0 0 auto; }
  .selvage-tabs { order: 3; flex: 1 0 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
  .selvage-tabs::-webkit-scrollbar { display: none; }
  .selvage-tabs a { flex: none; }
  .selvage-tabs.more-right { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
  .selvage-tabs.more-left { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px); mask-image: linear-gradient(90deg, transparent, #000 36px); }
  .selvage-tabs.more-left.more-right { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
}
@media (max-width: 560px) {
  .selvage { font-size: 12px; letter-spacing: 0.12em; }
  .selvage-mark { font-size: 22px; }
  .selvage-account { gap: 14px; }
  .selvage-login svg { display: none; }
  .selvage a.selvage-cta { height: 34px; padding: 0 13px; line-height: 34px; letter-spacing: 0.1em; }
  .selvage-cta span { display: none; }
  .selvage-tabs a { height: 36px; padding: 0 12px 1px; }
  .selvage-tabs a[aria-current="page"] { height: 41px; }
  .selvage-tabs a[aria-current="page"]::after { left: 12px; right: calc(12px + 0.12em); }
}
@media (max-width: 359px) { .selvage { letter-spacing: 0.08em; } .selvage-account { gap: 10px; } .selvage a.selvage-cta { padding: 0 10px; } }

/* the sign-in pages centre their panel in the window; under the strip they keep the panel near the top instead */
.selvage + main.auth { min-height: 0; padding-block: clamp(28px, 7vh, 72px); place-items: start center; }

@media (prefers-reduced-motion: reduce) {
  .selvage *, .selvage *::before { transition: none !important; }
  .selvage-login:hover svg { transform: none; }
}
