:root {
  --bg: #f3ece0;
  --paper: #fbf7f0;
  --card: #fffdf8;
  --ink: #1b1813;
  --muted: #62584c;
  --line: #e3d6c3;
  --night: #0c1322;
  --slate: #15213a;
  --slate-2: #1f2d4a;
  --blue: #1f5079;
  --amber: #e09a35;
  --copper: #c9772a;
  --amber-deep: #8a5513;
  --glow: #f4b85c;
  --cream: #fff3df;
  --shadow: 0 30px 80px -30px rgba(52, 34, 10, 0.28);
  --radius: 24px;
  --font: Outfit, "Segoe UI", system-ui, sans-serif;
  --display: Fraunces, Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --container: 1180px;
  --tex-slate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='48'%3E%3Crect width='40' height='48' fill='%232f3943'/%3E%3Crect x='1' y='1' width='38' height='22' rx='1.5' fill='%23475461'/%3E%3Crect x='-19' y='25' width='38' height='22' rx='1.5' fill='%233f4a57'/%3E%3Crect x='21' y='25' width='38' height='22' rx='1.5' fill='%234f5c6a'/%3E%3Cpath d='M4 6h20M24 34h12' stroke='%23ffffff' stroke-opacity='.06'/%3E%3C/svg%3E");
  --tex-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='40'%3E%3Crect width='32' height='40' fill='%23652414'/%3E%3Cpath d='M0 20V9a8 8 0 0 1 16 0v11z' fill='%23b4532d'/%3E%3Cpath d='M16 20V9a8 8 0 0 1 16 0v11z' fill='%23c4643c'/%3E%3Cpath d='M-8 40V29a8 8 0 0 1 16 0v11zM8 40V29a8 8 0 0 1 16 0v11zM24 40V29a8 8 0 0 1 16 0v11z' fill='%23ae4f2a'/%3E%3Cpath d='M4 8a4 4 0 0 1 8 0M20 8a4 4 0 0 1 8 0M12 28a4 4 0 0 1 8 0' stroke='%23f09a6c' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .22 0 0 0 0 .1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 1rem;
  overflow-x: clip;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(circle at 50% 100%, transparent 15px, rgba(120, 84, 40, 0.07) 15.5px, rgba(120, 84, 40, 0.07) 16.5px, transparent 17px),
    radial-gradient(circle at 50% 100%, transparent 15px, rgba(120, 84, 40, 0.07) 15.5px, rgba(120, 84, 40, 0.07) 16.5px, transparent 17px);
  background-size: 34px 17px;
  background-position: 0 0, 17px 8.5px;
  mask-image: radial-gradient(ellipse 70% 60% at 85% 40%, #000, transparent 75%);
}

body::after {
  background-image: var(--grain);
  opacity: 0.35;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
  letter-spacing: -0.03em;
  line-height: 1.04;
  font-family: var(--display);
  font-weight: 560;
}

a {
  color: var(--blue);
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: white;
  color: var(--ink);
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
}

.skip:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo svg {
  width: 30px;
  height: 30px;
  flex: none;
}

/* Hero: dusk sky, live plan sheet, street of rooflines */

.hero {
  position: relative;
  color: white;
  isolation: isolate;
  background:
    radial-gradient(ellipse 75% 50% at 50% 112%, rgba(240, 146, 52, 0.62), rgba(196, 92, 46, 0.22) 42%, transparent 72%),
    radial-gradient(ellipse 50% 60% at 6% 20%, rgba(44, 92, 150, 0.35), transparent 65%),
    linear-gradient(180deg, #0a101d 0%, #111b31 46%, #2a2236 82%, #3a2730 100%);
  padding: 1.15rem 0 7.5rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 30% 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 28% 42%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1.4px 1.4px at 44% 12%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 58% 30%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.2px 1.2px at 71% 8%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 86% 26%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1.3px 1.3px at 94% 52%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 6% 60%, rgba(255, 255, 255, 0.45), transparent);
  background-size: 640px 360px;
  mask-image: linear-gradient(to bottom, #000 30%, transparent);
}

.hero .container {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.6rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
}

.nav a {
  position: relative;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.3rem;
  height: 2px;
  border-radius: 2px;
  background: var(--glow);
  transform: scaleX(0);
  transition: transform 0.25s;
}

.nav a:hover {
  color: white;
}

.nav a:hover::after {
  transform: scaleX(1);
}

.hero-grid {
  display: grid;
  gap: 2.25rem;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  color: var(--glow);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow-peak {
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--glow);
  border-left: 2px solid var(--glow);
  transform: translateY(3px) rotate(45deg);
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  font-weight: 540;
  max-width: 10.5em;
  line-height: 0.98;
  font-variation-settings: "SOFT" 50, "WONK" 1;
}

.hero h1 em {
  font-style: italic;
  font-weight: 460;
  color: var(--glow);
  background: linear-gradient(90deg, #ffd08a, #e9893a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-right: 0.12em;
}

.subhead {
  margin-top: 1.2rem;
  max-width: 34rem;
  color: #d8dfeb;
  font-size: 1.18rem;
  line-height: 1.5;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.7rem;
}

.hero-cta .btn {
  text-decoration: none;
  padding: 0.95rem 1.35rem;
}

.btn-ghost {
  color: white;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.pills li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #c9d3e1;
  font-size: 0.9rem;
}

.pills li::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  background: var(--glow);
  clip-path: polygon(50% 0, 100% 55%, 100% 100%, 0 100%, 0 55%);
}

.plan {
  position: relative;
  margin: 0;
  padding: 0.9rem 0.9rem 0;
  border-radius: 20px;
  border: 1px solid rgba(150, 196, 255, 0.24);
  background:
    linear-gradient(rgba(140, 190, 255, 0.07) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(140, 190, 255, 0.07) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(rgba(140, 190, 255, 0.12) 1px, transparent 1px) 0 0 / 110px 110px,
    linear-gradient(90deg, rgba(140, 190, 255, 0.12) 1px, transparent 1px) 0 0 / 110px 110px,
    linear-gradient(160deg, rgba(24, 48, 86, 0.92), rgba(14, 26, 48, 0.94));
  box-shadow:
    0 40px 90px -30px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: rotate(1.2deg);
}

.plan::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border: solid var(--glow);
  border-width: 2px 2px 0 0;
  pointer-events: none;
}

.plan-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-right: 1.8rem;
  color: #9fc0e6;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-art {
  height: 230px;
  margin: 0.25rem 0 0.4rem;
}

.hero-art svg {
  width: 100%;
  height: 100%;
}

.hero-art.intro polyline {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: draw 1.9s cubic-bezier(0.6, 0, 0.2, 1) forwards;
}

.hero-art.intro polygon {
  opacity: 0;
  animation: fade 0.9s 1s ease forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fade {
  to {
    opacity: 1;
  }
}

.plan-block {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  margin: 0 -0.9rem;
  border-top: 1px solid rgba(150, 196, 255, 0.22);
}

.plan-block > div {
  padding: 0.75rem 0.9rem 0.85rem;
  min-width: 0;
}

.plan-block > div + div {
  border-left: 1px solid rgba(150, 196, 255, 0.22);
}

.plan-label {
  color: #8fb0d6;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.plan-count {
  margin-top: 0.15rem;
  font-family: var(--display);
  font-size: 1.55rem;
  line-height: 1.05;
  color: var(--glow);
  white-space: nowrap;
}

.plan-meta {
  margin-top: 0.3rem;
  color: #e4ebf5;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
}

.roofline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: 92px;
  z-index: 0;
}

.roofline-back {
  fill: rgba(16, 20, 34, 0.6);
}

.roofline-front {
  fill: #090d17;
}

.roofline-windows {
  fill: #f4b85c;
  opacity: 0.85;
}

.roofline-windows rect:nth-child(3n) {
  opacity: 0.45;
}

/* Cap-tape ribbon */

.ribbon {
  position: relative;
  z-index: 2;
  margin: -1.2rem -2rem 0;
  overflow: hidden;
  background: var(--ink);
  transform: rotate(-1.4deg);
  box-shadow: 0 14px 30px -14px rgba(27, 24, 19, 0.6);
  border-block: 2px solid var(--copper);
}

.ribbon-track {
  display: flex;
  width: max-content;
  animation: tape 46s linear infinite;
}

.ribbon-track span {
  display: inline-flex;
  align-items: center;
  gap: 1.4rem;
  padding: 0.7rem 0 0.7rem 1.4rem;
  color: #f4cf96;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ribbon-track span::after {
  content: "";
  width: 0.7rem;
  height: 0.45rem;
  background: var(--copper);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

@keyframes tape {
  to {
    transform: translateX(-50%);
  }
}

/* Sections */

.section {
  position: relative;
  padding: 3rem 0 3.5rem;
}

.section-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 1rem;
  align-items: start;
  margin-bottom: 1.75rem;
}

.section-copy::before {
  content: attr(data-no);
  grid-row: 1 / span 5;
  font-family: var(--display);
  font-size: 3.2rem;
  font-weight: 600;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1.2px var(--copper);
  letter-spacing: -0.04em;
  padding-top: 0.15rem;
}

.section-copy:not([data-no])::before {
  display: none;
}

.kicker-light {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--amber-deep);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kicker-light::after {
  content: "";
  width: 2.4rem;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

h2 {
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  font-weight: 560;
  margin: 0.45rem 0 0.75rem;
  font-variation-settings: "SOFT" 30;
}

.lede {
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.08rem;
}

.lede a {
  font-weight: 600;
}

/* Calculator card */

.calc-card {
  position: relative;
  background:
    linear-gradient(180deg, #fff, rgba(255, 255, 255, 0) 120px),
    var(--card);
  border: 1px solid #e6d7c0;
  border-radius: 30px;
  box-shadow: var(--shadow), 0 2px 0 #fff inset;
  padding: 1rem;
}

.calc-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(201, 119, 42, 0.22);
  border-radius: 22px;
  pointer-events: none;
}

.noscript {
  background: var(--cream);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
}

.calc-controls {
  position: relative;
  padding: 0.35rem 0.25rem;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

.calc-controls fieldset + fieldset {
  margin-top: 1.7rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

legend,
.results h3 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font);
  font-size: 1.04rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding: 0;
  margin-bottom: 0.9rem;
}

.step-no {
  display: inline-grid;
  place-items: end center;
  width: 2rem;
  height: 1.9rem;
  padding-bottom: 0.18rem;
  background: var(--slate);
  color: var(--glow);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0;
  clip-path: polygon(50% 0, 100% 42%, 100% 100%, 0 100%, 0 42%);
  flex: none;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.choice {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s;
}

.choice:hover {
  border-color: #d3b78f;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -16px rgba(52, 34, 10, 0.35);
}

.choice input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice input:focus {
  outline: none;
}

.choice:has(input:focus-visible) {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.shape {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 8.6rem;
  padding: 0.75rem 0.45rem 0.9rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.shape-copy {
  display: grid;
  gap: 0.1rem;
}

.shape-desc {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--muted);
}

.shape-icon {
  display: block;
  width: 96px;
  height: 64px;
  margin-bottom: 0.2rem;
  transition: transform 0.3s;
}

.shape:hover .shape-icon {
  transform: translateY(-2px) scale(1.04);
}

.shape-icon svg,
.diagram svg,
.compare-icon svg {
  width: 100%;
  height: 100%;
}

.shape:has(input:checked) {
  border-color: var(--copper);
  background:
    radial-gradient(circle at 50% 0%, rgba(244, 184, 92, 0.3), transparent 70%),
    var(--cream);
  box-shadow: inset 0 0 0 1px var(--copper), 0 14px 26px -18px rgba(201, 119, 42, 0.8);
}

.shape:has(input:checked)::after {
  content: "";
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--copper);
  clip-path: polygon(50% 0, 100% 55%, 100% 100%, 0 100%, 0 55%);
}

.shape:has(input:checked) .shape-desc {
  color: #7a5a30;
}

.material {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.7rem;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
  font-size: 0.92rem;
  text-align: left;
}

.swatch {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.material:has(input:checked) {
  background: var(--slate);
  color: white;
  border-color: var(--slate);
  box-shadow: 0 14px 26px -16px rgba(21, 33, 58, 0.9);
}

.material:has(input:checked) .swatch {
  box-shadow: 0 0 0 2px var(--slate), 0 0 0 4px var(--glow);
}

/* Material textures */

.tex-asphalt {
  background-color: #2c333c;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.2) 0.6px, transparent 1.1px),
    radial-gradient(rgba(0, 0, 0, 0.5) 0.7px, transparent 1.2px),
    linear-gradient(180deg, transparent 0 82%, rgba(0, 0, 0, 0.55) 82% 100%),
    linear-gradient(90deg, transparent 0 96%, rgba(0, 0, 0, 0.4) 96% 100%),
    linear-gradient(90deg, transparent 0 96%, rgba(0, 0, 0, 0.4) 96% 100%),
    linear-gradient(160deg, #3b4450, #262c34);
  background-size: 5px 5px, 7px 7px, 100% 18px, 34px 36px, 34px 36px, 100% 100%;
  background-position: 0 0, 2px 3px, 0 0, 0 0, 17px 18px, 0 0;
}

.tex-metal {
  background-color: #8b9caf;
  background-image:
    linear-gradient(105deg, rgba(255, 255, 255, 0) 25%, rgba(255, 255, 255, 0.4) 42%, rgba(255, 255, 255, 0) 58%),
    repeating-linear-gradient(90deg, #6d7f93 0 2px, #c2cfdb 2px 4px, #98a9ba 4px 24px, #8394a7 24px 26px);
}

.tex-tile {
  background-color: #8e3a22;
  background-image: var(--tex-tile);
  background-size: 24px 30px;
}

.tex-slate {
  background-color: #3b4652;
  background-image: var(--tex-slate);
  background-size: 30px 36px;
}

.dims {
  display: grid;
  gap: 1.1rem;
}

.dim label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.number-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.5rem 0.8rem;
  background: #fff;
  margin-bottom: 0.55rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.number-wrap:focus-within {
  border-color: var(--copper);
  box-shadow: 0 0 0 4px rgba(224, 154, 53, 0.18);
}

.number-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 560;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.number-wrap input:focus {
  outline: none;
}

.suffix {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  flex: none;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.slider {
  --pct: 40%;
  width: 100%;
  height: 1.8rem;
  margin: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}

.slider:focus {
  outline: none;
}

.slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px rgba(224, 154, 53, 0.35);
}

.slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--copper), var(--glow)) 0 0 / var(--pct) 100% no-repeat,
    repeating-linear-gradient(90deg, #e3d6c3 0 2px, #efe6d8 2px 10px);
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--slate);
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px rgba(21, 33, 58, 0.25), 0 4px 10px rgba(21, 33, 58, 0.3);
}

.slider::-moz-range-track {
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: #e3d6c3;
}

.slider::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--copper), var(--glow));
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--slate);
  box-shadow: 0 0 0 1px rgba(21, 33, 58, 0.25);
}

