/* Mold Generator: plaster, graphite and the three material colours of the 3D preview */
:root {
  --plaster: #E9ECEA;   /* page */
  --paper: #F8F9F8;     /* raised surfaces */
  --graphite: #1E2327;  /* text */
  --muted: #5B646B;
  --line: #CDD3D0;
  --silicone: #D93D78;  /* primary actions; anything meaning silicone */
  --silicone-dark: #B92B61;
  --shell: #6F93B6;
  --plate: #4E6F8F;
  --master: #C9B79C;
  --ok: #2F7A55;
  --wrap: 1180px;
  --gut: clamp(16px, 4vw, 40px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--plaster); color: var(--graphite);
  font: 400 17px/1.55 "Archivo", system-ui, sans-serif; font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--silicone); text-underline-offset: 3px; }
a:hover { color: var(--silicone-dark); }
:focus-visible { outline: 3px solid var(--silicone); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.05; font-stretch: 125%; letter-spacing: -0.015em; }
h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; margin-bottom: 12px; }
h3 { font-size: 20px; font-weight: 700; font-stretch: 112%; }
p { margin: 0 0 1em; max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 12px; z-index: 10; }

.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border: 0;
  border-radius: 999px; background: var(--silicone); color: #fff; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--silicone-dark); color: #fff; }
.btn-small { padding: 8px 16px; font-size: 15px; }
.btn-google { background: var(--paper); color: var(--graphite); border: 1px solid var(--line); }
.btn-google:hover { background: #fff; color: var(--graphite); }
.btn-google .g { width: 20px; height: 20px; }

/* header / footer */
.top, .foot, main > section, main > article { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gut); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 20px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-stretch: 112%; font-size: 18px; }
.mark { width: 30px; height: 30px; }
.top nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font-size: 15px; }
.top nav a:not(.btn) { text-decoration: none; }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-block: 40px; margin-top: 64px;
  border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

/* hero: the live 3D mold is the one loud thing on the page */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 56px);
  align-items: center; padding-block: clamp(24px, 6vw, 72px) 48px; }
