/* ==========================================================================
   Craft Price Wizard — Stylesheet
   --------------------------------------------------------------------------
   DESIGN SYSTEM
   Palette is drawn from a maker's actual worktable: kraft paper, a cutting
   mat, thread, and a measuring tape — not a generic "AI cream + terracotta"
   default. Type pairs a warm slab-serif display face (Fraunces) with a
   clean utility sans (Work Sans) for UI text, and a monospace (IBM Plex
   Mono) for every dollar figure — pricing is math, and the numbers should
   look like it.

   Signature element: the Results section is a literal hand-punched kraft
   price tag (see .price-tag). That is the one bold visual risk this page
   spends its budget on; everything else stays quiet and disciplined.
   ========================================================================== */

:root {
  /* ---- Color tokens ---- */
  --paper: #F7F1E4;       /* warm oat paper — page background */
  --paper-deep: #EFE6D2;  /* slightly deeper paper for section stripes */
  --card: #FFFDF8;        /* off-white card surface */
  --ink: #2A2320;         /* near-black warm brown — primary text */
  --muted: #7C7161;       /* warm gray-brown — secondary text */
  --line: #DCD1B8;        /* hairline borders, kraft edges */

  --cutmat: #2F6F5E;      /* cutting-mat teal — primary accent / CTA */
  --cutmat-dark: #204B40; /* pressed / hover state */
  --cutmat-tint: #E4EEE9; /* light teal fill for subtle backgrounds */

  --thread: #C4472E;      /* thread-red — warnings, premium tier */
  --thread-tint: #FBEAE4;

  --tape: #E3A73E;        /* measuring-tape gold — minimum tier, highlights */
  --tape-tint: #FBF0DC;

  --leaf: #5C8A4A;        /* profit green, used sparingly in the breakdown */

  /* ---- Type ---- */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* ---- Layout ---- */
  --max-width: 760px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(42, 35, 32, 0.06), 0 6px 20px -8px rgba(42, 35, 32, 0.12);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 84px; /* room for sticky mobile bar */
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h2 { font-size: clamp(1.5rem, 4vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; color: var(--ink); }

a { color: var(--cutmat-dark); }

.mono { font-family: var(--font-mono); font-weight: 600; letter-spacing: -0.01em; }

/* Accessibility: skip link + visually-hidden labels */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75em 1.25em;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--cutmat);
  outline-offset: 2px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--cutmat);
  color: #fff;
}
.btn-primary:hover { background: var(--cutmat-dark); }

.btn-secondary {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--paper); }

.btn-small { padding: 0.6em 1.1em; font-size: 0.9rem; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  background: var(--cutmat);
  color: #fff;
  padding: 3.5rem 1.25rem 5rem;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.75);
  margin-bottom: 1em;
}

.hero-title {
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  color: #fff;
  margin-bottom: 0.2em;
}

.hero-subhead {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.5vw, 1.4rem);
  font-weight: 500;
  color: var(--tape);
  margin-bottom: 0.6em;
}

.hero-support {
  max-width: 46ch;
  color: rgba(255,255,255,0.9);
  margin-bottom: 1.75em;
}

.hero .btn-primary {
  background: var(--tape);
  color: var(--ink);
}
.hero .btn-primary:hover { background: #f0b954; }

/* Decorative hanging tag in the hero — echoes the results price tag */
.hero-tag {
  position: absolute;
  right: 6%;
  top: 1rem;
  z-index: 1;
  display: none;
}
.hero-tag-string {
  display: block;
  width: 2px;
  height: 34px;
  margin: 0 auto;
  background: rgba(255,255,255,0.55);
}
.hero-tag-shape {
  display: block;
  position: relative;
  background: var(--tape);
  color: var(--ink);
  width: 150px;
  padding: 1.1rem 1rem 1rem 1.6rem;
  border-radius: 4px 14px 14px 4px;
  transform: rotate(6deg);
  box-shadow: var(--shadow-card);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
}
.hero-tag-hole {
  position: absolute;
  left: 0.6rem;
  top: 0.9rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cutmat);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.15);
}

@media (min-width: 860px) {
  .hero-tag { display: block; }
}

/* ==========================================================================
   Sections & cards
   ========================================================================== */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.section-note { color: var(--muted); font-size: 0.95rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  margin: 0 0 1.25rem;
}

.card legend {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  padding: 0 0.25em;
}

.supportive-text {
  color: var(--cutmat-dark);
  font-weight: 500;
  font-size: 0.95rem;
}

/* ==========================================================================
   Maker type pills
   ========================================================================== */

.maker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  margin-top: 1.25rem;
}

@media (min-width: 560px) {
  .maker-grid { grid-template-columns: repeat(3, 1fr); }
}

.maker-pill {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75em 0.9em;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.maker-pill:hover { border-color: var(--cutmat); }
.maker-pill.is-active {
  background: var(--cutmat-tint);
  border-color: var(--cutmat);
  font-weight: 600;
}

/* ==========================================================================
   Form fields
   ========================================================================== */

.field-group { margin-bottom: 1.1rem; }
.field-group:last-child { margin-bottom: 0; }

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 480px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4em;
}

.optional { font-weight: 400; color: var(--muted); }

input[type="text"],
input[type="number"],
input[type="email"],
select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7em 0.85em;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
}

input:focus, select:focus { border-color: var(--cutmat); }

