:root {
  --bg: #f3eee4;
  --bg-raised: #faf7f1;
  --ink: #241e18;
  --ink-soft: #5e564c;
  --line: #e0d6c8;
  --green: #2f4a3c;
  --green-soft: #e7efe9;
  --mat: #1b1815;
  --wood: #4a2f1e;
  --danger: #8d3b32;
  --note: #e7e6dc;
  --note-ink: #394234;
  --shadow: 0 18px 40px rgba(48, 34, 20, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(47, 74, 60, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: Outfit, "Segoe UI", sans-serif;
  font-weight: 380;
  font-size: 1.05rem;
  line-height: 1.5;
}

img { max-width: 100%; height: auto; }

button, input, textarea, select { font: inherit; color: inherit; }

input { accent-color: var(--green); }

button { cursor: pointer; }

a { color: inherit; }

h1, h2, h3 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 520;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}

.wrap {
  width: min(1120px, calc(100% - 1.5rem));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--green);
  color: #f6f1e7;
  padding: 0.5rem 0.8rem;
  z-index: 10;
}

.skip:focus { top: 0.5rem; }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(243, 238, 228, 0.94);
  backdrop-filter: blur(10px);
}

.mode-banner {
  margin: 0;
  padding: 0.55rem 1rem;
  text-align: center;
  background: var(--note);
  color: var(--note-ink);
  font-size: 0.92rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.95rem 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  text-decoration: none;
}

.brand-name {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.45rem;
  font-weight: 520;
  letter-spacing: -0.03em;
}

.brand-uf {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.nav { display: flex; gap: 1.2rem; }

.nav a { text-decoration: none; }

.nav a:hover { color: var(--green); }

.cart-count {
  display: inline-block;
  min-width: 1.35rem;
  margin-left: 0.2rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--green);
  color: #f6f1e7;
  font-size: 0.75rem;
  text-align: center;
}

.noscript, .checkout-note, .missing-blank, .disclaimer, .hint {
  color: var(--ink-soft);
}

