/* Tegnklar: the drawing sheet (BRAND.md). Paper, blueprint ink, one red pencil. Sharp corners, thin rules,
   dimension lines as dividers. Archivo for display and labels, Source Serif 4 for reading. */
@font-face { font-family: "Archivo"; src: url("/fonts/archivo-latin.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-latin.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-italic-latin.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  --paper: #f6f4ee; --sheet: #ffffff; --ink: #11233d; --muted: #4f5b6b; --line: #cfd5dc; --grid: #e6e9ec;
  --blue: #1d4f9c; --red: #c8401a; --red-dark: #a8340f; --warn: #8a5300; --ok: #2c6a3f;
  --display: "Archivo", "Arial Narrow", Arial, sans-serif; --text: "Source Serif 4", Georgia, "Times New Roman", serif;
  --max: 1280px; --ease: 180ms ease;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--text); font-size: 1.0625rem; line-height: 1.6; color: var(--ink); background: var(--paper); }
::selection { background: #f3c9b9; color: var(--ink); }
a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: 1px; transition: color var(--ease); }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
p, li, dd { hyphens: auto; }
h1, h2, h3, .label, .btn, .price, .big-number, legend, .tb-label, nav { font-family: var(--display); font-stretch: 87.5%; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -0.015em; font-weight: 800; margin: 0 0 .6em; hyphens: manual; overflow-wrap: break-word; }
h1 { font-size: clamp(2.2rem, 1.3rem + 3.2vw, 4.25rem); }
h2 { font-size: clamp(1.7rem, 1.25rem + 1.7vw, 2.6rem); }
h3 { font-size: 1.25rem; font-weight: 700; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: .5rem; }
.muted { color: var(--muted); } .small { font-size: .9rem; }

/* Labels like the text in a title block: small caps, letter-spaced, with the drawing number in red. */
.label { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--muted); margin: 0 0 1rem; display: flex; gap: .8rem; align-items: center; }
.label span { color: var(--red); }
.label span::after { content: ""; display: inline-block; width: 1.6rem; height: 1px; background: currentColor; vertical-align: middle; margin-left: .8rem; }

