/* An editorial workbench made from paper, indigo cloth and a woven care label. */
:root {
  color-scheme: light;
  --page: #f0eee7; --paper: #faf8f0; --paper-raised: #fffdf6; --paper-shadow: #d8d4c7;
  --ink: #18231e; --ink-soft: #46564d; --ink-faint: #44534a; --line: #89928a; --line-soft: #c5c6b9; --control-line: #71786f;
  --accent: #713019; --accent-ink: #fffaf2; --accent-soft: #e7d1c0;
  --denim: #213a4b; --denim-light: #36596a; --denim-shadow: #132936;
  --label: #f1eee3; --label-ink: #202a27; --label-thread: #a0a094; --label-accent: #713019;
  --focus: #713019; --weave: rgba(31, 43, 37, .045);
  --shadow: 0 20px 50px rgba(35, 35, 27, .12), 0 3px 10px rgba(35, 35, 27, .08);
  --serif: "Baskervville", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Atkinson Hyperlegible Next", "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --page: #101a20; --paper: #17252d; --paper-raised: #1d2c34; --paper-shadow: #0d171d;
  --ink: #f5f1e7; --ink-soft: #d8dfd9; --ink-faint: #bdcbc5; --line: #83958f; --line-soft: #485e62; --control-line: #819298;
  --accent: #f3ad87; --accent-ink: #25150f; --accent-soft: #563c30;
  --denim: #4d6978; --denim-light: #688393; --denim-shadow: #0b141b;
  --label: #10191d; --label-ink: #fff9eb; --label-thread: #738186; --label-accent: #ffc097;
  --focus: #ffd0ae; --weave: rgba(240, 243, 231, .045);
  --shadow: 0 22px 52px rgba(0, 0, 0, .32), 0 3px 12px rgba(0, 0, 0, .22);
}
@media (prefers-color-scheme: dark) { html:not([data-theme]) { color-scheme: dark; } }
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(ellipse at 9% 0%, rgba(146,119,79,.07), transparent 38rem), var(--page); font-family: var(--sans); font-size: 1rem; line-height: 1.48; transition: color .2s ease, background-color .2s ease; }
button, input, select { font: inherit; } button { color: inherit; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: .18em; }
[hidden], svg[hidden] { display: none !important; }
.wrap { width: min(1320px, calc(100% - 64px)); margin: 0 auto; }
.topbar { min-height: 68px; padding-top: var(--browser-safe-top,env(safe-area-inset-top,0px)); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line-soft); }
.home { display: inline-flex; align-items: center; gap: 11px; min-height: 48px; color: var(--ink); font-size: .86rem; font-weight: 700; letter-spacing: .02em; text-decoration: none; }
.home-mark { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--accent); font-family: var(--serif); font-size: 1.15rem; }
.tools { display: flex; align-items: center; gap: 9px; }
.language, .theme { min-height: 44px; border: 1px solid var(--control-line); border-radius: 3px; background: var(--paper); color: var(--ink); }
.language { padding: 0 34px 0 12px; } .theme { padding: 0 13px; cursor: pointer; font-size: .88rem; font-weight: 650; }
.theme:hover, .language:hover { border-color: var(--line); background-color: var(--paper-raised); }
.intro { max-width: 840px; padding: clamp(27px, 4vw, 49px) 0 25px; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.intro h1 { max-width: 780px; margin: 0; font-family: var(--serif); font-size: clamp(2.4rem, 5vw, 4.3rem); font-weight: 500; letter-spacing: -.045em; line-height: .99; text-wrap: balance; }
.intro p:last-child { max-width: 620px; margin: 16px 0 0; color: var(--ink-soft); font-size: clamp(1rem, 1.4vw, 1.13rem); }
.workbench { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(400px, .92fr); align-items: stretch; gap: 22px; }
.instrument { min-width: 0; padding: 19px; border: 1px solid var(--line-soft); background: var(--paper); box-shadow: 0 10px 30px rgba(35,35,27,.055); }
.instrument-label, .result-kicker { margin: 0 0 12px; color: var(--ink-faint); font-family: var(--mono); font-size: .68rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.fabric { position: relative; min-height: 265px; display: grid; place-items: center; overflow: hidden; padding: 25px 22px; isolation: isolate; background-color: var(--denim); background-image: repeating-linear-gradient(2deg,transparent 0 3px,rgba(225,235,230,.035) 3px 4px), repeating-linear-gradient(92deg,transparent 0 5px,rgba(4,17,27,.12) 5px 6px), radial-gradient(ellipse at 50% 20%,var(--denim-light),transparent 70%); box-shadow: inset 0 3px 12px rgba(0,0,0,.18), inset 0 -2px 7px rgba(0,0,0,.15); }
.fabric::before, .fabric::after { position: absolute; z-index: -1; width: 24px; height: 24px; content: ""; border-color: rgba(233,234,216,.52); border-style: solid; }
.fabric::before { top: 12px; left: 12px; border-width: 1px 0 0 1px; } .fabric::after { right: 12px; bottom: 12px; border-width: 0 1px 1px 0; }
.satin { position: relative; width: min(100%,570px); min-height: 194px; padding: 17px 16px 15px; transform: rotate(-1.15deg); color: var(--label-ink); background-color: var(--label); background-image: repeating-linear-gradient(0deg,transparent 0 2px,var(--weave) 2px 3px), repeating-linear-gradient(90deg,transparent 0 5px,var(--weave) 5px 6px), linear-gradient(114deg,rgba(255,255,255,.18),transparent 37%,rgba(90,90,72,.055) 72%,transparent); box-shadow: 0 12px 24px rgba(0,0,0,.3), 0 2px 3px rgba(0,0,0,.24); }
.satin::before { position: absolute; inset: 6px; border: 1px dashed var(--label-thread); content: ""; pointer-events: none; }
.satin::after { position: absolute; top: 0; right: 0; width: 27px; height: 100%; background: linear-gradient(270deg,rgba(48,48,38,.12),transparent 78%); content: ""; pointer-events: none; }
.stitch { position: absolute; inset: 0; pointer-events: none; }
.symbols { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 3px; }
.marks { width: 100%; min-height: 70px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.marks svg { width: clamp(44px,5.4vw,72px); height: clamp(44px,5.4vw,72px); max-width: 100%; flex: 0 1 72px; }
.slot { position: relative; min-width: 0; min-height: 112px; display: grid; align-content: center; justify-items: center; gap: 2px; border: 1px solid transparent; border-radius: 2px; padding: 8px 2px; background: transparent; color: var(--label-ink); cursor: pointer; touch-action: manipulation; transition: background .18s ease,color .18s ease,transform .18s ease,border-color .18s ease; }
.slot:hover { background: color-mix(in srgb,var(--label-accent) 12%,transparent); } .slot[aria-pressed="true"] { border-color: color-mix(in srgb,var(--label-accent) 48%,transparent); background: color-mix(in srgb,var(--label-accent) 14%,transparent); box-shadow: inset 0 -2px var(--label-accent); }
.slot svg { overflow: visible; }
.slot small { color: var(--label-ink); font-size: .68rem; font-weight: 650; line-height: 1.2; text-align: center; }
.label-caption { position: relative; z-index: 1; margin: 5px 0 0; padding: 7px 2px 0; border-top: 1px solid color-mix(in srgb,var(--label-thread) 56%,transparent); color: var(--label-ink); font-family: var(--mono); font-size: .61rem; letter-spacing: .08em; line-height: 1.25; text-align: center; text-transform: uppercase; overflow-wrap: anywhere; }
.example-title { color: var(--label-ink); }
.family-names { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; margin: 13px 0 17px; }
.family { min-width: 0; min-height: 48px; border: 1px solid var(--control-line); border-radius: 2px; padding: 5px 4px; background: var(--paper-raised); color: var(--ink-soft); cursor: pointer; font-size: .68rem; font-weight: 700; line-height: 1.14; overflow-wrap: anywhere; hyphens: auto; touch-action: manipulation; }
.family:hover { border-color: var(--line); color: var(--ink); } .family[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.picker { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.family-title { margin: 0; font-family: var(--serif); font-size: 1.42rem; font-weight: 500; line-height: 1.08; }
.hint { min-height: 1.4em; margin: 5px 0 10px; color: var(--ink-soft); font-size: .86rem; }
.choice-group { min-width: 0; margin: 10px 0 0; border: 0; padding: 0; }
.choice-group legend { margin-bottom: 5px; color: var(--ink-faint); font-size: .76rem; font-weight: 750; }
.temperatures { display: flex; flex-wrap: wrap; gap: 6px; }
.temp { min-width: 54px; min-height: 44px; border: 1px solid var(--control-line); border-radius: 2px; padding: 0 9px; background: var(--paper-raised); color: var(--ink); cursor: pointer; font-size: .83rem; font-weight: 700; touch-action: manipulation; }
.temp:hover { border-color: var(--line); } .temp[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.choices { display: flex; flex-wrap: wrap; gap: 7px; }
.choice { min-height: 46px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--control-line); border-radius: 2px; padding: 5px 11px 5px 7px; background: var(--paper-raised); color: var(--ink); cursor: pointer; font-size: .83rem; font-weight: 650; line-height: 1.1; touch-action: manipulation; }
.choice:hover { border-color: var(--line); } .choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.choice svg { width: 31px; height: 31px; flex: 0 0 auto; } .focus-result { display: none; }
.clear { min-height: 44px; margin-top: 12px; border: 1px solid var(--control-line); border-radius: 2px; padding: 0 13px; background: transparent; color: var(--ink); cursor: pointer; font-size: .82rem; font-weight: 700; touch-action: manipulation; }
.clear:hover:not(:disabled) { border-color: var(--line); background: var(--paper-raised); }
.clear:disabled { color: var(--ink-faint); cursor: default; }
.output { min-width: 0; position: relative; display: flex; flex-direction: column; padding: 24px 25px 19px; border-top: 3px solid var(--accent); background: var(--paper-raised); box-shadow: var(--shadow); }
.result-head { padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.result-head h2 { max-width: 560px; margin: 0; font-family: var(--serif); font-size: clamp(1.75rem,3vw,2.6rem); font-weight: 500; letter-spacing: -.025em; line-height: 1.04; text-wrap: balance; }
.example { display: block; margin-top: 9px; color: var(--ink-faint); font-size: .81rem; }
.instructions { display: grid; gap: 0; margin: 5px 0 14px; padding: 0; list-style: none; }
.instructions li { min-height: 48px; display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.result-icon { width: 29px; height: 29px; display: grid; place-items: center; color: var(--accent); } .result-icon svg { width: 27px; height: 27px; }
.instructions .term { display: block; margin-bottom: 1px; font-size: .72rem; font-weight: 750; letter-spacing: .025em; }
.instructions p { margin: 0; color: var(--ink-soft); font-size: .88rem; line-height: 1.32; }
.instructions li.is-active { box-shadow: inset 3px 0 var(--accent); padding-left: 7px; }
.share-row { display: flex; align-items: center; gap: 9px; margin-top: auto; padding-top: 9px; }
.share { min-height: 44px; flex: 0 0 auto; border: 1px solid var(--accent); border-radius: 2px; padding: 0 14px; background: var(--accent); color: var(--accent-ink); cursor: pointer; font-size: .84rem; font-weight: 750; }
.share:hover { filter: brightness(1.08); }
.link[hidden] { display: none !important; }
.link:not([hidden]) { display: block; width: 100%; min-width: 0; min-height: 44px; flex: 1 1 auto; border: 1px solid var(--control-line); border-radius: 2px; padding: 0 9px; background: var(--paper); color: var(--ink); font-size: .77rem; }
.copy-status { min-height: 1.2em; margin: 5px 0 0; color: var(--ink-soft); font-size: .76rem; }
.guide { margin: 37px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-soft); }
.guide summary { min-height: 58px; display: flex; align-items: center; cursor: pointer; font-family: var(--serif); font-size: 1.38rem; }
.guide summary::marker { color: var(--accent); } .guide-body { max-width: 840px; padding: 0 0 20px; color: var(--ink-soft); }
.reference-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 20px; }
.reference-row { min-width: 0; display: grid; grid-template-columns: 40px minmax(0,1fr); align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.reference-row > svg, .reference-row .marks { width: 38px; height: 38px; min-height: 38px; }
.reference-row .marks svg, .reference-row > svg { width: 36px; height: 36px; }
.reference-row > span { min-width: 0; display: block; }
.reference-row > span strong { display: block; color: var(--ink); font-size: .86rem; line-height: 1.2; }
.reference-row > span > span { display: block; color: var(--ink-soft); font-size: .82rem; line-height: 1.3; }
.reference-row p { margin: 0; color: var(--ink-soft); font-size: .85rem; line-height: 1.3; }
.iron-older { margin: 9px 0; border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--paper); color: var(--ink-soft); }
.guide-body h3 { margin: 22px 0 6px; color: var(--ink); font-family: var(--serif); font-size: 1.17rem; font-weight: 500; }
.guide-body p, .guide-body li { font-size: .94rem; } .guide-body p { margin: 8px 0; } .guide-body ul { padding-left: 1.25rem; }
.sources { padding: 22px 0 40px; color: var(--ink-faint); font-size: .78rem; } .sources p { margin: 6px 0; }
.sources a { color: var(--ink-soft); } .sources .rights-note { max-width: 880px; color: var(--ink-soft); }
.sample .label-caption { color: var(--label-ink); }
@media (min-width: 1240px) { .instrument { padding: 20px 22px; } .fabric { min-height: 286px; } .satin { min-height: 210px; padding-top: 20px; } .slot { min-height: 123px; } .family-names { margin: 14px 0 18px; } .output { padding: 28px 29px 22px; } .instructions li { min-height: 52px; padding: 10px 0; } }
@media (max-width: 980px) { .wrap { width: min(780px,calc(100% - 36px)); } .workbench { grid-template-columns: minmax(0,1fr); gap: 16px; } .output { min-height: 0; } .intro { padding-bottom: 20px; } .instructions { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 18px; } .instructions li:nth-last-child(2):nth-child(odd) { border-bottom: 0; } }
@media (max-width: 600px) {
  body { font-size: 16px; } .wrap { width: calc(100% - 28px); }
  .topbar { min-height: 61px; gap: 8px; } .home { gap: 7px; font-size: .76rem; } .home-mark { width: 27px; height: 27px; }
  .tools { gap: 6px; } .language { min-height: 44px; max-width: 104px; padding-left: 8px; font-size: .8rem; }
  .theme { width: 44px; min-width: 44px; overflow: hidden; padding: 0; font-size: 0; } .theme::before { content: attr(data-short); font-size: .95rem; }
  .intro { padding: 25px 0 15px; } .eyebrow { margin-bottom: 8px; font-size: .63rem; }
  .intro h1 { max-width: 520px; font-size: clamp(2.22rem,10vw,3.15rem); } .intro p:last-child { margin-top: 10px; font-size: .96rem; line-height: 1.4; }
  .instrument { padding: 12px; } .instrument-label { margin-bottom: 8px; font-size: .6rem; }
  .fabric { min-height: 192px; padding: 18px 10px; } .satin { min-height: 145px; padding: 10px 8px 8px; transform: rotate(-.8deg); } .satin::before { inset: 4px; }
  .symbols { gap: 0; } .slot { min-height: 93px; padding: 7px 0; } .marks { min-height: 50px; }
  .marks svg { width: clamp(44px,12vw,52px); height: clamp(44px,12vw,52px); flex-basis: 52px; }
  .slot small { min-height: 1em; max-width: 58px; font-size: .57rem; } .label-caption { margin-top: 2px; padding-top: 5px; font-size: .52rem; }
  .family-names { gap: 4px; margin: 10px 0 12px; } .family { min-height: 56px; padding: 4px 2px; font-size: .63rem; }
  .picker { padding-top: 11px; } .family-title { font-size: 1.32rem; } .hint { min-height: 0; margin: 4px 0 8px; font-size: .79rem; }
  .choice-group { margin-top: 10px; } .choice-group legend { font-size: .74rem; }
  .temperatures { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; } .temp { min-width: 0; min-height: 44px; padding: 0 3px; font-size: .79rem; }
  .choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; } .choice { min-width: 0; min-height: 47px; gap: 6px; padding: 5px 7px; font-size: .75rem; } .choice svg { width: 28px; height: 28px; }
  .clear { width: 100%; margin-top: 10px; }
  .focus-result { display: block; margin: 7px 0 8px; border-left: 3px solid var(--accent); padding: 7px 9px; background: var(--paper-raised); color: var(--ink); font-size: .81rem; line-height: 1.3; }
  .output { padding: 18px 16px 14px; } .result-head { padding-bottom: 10px; } .result-head h2 { font-size: 1.9rem; }
  .example { margin-top: 7px; font-size: .76rem; } .instructions { grid-template-columns: minmax(0,1fr); gap: 0; margin-bottom: 11px; }
  .instructions li { min-height: 45px; grid-template-columns: 30px minmax(0,1fr); gap: 8px; padding: 7px 0; } .instructions li:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--line-soft); }
  .instructions p { font-size: .85rem; } .share-row { align-items: flex-start; } .share { width: 100%; }
  .guide { margin-top: 25px; } .guide summary { min-height: 52px; font-size: 1.25rem; } .sources { padding-bottom: 28px; }
  .reference-grid { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