.checkout-note, .missing-blank, .disclaimer {
  padding: 0.8rem 0.9rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.missing-blank { border-color: #e2d2b0; background: #fbf6ec; }

.hero, .page-head, .section { padding-top: 1.5rem; }

.hero {
  display: grid;
  gap: 1.5rem;
  align-items: end;
}

.hero h1, .page-head h1 {
  margin: 0.2rem 0 0.6rem;
  font-size: clamp(2.5rem, 8vw, 4.7rem);
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead { margin: 0; max-width: 38rem; color: var(--ink-soft); font-size: 1.12rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.4rem;
  padding: 0.85rem 1.2rem;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #f7f3ea;
  text-decoration: none;
}

.button:hover { background: #263e32; }

.button:disabled { opacity: 0.45; cursor: not-allowed; }

.button-quiet {
  background: transparent;
  color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.group-photo { margin: 0; max-width: 872px; }

.group-photo img, .product-card img, .stage-frame {
  background: var(--mat);
}

.group-photo img, .product-card img {
  display: block;
  width: 100%;
  height: auto;
}

.group-photo figcaption, .hint {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.section-head { margin: 2.5rem 0 1rem; }

.section-head h2, .page-head h1 { margin-bottom: 0.35rem; }

.product-grid {
  display: grid;
  gap: 1.4rem;
  padding-bottom: 2rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.product-card-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.product-card-name {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.55rem;
  font-weight: 520;
}

.price { margin: 0.2rem 0 0.8rem; font-variant-numeric: tabular-nums; }

.price span, .product-card .price span { color: var(--ink-soft); font-size: 0.92rem; }

.product-layout, .cart-layout, .checkout-layout {
  display: grid;
  gap: 1.5rem;
  padding: 1.2rem 0 2.5rem;
}

.preview-column, .stage { display: flex; flex-direction: column; align-items: center; gap: 0.8rem; }

.preview-column { align-items: stretch; }

.stage-frame {
  position: relative;
  overflow: hidden;
  width: min(100%, calc(var(--preview-max, 70vh) * var(--aspect, 1)));
  container-type: inline-size;
}

.stage-frame img { display: block; width: 100%; height: auto; }

.burn-wrap {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%);
  touch-action: none;
}

.stage.is-personal .burn-wrap {
  pointer-events: auto;
  cursor: grab;
}

.stage.is-personal .burn-wrap.is-dragging {
  cursor: grabbing;
}

.burn-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: pre-wrap;
}

.burn-canvas {
  display: block;
  width: 100%;
  height: 100%;
  mix-blend-mode: multiply;
}

.curve-handle {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #ede7d4;
  border-radius: 50%;
  background: #34412de8;
  color: #fffcf3;
  font-size: 17px;
  line-height: 1;
  cursor: ns-resize;
  touch-action: none;
}

.curve-handle:focus-visible { outline: 2px solid #fff; }
@media print { .curve-handle { display: none; } }

.buy-box h1 { margin: 0.15rem 0 0.4rem; font-size: clamp(2.2rem, 6vw, 3.4rem); }

.choice, .font-choices {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
  display: grid;
  gap: 0.55rem;
}

.choice legend, .font-choices legend, .buy-box label, .checkout-form label {
  font-size: 0.92rem;
}

.choice-card, .font-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-raised);
  cursor: pointer;
}

.choice-card small, .font-option span { display: block; }

.choice-card small { color: var(--ink-soft); }

.choice-card:has(input:checked), .font-option:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
}

.font-choices { grid-template-columns: 1fr; }

.font-option[data-font="skrivstil"] span { font-family: "Cedarville Cursive", cursive; font-size: 1.35rem; line-height: 1.15; }
.font-option[data-font="handskriven"] span { font-family: "Nothing You Could Do", cursive; font-size: 1.2rem; line-height: 1.15; }
.font-option[data-font="versaler"] span { font-family: "Amatic SC", cursive; font-weight: 700; font-size: 1.55rem; letter-spacing: 0.03em; line-height: 1; }

.personal-panel, .checkout-form { display: grid; gap: 0.7rem; }

input[type="text"], input[type="email"], input[type="number"], textarea, .checkout-form input, .checkout-form textarea, .checkout-form select {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf9;
}

textarea { resize: vertical; min-height: 6.5rem; }

.price-story { color: var(--green); font-size: 1.2rem; font-weight: 500; }
.story-section { max-width: 850px; scroll-margin-top: 9rem; }
.story-section > p { max-width: 68ch; }
.team-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-top: 2rem; }
.team-grid article { background: var(--bg-raised); padding: 1.5rem; border-radius: 10px; }
.team-grid h3 { margin-top: 0; }
.faq-section { max-width: 850px; scroll-margin-top: 9rem; }
.faq-section details { border-bottom: 1px solid var(--line); padding: 1.2rem 0; }
.faq-section summary { font-weight: 500; cursor: pointer; }
.faq-section details p { max-width: 65ch; }
#address-fields { display: grid; gap: .7rem; }
.nav { flex-wrap: wrap; }
@media (max-width: 600px) {
  .team-grid { grid-template-columns: 1fr; }
  .site-header { flex-wrap: wrap; }
  .nav { gap: .6rem; font-size: .95rem; }
}

.size-field, .qty-field { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 0.8rem; align-items: center; }

.size-field input, .qty-field input { grid-column: 1 / -1; margin-top: 0; }

.qty-field input { max-width: 6rem; }

.form-error { min-height: 1.2rem; margin: 0; color: var(--danger); }

.summary, .order-block {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.summary p, .order-item p { margin: 0.25rem 0; }

.total { font-size: 1.15rem; }

.cart-line {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.85rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.cart-thumb {
  width: 88px;
  height: 88px;
  background: var(--mat);
  display: grid;
  place-items: center;
}

.cart-thumb img { width: 100%; height: 100%; object-fit: contain; }

.line-text {
  margin: 0.35rem 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.line-actions { display: flex; gap: 0.8rem; align-items: center; margin-top: 0.4rem; }

.line-actions input { width: 4.5rem; margin: 0; }

.text-button, .text-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.split { display: grid; gap: 0.7rem; }

.test-actions { display: grid; gap: 0.6rem; justify-items: start; margin: 1rem 0 2rem; }

.exact-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.order-item + .order-item { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }

.order-item h3, .order-block h2 { margin: 0 0 0.35rem; }

.empty { padding: 1rem 0 3rem; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 0 2rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

.site-footer p { margin: 0; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

@media (max-width: 800px) {
  .stage.is-personal {
    position: sticky;
    top: 6.5rem;
    z-index: 4;
    background: var(--bg);
    padding-bottom: 0.7rem;
    box-shadow: 0 12px 16px var(--bg);
  }
  .stage.is-personal .stage-frame { --preview-max: 30vh; }
}

@media (min-width: 800px) {
  .wrap { width: min(1120px, calc(100% - 3rem)); }
  .hero { grid-template-columns: 1.05fr 0.95fr; gap: 3rem; padding-top: 2.5rem; }
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 1.8rem; }
  .product-layout { grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); gap: 3rem; align-items: start; }
  .buy-box { position: sticky; top: 5.5rem; }
  .cart-layout, .checkout-layout { grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr); align-items: start; gap: 2rem; }
  .summary { position: sticky; top: 5.5rem; }
  .split { grid-template-columns: 0.7fr 1.3fr; }
  .font-choices { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
