/* Fitline: tailor's fitting card. Chalk paper, indigo ink, measuring-tape yellow. */
:root {
  --chalk: #F4F6FA;
  --paper: #FFFFFF;
  --ink: #1B2559;
  --slate: #4F5A85;
  --mist: #D5DBEA;
  --tape: #F6C945;
  --tape-deep: #D9A91C;
  --danger: #9B1C1C;
  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --text: 'Newsreader', Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0; background: var(--chalk); color: var(--ink);
  font-family: var(--text); font-size: 1.15rem; line-height: 1.65;
}
img, svg { max-width: 100%; }

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; margin: 0 0 .6rem; }
h1 { font-stretch: 75%; letter-spacing: -.01em; font-size: clamp(2.1rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); font-stretch: 85%; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1rem; }

a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--tape-deep); text-decoration-thickness: 3px; text-underline-offset: 3px; text-decoration-skip-ink: none; }
a:hover { background: var(--tape); text-decoration-color: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--tape); color: var(--ink); padding: .6rem 1rem; z-index: 10; font-family: var(--display); font-weight: 700; }
.skip:focus { left: 0; }
.wrap { max-width: 1080px; margin-inline: auto; padding-inline: 20px; }

/* ---------- header: the tape ---------- */
.tape {
  height: 22px; background-color: var(--tape);
  background-image:
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 40px);
  background-size: 100% 8px, 100% 14px;
  background-repeat: repeat-x; background-position: left bottom, left bottom;
}
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1.5rem; padding-block: .9rem; }
.brand { font-family: var(--display); font-weight: 900; font-stretch: 75%; font-size: 1.8rem; text-decoration: none; letter-spacing: -.01em; }
.brand:hover { background: none; color: var(--slate); }
.bar nav { display: flex; flex-wrap: wrap; gap: .1rem .3rem; }
.bar nav a { font-family: var(--display); font-weight: 600; font-size: .98rem; text-decoration: none; padding: .35rem .6rem; }
.bar nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--tape-deep); text-decoration-thickness: 3px; text-underline-offset: 6px; }

/* ---------- hero + calculator ---------- */
.hero { padding: 1.5rem 0 3rem; }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: .95; font-stretch: 70%; margin-bottom: 1rem; }
.lede { font-size: 1.25rem; color: var(--slate); max-width: 34em; }
.hero-fig svg { display: block; width: 100%; max-width: 430px; height: auto; margin-inline: auto; }

.units { border: 0; padding: 0; margin: 0 0 .8rem; display: flex; }
.unit { position: relative; display: block; }
.unit input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.unit span { display: block; padding: .35rem 1rem; border: 2px solid var(--ink); font-family: var(--display); font-weight: 700; font-size: .95rem; }
.unit + .unit span { margin-left: -2px; }
.unit input:checked + span { background: var(--ink); color: var(--chalk); }
.unit input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }

.measure { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: .5rem 0 .2rem; border-bottom: 2px solid var(--ink); }
.measure:focus-within { border-bottom-width: 6px; padding-bottom: 0; }
.measure-text label { display: block; font-family: var(--display); font-weight: 700; font-size: 1.3rem; line-height: 1.1; }
.hint { display: block; font-size: .95rem; color: var(--slate); line-height: 1.3; }
.measure-input { display: flex; align-items: baseline; gap: .4rem; padding-inline: .4rem; }
.measure:focus-within .measure-input { background: var(--tape); }
.measure input {
  width: 4.4ch; border: 0; background: transparent; text-align: right; padding: 0; color: var(--ink);
  font-family: var(--display); font-stretch: 70%; font-weight: 800; font-size: 3.6rem; line-height: 1.05;
  -moz-appearance: textfield; appearance: textfield;
}
.measure input:focus { outline: none; }
.measure input::placeholder { color: var(--mist); }
.measure input::-webkit-outer-spin-button, .measure input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.unit-label { font-family: var(--display); font-weight: 700; color: var(--slate); min-width: 2.2ch; }
.error { border-left: 6px solid var(--danger); padding: .3rem 0 .3rem .8rem; margin: 1rem 0 0; color: var(--danger); font-family: var(--display); font-weight: 600; font-size: 1rem; line-height: 1.35; }

