/* ==========================================================================
   Clamber Knots — cordwork.css
   Sand and deep brown, square corners, double rules, no shadows.
   Everything is laid out as ruled columns of text, the way a knot notebook
   would be: no cards, no boxes, no floating panels.
   ========================================================================== */

:root {
  --cord-raw: #e7dcc9;      /* sand ground */
  --cord-dye: #c97a4f;      /* terracotta accent */
  --knot-gap: 26px;         /* the one spacing unit everything is built from */
  --bight-ink: #4a3a2c;     /* deep brown text */
  --bight-pale: #faf7f1;    /* off white, used only for input fields and code */
  --bight-faint: #a8927a;   /* faded brown for meta text */
  --rule: #4a3a2c;
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--cord-raw);
  color: var(--bight-ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.62;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--bight-ink); text-decoration: underline; text-decoration-color: var(--cord-dye); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--cord-dye); text-decoration-color: var(--cord-dye); }
a:focus-visible { outline: 2px solid var(--cord-dye); outline-offset: 2px; }

h1, h2, h3, .mono { font-family: var(--mono); font-weight: 700; letter-spacing: -0.01em; }

h1 { font-size: clamp(26px, 4.2vw, 44px); line-height: 1.14; margin: 0 0 14px; }
h2 { font-size: clamp(19px, 2.4vw, 25px); line-height: 1.2; margin: 0 0 10px; }
h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.14em; margin: 0 0 8px; color: var(--cord-dye); }

p { margin: 0 0 12px; }
ul, ol { margin: 0 0 12px; padding-left: 20px; }
li { margin-bottom: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------- the tongue  */
/* language switch, pinned top left so it never moves between screens        */

.tongue-swap {
  position: fixed; top: 0; left: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px 10px 12px;
  background: var(--cord-raw);
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
}
.tongue-swap a { text-decoration: none; }
.tongue-swap a[aria-current="true"] { color: var(--cord-dye); text-decoration: underline; text-decoration-thickness: 2px; }
.tongue-swap__seam { color: var(--bight-faint); }

/* ------------------------------------------------------------- the rail    */
/* right hand dot rail: one dot per screen or per stage                      */

.cord-rail {
  position: fixed; top: 0; right: 0; z-index: 40;
  height: 100%; width: 46px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 14px;
  border-left: 1px solid var(--rule);
  background: var(--cord-raw);
}
.cord-rail__dot {
  display: block; width: 10px; height: 10px; padding: 0;
  background: transparent; border: 2px solid var(--rule);
  cursor: pointer; position: relative;
}
.cord-rail__dot[aria-current="true"] { background: var(--cord-dye); border-color: var(--cord-dye); }
.cord-rail__dot:hover { border-color: var(--cord-dye); }
.cord-rail__tag {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-family: var(--mono); font-size: 11px;
  background: var(--cord-raw); border: 1px solid var(--rule); padding: 2px 7px;
  opacity: 0; pointer-events: none; transition: opacity 120ms linear;
}
.cord-rail__dot:hover .cord-rail__tag, .cord-rail__dot:focus-visible .cord-rail__tag { opacity: 1; }

/* ------------------------------------------------------------- the deck    */
/* homepage: three snap screens, text only, no picture wall                  */

.strand-deck {
  height: 100vh; overflow-y: scroll; scroll-snap-type: y mandatory;
  padding-right: 46px;
}
.strand {
  min-height: 100vh; scroll-snap-align: start;
  display: flex; flex-direction: column; justify-content: center;
  padding: 64px clamp(24px, 7vw, 96px) 64px clamp(24px, 7vw, 96px);
  border-bottom: 3px double var(--rule);
}
.strand__slate { display: flex; align-items: baseline; gap: 18px; margin-bottom: 18px; }
.strand__brand {
  font-family: var(--mono); font-size: clamp(13px, 1.5vw, 16px); font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  margin: 0 0 10px; padding-bottom: 8px; border-bottom: 3px double var(--rule);
  max-width: 78ch;
}
.strand__brand span { font-weight: 400; letter-spacing: 0.04em; text-transform: none; color: var(--bight-faint); }
.strand__ord { font-family: var(--mono); font-size: 13px; color: var(--cord-dye); letter-spacing: 0.2em; }
.strand__mark { display: block; width: min(148px, 30vw); height: auto; }
.strand__lede { max-width: 62ch; font-size: 18px; }
.strand__lines { list-style: none; padding: 0; margin: 22px 0 0; max-width: 78ch; border-top: 1px solid var(--rule); }
.strand__lines li {
  border-bottom: 1px solid var(--rule);
  padding: 11px 4px; margin: 0;
  display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: baseline;
}
.strand__lines .ord { font-family: var(--mono); font-size: 12px; color: var(--cord-dye); letter-spacing: 0.1em; }
.strand__lines .what { font-family: var(--mono); font-size: 15px; }
.strand__lines .aside { display: block; font-family: var(--body); font-size: 14.5px; color: var(--bight-faint); }
.strand__foot { margin-top: 26px; font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.06em; }

.scroll-hint { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; color: var(--bight-faint); letter-spacing: 0.14em; z-index: 30; }

/* ------------------------------------------------------------- plain pages */

.sheet { max-width: 78ch; padding: 84px clamp(24px, 7vw, 96px) 64px; }
.sheet--wide { max-width: 104ch; }
.sheet__kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.2em; color: var(--cord-dye); text-transform: uppercase; }
.sheet__lede { font-size: 18px; max-width: 66ch; }

.seam { width: 72px; height: 0; border-top: 3px solid var(--cord-dye); margin: 30px 0 26px; }
.seam--double { border-top: 3px double var(--rule); width: 100%; margin: 22px 0; }