.hint {
  min-height: 1.2em;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.presets,
.pitch-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.presets {
  margin-bottom: 1.1rem;
}

.preset,
.pitch-picks button,
.compare-card {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.preset {
  display: grid;
  gap: 0.05rem;
  text-align: left;
  border-radius: 14px;
  padding: 0.55rem 0.75rem;
}

.preset:hover,
.pitch-picks button:hover {
  border-color: #d3b78f;
  transform: translateY(-1px);
}

.preset strong {
  font-size: 0.86rem;
}

.preset span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.preset.is-on,
.pitch-picks button.is-on {
  background: var(--slate);
  color: white;
  border-color: var(--slate);
}

.preset.is-on span {
  color: var(--glow);
}

.pitch-picks {
  margin-top: 0.55rem;
}

.pitch-picks button {
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.mode-switch,
.unit-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mode-switch {
  margin-bottom: 0.85rem;
}

.mode-switch button,
.unit-opt span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font: 600 0.78rem/1 var(--font);
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.mode-switch button.is-on,
.unit-opt:has(input:checked) span {
  background: var(--slate);
  border-color: var(--slate);
  color: white;
}

.unit-opt {
  position: relative;
}

.unit-opt input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.unit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin-bottom: 0.9rem;
}

.unit-row .hint {
  margin: 0;
}

.draw-panel {
  margin-top: 0.9rem;
}

.plan-board {
  height: 230px;
  margin: 0.4rem 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(rgba(21, 33, 58, 0.05) 1px, transparent 1px) 0 0 / 18px 18px,
    linear-gradient(90deg, rgba(21, 33, 58, 0.05) 1px, transparent 1px) 0 0 / 18px 18px,
    #fffaf3;
}

.plan-board svg {
  width: 100%;
  height: 100%;
}

.plan-main {
  fill: #24344d;
}

.plan-wing {
  fill: #c9772a;
  cursor: pointer;
}

.plan-ridge {
  stroke: #f4b85c;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.plan-hit {
  fill: transparent;
  cursor: pointer;
}

.wing-list {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.wing-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.wing-row strong {
  font-size: 0.86rem;
  min-width: 6.2rem;
}

.wing-row label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.wing-row input {
  width: 4.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.28rem 0.4rem;
  font: inherit;
  color: var(--ink);
}

.wing-row button,
#add-wing:disabled {
  border: 0;
  background: transparent;
  color: var(--copper);
  font: 600 0.78rem/1 var(--font);
  cursor: pointer;
}

#add-wing:disabled {
  opacity: 0.4;
  cursor: default;
}

.guide-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
}

