:root {
  --spruce: #12332A;
  --spruce-deep: #0B231D;
  --basswood: #E6CFA3;
  --sheet: #F6EEDB;
  --scorch: #2E1A0F;
  --scorch-soft: #6B5142;
  --berry: #B8243A;
  --berry-deep: #951A2D;
  --frost: #EEF3EC;
  --line: rgba(46, 26, 15, .18);
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  color: var(--scorch);
  background: var(--spruce);
}
h1, h2, h3, p { margin: 0; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.shell { min-height: 100dvh; display: flex; flex-direction: column; }

/* ------------------------------------------------ stage: the hanging ornament */
.stage {
  position: sticky; top: 0; z-index: 1;
  height: 40dvh; min-height: 250px;
  background: radial-gradient(120% 90% at 50% 0%, #1B4A3D 0%, var(--spruce) 55%, var(--spruce-deep) 100%);
  overflow: hidden;
}
.hang {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  transform-origin: 50% 0;
  animation: settle 2.4s cubic-bezier(.3, .1, .3, 1) 1;
}
.string { width: 2px; flex: 0 0 13%; background: linear-gradient(#C9B27E, #8F7B4F); }
.ornament {
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: flex; justify-content: center; align-items: flex-start;
  margin-top: -3.2%;            /* string meets the hole */
  padding-bottom: 32px;
  transition: opacity .2s;
}
.ornament.busy { opacity: .55; }
.ornament img, .ornament svg {
  max-height: 100%; max-width: 78%; height: 100%; width: auto; object-fit: contain;
  filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .38));
}
.stage-note {
  position: absolute; left: 0; right: 0; bottom: 6px; text-align: center;
  font-size: 13px; color: rgba(238, 243, 236, .72);
}
@keyframes settle {
  0% { transform: rotate(7deg); } 30% { transform: rotate(-4deg); }
  55% { transform: rotate(2.2deg); } 78% { transform: rotate(-1deg); } 100% { transform: rotate(0); }
}
@media (prefers-reduced-motion: reduce) { .hang { animation: none; } .ornament { transition: none; } }

.brand {
  position: absolute; top: 12px; left: 16px; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  color: #fff; text-decoration: none; font-weight: 800; font-size: 16px; line-height: 1.05; letter-spacing: -.01em;
}
.brand-name { max-width: 6.200em; }   /* wraps to two lines so it clears the hanging string */
.brand-line .brand-name { max-width: none; }
.brand:focus-visible { outline: 3px solid #8FC1FF; outline-offset: 3px; border-radius: 4px; }
.brand-line .brand { position: static; color: var(--spruce); }

/* ------------------------------------------------ bench: the working sheet */
.bench {
  position: relative; z-index: 2; flex: 1;
  background: var(--sheet);
  border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(96px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .25);
}
.intro h1 { font-size: clamp(30px, 8.4vw, 44px); line-height: 1.02; font-weight: 800; letter-spacing: -.02em; }
.intro p { margin-top: 8px; color: var(--scorch-soft); }

.steps {
  list-style: none; margin: 18px 0 20px; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  font-size: 13px; font-weight: 600; color: var(--scorch-soft);
  padding-top: 8px; border-top: 4px solid var(--line);
}
.steps li::before { content: counter(step) ". "; }
.steps li.done { border-color: var(--scorch); color: var(--scorch); }
.steps li.now { border-color: var(--berry); color: var(--berry-deep); }

.panel h2 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 14px; }
.panel h3 { font-size: 17px; font-weight: 600; margin: 24px 0 10px; }
.hint { font-size: 14px; color: var(--scorch-soft); margin-top: 12px; }

.blank-hint { margin: -4px 0 14px; color: var(--scorch); font-weight: 600; }

.alert {
  background: #FBE3E0; color: #7A1220; border-left: 4px solid var(--berry);
  padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; font-size: 15px;
}

/* shapes */
.blanks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.blank {
  display: grid; grid-template-rows: 96px auto; justify-items: center; gap: 8px;
  padding: 14px 8px 12px; text-align: center; cursor: pointer;
  background: #FFFBF0; border: 2px solid var(--line); border-radius: 14px;
}
.blank svg { height: 96px; width: auto; max-width: 100%; align-self: end; filter: drop-shadow(0 1px 1px rgba(46, 26, 15, .45)); }
.blank strong { display: block; font-weight: 600; }
.blank small { display: block; font-size: 14px; color: var(--scorch-soft); }
.blank[aria-pressed="true"] { border-color: var(--berry); background: #FFF4EE; box-shadow: inset 0 0 0 1px var(--berry); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 0 22px; border: 0; border-radius: 12px;
  font-weight: 600; font-size: 18px; cursor: pointer; text-align: center;
}
.btn-main { background: var(--berry); color: #fff; width: 100%; }
.btn-main:active { background: var(--berry-deep); }
.btn-main:disabled { background: #CDBFA4; color: #7C6C56; cursor: default; }
.btn-quiet { background: transparent; border: 2px solid var(--line); flex: 0 0 auto; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-btn:focus-within, .btn:focus-visible, .blank:focus-visible, .choice button:focus-visible,
.stock button:focus-visible, input:focus-visible { outline: 3px solid #1E6FD9; outline-offset: 2px; }

.warnings { list-style: none; padding: 0; margin: 12px 0 0; }
.warnings li { background: #FFF1C9; border-left: 4px solid #C48A00; padding: 9px 12px; border-radius: 6px; font-size: 15px; margin-top: 6px; }

.stock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stock button { aspect-ratio: 1; min-width: 0; padding: 8px; background: #FFFBF0; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; }
.stock button img { display: block; width: 100%; height: 100%; min-width: 0; object-fit: contain; mix-blend-mode: multiply; }
.stock button[aria-pressed="true"] { border-color: var(--berry); box-shadow: inset 0 0 0 1px var(--berry); }

/* fields */
.field { display: block; margin-bottom: 14px; }
.field span { display: flex; justify-content: space-between; font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.field em { font-style: normal; font-weight: 400; color: var(--scorch-soft); }
.field input {
  width: 100%; height: 52px; padding: 0 14px; font-size: 18px;
  background: #FFFBF0; border: 2px solid var(--line); border-radius: 10px;
}
.choice { display: flex; gap: 8px; margin-bottom: 16px; }
.choice button {
  flex: 1; min-height: 46px; background: #FFFBF0; border: 2px solid var(--line); border-radius: 10px;
  font-weight: 600; cursor: pointer;
}
.choice button[aria-checked="true"] { background: var(--scorch); border-color: var(--scorch); color: var(--sheet); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 16px; font-size: 16px; }
.check input { width: 24px; height: 24px; flex: 0 0 auto; accent-color: var(--berry); margin: 0; }
.slider { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 15px; font-weight: 600; }
.slider input { width: 100%; height: 34px; accent-color: var(--berry); }
.summary { font-size: 18px; font-weight: 600; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }

.actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; gap: 10px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(246, 238, 219, 0), var(--sheet) 28%);
}

/* ------------------------------------------------ wide screens */
@media (min-width: 860px) {
  .shell { flex-direction: row; }
  .stage { flex: 1 1 50%; height: 100dvh; }
  .bench { flex: 0 0 480px; border-radius: 0; padding: 48px 40px 120px; overflow-y: auto; height: 100dvh; }
  .actions { left: auto; width: 480px; padding: 16px 40px 24px; }
  .ornament img, .ornament svg { max-width: 62%; }
}

/* ------------------------------------------------ order status page */
.ticket { max-width: 480px; margin: 0 auto; padding: 0 20px 48px; text-align: center; color: var(--frost); }
.ticket .stage { position: relative; height: 38dvh; margin: 0 -20px; }
.ticket-label { font-size: 15px; color: rgba(238, 243, 236, .72); margin-top: 18px; }
.ticket-number { font-size: clamp(84px, 30vw, 132px); line-height: .95; font-weight: 800; letter-spacing: -.04em; color: var(--basswood); }
.ticket-status { font-size: 24px; font-weight: 800; margin-top: 14px; }
.ticket-detail { margin-top: 8px; color: rgba(238, 243, 236, .82); }
.ticket a { color: var(--basswood); }

/* ------------------------------------------------ order step: quantity, delivery, totals */
.qty { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin-bottom: 6px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 48px; height: 48px; font-size: 24px; font-weight: 600; line-height: 1; cursor: pointer;
  background: #FFFBF0; border: 2px solid var(--line); border-radius: 10px;
}
.stepper button:disabled { opacity: .4; cursor: default; }
.stepper output { min-width: 44px; text-align: center; font-size: 22px; font-weight: 800; }
.qty-hint { margin: 0 0 16px; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0 0 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.totals dt, .totals dd { margin: 0; }
.totals dd { text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-weight: 800; font-size: 19px; padding-top: 6px; }
.stepper button:focus-visible, textarea:focus-visible { outline: 3px solid #1E6FD9; outline-offset: 2px; }

.more { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.more h3 { margin: 0 0 8px; }
.more ul { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; }
.more a, .sheet a { color: var(--berry-deep); font-weight: 600; }

/* ------------------------------------------------ plain pages (bulk orders) */
body.plain { background: var(--sheet); }
.sheet { max-width: 560px; margin: 0 auto; padding: 28px 20px 60px; }
.sheet h1 { font-size: clamp(30px, 8vw, 40px); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; margin: 18px 0 12px; }
.sheet .lede { color: var(--scorch-soft); margin-bottom: 14px; }
.sheet .points { margin: 0 0 22px; padding-left: 20px; }
.sheet textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 18px; resize: vertical;
  background: #FFFBF0; border: 2px solid var(--line); border-radius: 10px;
}
.field input[type="file"] { height: auto; padding: 12px 14px; font-size: 16px; }