/* ------------------------------------------------------------- the roster  */
/* index pages: ruled rows, deliberately not cards                           */

.roster { list-style: none; padding: 0; margin: 26px 0 0; border-top: 3px double var(--rule); }
.roster__row { border-bottom: 1px solid var(--rule); padding: 16px 4px; display: grid; grid-template-columns: 46px 1fr 118px; gap: 16px; align-items: start; }
.roster__no { font-family: var(--mono); font-size: 13px; color: var(--cord-dye); }
.roster__link { font-family: var(--mono); font-size: 17px; text-decoration: none; }
.roster__link:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.roster__meta { font-family: var(--mono); font-size: 11.5px; color: var(--bight-faint); letter-spacing: 0.05em; display: block; margin-top: 5px; }
.roster__said { margin: 8px 0 0; font-size: 15px; color: var(--bight-ink); max-width: 62ch; }
.roster__thumb { width: 100%; height: auto; border: 1px solid var(--rule); display: block; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; font-family: var(--mono); font-size: 12.5px; }
.filters a { border: 1px solid var(--rule); padding: 3px 10px; text-decoration: none; }
.filters a[aria-current="true"] { background: var(--cord-dye); border-color: var(--cord-dye); color: var(--bight-pale); }

/* ------------------------------------------------------------- the stage   */
/* detail pages: one full screen per stage, count on the left in big mono    */

.stage {
  min-height: 92vh; display: flex; flex-direction: column; justify-content: center;
  padding: 76px clamp(24px, 7vw, 96px) 56px 0; margin-right: 46px;
  border-bottom: 1px solid var(--rule);
}
.stage__grid { display: grid; grid-template-columns: minmax(96px, 15vw) minmax(0, 78ch); gap: clamp(16px, 3vw, 42px); align-items: start; width: 100%; }
.stage__count { font-family: var(--mono); font-weight: 700; font-size: clamp(56px, 11vw, 132px); line-height: 0.86; color: var(--cord-dye); letter-spacing: -0.04em; }
.stage__count small { display: block; font-size: 11px; color: var(--bight-faint); letter-spacing: 0.16em; margin-top: 12px; }
.stage__dash { width: 56px; border-top: 2px solid var(--rule); margin-bottom: 14px; }
.stage__body { max-width: 78ch; }
.stage__body p { font-size: 17.5px; }
.stage__note { color: var(--bight-faint); font-size: 15.5px; }

.record-head { padding: 84px clamp(24px, 7vw, 96px) 30px; margin-right: 46px; }
.record-head__stamp { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--bight-faint); }
/* the byline sits inside the stamp but is set in ink, so the desk that wrote
   the entry reads as part of the record rather than as a stray string */
.record-head__byline { color: var(--bight-ink); }
.record-head__pile { display: flex; flex-wrap: wrap; gap: 0; list-style: none; padding: 0; margin: 22px 0 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.record-head__pile li { font-family: var(--mono); font-size: 12.5px; padding: 8px 16px 8px 0; margin: 0; }
.record-head__pile li + li { border-left: 1px solid var(--rule); padding-left: 16px; }
.figure { margin: 26px 0 0; }
.figure img { display: block; width: 100%; max-width: 620px; height: auto; border: 1px solid var(--rule); }
.figure figcaption { font-family: var(--mono); font-size: 11.5px; color: var(--bight-faint); margin-top: 8px; max-width: 62ch; }

.cut-table { width: 100%; max-width: 640px; border-collapse: collapse; font-family: var(--mono); font-size: 14px; }
.cut-table caption { text-align: left; font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--cord-dye); padding-bottom: 8px; }
.cut-table th, .cut-table td { text-align: left; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--rule); }
.cut-table th { font-size: 12px; letter-spacing: 0.1em; color: var(--bight-faint); border-bottom: 3px double var(--rule); }
.cut-table td.num { text-align: right; padding-right: 18px; }

.tally { list-style: none; padding: 0; margin: 0; }
.tally li { padding-left: 24px; position: relative; margin-bottom: 9px; }
.tally li::before { content: "—"; position: absolute; left: 0; color: var(--cord-dye); font-family: var(--mono); }
.warn { border-left: 3px double var(--cord-dye); padding-left: 16px; }
.warn li::before { content: "!"; font-weight: 700; }

.rope-link { font-family: var(--mono); font-size: 13px; letter-spacing: 0.03em; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin: 30px 0 0; font-family: var(--mono); font-size: 13px; }

/* ------------------------------------------------------------- the footer  */

.whipping { border-top: 3px double var(--rule); padding: 26px clamp(24px, 7vw, 96px) 60px; margin-right: 46px; }
.whipping__cols { display: flex; flex-wrap: wrap; gap: 8px 34px; font-family: var(--mono); font-size: 12.5px; }
.whipping__note { max-width: 70ch; font-size: 14px; color: var(--bight-faint); margin-top: 16px; }
.whipping__note a { color: var(--bight-faint); }
/* the editorial line is legal copy, so it is set in ink rather than faded */
.whipping__note--editorial { color: var(--bight-ink); }

/* ------------------------------------------------------------- misc        */

.notfound { padding: 96px clamp(24px, 7vw, 96px); max-width: 62ch; }

@media (max-width: 720px) {
  .stage__grid { grid-template-columns: 1fr; gap: 8px; }
  .stage__count { font-size: 64px; }
  .roster__row { grid-template-columns: 34px 1fr; }
  .roster__thumb { grid-column: 1 / -1; max-width: 260px; }
  .cord-rail { width: 34px; }
  .strand-deck, .record-head, .stage, .whipping { padding-right: 34px; margin-right: 34px; }
  .strand-deck { padding-right: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .strand-deck { scroll-snap-type: none; scroll-behavior: auto; }
  html { scroll-behavior: auto; }
}