.guide-card {
  display: block;
  padding: 1.15rem 1.15rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.guide-card:hover {
  border-color: #d3b78f;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -18px rgba(52, 34, 10, 0.4);
}

.guide-card h3 {
  font-size: 1.25rem;
  margin: 0.25rem 0 0.4rem;
}

.guide-card p:last-child {
  color: #5c5146;
  margin: 0;
}

.method {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}

.method summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--blue);
}

.method summary:focus-visible,
.faq-list summary:focus-visible,
.btn:focus-visible,
.nav a:focus-visible,
.logo:focus-visible,
.footer a:focus-visible,
.preset:focus-visible,
.pitch-picks button:focus-visible,
.compare-card:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.method-body {
  padding-top: 0.75rem;
  color: #4a4136;
  font-size: 0.95rem;
}

.method-body p,
.faq-body p {
  margin-bottom: 0.75rem;
}

.method-body ul,
.faq-body ul {
  margin: 0 0 0.75rem;
  padding-left: 1.15rem;
}

.method-body li + li,
.faq-body li + li {
  margin-top: 0.35rem;
}

/* Results: a dark plan sheet with a roof-peak top */

.results {
  position: relative;
  color: white;
  border-radius: 22px;
  padding: 2.1rem 1.1rem 1.15rem;
  margin-top: 1.4rem;
  background:
    linear-gradient(rgba(140, 190, 255, 0.05) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, rgba(140, 190, 255, 0.05) 1px, transparent 1px) 0 0 / 20px 20px,
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(240, 146, 52, 0.28), transparent 70%),
    linear-gradient(180deg, #1a2844, #0f1729);
  clip-path: polygon(0 26px, 50% 0, 100% 26px, 100% 100%, 0 100%);
  box-shadow: var(--shadow);
}

