/* Formwork Templates — digital templates & printables (fictional demo shop)
   BATCH FORMAT: separate flow for digital delivery instead of a shipping
   step. Centerpiece: checkout step 1 asks only for a delivery email (no
   name/address/city/zip), and the confirmation screen shows mock download
   links instead of an order-tracking message. Dark modern-creative theme +
   violet accent, monospace display type (nods to "template"/build tooling). */

:root {
  --bg: #16181c;
  --bg-2: #1f232a;
  --panel: #1b1e24;
  --line: #2c313a;
  --ink: #eef0f2;
  --muted: #9aa1ac;
  --violet: #8b7cf6;
  --violet-ink: #a597ff;
  --mint: #4fd1a5;
  --danger: #e5646a;
  --r: 6px;
  --wrap: 1200px;
  --display: "Space Mono", "Courier New", monospace;
  --sans: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; line-height: 1.2; margin: 0; }

.eyebrow { font-family: var(--display); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--violet-ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; font-size: 14px; padding: 13px 26px; border-radius: var(--r); cursor: pointer; border: 1px solid transparent; transition: transform .15s, background .15s, color .15s, border-color .15s; }
.btn-accent { background: var(--violet); color: #14121f; }
.btn-accent:hover { transform: translateY(-2px); background: var(--violet-ink); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-full { width: 100%; }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none !important; }

.site-header { position: sticky; top: 0; z-index: 60; background: rgba(22,24,28,.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 9px; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); }
.nav-links { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 18px; }
.cart-btn { position: relative; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 8px; display: flex; }
.cart-badge { position: absolute; top: -2px; right: -2px; background: var(--violet); color: #14121f; font-size: 10.5px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0 2px; }
.menu-btn { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .25s, opacity .25s; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.announce { background: var(--violet); color: #14121f; text-align: center; font-size: 12px; font-weight: 700; padding: 9px; }

.hero { position: relative; height: 74vh; min-height: 480px; display: flex; align-items: center; overflow: hidden; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(22,24,28,.96) 0%, rgba(22,24,28,.68) 55%, rgba(22,24,28,.14) 100%); }
.hero-inner { position: relative; z-index: 1; max-width: 600px; }
.hero h1 { font-size: clamp(30px, 4.6vw, 48px); }
.hero h1 em { font-style: normal; color: var(--violet-ink); }
.hero-lead { font-size: 15.5px; color: var(--muted); max-width: 46ch; margin: 16px 0 26px; }

section { padding: 68px 0; }
.sec-head { text-align: center; max-width: 50ch; margin: 0 auto 34px; }
.sec-head h2 { font-size: clamp(24px, 3.2vw, 32px); }
.sec-head h2 em { font-style: normal; color: var(--violet-ink); }
.sec-head p { color: var(--muted); margin: 12px 0 0; font-size: 14px; }

.value-strip { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.value-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 44px; padding: 16px 0; }
.value-row span { font-size: 12px; color: var(--muted); }
.value-row b { color: var(--violet-ink); }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); border-color: var(--violet); }
.card-media { aspect-ratio: 1/1; background: var(--bg-2); position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-format-badge { position: absolute; left: 10px; top: 10px; background: rgba(20,18,31,.78); color: var(--violet-ink); font-family: var(--display); font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: 100px; }
.card-body { padding: 15px; }
.card-body h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; }
.card-body .price { font-family: var(--display); color: var(--violet-ink); font-size: 15px; }

.lifestyle img { width: 100%; aspect-ratio: 16/8; object-fit: cover; border-radius: var(--r); }

.overlay-scrim { position: fixed; inset: 0; background: rgba(6,7,9,.68); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.overlay-scrim.open { opacity: 1; pointer-events: auto; }

.quickview { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-48%); width: min(820px, calc(100% - 40px)); max-height: 88vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); z-index: 101; opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.quickview.open { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%); }
.qv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.qv-media img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r) 0 0 var(--r); }
.qv-body { padding: 32px; position: relative; }
.qv-close { position: absolute; top: 16px; right: 16px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 22px; line-height: 1; }
.qv-close:hover { color: var(--ink); }
.qv-body h3 { font-size: 21px; margin: 6px 0 6px; }
.qv-price { font-family: var(--display); font-size: 19px; color: var(--violet-ink); margin-bottom: 14px; }
.qv-desc { color: var(--muted); font-size: 14.5px; margin: 0 0 18px; }

.variant-row { margin-bottom: 18px; }
.variant-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: block; }
.variant-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.variant-opt { border: 1px solid var(--line); background: var(--panel); border-radius: 100px; padding: 8px 16px; font-size: 13px; cursor: pointer; transition: all .15s; color: var(--ink); }
.variant-opt:hover { border-color: var(--violet); }
.variant-opt.selected { background: var(--violet); border-color: var(--violet); color: #14121f; }

.qty-row { display: flex; align-items: center; gap: 14px; margin: 4px 0 18px; }
.qty-stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 100px; }
.qty-stepper button { width: 36px; height: 36px; background: none; border: 0; color: var(--ink); font-size: 16px; cursor: pointer; }
.qty-stepper span { min-width: 30px; text-align: center; font-weight: 700; }