/* Header */
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem clamp(1rem, 3vw, 2.5rem); border-bottom: 1px solid var(--line); background: rgba(246, 244, 238, .94); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(6px); }
.site-header nav { display: flex; align-items: center; gap: 1.6rem; font-size: 1rem; font-weight: 600; }
.site-header nav a:not(.btn) { color: var(--ink); text-decoration: none; }
.site-header nav a:not(.btn):hover { color: var(--red); }
@media (max-width: 720px) { .site-header nav a:not(.btn) { display: none; } }
.logo { display: block; line-height: 0; }
.wordmark { width: 128px; height: auto; }
.wordmark text { font-family: var(--display); font-stretch: 87.5%; font-weight: 800; font-size: 25px; fill: var(--ink); letter-spacing: -.3px; }
.wordmark .wm-line { stroke: var(--ink); stroke-width: 1; fill: none; }
.wordmark .wm-tick { stroke: var(--red); stroke-width: 2; fill: none; }
.wordmark-small { width: 104px; display: block; margin: .1rem 0 .3rem; }
.banner { background: #fbe9c8; border-bottom: 1px solid #ecd29f; padding: .45rem 1rem; font-size: .9rem; text-align: center; font-family: var(--display); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; background: var(--red); color: #fff; border: 1px solid var(--red); border-radius: 2px; padding: .65rem 1.3rem; font-size: 1.05rem; font-weight: 700; letter-spacing: .01em; cursor: pointer; text-decoration: none; transition: background var(--ease), transform var(--ease), box-shadow var(--ease); box-shadow: 3px 3px 0 var(--ink); }
.btn:hover { background: var(--red-dark); color: #fff; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-big { min-height: 52px; padding: .8rem 1.7rem; font-size: 1.15rem; }
.btn-small { min-height: 38px; padding: .4rem .95rem; font-size: .95rem; box-shadow: 2px 2px 0 var(--ink); }
.btn-ghost { background: var(--sheet); color: var(--ink); border-color: var(--ink); box-shadow: none; }
.btn-ghost:hover { background: var(--ink); color: #fff; box-shadow: none; transform: none; }
.btn-light { background: #fff; color: var(--blue); border-color: #fff; box-shadow: 3px 3px 0 #0b2a5c; }
.btn-light:hover { background: var(--paper); color: var(--red); box-shadow: 4px 4px 0 #0b2a5c; }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.btn-text { font-family: var(--display); font-weight: 700; font-stretch: 87.5%; color: var(--blue); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.btn-text:hover { color: var(--red); }
button.link { background: none; border: 0; color: var(--red); cursor: pointer; font-family: var(--display); font-size: .9rem; text-decoration: underline; padding: .3rem; min-height: 32px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: center; margin: 1.6rem 0 .8rem; }

/* Layout */
main { display: block; }
.section, .hero, .faq, .order, .legal { max-width: var(--max); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5.5rem) clamp(1rem, 4vw, 3rem); }
main.wide { max-width: 1600px; margin: 0 auto; padding: 1rem clamp(.8rem, 2vw, 2rem) 3rem; }
.section + .section { border-top: 1px solid var(--line); }
.grid-paper { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 20px 20px; background-position: -1px -1px; }
.hero { display: grid; gap: clamp(2rem, 4vw, 4rem); align-items: center; max-width: none; padding-left: max(clamp(1rem, 4vw, 3rem), calc((100vw - var(--max)) / 2 + 3rem)); padding-right: max(clamp(1rem, 4vw, 3rem), calc((100vw - var(--max)) / 2 + 3rem)); border-bottom: 1px solid var(--line); }
@media (min-width: 980px) { .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }
.hero-copy { max-width: 40rem; }
.lead { font-size: clamp(1.12rem, 1rem + .4vw, 1.3rem); line-height: 1.55; max-width: 36rem; }
.facts-strip { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 0; margin: 2rem 0 0; border: 1px solid var(--ink); background: var(--sheet); width: max-content; max-width: 100%; }
.facts-strip div { padding: .5rem 1rem; border-left: 1px solid var(--ink); }
.facts-strip div:first-child { border-left: 0; }
.facts-strip dt { font-family: var(--display); text-transform: uppercase; letter-spacing: .12em; font-size: .66rem; color: var(--muted); }
.facts-strip dd { margin: 0; font-family: var(--display); font-weight: 800; font-stretch: 87.5%; font-size: 1.35rem; line-height: 1.2; }
@media (max-width: 520px) { .facts-strip { grid-template-columns: repeat(2, auto); } .facts-strip div:nth-child(3) { border-left: 0; } .facts-strip div:nth-child(n+3) { border-top: 1px solid var(--ink); } }

/* The demo: a sheet with a header strip and controls below, like a drawing with its title strip. */
.hero-demo { background: var(--sheet); border: 1px solid var(--ink); box-shadow: 8px 8px 0 rgba(17, 35, 61, .12); margin: 0; }
.demo-head { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .9rem; border-bottom: 1px solid var(--ink); font-family: var(--display); font-stretch: 87.5%; }
.demo-out { font-weight: 800; color: var(--red); }
.tb-label { display: block; text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; color: var(--muted); font-weight: 700; }
.demo-head .tb-label { display: inline; font-size: .75rem; color: var(--ink); }
.demo-sheet { border: 0; box-shadow: none; transition: opacity var(--ease); }
.demo-sheet.is-drawing { opacity: .55; }
.demo-controls { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1.4rem; padding: .9rem; border-top: 1px solid var(--line); align-items: end; }
.demo-controls label > span { display: flex; justify-content: space-between; font-family: var(--display); font-weight: 700; font-size: .95rem; }
.demo-controls output { color: var(--red); }
.demo-controls .seg { grid-column: 1 / -1; }
.demo-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; padding: 0 .9rem .9rem; margin: 0; }
input[type=range] { width: 100%; accent-color: var(--red); height: 28px; }
.hero-demo figcaption { padding: .5rem .9rem; border-top: 1px solid var(--line); }

/* Steps: big numbers on a dimension line. */
.steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 2rem; }
@media (min-width: 820px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 0; } .steps li { padding: 0 2rem 0 0; } }
.steps li { position: relative; padding-top: 0; }
.step-nr { display: block; font-family: var(--display); font-weight: 800; font-stretch: 87.5%; font-size: 3.6rem; line-height: 1; color: var(--red); padding-bottom: .9rem; margin-bottom: 1rem; position: relative; }
.step-nr::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ink); }
.step-nr::before { content: ""; position: absolute; left: -4px; bottom: -5px; width: 10px; height: 10px; background: linear-gradient(135deg, transparent 45%, var(--red) 45%, var(--red) 58%, transparent 58%); }
.steps h3 { margin-bottom: .4rem; }
.steps p { margin: 0; color: var(--muted); max-width: 22rem; }

