:root {
  --floor: #1a1410;
  --thread: #e24b4b;
  --cloth: #f0e6d8;
  --mute: #b7a898;
  --display: "Noto Sans SC", "PingFang SC", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 64px; }
body { margin: 0; color: var(--cloth); background: var(--floor); font-family: var(--display); font-size: 16px; line-height: 1.65; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.app-link { color: var(--thread); text-decoration: underline; text-underline-offset: 3px; }
button { font-family: inherit; cursor: pointer; }
code { font-family: var(--mono); background: #2a221c; padding: 0.05em 0.35em; }
.twill { pointer-events: none; position: fixed; inset: 0; z-index: 6; opacity: 0.12; background-image: url("images/texture.webp"); background-size: 280px auto; mix-blend-mode: overlay; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; z-index: 80; background: var(--thread); color: #fff; padding: 8px; }
.thread-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; min-height: 58px; background: #120e0b; border-bottom: 3px solid var(--thread); }
.brand { font-weight: 700; }
.brand small { display: block; font-family: var(--mono); font-size: 10px; color: var(--thread); letter-spacing: 0.14em; }
.sew-links { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 14px; }
.sew-links a.is-active { color: var(--thread); }
.sew-links .live { background: var(--thread); color: #fff; padding: 6px 12px; font-weight: 700; }
.nav-toggle { display: none; background: transparent; color: var(--thread); border: 1px solid var(--thread); padding: 6px 12px; }
.hero { position: relative; }
.hero > img { width: 100%; height: 80vh; object-fit: cover; }
.bobbin { position: absolute; right: 6vw; bottom: 28px; max-width: 560px; background: rgba(26, 20, 16, 0.88); padding: 28px; }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; color: var(--thread); margin: 0 0 8px; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.15; }
h1 { font-size: clamp(32px, 5.5vw, 52px); }
h1 em { font-style: normal; color: var(--thread); }
h2 { font-size: clamp(24px, 3.2vw, 36px); }
.quiet { color: var(--mute); }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn { display: inline-block; padding: 10px 16px; border: 1px solid var(--thread); font-weight: 700; }
.btn.fill { background: var(--thread); color: #fff; }
.btn.ghost { background: transparent; }
.wrap { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0; }
.floor { background: #221a14; }
.three, .four, .io { display: grid; gap: 16px; }
.three { grid-template-columns: repeat(3, 1fr); }
.four { grid-template-columns: repeat(4, 1fr); }
.three article, .four article, .io > div { background: #2a221c; border: 1px solid #3a3028; padding: 18px; }
.three .warn { border-color: var(--thread); }
ul { margin: 0; padding-left: 1.1em; }
li + li { margin-top: 6px; }
.spi { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; list-style: none; padding: 0; margin: 0 0 36px; }
.spi li { padding: 12px 8px; background: #2a221c; border-top: 3px dashed var(--thread); font-size: 14px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; margin-bottom: 40px; }
.pair.flip figure { order: -1; }
.num { font-family: var(--mono); color: var(--thread); font-size: 12px; }
figure { margin: 0; }
figcaption { color: var(--mute); font-size: 13px; margin-top: 8px; }
.qc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.qc button { background: #2a221c; color: var(--cloth); border: 1px solid #3a3028; padding: 8px 12px; }
.qc button.on { border-color: var(--thread); color: var(--thread); }
.bound { padding-left: 1.2em; }
.io { grid-template-columns: 1fr 1fr; }
footer { padding: 24px 20px 40px; border-top: 3px solid var(--thread); color: var(--mute); font-size: 14px; }
@media (max-width: 900px) {
  .nav-toggle { display: inline-block; }
  .sew-links { display: none; position: absolute; top: 58px; left: 0; right: 0; background: #120e0b; padding: 12px 18px; flex-direction: column; align-items: flex-start; }
  .sew-links.open { display: flex; }
  .hero > img { height: 48vh; }
  .bobbin { position: relative; right: auto; bottom: auto; max-width: none; }
  .three, .four, .pair, .pair.flip, .io, .spi { grid-template-columns: 1fr; }
  .pair.flip figure { order: 0; }
}
