@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --black: #050505;
  --surface: #0c0b09;
  --surface-raised: #12100c;
  --gold: #d8b65c;
  --gold-light: #f3df9d;
  --gold-deep: #806127;
  --muted: #c0ad86;
  --line: rgba(216, 182, 92, .24);
  --line-strong: rgba(216, 182, 92, .48);
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Manrope', system-ui, sans-serif;
  --shadow: 0 22px 70px rgba(0,0,0,.56);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--black); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: #050505; color: var(--gold-light); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; background: radial-gradient(ellipse at 12% 0%, rgba(151,110,34,.09), transparent 40%), radial-gradient(ellipse at 90% 80%, rgba(151,110,34,.055), transparent 35%); }
button, input, select, textarea { font-family: var(--sans); }
button, a, input, select, textarea, summary, label { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { min-height: 48px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, label:has(input:focus-visible) { outline: 2px solid var(--gold-light); outline-offset: 3px; }
::selection { background: var(--gold); color: #080705; }
header, main, footer { position: relative; z-index: 1; }
header { max-width: 1280px; margin: auto; padding: 24px 32px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 17px; }
.brand-logo { width: 90px; height: 60px; object-fit: contain; display: block; filter: drop-shadow(0 0 18px rgba(216,182,92,.14)); }
.brand h1 { margin: 0; font: 700 28px/1 var(--serif); color: var(--gold-light); letter-spacing: .035em; }
.brand p { margin: 7px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.badge { border: 1px solid var(--line); padding: 10px 15px; border-radius: 99px; font-size: 10px; letter-spacing: .15em; color: var(--gold); background: #0b0a08; }
main { max-width: 1280px; margin: auto; padding: 0 32px 64px; }

.hero { min-height: 445px; display: flex; align-items: center; position: relative; overflow: hidden; isolation: isolate; margin: 6px 0 28px; padding: 58px 60px; border: 1px solid var(--line); border-radius: 28px; background-color: #050505; background-image: linear-gradient(90deg, rgba(5,5,5,.99) 0%, rgba(5,5,5,.88) 38%, rgba(5,5,5,.28) 70%, rgba(5,5,5,.1) 100%), url('/art/hero-atelier.webp'); background-size: cover; background-position: center; box-shadow: var(--shadow), inset 0 1px rgba(243,223,157,.08); }
.hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(5,5,5,.55), transparent 45%); z-index: -1; }
.hero-copy { max-width: 650px; position: relative; z-index: 1; }
.eyebrow { display: block; font-size: 10px; font-weight: 700; letter-spacing: .23em; color: var(--gold); margin-bottom: 22px; }
h2 { font: 600 clamp(48px, 5.5vw, 76px)/.99 var(--serif); margin: 0; color: var(--gold-light); letter-spacing: -.035em; text-shadow: 0 3px 25px #000; }
h2 em { font-style: normal; color: var(--gold); }
.hero p { color: #d5c5a3; max-width: 570px; margin: 25px 0 0; line-height: 1.75; font-size: 15px; }
.hero-note { display: inline-flex; align-items: center; gap: 10px; margin-top: 30px; color: var(--gold-light); font-size: 12px; letter-spacing: .035em; }
.hero-note i { width: 26px; height: 1px; background: var(--gold); box-shadow: 0 0 8px var(--gold); }

.card { background: linear-gradient(145deg, #11100d, #090909 70%); border: 1px solid var(--line); border-radius: 22px; padding: 32px; box-shadow: 0 18px 50px rgba(0,0,0,.34), inset 0 1px rgba(243,223,157,.035); }
.start-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.step { position: relative; min-width: 0; padding-top: 0; }
.step-no { display: inline-grid; place-items: center; flex: 0 0 auto; background: linear-gradient(145deg, var(--gold-light), var(--gold-deep)); color: #100c04; width: 36px; height: 36px; border-radius: 50%; font-weight: 800; font-size: 13px; box-shadow: 0 0 24px rgba(216,182,92,.16); }
.step > .step-no { position: absolute; left: 0; top: 0; z-index: 2; }
.step-art { float: right; width: 122px; height: 122px; object-fit: cover; border-radius: 18px; margin: -10px -6px 12px 18px; border: 1px solid var(--line); box-shadow: 0 12px 30px #000; }
.step h3, .section-title h3 { font: 600 28px/1.15 var(--serif); margin: 5px 0 9px; color: var(--gold-light); letter-spacing: -.015em; }
.step h3 { padding-top: 4px; }
.step p, .section-title p { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.drop { clear: both; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed var(--line-strong); border-radius: 16px; min-height: 174px; cursor: pointer; background: #0b0a08; transition: border-color .2s, background .2s, transform .2s; position: relative; text-align: center; padding: 18px; }
.drop:hover { border-color: var(--gold); background: #141008; transform: translateY(-1px); }
.camera { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: #181309; color: var(--gold-light); font-size: 27px; margin-bottom: 10px; font-weight: 400; }
.drop strong { color: var(--gold-light); font-size: 14px; }
.drop small { color: var(--muted); margin-top: 7px; font-size: 11px; }
.drop input { position: absolute; opacity: 0; pointer-events: none; inset: 0; width: 100%; height: 100%; }
.thumbs { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-strong); background: #090909; }
.machines { display: grid; gap: 8px; clear: both; }
.machine { border: 1px solid var(--line); border-radius: 11px; min-height: 48px; padding: 10px 13px; display: flex; gap: 11px; align-items: center; cursor: pointer; font-size: 13px; background: #0b0b0a; color: var(--gold-light); transition: .18s; }
.machine:hover { border-color: var(--line-strong); background: #141109; }
.machine:has(input:checked) { border-color: var(--gold); background: #1b160b; font-weight: 600; box-shadow: inset 3px 0 var(--gold); }
.machine input { accent-color: var(--gold); width: 17px; height: 17px; min-height: 17px; margin: 0; }
.machine-info { font-size: 11px; color: var(--muted); margin: 12px 0 0; line-height: 1.55; }
.start-action { grid-column: 1/-1; text-align: center; border-top: 1px solid var(--line); padding-top: 28px; }
.primary, .secondary { border: 0; border-radius: 11px; min-height: 54px; padding: 0 25px; font: 700 14px var(--sans); cursor: pointer; transition: transform .18s, filter .18s, box-shadow .18s; }
.primary { background: linear-gradient(135deg, #f1d990, #c69c3e 60%, #9a7227); color: #110d05; box-shadow: 0 8px 28px rgba(186,141,46,.19), inset 0 1px rgba(255,255,255,.38); }
.primary:hover { filter: brightness(1.09); transform: translateY(-1px); box-shadow: 0 10px 32px rgba(186,141,46,.27); }
.primary:disabled { opacity: .65; cursor: wait; }
.primary span { margin-left: 18px; font-size: 20px; }
.start-action .primary { min-width: 290px; }
.start-action small { display: block; color: var(--muted); margin-top: 12px; font-size: 11px; }
.hidden { display: none !important; }
.loading { text-align: center; padding: 70px 20px; background: #090909; border: 1px solid var(--line); border-radius: 22px; }
.spinner { border: 2px solid #332914; border-top-color: var(--gold); width: 44px; height: 44px; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 20px; box-shadow: 0 0 25px rgba(216,182,92,.14); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading h3 { color: var(--gold-light); font: 600 28px var(--serif); }
.loading p { color: var(--muted); }
.error { padding: 18px; background: #21120d; color: #f0bb9b; border: 1px solid #80563c; border-radius: 12px; margin: 18px 0; }
.success { display: flex; gap: 15px; align-items: center; background: linear-gradient(90deg, #171309, #0b0b09); border: 1px solid var(--line-strong); border-radius: 16px; padding: 18px 22px; margin: 28px 0 20px; }
.success > span { display: grid; place-items: center; background: var(--gold); color: #0b0904; width: 32px; height: 32px; border-radius: 50%; font-weight: 800; flex: 0 0 auto; }
.success strong { color: var(--gold-light); font: 600 21px var(--serif); }
.success p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.workspace-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 20px; align-items: start; }
.section-title { display: flex; gap: 12px; align-items: flex-start; position: relative; }
.section-title > div { min-width: 0; flex: 1; }
.section-art { width: 76px; height: 76px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); flex: 0 0 auto; margin: -6px 1px 0 0; order: 3; box-shadow: 0 8px 24px #000; }
.fields { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px 13px; }
.field label, .edit-card label { display: block; font-size: 11px; font-weight: 600; margin-bottom: 8px; color: var(--gold); line-height: 1.45; }
.field input, .field select, textarea, select { width: 100%; border: 1px solid #504326; border-radius: 10px; background: #080808; padding: 12px 13px; color: var(--gold-light); font: 14px var(--sans); color-scheme: dark; }
.field input:focus, textarea:focus, select:focus { outline: 2px solid rgba(216,182,92,.35); outline-offset: 0; border-color: var(--gold); }
input::placeholder, textarea::placeholder { color: #9c8b68; opacity: 1; }
select option { background: #090909; color: var(--gold-light); }
.machine-settings { margin: 24px 0; border-top: 1px solid var(--line); padding-top: 17px; }
.machine-settings summary { cursor: pointer; font-size: 12px; color: var(--gold); font-weight: 600; min-height: 32px; }
.machine-settings .fields { margin-top: 16px; }
.hint { font-size: 11px; color: var(--muted); line-height: 1.6; }
fieldset { border: 0; padding: 0; margin: 22px 0; }
legend { font-size: 12px; font-weight: 600; margin-bottom: 12px; color: var(--gold-light); }
.checks { display: flex; gap: 9px; flex-wrap: wrap; }
.checks label { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 9px 12px; background: #0b0b09; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; color: var(--gold-light); cursor: pointer; }
.checks label:has(input:checked) { background: #1b160b; border-color: var(--line-strong); }
.checks input { accent-color: var(--gold); min-height: 16px; width: 16px; height: 16px; margin: 0; }
aside { display: grid; gap: 20px; align-content: start; }
.edit-card { background: linear-gradient(145deg, #171309, #0a0a09 75%); border-color: var(--line-strong); }
.edit-card textarea { min-height: 112px; resize: vertical; margin-bottom: 14px; line-height: 1.5; }
.secondary { background: #0b0a08; color: var(--gold-light); width: 100%; border: 1px solid var(--line-strong) !important; }
.secondary:hover { background: #1b160b; }
.last-edit { font-size: 12px; color: var(--gold); line-height: 1.55; }
.totals h3 { font: 600 24px var(--serif); margin: 0 0 13px; color: var(--gold-light); }
.total-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--gold-light); }
.total-row:last-child { border-bottom: 0; }
.total-row strong { font-size: 11px; color: var(--muted); text-align: right; }
.questions { font-size: 12px; background: #0d0c09; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 20px 0; color: var(--muted); line-height: 1.6; }
.questions strong { color: var(--gold-light); }
.questions ul { margin: 7px 0 0; padding-left: 19px; }
.simulator { margin-top: 20px; }
.sim-title { align-items: flex-start; }
.sim-title select { margin-left: auto; width: auto; min-width: 170px; }
.sim-layout { display: grid; grid-template-columns: 3fr 1fr; gap: 22px; margin-top: 10px; }
.canvas-wrap { overflow: hidden; background: #050505; border-radius: 15px; position: relative; border: 1px solid var(--line); }
canvas { width: 100%; max-width: 100%; height: auto; display: block; background: #050505; }
.canvas-label { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; color: var(--muted); font-size: 11px; background: #0b0a08; border-top: 1px solid var(--line); }
.sim-side { padding-top: 8px; }
.sim-status { padding: 13px; background: #0d0c09; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; color: var(--gold-light); line-height: 1.5; }
.playback { display: flex; gap: 14px; align-items: center; margin: 22px 0; }
.round { flex: 0 0 auto; width: 52px; height: 52px; border: 0; background: linear-gradient(145deg, var(--gold-light), var(--gold)); color: #0d0903; border-radius: 50%; cursor: pointer; font-size: 17px; box-shadow: 0 0 25px rgba(216,182,92,.18); }
.playback input { min-width: 0; width: 100%; }
input[type=range] { accent-color: var(--gold); background: transparent; cursor: pointer; }
.sim-side > label { font-size: 11px; display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.sim-side > label strong { color: var(--gold-light); }
.sim-side > input { width: 100%; }
.warnings { margin-top: 16px; font-size: 11px; color: #e5b68f; line-height: 1.55; }
.warning { padding: 9px; border-left: 2px solid #d79c69; margin: 6px 0; background: #1c120c; }
.export { margin-top: 20px; display: flex; align-items: center; gap: 28px; justify-content: space-between; flex-wrap: wrap; }
.export > div:first-child { max-width: 760px; flex: 1; }
.export .section-title p { margin-bottom: 8px; }
.export-note { color: #ddba83; font-size: 11px; line-height: 1.6; margin: 10px 0 0; }
.downloads { display: flex; gap: 10px; width: 100%; flex-wrap: wrap; }
.downloads a { background: #171309; border: 1px solid var(--line-strong); padding: 13px 17px; min-height: 48px; border-radius: 9px; color: var(--gold-light); font-weight: 600; font-size: 12px; text-decoration: none; }
.downloads a:hover { background: #241c0d; }
.open-points { margin-top: 18px; color: var(--muted); font-size: 12px; padding: 14px 16px; background: #090909; border: 1px solid var(--line); border-radius: 12px; }
.open-points summary { cursor: pointer; font-weight: 600; color: var(--gold); min-height: 30px; }
.open-points li { margin: 10px; line-height: 1.55; }
footer { max-width: 1280px; margin: auto; padding: 26px 32px 32px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }
footer span { float: right; color: var(--muted); }

@media (max-width: 900px) {
  .hero { background-position: 60% center; padding: 48px 40px; }
  .start-grid, .workspace-grid, .sim-layout { grid-template-columns: 1fr; }
  .start-grid { gap: 36px; }
  .fields { grid-template-columns: repeat(2,1fr); }
  .sim-title { flex-wrap: wrap; }
  .sim-title select { margin: 8px 0 0 48px; width: calc(100% - 48px); }
}
@media (max-width: 600px) {
  header { padding: 18px 16px; }
  main { padding: 0 14px 40px; }
  .brand-logo { width: 67px; height: 48px; }
  .brand { gap: 11px; }
  .brand h1 { font-size: 25px; }
  .brand p { font-size: 9px; }
  .badge { display: none; }
  .hero { min-height: 510px; align-items: flex-end; padding: 32px 24px 36px; margin-top: 2px; border-radius: 22px; background-image: linear-gradient(0deg, #050505 5%, rgba(5,5,5,.94) 35%, rgba(5,5,5,.2) 77%), url('/art/hero-atelier.webp'); background-position: 65% center; }
  h2 { font-size: clamp(42px, 12.5vw, 58px); }
  .eyebrow { font-size: 8px; letter-spacing: .18em; margin-bottom: 16px; }
  .hero p { font-size: 13px; line-height: 1.65; margin-top: 18px; }
  .hero p br { display: none; }
  .hero-note { margin-top: 20px; font-size: 10px; }
  .card { padding: 22px 18px; border-radius: 18px; }
  .step-art { width: 94px; height: 94px; margin-top: -8px; }
  .step h3, .section-title h3 { font-size: 25px; }
  .step p, .section-title p { font-size: 12px; }
  .drop { min-height: 170px; }
  .machine { min-height: 54px; font-size: 12px; }
  .start-action .primary { min-width: 0; width: 100%; }
  .primary, .secondary { min-height: 56px; font-size: 15px; }
  .section-art { width: 60px; height: 60px; border-radius: 11px; }
  .section-title { gap: 9px; }
  .section-title .step-no { width: 31px; height: 31px; font-size: 12px; }
  .fields { grid-template-columns: 1fr; }
  .field input, .field select, textarea, select { min-height: 52px; font-size: 16px; }
  .questions { padding: 13px; }
  .success { padding: 16px; align-items: flex-start; }
  .sim-title select { margin-left: 0; width: 100%; }
  .canvas-wrap { overflow-x: auto; }
  canvas { min-width: 620px; }
  .canvas-label { min-width: 620px; }
  .export { gap: 20px; }
  .export > .primary { width: 100%; }
  footer { padding: 24px 18px; }
  footer span { float: none; display: block; margin-top: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* fix: step number badges never overlap text */
.step > .step-no { position: static; display: grid; margin: 0 0 10px; }
.step h3 { padding-top: 0; clear: none; }
.section-title > .step-no { margin-top: 2px; }
.section-title > div h3 { margin-top: 0; overflow-wrap: anywhere; }
.step h3 { overflow-wrap: anywhere; }

html,body{min-height:100dvh}body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}header{padding-top:calc(24px + env(safe-area-inset-top))}footer{padding-bottom:calc(32px + env(safe-area-inset-bottom))}@media(prefers-reduced-motion:no-preference){#splash{animation:splash-out .35s ease .6s forwards}@keyframes splash-out{to{opacity:0;visibility:hidden}}}