/* Blueprint band, full width. */
.band { width: 100%; }
.band-blue { background: var(--blue); color: #fff; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 24px 24px; }
.band-inner { max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem); display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 980px) { .band-inner { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); } }
.band-blue .label { color: #cfe0f7; } .band-blue .label span { color: #fff; }
.band-blue a:not(.btn) { color: #fff; }
.sheet-list { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.sheet-list li { padding: .7rem 0; border-top: 1px solid rgba(255,255,255,.3); }
.sheet-list b { font-family: var(--display); font-stretch: 87.5%; font-size: 1.1rem; display: block; }
.band-sheets { display: grid; gap: 1.4rem; }
@media (min-width: 640px) { .band-sheets { grid-template-columns: 1fr 1fr; } }
.band-sheets figcaption { color: #cfe0f7; }

/* Sheets */
.sheet { background: #fff; border: 1px solid var(--line); line-height: 0; overflow: hidden; }
.sheet svg { display: block; width: 100%; height: auto; }
figure { margin: 0; }
figcaption { font-size: .85rem; color: var(--muted); margin-top: .5rem; line-height: 1.4; font-family: var(--display); font-stretch: 87.5%; }
.band .sheet { border-color: #0b2a5c; box-shadow: 6px 6px 0 rgba(0,0,0,.18); }

/* Split sections and the requirements table */
.split { display: grid; gap: 1.5rem 4rem; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; } }
.prose { max-width: 40rem; }
.prose p:first-child { margin-top: 0; }
table.req { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--ink); font-size: .98rem; }
table.req th { font-family: var(--display); text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--ink); }
table.req td { padding: .6rem .8rem; border-top: 1px solid var(--line); vertical-align: top; }
table.req td:first-child { border-right: 1px solid var(--line); width: 50%; }
table.req td.no { color: var(--muted); font-style: italic; }

/* Price */
.price-grid { display: grid; gap: 1rem 4rem; align-items: center; }
@media (min-width: 900px) { .price-grid { grid-template-columns: auto 1fr; } }
.big-number { font-family: var(--display); font-weight: 800; font-stretch: 87.5%; font-size: clamp(4.5rem, 3rem + 7vw, 10rem); line-height: .9; letter-spacing: -.03em; color: var(--ink); white-space: nowrap; }
.big-number span { color: var(--red); }
.price { font-size: 2rem; font-weight: 800; margin: .3rem 0; }
.checks-list { list-style: none; padding: 0; margin: .8rem 0 1.2rem; }
.checks-list li { padding-left: 1.8rem; position: relative; margin: .55rem 0; }
.checks-list li::before { content: ""; position: absolute; left: .1rem; top: .5rem; width: .85rem; height: .45rem; border-left: 2.5px solid var(--red); border-bottom: 2.5px solid var(--red); transform: rotate(-45deg); }
.band-blue .checks-list li::before { border-color: #fff; }

/* FAQ */
.faq { border-top: 1px solid var(--line); }
.faq-list { max-width: 52rem; border-top: 1px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); padding: .2rem 0; }
.faq summary { cursor: pointer; font-family: var(--display); font-stretch: 87.5%; font-weight: 700; font-size: 1.15rem; padding: .8rem 2rem .8rem 0; list-style: none; position: relative; transition: color var(--ease); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: .2rem; top: .55rem; font-size: 1.5rem; color: var(--red); transition: transform var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--red); }
.faq details p { margin: 0 0 1rem; max-width: 46rem; }

/* Footer as a title block */
.site-footer { padding: 2.5rem clamp(1rem, 4vw, 3rem) 3rem; border-top: 1px solid var(--line); }
.titleblock { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); border: 1px solid var(--ink); background: var(--sheet); font-size: .92rem; }
.tb-cell { padding: .6rem .8rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); line-height: 1.45; }
.tb-name { grid-column: span 2; }
@media (min-width: 1100px) { .titleblock { grid-template-columns: 1.6fr repeat(5, 1fr); } .tb-name { grid-column: auto; } }
@media (max-width: 460px) { .tb-name { grid-column: auto; } }
.tb-cell a { color: var(--ink); }
.tb-cell a:hover { color: var(--red); }

