@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: "DM Serif Text";
  src: url("fonts/dm-serif-text.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Serif Text";
  src: url("fonts/dm-serif-text-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
:root {
  --ink: #263c32;
  --pine: #26483b;
  --subtle: #5d685e;
  --ivory: #fbf8f0;
  --paper: #fffdf8;
  --line: #dbd9c9;
  --serif: "DM Serif Text", Georgia, serif;
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cpath fill='%23b66042' d='M0 0h96v96H0z'/%3E%3Cpath fill='%23c97853' d='M0 0h24v24L0 0Zm96 0v24H72L96 0ZM0 96V72h24L0 96Zm96 0H72V72l24 24Z'/%3E%3Cpath fill='%23f3e2b6' d='m48 0 8 24 16-8-1 16 25 16-25 8 9 16-17-1-15 25-8-25-16 9 1-17L0 48l25-8-9-16 17 1Z'/%3E%3Cpath fill='%23e2bc8c' d='m48 0 1 36 7-12Zm48 48L60 49l11 7ZM48 96l-1-36-7 11ZM0 48l36-1-11-7Z'/%3E%3Cpath fill='%239a543a' d='m48 31 17 17-17 17-17-17Z'/%3E%3Cpath fill='%23d29669' d='m48 31 17 17H48Z'/%3E%3Cpath fill='none' stroke='%23573d2c' stroke-opacity='.32' stroke-width='.8' stroke-dasharray='2.3 2' d='m48 4 8 23 13-8-1 14 24 15-24 8 9 13-15-1-14 24-8-24-13 9 1-15L4 48l24-8-9-13 15 1ZM1 1l94 94m0-94L1 95'/%3E%3C/svg%3E");
  --sprig: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 54'%3E%3Cg fill='%23d2ce9c'%3E%3Cpath d='M9 27q8-7 4-14-6 2-4 14Zm4-6q7 1 11-5-7-2-11 5Zm-4 5q-8-2-8-8 8 1 8 8Zm25 19q9-7 7-15-8 2-7 15Zm3-7q-8-1-8-9 7 2 8 9Z'/%3E%3C/g%3E%3Cpath d='m7 31 8-13m17 31 7-15' stroke='%23e4dab5' stroke-width='1.2'/%3E%3Ccircle cx='32' cy='10' r='1.7' fill='%23d2cfad'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font: 400 1rem/1.55 "DM Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3, .brand { font-family: var(--serif); font-weight: 400; }
h1, h2 { letter-spacing: -.034em; }
h2 { font-size: clamp(1.62rem, 2.4vw, 2.1rem); line-height: 1.15; }
a { color: inherit; text-underline-offset: .19em; }
button, input { font: inherit; color: inherit; }
button, input[type="radio"] { cursor: pointer; }
:focus-visible { outline: 3px solid #96703a; outline-offset: 4px; }
[hidden], .print-only { display: none !important; }
.shell { width: min(73.5rem, calc(100% - clamp(2.5rem, 9vw, 9rem))); margin-inline: auto; }
.skip-link, .sr-only, .pill input, .placement-options input {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus { width: auto; height: auto; margin: .6rem; padding: .6rem 1rem; clip-path: none; background: white; z-index: 5; }
.site-header { background: #fffcf5; border-bottom: 1px solid rgba(55, 64, 47, .1); }
.site-header .shell, .site-footer .shell { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-header .shell { min-height: 4.35rem; }
.brand { display: inline-flex; align-items: center; gap: .2em; color: var(--pine); text-decoration: none; font-size: 1.51rem; letter-spacing: -.047em; white-space: nowrap; }
.brand img { margin-right: .28em; width: 1.26em; height: 1.26em; }
.brand i { font-weight: inherit; }
.site-nav { display: flex; gap: clamp(1.1rem, 3vw, 2.6rem); }
.site-nav a, .site-footer .shell > a:last-child:not(.brand) { font-size: .88rem; font-weight: 560; text-decoration: none; }
.site-nav a:hover, .site-footer .shell > a:last-child:not(.brand):hover { text-decoration: underline; }

.hero {
  overflow: hidden;
  color: #fff9e8;
  background: radial-gradient(ellipse at 70% 48%, #365b47 0, transparent 61%), #254637;
}
.hero-inner { display: grid; grid-template-columns: 1.08fr 1fr; min-height: clamp(19rem, 25vw, 22rem); align-items: stretch; }
.hero-copy { align-self: center; position: relative; z-index: 1; padding-block: 2.7rem 2.9rem; }
.hero h1 { font-size: clamp(3.1rem, 5.9vw, 5rem); line-height: .99; }
.hero h1 em { color: #efd7ad; font-weight: inherit; }
.hero p { max-width: 33rem; margin-top: 1.3rem; font-size: clamp(.99rem, 1.3vw, 1.09rem); line-height: 1.6; color: #edeedf; }
.textile { position: relative; width: min(100%, 33rem); height: 100%; min-height: 16rem; justify-self: end; isolation: isolate; }
.fabric { position: absolute; width: 58%; height: 78%; border-radius: 1.2% 2% 1% 1%; box-shadow: .2rem .5rem .7rem #142b2380, 0 0 0 1px #162d2838; }
.fabric::after {
  content: ""; pointer-events: none; position: absolute; inset: 0; border: 2px dotted #e7d9af88;
  background: repeating-linear-gradient(0deg, transparent 0 2px, #c1bfa442 2px 3px),
    repeating-linear-gradient(90deg, #2a26121a 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.fabric::before { content: ""; position: absolute; inset: .43rem; border: 1.25px dashed #fff3ccad; }
.fabric-check {
  top: 23%; left: 10%; transform: rotate(-13deg); background-color: #d5c596;
  background-image: repeating-linear-gradient(0deg, transparent 0 12px, #5d6a4e7d 12px 24px), repeating-linear-gradient(90deg, transparent 0 12px, #627254a6 12px 24px);
}
.fabric-floral { top: 8%; left: 26%; height: 83%; transform: rotate(14deg); background: var(--sprig) 0 0 / 2.9rem 3.25rem, #6d8064; }
.fabric-block { left: 33%; top: 27%; width: 53%; height: 82%; transform: rotate(-6deg); background: var(--star) 50% 39% / 5.15rem 5.15rem, #b96e50; }
.measuring-tape {
  position: absolute; z-index: 2; width: 65%; height: 2.35rem; right: -3%; bottom: 7%;
  display: flex; align-items: flex-start; justify-content: space-around; padding: .08rem .14rem 0; transform: rotate(-21deg);
  border-block: 1px solid #7a6239; border-radius: 3px;
  color: #4e452c; background: repeating-linear-gradient(90deg, #695530 0 1px, transparent 1px 7px) left bottom / 100% 19% no-repeat,
    repeating-linear-gradient(90deg, #695530 0 1.5px, transparent 1.5px 28px) left bottom / 100% 31% no-repeat,
    linear-gradient(100deg, #c39d5d, #ecd293 18%, #e3c883 63%, #d6ba73);
  box-shadow: 0 .25rem .32rem #272e2475;
}
.measuring-tape span { font: 550 .89rem/1.45 "DM Sans", sans-serif; }
.measuring-tape::before { content: ""; position: absolute; width: .48rem; inset: -1px auto -1px 0; border: 1px solid #92805d; border-radius: 2px; background: linear-gradient(90deg, #9d885d, #e7d293, #ab9467); }

.workspace { padding-block: clamp(2rem, 4.1vw, 3.7rem) 0; display: grid; grid-template-columns: minmax(16rem, .77fr) minmax(0, 1.32fr); align-items: start; gap: clamp(1rem, 2.5vw, 2rem); }
.measures, .plan {
  min-width: 0; padding: clamp(1.15rem, 2.45vw, 2rem); background: var(--paper);
  border: 1px solid var(--line); border-radius: .7rem; box-shadow: 0 2px 0 #4c593509;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: 1.35rem; }
.panel-head h2 { min-width: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.pill { display: inline-flex; flex: none; gap: .1rem; padding: .18rem; border: 1px solid var(--line); border-radius: 2rem; background: #f4f2e8; }
.pill label, .placement-options label { position: relative; cursor: pointer; margin: 0; }
.pill label span { display: block; border-radius: 2rem; padding: .2rem .65rem; font-size: .79rem; line-height: 1.45; font-weight: 650; }
.pill input:checked + span { background: var(--pine); color: #fff9e8; }
.pill input:focus-visible + span, .placement-options input:focus-visible + span { outline: 3px solid #96703a; outline-offset: 2px; }
.measure-group { position: relative; margin: 0 0 1.15rem; padding: 0 0 1.13rem; border-bottom: 1px solid var(--line); }
.measure-group:last-child { border-bottom: none; margin: 0; padding: 0; }
.measure-group legend { padding: 0; margin: 0 0 .65rem; font-size: .94rem; font-weight: 720; }
.pair, .placement-options { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.pair > label { display: flex; flex-direction: column; min-width: 0; gap: .28rem; color: var(--subtle); font-size: .8rem; font-weight: 510; }
.entry { display: flex; align-items: center; border: 1px solid #c9cbbb; border-radius: .28rem; background: #fffef9; overflow: hidden; }
.entry:focus-within { border-color: var(--pine); outline: 2px solid #c0cbb7; outline-offset: 1px; }
.entry:has(input[aria-invalid="true"]) { border-color: #a5452c; }
.entry input { appearance: textfield; -moz-appearance: textfield; width: 100%; min-width: 0; height: 2.65rem; border: 0; outline: none; padding: .45rem 0 .45rem .68rem; background: transparent; color: var(--ink); font-size: 1.02rem; line-height: 1.3; font-weight: 570; }
.entry input::-webkit-inner-spin-button, .entry input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.unit { padding-inline: .36rem .7rem; color: var(--subtle); font-size: .78rem; }
.hint { margin-top: .62rem; color: var(--subtle); font-size: .775rem; line-height: 1.55; }
.placement-options { gap: .42rem; }
.placement-options label > span {
  display: flex; gap: .39rem; justify-content: center; align-items: center; padding: .53rem .15rem; border: 1px solid #cacbbd; border-radius: .27rem;
  font-size: .81rem; font-weight: 550; color: var(--subtle); white-space: nowrap;
}
.placement-options input:checked + span { border-color: #48664f; color: var(--pine); background: #e9eee2; }
.placement-icon { width: .98rem; height: .94rem; border: 1px solid currentColor; display: inline-block; }
.edge-icon { background: linear-gradient(to right, transparent 0 67%, currentColor 67% 100%); }
.insert-icon { background: linear-gradient(to right, transparent 0 36%, currentColor 36% 64%, transparent 64%); }

.button {
  display: inline-flex; justify-content: center; align-items: center; gap: .4rem; padding: .54rem .86rem;
  border: 1px solid var(--pine); border-radius: .33rem; background: var(--pine); color: #fffcf2; text-decoration: none; font-weight: 590; font-size: .87rem; line-height: 1.4;
}
.button:hover:not(:disabled) { background: #18372c; }
.button-secondary { background: transparent; color: var(--pine); }
.button-secondary:hover:not(:disabled) { background: #e8eee2; }
.button:disabled { opacity: .47; cursor: default; }
.print-button { flex: none; }
.plan-error { padding: .8rem 1rem; background: #faeade; border: 1px solid #e7b99f; border-radius: .3rem; color: #783e2b; }
.drawing {
  overflow: hidden; background-color: #f5f3e7;
  background-image: linear-gradient(#8b9b821c 1px, transparent 1px), linear-gradient(90deg, #8b9b821c 1px, transparent 1px);
  background-size: 15px 15px; border: 1px solid #d7d8c6; border-radius: .36rem;
}
.drawing-head { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .8rem 1rem 0; }
.drawing-head span:first-child, .drawing-head span:last-child { font-size: .73rem; font-weight: 670; letter-spacing: .025em; }
.drawing-head span:last-child { font-weight: 480; color: var(--subtle); }
#diagram { min-width: 0; }
#diagram svg { display: block; max-width: 100%; width: 100%; height: clamp(14.4rem, 22vw, 18.4rem); margin: 0 auto; }
.result-meta { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 1rem; padding: 1rem .08rem; border-bottom: 1px solid var(--line); }
.result-meta div + div { border-left: 1px solid var(--line); padding-inline-start: 1.15rem; }
.result-meta span { display: block; color: var(--subtle); font-size: .77rem; }
.result-meta strong { display: block; font-size: 1.08rem; font-weight: 650; overflow-wrap: anywhere; }
.list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-top: 1.08rem; font-size: 1.32rem; letter-spacing: -.02em; }
.list-heading span { font: 450 .75rem/1.45 "DM Sans", sans-serif; letter-spacing: 0; color: var(--subtle); }
.cut-list { list-style: none; padding: 0; margin: .45rem 0 .85rem; }
.cut-list li { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .35rem .9rem; padding: .55rem .7rem; background: #f1f0e6; border-radius: .23rem; margin-top: .28rem; font-size: .88rem; }
.cut-list li strong { font-weight: 650; }
.sewing { padding-top: .6rem; border-top: 1px dashed #c6c9b7; font-size: .87rem; }
.sewing summary { cursor: pointer; color: var(--pine); font-weight: 650; }
.sewing ol { margin: .65rem 0 .1rem; padding-left: 1.26rem; }
.sewing li + li { margin-top: .33rem; }
.strip-guide { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; margin-top: clamp(2.4rem, 5vw, 4rem); padding-top: 1.8rem; border-top: 1px solid var(--line); }
.strip-guide h2 { max-width: 28ch; }
.strip-guide p { margin-top: .75rem; line-height: 1.55; color: var(--subtle); }
.strip-formulas { margin: .95rem 0; }
.strip-formulas div { padding: .5rem 0; border-block-end: 1px solid var(--line); }
.strip-formulas dt { font-size: .82rem; color: var(--subtle); }
.strip-formulas dd { margin: .15rem 0 0; font-weight: 650; }
.strip-guide-note { padding-inline-start: 1.25rem; border-inline-start: 2px solid #c8bca1; }
.strip-guide-note h3 { font-size: 1.35rem; line-height: 1.2; }
.strip-guide-note p { font-size: .92rem; }
.examples-section { padding-block: clamp(2.4rem, 5vw, 4rem); }
.examples-section h2 { margin-bottom: 1rem; }
.example-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.example-card { min-width: 0; display: flex; align-items: center; gap: .95rem; text-decoration: none; padding: .9rem; border-block: 1px solid var(--line); }
.example-card::after { content: "→"; margin-left: auto; padding-right: .2rem; color: #586b55; }
.example-card:hover { background: #f3f1e6; }
.example-card > span:nth-child(2) { min-width: 0; }
.example-card strong { display: block; font-size: 1.13rem; font-family: var(--serif); font-weight: 400; line-height: 1.18; }
.example-card small { display: block; margin-top: .25rem; font-size: .79rem; color: var(--subtle); }
.sample-swatch { flex: none; display: block; width: 3.35rem; height: 3.35rem; border: 1px solid #a59f80; }
.sample-one { background: var(--star) center / 3.35rem; }
.sample-two { background: var(--sprig) center / 1.8rem, #708365; }
.site-footer { border-top: 1px solid var(--line); background: #f3f2e7; }
.site-footer .shell { min-height: 5rem; }
.site-footer .brand { font-size: 1.23rem; }
.example-page h1 { font-size: clamp(2.65rem, 6vw, 4.5rem); }
.example-crumb, .example-more { color: #466254; }
.guide-intro > p { color: var(--subtle); font-size: 1.08rem; }
.guide-body h2 { font-size: clamp(1.55rem, 3vw, 2rem); }

@media (max-width: 58rem) {
  .shell { width: min(100% - 3rem, 73.5rem); }
  .workspace { grid-template-columns: minmax(15rem,.83fr) minmax(0,1.14fr); }
  .hero-inner { min-height: 18rem; }
  .hero-copy { padding-block: 2.45rem; }
  .fabric-block { background-size: 4.15rem 4.15rem; }
}
@media (max-width: 46rem) {
  .strip-guide { grid-template-columns: 1fr; gap: 1.45rem; }
  .workspace { grid-template-columns: 1fr; gap: 1rem; }
  .hero-inner { grid-template-columns: 1.12fr .88fr; min-height: 16.5rem; }
  .hero h1 { font-size: clamp(2.5rem, 7vw, 3.7rem); }
  .hero p { font-size: .96rem; }
  .fabric { width: 72%; height: 68%; }
  .fabric-floral { top: 15%; height: 73%; }
  .fabric-check { left: 4%; top: 24%; }
  .fabric-block { top: 31%; left: 31%; }
  .measuring-tape { width: 80%; height: 1.8rem; right: -11%; bottom: 12%; }
  .measuring-tape span { font-size: .75rem; }
  #diagram svg { height: 16rem; }
  .example-grid { grid-template-columns: 1fr; gap: 0; }
  .example-card + .example-card { border-top: 0; }
}
@media (max-width: 35rem) {
  .shell { width: calc(100% - 2rem); }
  .site-header .shell { min-height: 3.7rem; gap: .6rem; }
  .brand { font-size: 1.19rem; }
  .site-nav { gap: .8rem; }
  .site-nav a { font-size: .73rem; }
  .hero-inner { grid-template-columns: minmax(0,1fr); min-height: 0; }
  .hero-copy { padding-block: 1.8rem 1.65rem; }
  .hero h1 { font-size: clamp(2.82rem, 12vw, 3.75rem); }
  .hero p { width: 89%; max-width: 29rem; margin-top: .88rem; font-size: .94rem; }
  .textile { position: relative; min-height: 0; width: calc(100% + 2rem); margin-right: -1rem; height: 7.4rem; overflow: hidden; }
  .fabric { width: 45%; height: 175%; }
  .fabric-check { top: 28%; left: 9%; transform: rotate(-13deg); }
  .fabric-floral { top: 14%; left: 32%; height: 170%; }
  .fabric-block { left: 52%; top: 20%; height: 180%; background-size: 3.7rem 3.7rem; }
  .measuring-tape { right: -10%; bottom: 30%; width: 56%; transform: rotate(-24deg); }
  .workspace { padding-top: 1.2rem; }
  .measures, .plan { padding: 1.05rem; border-radius: .45rem; }
  .panel-head { margin-bottom: 1rem; }
  .plan .panel-head h2 { font-size: clamp(1.4rem, 6.3vw, 1.7rem); }
  .print-button { padding: .46rem .56rem; font-size: .78rem; }
  .print-button svg { width: 14px; }
  .measure-group { padding-bottom: 1rem; margin-bottom: .95rem; }
  .entry input { height: 2.75rem; }
  .drawing-head { padding: .55rem .65rem .1rem; }
  #diagram svg { height: auto; min-height: 12rem; }
  .list-heading { margin-top: .85rem; }
  .example-card { padding-inline: .15rem; }
  .site-footer .shell { min-height: 4.5rem; }
}
@media (max-width: 22rem) {
  .site-nav { gap: .48rem; }
  .site-nav a { font-size: .68rem; }
  .brand { font-size: 1.08rem; }
  .measures, .plan { padding: .83rem; }
  .panel-head { gap: .3rem; }
  .pair { gap: .55rem; }
  .entry input { padding-left: .45rem; }
}
@page { margin: 12mm; }
@media print {
  html, body { background: white; color: #1e2f27; margin: 0; padding: 0; font-size: 10pt; }
  .no-print, .skip-link { display: none !important; }
  .print-only { display: block !important; }
  .workspace { width: 100%; max-width: none; display: block; margin: 0; padding: 0; }
  .plan { display: block; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .print-brand { margin: 0 0 4pt; color: #4f6756; font-size: 9pt; }
  .plan .panel-head { display: block; margin-bottom: 7pt; }
  .plan .panel-head h2 { font-size: 24pt; line-height: 1.05; }
  .drawing { background: #f6f6ef; border: 1px solid #aaa; break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .drawing-head { padding: 4pt 7pt 0; }
  .drawing-head span:first-child, .drawing-head span:last-child { font-size: 8pt; }
  #diagram svg { height: 67mm; min-height: 0; max-width: 100%; }
  .result-meta { padding: 5pt 0; gap: 8pt; }
  .result-meta span, .list-heading span, .print-summary, .print-scale { font-size: 8pt; }
  .result-meta strong { font-size: 11pt; }
  .print-summary { margin-top: 5pt; color: #475347; }
  .list-heading { font-size: 15pt; margin: 6pt 0 2pt; }
  .cut-list { margin: 0 0 4pt; }
  .cut-list li { padding: 3pt 5pt; margin: 1pt 0; border-bottom: 1px solid #ddd; font-size: 9pt; break-inside: avoid; }
  .sewing { padding: 4pt 0 0; font-size: 9pt; }
  .sewing summary { display: block; font-size: 12pt; }
  .sewing summary::marker { content: ""; }
  .sewing summary::-webkit-details-marker { display: none; }
  .sewing::details-content { content-visibility: visible; display: block; height: auto; }
  .sewing ol, .sewing:not([open]) > ol { display: block !important; margin: 3pt 0 0; padding-left: 15pt; }
  .sewing li { break-inside: avoid; }
  .sewing li + li { margin-top: 2pt; }
  .print-scale { margin-top: 6pt; color: #475347; }
  .worked-example .guide-intro > p { font-size: 10pt; }
}