.input-prefix, .input-suffix {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow: hidden;
}
.input-prefix:focus-within, .input-suffix:focus-within { border-color: var(--cutmat); }
.input-prefix span, .input-suffix span {
  padding: 0 0.75em;
  color: var(--muted);
  font-family: var(--font-mono);
}
.input-prefix input, .input-suffix input {
  border: none;
  background: transparent;
}
.input-prefix input:focus, .input-suffix input:focus { outline: none; }

input[type="range"] {
  width: 100%;
  accent-color: var(--cutmat);
  margin-top: 0.4em;
}

.range-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.3em;
}

.total-line {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--line);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* ---- Materials rows ---- */

.materials-list { display: flex; flex-direction: column; gap: 0.75rem; }

.material-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.6rem;
  align-items: center;
}

.remove-row {
  background: none;
  border: 1.5px solid var(--line);
  color: var(--muted);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  cursor: pointer;
  font-size: 1rem;
}
.remove-row:hover:not(:disabled) { border-color: var(--thread); color: var(--thread); }
.remove-row:disabled { opacity: 0.35; cursor: not-allowed; }

#add-material { margin-top: 0.5rem; }

/* ==========================================================================
   Results — the signature price tag
   ========================================================================== */

.results-section { text-align: center; }

.price-tag {
  position: relative;
  max-width: 320px;
  margin: 1.5rem auto 2rem;
  background: var(--tape-tint);
  border: 2px dashed var(--tape);
  border-radius: 6px 28px 28px 6px;
  padding: 2.2rem 1.5rem 1.75rem 2.4rem;
  box-shadow: var(--shadow-card);
}

.price-tag-hole {
  position: absolute;
  left: 1rem;
  top: 1.1rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--tape);
}

.price-tag-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.3em;
}

.price-tag-amount {
  font-size: clamp(2.2rem, 9vw, 3rem);
  color: var(--ink);
  margin: 0.1em 0;
}

.price-tag-caption {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--cutmat-dark);
  margin: 0;
}

.tier-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  text-align: left;
  margin-bottom: 2rem;
}
@media (min-width: 640px) {
  .tier-grid { grid-template-columns: repeat(3, 1fr); }
}

.tier-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}
.tier-card--recommended {
  border-color: var(--cutmat);
  background: var(--cutmat-tint);
}

.tier-label {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.3em;
}
.tier-card--recommended .tier-label { color: var(--cutmat-dark); }

.tier-amount { font-size: 1.5rem; margin: 0.1em 0; }
.tier-caption { font-size: 0.85rem; color: var(--muted); margin: 0; }

/* ---- Breakdown bar ---- */

.breakdown { text-align: left; margin-bottom: 2rem; }

.breakdown-bar {
  display: flex;
  width: 100%;
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  margin: 1rem 0 1.25rem;
  border: 1px solid var(--line);
}

.bar-segment { height: 100%; }

.seg-materials, .legend-swatch.seg-materials { background: var(--tape); }
.seg-labor, .legend-swatch.seg-labor { background: var(--cutmat); }
.seg-overhead, .legend-swatch.seg-overhead { background: var(--muted); }
.seg-fees, .legend-swatch.seg-fees { background: var(--thread); }
.seg-shipping, .legend-swatch.seg-shipping { background: #B7A98C; }
.seg-profit, .legend-swatch.seg-profit { background: var(--leaf); }

.breakdown-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 0.5rem;
}
.breakdown-list li {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
}
.legend-swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
}
.legend-percent { color: var(--muted); min-width: 3em; text-align: right; }

/* ---- Warnings ---- */

.warnings {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  text-align: left;
  margin-bottom: 2rem;
}

.warning-card {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: var(--tape-tint);
  border: 1px solid var(--tape);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}
.warning-card p { margin: 0; font-size: 0.92rem; }
.warning-icon { font-size: 1.1rem; line-height: 1.4; }

.results-actions { text-align: center; }

/* ==========================================================================
   Lead magnet
   ========================================================================== */

.lead-magnet {
  background: var(--cutmat-tint);
  border-radius: var(--radius);
  text-align: center;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 420px;
  margin: 1.25rem auto 0;
}
@media (min-width: 480px) {
  .lead-form { flex-direction: row; }
}

.lead-form input { flex: 1; }
.form-status { font-size: 0.9rem; color: var(--cutmat-dark); margin-top: 0.75rem; }

/* ==========================================================================
   FAQ
   ========================================================================== */

.faq-item {
  padding: 1.25rem 0;
  border-top: 1px dashed var(--line);
}
.faq-item:last-child { padding-bottom: 0; }
.faq-item h3 { font-size: 1.05rem; margin-bottom: 0.35em; }
.faq-item p { color: var(--ink); margin: 0; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  text-align: center;
  padding: 2rem 1.25rem 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Sticky mobile summary bar
   ========================================================================== */

.sticky-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.1rem;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
}

.sticky-bar-info { display: flex; flex-direction: column; line-height: 1.2; }
.sticky-bar-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.65);
}
.sticky-bar-amount { font-size: 1.15rem; color: var(--tape); }

@media (min-width: 860px) {
  .sticky-bar { display: none; }
  body { padding-bottom: 0; }
}

/* ==========================================================================
   Print styles
   ========================================================================== */

@media print {
  .hero, .sticky-bar, .maker-grid, .calculator-form, .lead-magnet, .results-actions, .skip-link {
    display: none !important;
  }
  body { background: #fff; padding-bottom: 0; }
  .results-section { text-align: left; }
}