.results::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  clip-path: polygon(0 26px, 50% 0, 100% 26px, 100% 29px, 50% 3px, 0 29px);
  background: var(--glow);
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.results h3 {
  color: white;
  margin: 0;
}

.results .step-no {
  background: var(--glow);
  color: var(--night);
}

.live-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--glow);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #3ddc97;
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(61, 220, 151, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(61, 220, 151, 0);
  }
}

#result-meta {
  color: #c8d3e3;
  font-size: 0.9rem;
  margin: 0.8rem 0 0.6rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
}

.diagram-wrap {
  position: relative;
  margin-top: 0.85rem;
}

.diagram {
  height: 230px;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.diagram.is-dragging {
  cursor: grabbing;
}

.diagram-tools {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 0.3rem;
}

.diagram-tools button {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.55rem;
  border: 1px solid rgba(244, 184, 92, 0.35);
  border-radius: 999px;
  background: rgba(12, 19, 34, 0.75);
  color: #f3e3c4;
  font: 600 0.72rem/1 var(--mono);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.diagram-tools button:hover,
.diagram-tools button:focus-visible {
  border-color: var(--glow);
  background: rgba(244, 184, 92, 0.16);
}

.diagram-hint {
  font-style: normal;
  color: #7f8ea6;
}

.diagram-key em {
  margin-left: auto;
  font-style: normal;
  color: var(--glow);
}

.diagram-key {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #b7c3d4;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.85rem;
}

.diagram-key span {
  width: 1.1rem;
  height: 3px;
  border-radius: 999px;
  background: var(--amber);
}

.stat-grid,
.mini-grid,
.cost-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.stat-grid > div,
.mini-grid > div,
.cost-grid > div {
  min-width: 0;
}

.kicker {
  color: #93a7bf;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.stat-value,
.mini-value,
.cost-value,
output {
  font: inherit;
  color: inherit;
}

.stat-value {
  font-family: var(--display);
  font-size: clamp(2.4rem, 4vw, 3.3rem);
  font-weight: 540;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-grid > div + div .stat-value {
  color: var(--glow);
}

.unit {
  font-family: var(--font);
  font-size: 0.36em;
  font-weight: 500;
  letter-spacing: 0;
  color: #c5d0de;
  margin-left: 0.15rem;
}

.breakdown {
  margin-top: 0.75rem;
  font-weight: 600;
}

.fine {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  margin-top: 0.3rem;
}

.results .fine {
  color: #aebbd0;
}

.rule {
  border: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  margin: 0.95rem 0;
}

.mini-value,
.cost-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.mini-value {
  font-size: 1.2rem;
}

.cost-heading {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}

.cost-bars {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.cost-bar-row {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.5rem;
  align-items: center;
  color: #aebbd0;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
}

.cost-bar-row i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.cost-bar-row b {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--copper), var(--glow));
  transition: width 0.5s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.cost-bar-row:first-child b {
  background: linear-gradient(90deg, #3a8f7c, #6fd3b0);
}

.cost-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.75rem 0.8rem;
}

.cost-value {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.25;
}

.shop {
  margin-top: 0.9rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(244, 184, 92, 0.35);
}

.shop ul {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
}

.shop li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.9rem;
}

.shop li span {
  color: #b7c3d4;
}

.actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.1rem;
}

.btn-share {
  font-size: 0.86rem;
}

.region {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0.35rem 0 0.2rem;
  color: #b7c3d4;
  font-size: 0.82rem;
}

.region select {
  border: 1px solid rgba(244, 184, 92, 0.35);
  border-radius: 999px;
  background: rgba(12, 19, 34, 0.55);
  color: #f3e3c4;
  font: 600 0.78rem/1 var(--font);
  padding: 0.4rem 0.7rem;
}

.library {
  margin-top: 0.9rem;
}

.library label {
  display: block;
  margin-bottom: 0.35rem;
  color: #b7c3d4;
  font-size: 0.78rem;
}

.library-row {
  display: flex;
  gap: 0.45rem;
}

.library-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: white;
  font: inherit;
  padding: 0.55rem 0.7rem;
}

.library ul {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
}

.library li {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.28rem 0;
}

.library li button {
  border: 0;
  background: transparent;
  color: #f4b85c;
  font: 600 0.78rem/1 var(--font);
  cursor: pointer;
}

.library li button[data-load] {
  margin-right: auto;
  color: white;
  font-size: 0.92rem;
  text-align: left;
}

.library-empty {
  color: #8ea0b8;
  font-size: 0.82rem;
}

.lost {
  min-height: calc(100vh - 14rem);
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.lost-code {
  margin: 0;
  font-family: var(--display, "Fraunces", serif);
  font-size: clamp(5rem, 18vw, 9rem);
  line-height: 0.9;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--copper);
}

.lost .btn {
  display: inline-flex;
  margin-top: 0.6rem;
  text-decoration: none;
}

.copy-fallback {
  margin-top: 0.75rem;
}

.copy-fallback p {
  color: var(--glow);
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
}

.copy-fallback textarea {
  width: 100%;
  min-height: 9.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #0a111d;
  color: #f4f7fb;
  padding: 0.7rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.45;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 0.9rem 0.95rem;
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.3;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-primary {
  background: linear-gradient(180deg, #f6be63, var(--amber));
  color: #1f1404;
  box-shadow: 0 10px 24px -12px rgba(224, 154, 53, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #ffc977, #eaa641);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: white;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.26);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
}

.btn:active {
  transform: translateY(1px);
}

/* Shape comparison */

.compare-grid,
.material-cards,
.notes {
  display: grid;
  gap: 0.85rem;
}

.compare-card {
  position: relative;
  display: grid;
  border-radius: 22px;
  padding: 1rem 1.05rem 1.1rem;
  text-align: left;
  box-shadow: 0 18px 40px -28px rgba(52, 34, 10, 0.4);
  overflow: hidden;
}

.compare-card:hover {
  transform: translateY(-3px);
  border-color: #d3b78f;
}

.compare-icon {
  display: block;
  height: 86px;
  margin: -0.2rem -0.3rem 0.6rem;
  border-radius: 14px;
  background:
    linear-gradient(rgba(31, 80, 121, 0.06) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(90deg, rgba(31, 80, 121, 0.06) 1px, transparent 1px) 0 0 / 14px 14px,
    #f7f2ea;
  padding: 0.35rem;
}

.compare-card small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compare-card strong {
  display: block;
  margin: 0.3rem 0 0.15rem;
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 540;
  letter-spacing: -0.03em;
}

.compare-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.compare-card.is-on {
  border-color: var(--copper);
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--copper), 0 18px 40px -24px rgba(201, 119, 42, 0.7);
}

.compare-card.is-on .compare-icon {
  background:
    linear-gradient(rgba(201, 119, 42, 0.1) 1px, transparent 1px) 0 0 / 14px 14px,
    linear-gradient(90deg, rgba(201, 119, 42, 0.1) 1px, transparent 1px) 0 0 / 14px 14px,
    #fff8ec;
}

/* Materials: dark band with a sawtooth roofline edge */

.band-dark {
  color: #e9eef6;
  padding: 5rem 0 5rem;
  margin: 1.5rem 0;
  background:
    radial-gradient(ellipse 60% 50% at 90% 10%, rgba(240, 146, 52, 0.18), transparent 70%),
    radial-gradient(ellipse 50% 60% at 0% 100%, rgba(44, 92, 150, 0.3), transparent 70%),
    linear-gradient(180deg, #0f1729, #15213a);
}

.band-dark::before,
.band-dark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 28px;
  background-size: 56px 28px;
  background-repeat: repeat-x;
}

.band-dark::before {
  top: -1px;
  height: 22px;
  background-image:
    linear-gradient(135deg, var(--bg) 50%, transparent 50%),
    linear-gradient(225deg, var(--bg) 50%, transparent 50%);
  background-size: 44px 44px;
  background-position: 0 100%;
}

.band-dark::after {
  bottom: -1px;
  height: 22px;
  background-image:
    linear-gradient(45deg, var(--bg) 50%, transparent 50%),
    linear-gradient(315deg, var(--bg) 50%, transparent 50%);
  background-size: 44px 44px;
  background-position: 0 0;
}

.band-dark h2 {
  color: white;
}

.band-dark .lede {
  color: #b9c5d6;
}

.band-dark .kicker-light {
  color: var(--glow);
}

.band-dark .section-copy::before {
  -webkit-text-stroke-color: var(--glow);
}

.studio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 0 1.1rem 1.15rem;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s;
}

.studio-card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 184, 92, 0.45);
}

.studio-tex {
  height: 120px;
  margin: 0 -1.1rem 0.25rem;
  position: relative;
}

.studio-tex::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(15, 23, 41, 0.85));
}