/* Messages */
.error { color: #b3261e; font-weight: 600; margin: .3rem 0; }
.warn { color: var(--warn); margin: .3rem 0; }
.note { background: var(--sheet); border: 1px solid var(--line); border-left: 3px solid var(--blue); padding: .7rem 1rem; margin: 1rem 0; }
.note.ok { border-left-color: var(--ok); }
.consent { display: flex; gap: .7rem; align-items: flex-start; margin: 1rem 0; font-size: .98rem; cursor: pointer; }
.consent input { margin-top: .25rem; width: 1.25rem; height: 1.25rem; flex: none; accent-color: var(--red); }
.legal { max-width: 52rem; }
.legal h2 { font-size: 1.35rem; margin-top: 2rem; }

/* Tool */
.tool { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr); }
.tool > * { min-width: 0; }
@media (min-width: 1000px) { .tool { grid-template-columns: minmax(380px, 450px) 1fr; align-items: start; } .tool-preview { position: sticky; top: 4.6rem; } }
@media (max-width: 999px) { .tool-preview { order: -1; position: sticky; top: 3.6rem; z-index: 5; background: var(--paper); padding: .4rem 0; border-bottom: 1px solid var(--line); } .tool-preview .sheet { max-height: 38vh; overflow: auto; } }
.tool-form h1 { font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.4rem); margin: .6rem 0 .4rem; }
fieldset { border: 1px solid var(--ink); background: var(--sheet); border-radius: 0; padding: .4rem 1rem 1rem; margin: 0 0 1.1rem; min-width: 0; }
legend { font-weight: 800; padding: 0 .5rem; font-size: 1.05rem; }
.field { display: flex; flex-direction: column; gap: .2rem; font-size: .95rem; margin: .5rem 0; min-width: 0; }
.field > span:first-child { font-family: var(--display); font-stretch: 87.5%; font-weight: 700; }
.field small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=number], select { width: 100%; min-height: 44px; padding: .5rem .6rem; font-size: 1rem; border: 1px solid #aeb7c2; border-radius: 0; background: #fff; color: var(--ink); font-family: var(--display); transition: border-color var(--ease); }
input[type=text]:hover, input[type=number]:hover, select:hover { border-color: var(--ink); }
input:focus, select:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: var(--ink); }
.unit { display: flex; align-items: center; gap: .4rem; }
.unit em { font-style: normal; color: var(--muted); font-size: .85rem; font-family: var(--display); }
.grid2, .grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
.seg { display: flex; border: 1px solid var(--ink); margin: .5rem 0 .7rem; background: #fff; }
.seg label { flex: 1; text-align: center; cursor: pointer; border-left: 1px solid var(--ink); }
.seg label:first-child { border-left: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: .6rem .3rem; font-family: var(--display); font-stretch: 87.5%; font-weight: 700; transition: background var(--ease), color var(--ease); min-height: 44px; }
.seg label:hover span { background: var(--paper); }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--red); outline-offset: -3px; }
.seg-small span { padding: .45rem .3rem; min-height: 38px; font-size: .95rem; }
.walls-help { display: flex; gap: .9rem; align-items: center; }
.walls-help svg { width: 92px; flex: none; font-family: var(--display); font-weight: 800; font-size: 13px; fill: var(--ink); }
.walls-help svg rect { fill: var(--paper); stroke: var(--ink); }
.walls-help p { margin: 0; }
.checks { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .98rem; }
.checks input { accent-color: var(--red); width: 1.1rem; height: 1.1rem; }
.carport-only { display: none; }
.is-carport .carport-only { display: block; }
.opening { border-top: 1px dashed var(--line); padding-top: .6rem; margin-top: .6rem; }
.opening-head { display: flex; align-items: center; gap: .6rem; font-family: var(--display); }
.opening-head select { flex: 1; }
.add-row { display: flex; gap: .5rem; margin-top: .9rem; flex-wrap: wrap; }
.save-bar { background: var(--sheet); border: 1px solid var(--ink); padding: .9rem 1rem; }
.save-bar .btn { width: 100%; }
.tabs { display: flex; gap: 0; margin-bottom: .6rem; border: 1px solid var(--ink); width: max-content; max-width: 100%; background: #fff; overflow-x: auto; scrollbar-width: thin; }
.tabs button { flex: none; white-space: nowrap; }
.tabs button { background: transparent; border: 0; border-right: 1px solid var(--line); padding: .45rem .8rem; font-size: .9rem; cursor: pointer; color: var(--ink); font-family: var(--display); font-stretch: 87.5%; font-weight: 700; min-height: 38px; transition: background var(--ease); }
.tabs button:last-child { border-right: 0; }
.tabs button:hover { background: var(--paper); }
.tabs button[aria-selected=true] { background: var(--ink); color: #fff; }
.tool-preview .sheet { border-color: var(--ink); display: flex; justify-content: center; }
@media (min-width: 1000px) { .tool-preview .sheet svg { max-height: calc(100vh - 11rem); width: auto; max-width: 100%; } }
.sheet.has-errors { opacity: .35; }
.facts { font-size: .95rem; color: var(--muted); margin: .6rem 0 0; font-family: var(--display); font-stretch: 87.5%; }
[hidden] { display: none !important; }

/* Order */
.order { max-width: 1180px; }
.order h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem); margin: .6rem 0 .4rem; }
.crumbs { margin: 0; font-family: var(--display); }
.buy-box { display: grid; gap: 1rem 2.5rem; background: var(--sheet); border: 1px solid var(--ink); padding: 1.2rem 1.5rem; margin: 1.4rem 0; box-shadow: 8px 8px 0 rgba(17, 35, 61, .1); }
@media (min-width: 820px) { .buy-box { grid-template-columns: 1fr 1fr; align-items: center; } }
.sheets { display: grid; gap: 1.4rem; }
@media (min-width: 820px) { .sheets { grid-template-columns: 1fr 1fr; } }
.download { background: var(--sheet); border: 1px solid var(--ink); padding: .4rem 1.5rem 1.4rem; margin: 1.4rem 0; }
.download h2 { font-size: 1.3rem; margin: 1.1rem 0 .3rem; }
.downloads { display: flex; flex-wrap: wrap; gap: .6rem; }
.delivery { background: var(--sheet); border: 1px solid var(--line); padding: 1rem 1.2rem; }
.notfound { text-align: left; }
.notfound .big-number { font-size: clamp(5rem, 4rem + 8vw, 11rem); }