.site-footer { background: #0f1114; color: #838a95; padding: 48px 0 26px; border-top: 1px solid var(--line); }
.foot-top { display: flex; justify-content: space-between; gap: 36px; flex-wrap: wrap; padding-bottom: 26px; border-bottom: 1px solid #262a32; }
.foot-brand { max-width: 30ch; } .foot-brand .brand { margin-bottom: 12px; color: #fff; } .foot-brand p { color: #6b727d; font-size: 13px; margin: 0; }
.foot-cols { display: flex; gap: 44px; flex-wrap: wrap; }
.foot-col h5 { font-family: var(--display); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: #8b7cf6; margin: 0 0 12px; }
.foot-col a { display: block; color: #6b727d; font-size: 13px; margin-bottom: 9px; }
.foot-col a:hover { color: #fff; }
.foot-bottom { padding-top: 16px; font-size: 11.5px; color: #4a505a; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

.cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--panel); border-left: 1px solid var(--line); z-index: 101; transform: translateX(100%); transition: transform .3s ease; display: flex; flex-direction: column; }
.cart-drawer.open { transform: none; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.cart-head h3 { font-size: 17px; }
.cart-close { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
.cart-close:hover { color: var(--ink); }
.cart-items { flex: 1; overflow-y: auto; padding: 8px 22px; }
.cart-empty { color: var(--muted); text-align: center; padding: 60px 20px; font-size: 14px; }
.cart-line { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 54px; height: 54px; object-fit: cover; border-radius: 4px; background: var(--bg-2); }
.cart-line .cl-name { font-size: 13.5px; font-weight: 700; }
.cart-line .cl-variant { font-size: 11.5px; color: var(--violet-ink); margin-top: 2px; font-weight: 600; }
.cart-line .cl-price { font-family: var(--display); color: var(--ink); font-size: 13px; margin-top: 6px; }
.cart-line .cl-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-line .qty-stepper button { width: 24px; height: 24px; font-size: 13px; }
.cart-line .qty-stepper span { font-size: 12.5px; }
.cart-line .remove-btn { background: none; border: 0; color: var(--muted); font-size: 11.5px; cursor: pointer; text-decoration: underline; }
.cart-line .remove-btn:hover { color: var(--danger); }
.cart-foot { padding: 20px 22px; border-top: 1px solid var(--line); }
.cart-subtotal { display: flex; justify-content: space-between; font-size: 14px; font-weight: 700; margin-bottom: 16px; }
.cart-subtotal b { color: var(--violet-ink); font-family: var(--display); }

.checkout { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-48%); width: min(640px, calc(100% - 32px)); max-height: 88vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); z-index: 102; opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.checkout.open { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%); }
.checkout-inner { padding: 34px; position: relative; }
.checkout-close { position: absolute; top: 16px; right: 16px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 22px; }
.checkout-close:hover { color: var(--ink); }
.steps-track { display: flex; gap: 8px; margin-bottom: 28px; }
.steps-track span { flex: 1; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.steps-track span::after { content: ""; display: block; height: 100%; width: 0; background: var(--violet); transition: width .3s ease; }
.steps-track span.done::after, .steps-track span.active::after { width: 100%; }
.co-step { display: none; }
.co-step.active { display: block; }
.co-step h3 { font-size: 20px; margin-bottom: 6px; }
.co-step .co-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 7px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; font: inherit; font-size: 14.5px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--violet); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-error { font-size: 11.5px; color: var(--danger); margin-top: 6px; display: none; }
.field.invalid input { border-color: var(--danger); }
.field.invalid .field-error { display: block; }
.co-actions { display: flex; gap: 12px; margin-top: 24px; }
.demo-note { font-size: 11.5px; color: var(--muted); text-align: center; margin-top: 16px; }
.review-list { border: 1px solid var(--line); border-radius: 6px; padding: 4px 14px; margin-bottom: 14px; }
.review-line { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.review-line:last-child { border-bottom: 0; }
.upsell-row { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-bottom: 16px; font-size: 13.5px; }
.upsell-row input { accent-color: var(--violet); width: 16px; height: 16px; }
.upsell-row b { color: var(--violet-ink); }
.review-total { display: flex; justify-content: space-between; font-size: 15.5px; font-weight: 700; padding-top: 12px; border-top: 1px solid var(--line); }
.review-total b { color: var(--violet-ink); font-family: var(--display); }
.confirm { text-align: center; padding: 16px 0; }
.confirm .check { width: 60px; height: 60px; border-radius: 50%; background: var(--violet); color: #14121f; display: grid; place-items: center; margin: 0 auto 18px; font-size: 28px; font-weight: 800; }
.confirm h3 { font-size: 24px; margin-bottom: 10px; }
.confirm .order-no { font-family: var(--display); color: var(--violet-ink); font-size: 13px; margin-bottom: 16px; }
.confirm p { color: var(--muted); max-width: 42ch; margin: 0 auto 20px; font-size: 14px; }
.download-list { border: 1px solid var(--line); border-radius: 6px; padding: 6px 16px; margin: 0 auto 22px; max-width: 40ch; text-align: left; }
.download-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; gap: 10px; }
.download-line:last-child { border-bottom: 0; }
.download-line .dl-btn { font-family: var(--display); font-size: 11.5px; font-weight: 700; color: var(--mint); border: 1px solid var(--mint); border-radius: 100px; padding: 5px 12px; flex-shrink: 0; }

html.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .7s ease; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { html.js .reveal { opacity: 1; transform: none; transition: none; } }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .qv-grid { grid-template-columns: 1fr; }
  .qv-media img { border-radius: var(--r) var(--r) 0 0; max-height: 280px; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .menu-btn { display: block; }
  .nav-links.open { display: flex; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; gap: 4px; padding: 16px 24px 22px; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 59; }
  .nav-links.open a { padding: 10px 0; font-size: 13.5px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .field-row { grid-template-columns: 1fr; }
  section { padding: 50px 0; }
  .checkout-inner, .qv-body { padding: 22px; }
}