.studio-card h3 {
  font-size: 1.45rem;
  margin: 0.55rem 0 0.45rem;
  color: white;
}

.studio-card p {
  color: #c2cddc;
  font-size: 0.94rem;
}

.studio-card dl {
  display: grid;
  gap: 0.35rem;
  margin: auto 0 0;
  padding-top: 1rem;
}

.studio-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.86rem;
}

.studio-card dt {
  color: #93a7bf;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  align-self: center;
}

.studio-card dd {
  margin: 0;
  font-weight: 600;
  color: white;
}

/* Install guide */

.steps {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.steps li,
.notes article {
  position: relative;
  background: var(--card);
  border: 1px solid #e6d7c0;
  border-radius: 22px;
  padding: 1.2rem 1.15rem 1.25rem;
  box-shadow: 0 18px 40px -30px rgba(52, 34, 10, 0.45);
}

.steps li > span {
  display: inline-grid;
  place-items: end center;
  width: 2.6rem;
  height: 2.4rem;
  padding-bottom: 0.3rem;
  background: var(--slate);
  color: var(--glow);
  font-family: var(--mono);
  font-size: 0.78rem;
  clip-path: polygon(50% 0, 100% 42%, 100% 100%, 0 100%, 0 42%);
}

.steps h3,
.notes h3 {
  font-size: 1.4rem;
  margin: 0.65rem 0 0.4rem;
}

.steps p,
.notes p {
  color: #4a4136;
  font-size: 0.95rem;
}

.notes {
  margin-top: 0.85rem;
}

.notes article {
  background:
    linear-gradient(90deg, var(--copper) 0 4px, transparent 4px),
    var(--paper);
}

/* Costs: shingle band */

.band-shingle {
  padding: 4rem 0 4.5rem;
  background:
    radial-gradient(circle at 50% 100%, transparent 21px, rgba(138, 85, 19, 0.1) 21.5px, rgba(138, 85, 19, 0.1) 23px, transparent 23.5px) 0 0 / 48px 24px,
    radial-gradient(circle at 50% 100%, transparent 21px, rgba(138, 85, 19, 0.1) 21.5px, rgba(138, 85, 19, 0.1) 23px, transparent 23.5px) 24px 12px / 48px 24px,
    linear-gradient(180deg, #efe3cf, #f3ece0);
  border-block: 1px solid #e2d1b6;
}

.table-card,
.faq-list {
  background: var(--card);
  border: 1px solid #e3d2b8;
  border-radius: 22px;
  box-shadow: 0 24px 60px -36px rgba(52, 34, 10, 0.5);
}

.table-card {
  overflow: hidden;
}

.cost-table {
  width: 100%;
  border-collapse: collapse;
}

.cost-table th,
.cost-table td {
  text-align: left;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.cost-table thead th {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c9d4e3;
  font-weight: 500;
  background: var(--slate);
  border-bottom: 0;
}

.cost-table tbody th {
  font-weight: 600;
}

.cost-table tbody tr {
  transition: background 0.2s;
}

.cost-table tbody tr:hover {
  background: #fff6e6;
}

.cost-table td {
  font-variant-numeric: tabular-nums;
}

.cost-table td:nth-child(4) {
  font-weight: 600;
  color: var(--amber-deep);
}

.chip {
  display: inline-block;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 8px;
  margin-right: 0.7rem;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.cost-table tbody tr:last-child th,
.cost-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-note {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 46rem;
  margin-top: 1rem;
}

/* FAQ */

.faq-contact {
  margin-top: 1.1rem;
  color: var(--muted);
}

.faq-contact a {
  font-weight: 600;
}

.faq-list {
  padding: 0 1.2rem;
}

.faq-list details + details {
  border-top: 1px solid var(--line);
}

.faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "";
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 10px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 2px 10px no-repeat,
    var(--cream);
  transition: transform 0.25s, background-color 0.25s;
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
  background:
    linear-gradient(#fff, #fff) center / 10px 2px no-repeat,
    linear-gradient(#fff, #fff) center / 2px 10px no-repeat,
    var(--slate);
}

.faq-list h3 {
  font-size: 1.2rem;
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.faq-body {
  padding: 0 0 1.2rem;
  color: #3f372d;
}

/* Footer */

.footer {
  position: relative;
  margin-top: 2rem;
  background:
    radial-gradient(ellipse 60% 80% at 50% 120%, rgba(240, 146, 52, 0.25), transparent 70%),
    var(--night);
  color: #c9d3e1;
  padding: 3.5rem 0 2rem;
  overflow: hidden;
}

.footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 22px;
  background-image:
    linear-gradient(135deg, var(--bg) 50%, transparent 50%),
    linear-gradient(225deg, var(--bg) 50%, transparent 50%);
  background-size: 44px 44px;
  background-position: 0 100%;
  background-repeat: repeat-x;
}

.footer-mark {
  font-family: var(--display);
  font-size: clamp(3.4rem, 13vw, 10rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(244, 184, 92, 0.45);
  margin-bottom: 1.4rem;
  user-select: none;
}

.footer-mark span {
  color: var(--glow);
  -webkit-text-stroke: 0;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.6rem;
  margin-bottom: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
  margin: 0;
}

.footer a {
  color: white;
  text-underline-offset: 0.2em;
}

.disclaimer {
  color: #9fb0c6;
}

/* Privacy page */

.subbar {
  background: var(--night);
  color: white;
}

.subbar .bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 4.4rem;
}

.subbar .nav a {
  color: rgba(255, 255, 255, 0.8);
}

.prose {
  max-width: 42rem;
  padding: 3rem 0 4rem;
}

.prose h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  margin-bottom: 0.5rem;
}

.prose .updated {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  margin-bottom: 1.8rem;
}

.prose h2 {
  font-size: 1.5rem;
  margin: 2rem 0 0.5rem;
}

.prose p,
.prose li {
  color: #3f372d;
  margin-bottom: 0.75rem;
}

.prose a {
  color: var(--copper);
}

.prose ul {
  padding-left: 1.2rem;
  margin-bottom: 0.9rem;
}

/* Scroll reveal */

.reveal > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.is-in > * {
  opacity: 1;
  transform: none;
}

.reveal.is-in > *:nth-child(2) { transition-delay: 0.07s; }
.reveal.is-in > *:nth-child(3) { transition-delay: 0.14s; }
.reveal.is-in > *:nth-child(4) { transition-delay: 0.21s; }

.faq-list.reveal > *,
.table-card.reveal > * {
  transform: none;
}

.sticky-bar {
  display: none;
}

.print-only {
  display: none;
}

@media (min-width: 720px) {
  .compare-grid,
  .notes,
  .material-cards,
  .steps {
    grid-template-columns: 1fr 1fr;
  }

  .section-copy::before {
    font-size: 5rem;
  }

  .section-copy {
    column-gap: 1.5rem;
  }
}

@media (min-width: 800px) {
  .section {
    padding: 4rem 0 4.5rem;
  }

  .calc-card {
    padding: 1.6rem;
  }

  .dims {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .hero {
    padding: 1.25rem 0 9rem;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  }

  .hero-art {
    height: 270px;
  }

  .roofline {
    height: 120px;
  }

  .faq-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr);
    gap: 2.5rem;
    align-items: start;
  }

  .faq-layout .section-copy {
    position: sticky;
    top: 2rem;
  }
}

@media (min-width: 980px) {
  .calc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(330px, 0.88fr);
    gap: 1.6rem;
    align-items: start;
  }

  .results {
    margin-top: 0;
  }
}

@media (min-width: 1040px) {
  .compare-grid,
  .material-cards,
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .notes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .steps::before {
    content: "";
    position: absolute;
    top: 2.4rem;
    left: 2rem;
    right: 2rem;
    border-top: 2px dashed var(--copper);
    opacity: 0.5;
    z-index: -1;
  }
}

@media (max-width: 860px) {
  body {
    padding-bottom: calc(5.2rem + env(safe-area-inset-bottom));
  }

  .sticky-bar {
    position: fixed;
    z-index: 15;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(0.75rem + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    background: var(--slate);
    border: 1px solid rgba(244, 184, 92, 0.35);
    color: white;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(16, 24, 38, 0.35);
  }

  .sticky-bar strong {
    display: block;
    font-size: 0.98rem;
    color: white;
  }

  .sticky-bar span {
    color: #d5deea;
    font-size: 0.85rem;
  }

  .sticky-go {
    color: #1c1404 !important;
    background: var(--amber);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-weight: 600;
    font-size: 0.82rem !important;
  }
}

.sticky-bar.is-hidden {
  display: none !important;
}

@media (max-width: 560px) {
  .material-grid,
  .cost-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 11vw, 3.2rem);
  }

  .plan {
    transform: none;
  }

  .plan-block {
    grid-template-columns: 1fr 1fr;
  }

  .plan-block > div:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    border-left: 0;
    border-top: 1px solid rgba(150, 196, 255, 0.22);
  }

  .hero-art {
    height: 190px;
  }
}