.btn {
  display: inline-block; font-family: var(--display); font-weight: 800; font-size: 1.05rem; line-height: 1.2;
  background: var(--tape); color: var(--ink); border: 2px solid var(--ink); border-radius: 0;
  padding: .75rem 1.4rem; margin-top: 1.2rem; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--ink); color: var(--tape); }
.btn-quiet { background: transparent; }

/* ---------- figure (dress form) ---------- */
.fig-body, .fig-cap, .fig-base { fill: var(--ink); }
.fig-pole { stroke: var(--ink); stroke-width: 4; }
.fig-band { fill: var(--tape); stroke: var(--ink); stroke-width: 1.5; }
.fig-lead { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 2 3; }
.fig-key { font-family: var(--display); font-weight: 700; font-size: 15px; fill: var(--ink); }
.fig-val { font-weight: 800; font-size: 19px; }
.is-idle .fig-body, .is-idle .fig-cap, .is-idle .fig-base { fill: var(--mist); }
.is-idle .fig-pole { stroke: var(--mist); }
.is-idle .fig-band { fill: var(--paper); stroke: var(--slate); }
.is-idle .fig-lead { stroke: var(--slate); }
.is-idle .fig-key { fill: var(--slate); }

/* ---------- result ---------- */
.result { background: var(--ink); color: var(--chalk); padding: 2.5rem 0 3rem; scroll-margin-top: 0; }
.result[hidden] { display: none; }
.result-inner h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 700; margin: 0; }
.result h2:focus { outline: none; }
.result-shape { display: block; font-size: clamp(3.4rem, 12vw, 7rem); font-weight: 900; font-stretch: 65%; line-height: .95; color: var(--tape); margin-top: .2rem; }
.result-sum { font-size: 1.3rem; max-width: 34em; margin-top: 1rem; }
.ratios { list-style: none; padding: 0; margin: 0 0 1.2rem; font-family: var(--display); font-weight: 600; }
.ratios li { margin: .25rem 0; }
.close-note { border-left: 6px solid var(--tape); padding-left: 1rem; max-width: 36em; }
.result h3 { margin-top: 1.5rem; }
.result a { color: var(--tape); text-decoration-color: var(--tape); }
.result a:hover { background: var(--tape); color: var(--ink); }
.result :focus-visible { outline-color: var(--tape); }
.result .chips a { border-color: var(--tape); }
.result .btn { background: var(--tape); color: var(--ink); border-color: var(--tape); margin-right: .6rem; }
.result .btn:hover { background: transparent; color: var(--tape); }
.result .btn-quiet { background: transparent; color: var(--tape); }
.result .btn-quiet:hover { background: var(--tape); color: var(--ink); }

/* ---------- content ---------- */
.prose { max-width: 44rem; margin: 2.5rem 0; }
.prose h2 { margin-top: 0; }
.prose h3 { margin: 1.6rem 0 .25rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .35rem 0; }
.steps li { margin: .6rem 0; }
.plain, .inline-list, .chips, .guide-list, .hub-list, .type-list, .shape-grid { list-style: none; padding: 0; }
.aka { color: var(--slate); font-size: 1rem; }
.fine { font-size: .9rem; color: var(--slate); }
.notice { background: var(--tape); padding: .8rem 1rem; font-family: var(--display); font-weight: 600; }

.rules { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 1.05rem; }
.rules th, .rules td { text-align: left; padding: .6rem .8rem .6rem 0; border-bottom: 1px solid var(--mist); vertical-align: top; }
.rules thead th { border-bottom: 2px solid var(--ink); font-family: var(--display); }
.rules tbody th { font-family: var(--display); font-weight: 700; white-space: nowrap; }