.hero h1 { font-size: clamp(42px, 5.4vw, 78px); font-weight: 850; line-height: 0.95; margin-bottom: 24px; }
.lead { font-size: clamp(18px, 1.6vw, 21px); }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.viewer { margin: 0; }
.viewer model-viewer {
  display: block; width: 100%; height: clamp(340px, 44vw, 600px);
  background: radial-gradient(closest-side, #F4F6F5, var(--plaster));
  --poster-color: transparent; border-radius: 28px;
}
.viewer figcaption, .legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; margin-top: 8px; }
.viewer i, .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.alert { background: #FBE3EC; border-left: 4px solid var(--silicone); padding: 10px 14px; border-radius: 6px; }
.ok { background: #E1F0E8; border-left: 4px solid var(--ok); padding: 10px 14px; border-radius: 6px; }

/* silicone comparison */
.compare { padding-block: 40px; }
.bars { display: grid; grid-template-columns: max-content 1fr; gap: 14px 24px; align-items: center; margin: 24px 0 0; }
.bars dt { font-weight: 700; }
.bars dd { margin: 0; display: flex; align-items: center; gap: 14px; }
.bar { display: block; height: 22px; width: var(--w); max-width: 70%; background: var(--silicone); border-radius: 0 11px 11px 0; }
.bars b { font-variant-numeric: tabular-nums; }

/* steps: a real sequence, so it is numbered */
.how { padding-block: 56px; }
.how ol { list-style: none; counter-reset: step; padding: 0; margin: 28px 0 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.how li { counter-increment: step; border-top: 2px solid var(--graphite); padding-top: 16px; }
.how li::before { content: counter(step); display: block; font-size: 44px; font-weight: 850; font-stretch: 125%; line-height: 1; margin-bottom: 12px; color: var(--plate); }
.how h3 { margin-bottom: 8px; }

/* mold types with cross-sections */
.modes { padding-block: 56px; }
.modes ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 48px; }
.modes li { display: grid; grid-template-columns: 132px 1fr; gap: 20px; align-items: start; }
.section { width: 132px; height: auto; }
.modes h3 { margin-bottom: 6px; }
.details { margin-top: 36px; }

/* pricing */
.pricing { padding-block: 56px; }
.price-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; margin-top: 28px; }
.free { background: var(--graphite); color: var(--paper); border-radius: 28px; padding: 32px; }
.free .price { font-size: 32px; font-weight: 850; font-stretch: 125%; line-height: 1.1; margin: 8px 0 12px; }
.packs { background: var(--paper); border-radius: 18px; padding: 32px; }
.packs table, .history { width: 100%; border-collapse: collapse; margin-top: 12px; }
.packs th, .packs td, .history th, .history td { text-align: left; padding: 12px 0; border-top: 1px solid var(--line); }
.packs .num, .history .num { text-align: right; }
.packs th { font-weight: 700; }

/* faq */
.faq { padding-block: 56px; }
.faq details, .faq h2 { max-width: 860px; }
.faq details { border-top: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 18px; }
.faq details p { margin: 10px 0 0; }

/* narrow pages: sign in, account, legal */
.narrow { max-width: 620px !important; padding-block: 48px; }
.narrow.wide { max-width: 760px !important; }
.h-page { font-size: clamp(36px, 5vw, 56px); font-weight: 850; margin-bottom: 16px; }
.balance { font-size: clamp(48px, 8vw, 88px); font-weight: 850; margin: 4px 0 12px; }
.balance .num { color: var(--silicone); }
.narrow h2 { font-size: 26px; margin-top: 40px; }
.buy { display: grid; gap: 0; margin-top: 8px; }
.buy form { display: grid; grid-template-columns: 1fr auto auto auto; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.history .plus { color: var(--ok); }
.legal h2 { font-size: 22px; margin-top: 32px; }
.legal li { margin-bottom: 8px; max-width: 70ch; }

@media (max-width: 900px) {
  .hero, .price-grid { grid-template-columns: 1fr; }
  .how ol, .modes ul { grid-template-columns: 1fr; }
  .top nav a:not(.btn):first-child { display: none; }
}
@media (max-width: 520px) {
  .modes li { grid-template-columns: 1fr; }
  .buy form { grid-template-columns: 1fr auto; }
  .buy form .muted { display: none; }
  .bars { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- dashboard (/app) ---------- */
body.app { --wrap: 1320px; }
body.app .foot { margin-top: 32px; }
.credit-pill { background: var(--graphite); color: var(--paper) !important; padding: 7px 14px; border-radius: 999px; text-decoration: none; }
.credit-pill b { color: #F0A6C3; font-variant-numeric: tabular-nums; }
.credit-pill:hover { background: #2E3439; }
.dash { max-width: var(--wrap); margin: 0 auto; padding: 8px var(--gut) 0;
  display: grid; grid-template-columns: minmax(330px, 410px) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.dash-h { font-size: 30px; font-weight: 850; margin: 0; }
[hidden] { display: none !important; }

/* the new-mold form: a sheet of paper on the plaster */
.newmold { background: var(--paper); border-radius: 26px; padding: 26px; position: sticky; top: 16px; }
.newmold .dash-h { margin-bottom: 6px; }
.step { border: 0; padding: 0; margin: 22px 0 0; min-width: 0; }
.step legend { display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 12px; font-weight: 800; font-stretch: 112%; font-size: 17px; }
.step .n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--graphite); color: var(--paper); font-size: 13px; font-stretch: 100%; }
.drop { position: relative; display: block; border: 2px dashed #A3ABA8; border-radius: 18px; padding: 22px 18px; cursor: pointer;
  background: #fff; transition: border-color .15s, background .15s; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--silicone); background: #FDF2F6; }
.drop:focus-within { outline: 3px solid var(--silicone); outline-offset: 3px; }
.drop.has-file { border-style: solid; border-color: var(--shell); }
.drop-empty, .drop-file { display: grid; gap: 2px; text-align: center; }
.drop-empty span, .drop-file span { font-size: 14px; color: var(--muted); }
.drop-file b { overflow-wrap: anywhere; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.field { display: grid; gap: 5px; font-size: 14px; }
.field > span:first-child { font-weight: 600; }
.field small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 1px; }
.field .input { display: flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding-right: 10px; }
.field .input:focus-within, .field select:focus { border-color: var(--silicone); outline: 2px solid #F8D0E0; }
.field input, .field select { font: inherit; font-size: 15px; color: inherit; border: 0; background: transparent; padding: 9px 10px; width: 100%; min-width: 0; }
.field select { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.field input:focus, .field select:focus-visible { outline: none; }
.field em { font-style: normal; color: var(--muted); font-size: 13px; white-space: nowrap; }
.hint { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.hint.warn { color: var(--silicone-dark); }
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type { position: relative; display: grid; gap: 1px; padding: 12px; border-radius: 16px; background: #fff;
  border: 2px solid transparent; cursor: pointer; }
.type input { position: absolute; opacity: 0; }
.type svg { width: 100%; height: auto; max-height: 64px; margin-bottom: 6px; }
.type b { font-size: 15px; }
.type span { font-size: 13px; color: var(--muted); }
.type:hover { border-color: var(--line); }
.type:has(input:checked) { border-color: var(--silicone); box-shadow: 0 0 0 4px #FCEAF1; }
.type:has(input:focus-visible) { outline: 3px solid var(--silicone); outline-offset: 2px; }
.settings summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.settings[open] summary { margin-bottom: 12px; }
.fields { display: grid; gap: 14px; }
.btn-go { width: 100%; justify-content: center; margin-top: 24px; padding: 16px; font-size: 18px; }
.btn-go span { font-weight: 500; opacity: .8; font-size: 15px; }
.btn-go:disabled { opacity: .6; cursor: progress; }
.form-msg { min-height: 1.5em; margin: 12px 0 0; font-size: 14px; }
.form-msg.bad { color: var(--silicone-dark); font-weight: 600; }
.form-msg.good { color: var(--ok); font-weight: 600; }

/* my molds */
.molds-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin: 26px 0 16px; }
.plan-note { max-width: none; background: #FCEAF1; border-radius: 14px; padding: 12px 16px; font-size: 15px; }
.plan-note a { font-weight: 700; color: var(--silicone-dark); }
.mold-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.mold { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 16px; align-items: center;
  background: var(--paper); border-radius: 18px; padding: 12px 14px 12px 12px; }
.mold-thumb { width: 64px; height: 48px; display: grid; place-items: center; background: #fff; border-radius: 12px; }
.mold-thumb svg { width: 52px; height: auto; }
.mold-main { display: grid; gap: 2px; min-width: 0; }
.mold-name { font-size: 16px; overflow-wrap: anywhere; }
.mold-meta { font-size: 13px; color: var(--muted); }
.mold-error { font-size: 13px; color: var(--silicone-dark); }
.pill { font-size: 13px; font-weight: 600; padding: 5px 11px; border-radius: 999px; white-space: nowrap; background: #E1E5E3; color: #434B51; }
.mold.done .pill { background: #E1F0E8; color: var(--ok); }
.mold.run .pill { background: #E3ECF5; color: #3D6489; position: relative; overflow: hidden; }
.mold.run .pill::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 40%; background: var(--shell);
  animation: building 1.3s ease-in-out infinite; }
@keyframes building { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.mold.fail .pill { background: #FBE3EC; color: var(--silicone-dark); }
.mold.old { opacity: .55; }
.mold:not(.done) { grid-template-columns: 64px minmax(0, 1fr) auto; }
.actions { display: flex; gap: 8px; }
.act { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--graphite); }
.act svg { width: 16px; height: 16px; }
.act:hover { border-color: var(--graphite); }
.act-main { background: var(--silicone); border-color: var(--silicone); color: #fff; }
.act-main:hover { background: var(--silicone-dark); border-color: var(--silicone-dark); }
.act-locked { color: var(--muted); background: #EEF1EF; border-color: #EEF1EF; }
.act-locked svg { color: var(--silicone); }
.empty, .loading { background: var(--paper); border-radius: 18px; padding: 28px; color: #434B51; }

/* preview window */
#viewer { width: min(1180px, 94vw); max-height: 92vh; padding: 0; border: 0; border-radius: 26px; background: var(--paper); color: inherit; overflow: hidden; }
#viewer::backdrop { background: rgba(30, 35, 39, .6); }
#viewer[open] { animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.viewer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); max-height: 92vh; }
#mv { width: 100%; height: min(78vh, 720px); background: radial-gradient(closest-side, #F4F6F5, var(--plaster)); --poster-color: transparent; }
.viewer-side { padding: 22px 24px 26px; overflow-y: auto; }
.viewer-top { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.viewer-top h2 { font-size: 26px; margin: 4px 0 4px; overflow-wrap: anywhere; }
.icon-btn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 0; background: #E1E5E3; cursor: pointer; color: var(--graphite); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--line); }
.viewer-side h3 { font-size: 16px; margin: 24px 0 10px; scroll-margin-top: 16px; }
.files { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.file { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: #fff; text-decoration: none; font-weight: 600; }
.file svg { width: 18px; height: 18px; color: var(--silicone); }
.file span { flex: 1; }
.file em { font-style: normal; font-size: 12px; color: var(--muted); }
.file:hover { box-shadow: 0 0 0 2px var(--silicone); color: inherit; }
.lockbox { display: flex; gap: 14px; align-items: flex-start; background: #fff; border-radius: 16px; padding: 16px; }
.lockbox > svg { flex: none; width: 28px; height: 28px; color: var(--silicone); }
.lockbox p { font-size: 14px; margin: 4px 0 12px; }
.numbers { width: 100%; border-collapse: collapse; font-size: 14px; }
.numbers th, .numbers td { padding: 8px 0; border-top: 1px solid var(--line); font-weight: 400; vertical-align: top; }
.numbers th { text-align: left; color: var(--muted); padding-right: 12px; }
.numbers td { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 980px) {
  .dash { grid-template-columns: 1fr; }
  .newmold { position: static; }
  .viewer-grid { grid-template-columns: 1fr; overflow-y: auto; }
  #mv { height: 48vh; }
}
@media (max-width: 600px) {
  .mold, .mold:not(.done) { grid-template-columns: 48px minmax(0, 1fr); }
  .mold-thumb { width: 48px; height: 40px; }
  .mold .pill { justify-self: start; grid-column: 2; }
  .actions { grid-column: 1 / -1; }
  .act { flex: 1; justify-content: center; }
  .newmold { padding: 20px; border-radius: 20px; }
  #viewer { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mold.run .pill::after, #viewer[open] { animation: none; }
}

/* feedback window */
.nav-btn { font: inherit; font-size: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.nav-btn:hover { text-decoration: underline; text-decoration-color: var(--silicone); text-underline-offset: 3px; }
#feedback { width: min(560px, 94vw); padding: 26px 28px 28px; border: 0; border-radius: 26px; background: var(--paper); color: inherit; }
#feedback::backdrop { background: rgba(30, 35, 39, .6); }
#feedback[open] { animation: rise .18s ease-out; }
#feedback .viewer-top h2 { font-size: 28px; margin: 2px 0 6px; }
.kinds { border: 0; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kinds legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.kinds label { position: relative; cursor: pointer; }
.kinds input { position: absolute; opacity: 0; }
.kinds span { display: inline-block; padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.kinds label:hover span { border-color: var(--graphite); }
.kinds input:checked + span { background: var(--graphite); border-color: var(--graphite); color: var(--paper); }
.kinds input:focus-visible + span { outline: 3px solid var(--silicone); outline-offset: 2px; }
.fb-text { display: grid; gap: 6px; margin-top: 18px; font-size: 14px; font-weight: 600; }
.fb-text textarea { font: inherit; font-size: 16px; font-weight: 400; line-height: 1.5; color: inherit; resize: vertical; min-height: 150px;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.fb-text textarea:focus { outline: 2px solid #F8D0E0; border-color: var(--silicone); }
.fb-text small { justify-self: end; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.fb-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.fb-actions .btn { padding: 11px 22px; }
.fb-done { text-align: center; padding: 18px 6px 4px; }
.fb-done .done-mark { width: 64px; height: 64px; }
.fb-done h2 { font-size: 28px; margin: 14px 0 8px; }
.fb-done p { margin: 0 auto 22px; }
@media (max-width: 600px) { #feedback { padding: 22px 20px; } .fb-actions .btn, .fb-actions .act { flex: 1; justify-content: center; } }
@media (prefers-reduced-motion: reduce) { #feedback[open] { animation: none; } }

/* footer credit and contact */
.foot .credit { margin-left: auto; }
.foot .credit a { color: var(--graphite); font-weight: 700; }
.contact-btn { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper);
  color: var(--graphite) !important; font-weight: 700; text-decoration: none; }
.contact-btn:hover { border-color: var(--graphite); }
@media (max-width: 700px) { .foot .credit { margin-left: 0; flex-basis: 100%; } }