@media (max-width: 720px) {
  .guide-cards {
    grid-template-columns: 1fr;
  }

  .cost-table thead {
    display: none;
  }

  .cost-table,
  .cost-table tbody,
  .cost-table tr,
  .cost-table th,
  .cost-table td {
    display: block;
    width: 100%;
  }

  .cost-table tr {
    padding: 0.9rem 1rem 1rem;
    border-bottom: 1px solid var(--line);
  }

  .cost-table tbody tr:last-child {
    border-bottom: 0;
  }

  .cost-table th,
  .cost-table td {
    border: 0;
    padding: 0.22rem 0;
  }

  .cost-table tbody th {
    font-size: 1.05rem;
    padding-bottom: 0.45rem;
  }

  .cost-table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
  }

  .cost-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 500;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .hero-art.intro polyline {
    stroke-dashoffset: 0;
  }

  .hero-art.intro polygon,
  .reveal > * {
    opacity: 1;
    transform: none;
  }
}

@media print {
  @page {
    margin: 0.6in;
  }

  body {
    background: white;
    padding: 0;
  }

  body::before,
  body::after {
    display: none;
  }

  .hero,
  .ribbon,
  .section-copy,
  #compare,
  #materials,
  #guide,
  #costs,
  #faq,
  #articles,
  .footer,
  .sticky-bar,
  .skip,
  .calc-controls,
  .actions,
  .diagram-tools,
  .diagram-hint,
  .live-flag,
  .copy-fallback,
  .cost-bars,
  .library {
    display: none !important;
  }

  .diagram-wrap,
  .diagram,
  .shop {
    display: block !important;
  }

  .results-head,
  #save-note {
    display: none !important;
  }

  .diagram {
    height: 128px;
    cursor: default;
    background: #101826 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .shop {
    margin-top: 0.35rem;
    padding: 0.3rem 0.55rem 0.4rem !important;
  }

  .shop li {
    padding: 0.08rem 0 !important;
  }

  .shop .fine {
    margin: 0.2rem 0 0;
  }

  .diagram-key,
  .diagram-key em {
    color: #111 !important;
  }

  .shop,
  .shop li span,
  .shop strong,
  .region,
  .region select {
    color: #111 !important;
    background: white !important;
  }

  .section,
  .calc-card,
  .results {
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
    background: white !important;
    color: #111 !important;
    clip-path: none;
  }

  .calc-card::before,
  .results::before {
    display: none;
  }

  .calc-layout {
    display: block !important;
  }

  .results {
    position: static;
    width: 100% !important;
    max-width: 40rem;
  }

  .results h3,
  .stat-value,
  .cost-heading,
  .cost-value,
  .mini-value,
  .breakdown,
  #result-meta,
  .unit {
    color: #111 !important;
  }

  .results .fine,
  .kicker {
    color: #333 !important;
  }

  .cost-box {
    background: transparent;
    border: 0;
    padding-left: 0;
  }

  .print-only {
    display: block !important;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
  }

  .step-no {
    background: #111 !important;
    color: white !important;
  }
}