.shapes-row { margin: 3rem 0; }
.shape-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin: 1rem 0 0; }
.shape-grid a { display: block; text-decoration: none; }
.shape-grid a:hover { background: none; }
.shape-grid svg { display: block; width: 100%; max-width: 130px; height: auto; margin: 0 auto .6rem; }
.shape-grid .shape-name { display: block; font-family: var(--display); font-weight: 800; font-size: 1.35rem; text-decoration: underline; text-decoration-color: var(--tape-deep); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.shape-grid a:hover .shape-name { background: var(--tape); }
.shape-grid .shape-sum { display: block; font-size: .98rem; line-height: 1.4; color: var(--slate); margin-top: .3rem; }

.crumbs ol { list-style: none; padding: 0; margin: 0 0 1.2rem; display: flex; flex-wrap: wrap; gap: .2rem .5rem; font-family: var(--display); font-size: .92rem; }
.crumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--slate); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.article { padding-block: 1.5rem 3rem; }
.article > h1 { max-width: 20em; }
.article-head { display: grid; gap: 1.5rem; align-items: center; margin-bottom: .5rem; }
.article-head h1 { max-width: 16em; }
.shape-fig { margin: 0; }
.shape-fig svg { display: block; width: 100%; max-width: 300px; height: auto; margin-inline: auto; }
.shape-fig.small svg { max-width: 150px; }

.pair { display: grid; gap: 2rem; margin: 2.5rem 0; max-width: 60rem; }
.pair section { border-top: 8px solid var(--tape); padding-top: .9rem; }
.pair section + section { border-top-color: var(--ink); }
.pair ul { padding-left: 1.2rem; margin: 0; }
.pair li { margin: .55rem 0; }

.tip { max-width: 44rem; background: var(--paper); border-left: 8px solid var(--tape); padding: 1rem 1.4rem; margin: 2rem 0; }
.tip h2 { font-size: 1.1rem; margin-bottom: .2rem; }
.tip p { margin: 0; }

.guide-list li { border-top: 1px solid var(--mist); padding: .9rem 0; }
.guide-list a { font-family: var(--display); font-size: 1.1rem; }
.guide-list span { display: block; color: var(--slate); margin-top: .15rem; }

.inline-list, .chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 0; }
.inline-list a, .chips a { display: inline-block; border: 2px solid var(--ink); padding: .3rem .8rem; font-family: var(--display); font-weight: 600; font-size: .95rem; text-decoration: none; }
.inline-list a:hover, .chips a:hover { background: var(--tape); color: var(--ink); }

.hub-row, .type-row { display: grid; grid-template-columns: 96px 1fr; gap: 1.2rem; padding: 1.4rem 0; border-top: 1px solid var(--mist); align-items: start; }
.hub-fig svg, .type-fig svg { display: block; width: 100%; height: auto; }
.hub-row h2, .type-row h2 { margin-bottom: .3rem; }
.hub-look { color: var(--slate); }

.cta { margin-top: 3rem; padding: 1.4rem 1.6rem; background: var(--tape); display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 2rem; }
.cta p { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.4rem; font-stretch: 85%; }
.cta .btn { margin: 0; background: var(--ink); color: var(--tape); }
.cta .btn:hover { background: var(--paper); color: var(--ink); }

.faq h3 { font-size: 1.15rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: var(--chalk); margin-top: 4rem; padding: 2.5rem 0 2rem; }
.foot { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.foot-h { font-size: 1rem; font-stretch: 100%; color: var(--tape); margin: 0 0 .5rem; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin: .25rem 0; }
.site-footer a { color: var(--chalk); text-decoration-color: var(--tape); }
.site-footer a:hover { background: var(--tape); color: var(--ink); }
.site-footer :focus-visible { outline-color: var(--tape); }
.fine-wrap { border-top: 1px solid rgba(244, 246, 250, .25); margin-top: 1.5rem; padding-top: 1rem; }
.site-footer .fine { color: #C9D0E6; max-width: 60rem; }

/* ---------- larger screens ---------- */
@media (min-width: 700px) {
  .pair { grid-template-columns: 1fr 1fr; }
  .hub-row, .type-row { grid-template-columns: 130px 1fr; }
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 3rem; }
  .article-head { grid-template-columns: minmax(0, 1fr) 300px; }
  .article-head:has(.small) { grid-template-columns: minmax(0, 1fr) 170px; }
}
@media (max-width: 420px) {
  .measure input { font-size: 3rem; }
  body { font-size: 1.08rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .inline-list a, .chips a { transition: background-color .12s, color .12s; }
}
