:root {
  --ink: #101616;
  --muted: #596462;
  --paper: #f4f1e8;
  --card: #fffdf7;
  --lime: #dfff58;
  --teal: #127d72;
  --line: #c8cec8;
  --shadow: 0 24px 70px rgba(16, 22, 22, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .38;
  background-image: radial-gradient(#aab0a8 .65px, transparent .65px);
  background-size: 7px 7px;
}

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.hero { padding: 42px 0 64px; max-width: 900px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; font-weight: 850; letter-spacing: -.03em; }
.brand-mark { position: relative; display: grid; grid-template-columns: repeat(2, 8px); grid-template-rows: repeat(2, 8px); gap: 3px; width: 22px; height: 22px; }
.brand-mark i { display: block; background: var(--ink); }
.brand-mark i:nth-child(3) { grid-column: 2; grid-row: 2; width: 5px; height: 5px; align-self: end; justify-self: end; }
.eyebrow { margin: 68px 0 14px; color: var(--teal); font-size: .76rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.8rem, 9vw, 7.7rem); line-height: .87; letter-spacing: -.075em; font-weight: 500; }
h1 em { color: var(--teal); font-weight: inherit; }
.intro { max-width: 620px; margin: 30px 0 0; color: var(--muted); font-size: 1.12rem; line-height: 1.7; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.controls { padding: clamp(28px, 5vw, 58px); border-right: 1px solid var(--line); }
.section-heading { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 34px; }
.step { display: inline-flex; justify-content: center; align-items: center; min-width: 38px; height: 26px; border-radius: 99px; background: var(--lime); font-size: .72rem; font-weight: 900; letter-spacing: .08em; }
h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.9rem, 3vw, 2.7rem); font-weight: 500; letter-spacing: -.04em; }
.section-heading p { margin: 7px 0 0; color: var(--muted); }

.field { display: grid; gap: 8px; }
.field > span { font-size: .78rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.field small { justify-self: end; color: var(--muted); font-variant-numeric: tabular-nums; }
textarea, select, input[type="number"] {
  width: 100%;
  border: 1px solid #aeb6b1;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 14px 15px;
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 94px; resize: vertical; line-height: 1.45; }
textarea:focus, select:focus, input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(18,125,114,.13); }
.field-wide { margin-bottom: 26px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; }
.custom-size { grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }

.options { margin: 28px 0 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.options summary { padding: 18px 0; cursor: pointer; font-weight: 800; list-style: none; }
.options summary::-webkit-details-marker { display: none; }
.options summary::after { content: "+"; float: right; font-size: 1.25rem; font-weight: 500; }
.options[open] summary::after { content: "−"; }
.options summary span { color: var(--muted); margin-left: 6px; font-weight: 500; }
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 4px 0 22px; }
.check-field { display: flex; grid-column: 1 / -1; gap: 10px; align-items: center; color: var(--muted); font-size: .9rem; }
.check-field input { width: 18px; height: 18px; accent-color: var(--teal); }

.primary { width: 100%; min-height: 58px; border: 0; background: var(--ink); color: white; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font: inherit; font-weight: 850; transition: transform .15s, background .15s; }
.primary:hover { background: var(--teal); transform: translateY(-2px); }
.primary:disabled { opacity: .6; cursor: wait; transform: none; }
.primary svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.print-note { margin: 14px 0 0; color: var(--muted); font-size: .81rem; line-height: 1.5; }
.error { margin: 0 0 18px; padding: 12px 14px; background: #ffe8e2; border-left: 3px solid #ae351e; color: #7e2516; font-size: .9rem; }

.preview-panel { display: flex; flex-direction: column; padding: clamp(28px, 4vw, 48px); background: #e8ece4; }
.preview-topline { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.preview-topline > div { display: flex; align-items: center; gap: 12px; }
.preview-topline h2 { font-size: 2rem; }
.badge { border: 1px solid var(--ink); border-radius: 99px; padding: 6px 10px; font-size: .72rem; font-weight: 850; }
.preview-stage { display: grid; place-items: center; flex: 1; min-height: 420px; padding: 24px; background: #d8ded5; overflow: hidden; }
#preview { display: block; max-width: 100%; max-height: 520px; filter: drop-shadow(0 12px 22px rgba(16,22,22,.16)); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 24px 0 0; border-top: 1px solid #adb6ae; border-bottom: 1px solid #adb6ae; }
.stats div { padding: 15px 10px 15px 0; }
.stats div + div { padding-left: 14px; border-left: 1px solid #adb6ae; }
.stats dt { color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.stats dd { margin: 4px 0 0; font-size: .79rem; font-weight: 750; }
.assembly-tip { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; }
.assembly-tip > span { color: var(--teal); font-size: 1.3rem; }
.assembly-tip p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.assembly-tip strong { display: block; color: var(--ink); }

.how-it-works { padding: 110px 0 90px; }
.how-it-works .eyebrow { margin: 0 0 12px; }
.how-it-works ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 0; margin: 46px 0 0; list-style: none; border-top: 1px solid var(--line); }
.how-it-works li { display: flex; gap: 18px; padding: 27px 28px 0 0; }
.how-it-works li + li { padding-left: 28px; border-left: 1px solid var(--line); }
.how-it-works li > span { color: var(--teal); font-family: Georgia, serif; font-size: 1.8rem; }
.how-it-works strong { font-size: 1rem; }
.how-it-works li p { color: var(--muted); line-height: 1.55; margin: 7px 0 0; }

footer { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 30px 0 42px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.kofi { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 800; text-decoration: none; }
.kofi span { display: inline-grid; place-items: center; width: 31px; height: 31px; background: var(--lime); border-radius: 50%; }
.kofi:hover { color: var(--teal); }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .controls { border-right: 0; border-bottom: 1px solid var(--line); }
  .preview-stage { min-height: 360px; }
}

@media (max-width: 600px) {
  .shell { width: min(100% - 24px, 1180px); }
  .hero { padding-top: 25px; }
  .eyebrow { margin-top: 48px; }
  h1 { font-size: clamp(3.25rem, 16vw, 5rem); }
  .field-grid, .option-grid, .custom-size { grid-template-columns: 1fr; }
  .check-field { grid-column: auto; }
  .preview-panel { padding: 26px 18px; }
  .stats { grid-template-columns: 1fr; }
  .stats div + div { border-left: 0; border-top: 1px solid #adb6ae; padding-left: 0; }
  .how-it-works ol { grid-template-columns: 1fr; }
  .how-it-works li + li { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; margin-top: 24px; }
  footer { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
