:root {
  --ink: #221f1d;
  --muted: #746d68;
  --line: rgba(62, 52, 46, 0.12);
  --cream: #f7f3ee;
  --paper: rgba(255, 255, 255, 0.88);
  --accent: #8b5e4d;
  --accent-dark: #684235;
  --accent-soft: #eadbd2;
  --shadow: 0 24px 70px rgba(70, 48, 37, 0.09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: linear-gradient(180deg, #faf8f5 0%, #f3ede7 100%); color: var(--ink); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.page-glow { position: fixed; width: 520px; height: 520px; border-radius: 50%; filter: blur(1px); opacity: .45; pointer-events: none; z-index: 0; }
.glow-one { top: -280px; right: -140px; background: radial-gradient(circle, #eedcd3 0%, transparent 70%); }
.glow-two { bottom: -330px; left: -210px; background: radial-gradient(circle, #e6ded5 0%, transparent 70%); }

.topbar, .app-shell, footer { position: relative; z-index: 1; }
.topbar { max-width: 1240px; margin: 0 auto; padding: 28px 28px 10px; display: flex; justify-content: space-between; align-items: center; }
.wordmark { color: var(--ink); text-decoration: none; font-family: Georgia, serif; letter-spacing: .16em; font-size: 18px; font-weight: 700; }
.wordmark span { color: var(--accent); font-size: .66em; }
.lang-toggle { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.62); color: var(--ink); padding: 8px 16px; cursor: pointer; }
.lang-toggle:hover { border-color: var(--accent); }

.app-shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 54px 0 24px; }
.hero { max-width: 800px; margin: 0 auto 52px; text-align: center; }
.kicker { color: var(--accent); font-size: 12px; letter-spacing: .18em; font-weight: 750; }
.hero h1 { margin: 16px 0 18px; font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: clamp(42px, 6vw, 76px); line-height: .98; letter-spacing: -.035em; }
.hero > p { max-width: 670px; margin: 0 auto; color: var(--muted); font-size: 17px; line-height: 1.7; }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 26px; }
.trust-row span { border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; font-size: 12px; color: #655d58; background: rgba(255,255,255,.55); }

#tryonForm { display: grid; gap: 22px; }
.panel { border: 1px solid rgba(255,255,255,.9); background: var(--paper); border-radius: 28px; padding: 34px; box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.section-heading { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 28px; }
.section-heading .step { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; letter-spacing: .08em; }
.section-heading h2 { margin: 1px 0 7px; font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.section-heading p { margin: 0; color: var(--muted); line-height: 1.55; }

.method-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.method-card { display: flex; flex-direction: column; text-align: left; border: 1px solid var(--line); border-radius: 19px; overflow: hidden; padding: 0; background: #fff; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s; }
.method-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(61,42,32,.09); }
.method-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(139,94,77,.15); }
.method-card img { width: 100%; aspect-ratio: 1.25; object-fit: cover; background: #f4f1ed; }
.method-card > span { display: flex; flex-direction: column; gap: 7px; padding: 16px; min-height: 138px; }
.method-card strong { font-size: 16px; }
.method-card small { color: var(--muted); line-height: 1.45; }
.method-card em { margin-top: auto; color: var(--accent); font-size: 11px; font-style: normal; letter-spacing: .07em; text-transform: uppercase; }

.shade-tools { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.search-box { min-width: 290px; }
.search-box input, .access-code input, .select-field select { width: 100%; border: 1px solid var(--line); border-radius: 13px; background: #fff; padding: 13px 15px; outline: none; color: var(--ink); }
.search-box input:focus, .access-code input:focus, .select-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,94,77,.10); }
.shade-filters { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.shade-filters button { border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); padding: 8px 12px; cursor: pointer; font-size: 12px; }
.shade-filters button.active { background: var(--ink); color: white; border-color: var(--ink); }
.shade-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; max-height: 530px; overflow: auto; padding: 3px 5px 8px 3px; scrollbar-color: #c7b5aa transparent; }
.shade-card { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 8px; text-align: left; cursor: pointer; transition: border-color .16s, transform .16s; }
.shade-card:hover { transform: translateY(-2px); }
.shade-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(139,94,77,.14); }
.shade-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; background: #f3f0ec; }
.shade-card span { display: block; padding: 9px 3px 4px; overflow: hidden; }
.shade-card strong, .shade-card small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shade-card strong { font-size: 12px; }
.shade-card small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.selected-shade { display: grid; grid-template-columns: 90px 1fr 128px; align-items: center; gap: 18px; margin-top: 22px; border-radius: 18px; padding: 14px; background: linear-gradient(110deg, #f0e4dc, #f8f4f0); }
.selected-shade img { width: 90px; height: 90px; border-radius: 12px; object-fit: cover; background: #fff; }
.selected-shade .product-preview { width: 128px; object-fit: contain; }
.selected-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.selected-copy span { color: var(--accent); font-size: 10px; letter-spacing: .15em; }
.selected-copy strong { font-family: Georgia, serif; font-size: 22px; }
.selected-copy small { color: var(--muted); }

.photo-options-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); gap: 22px; }
.upload-box { position: relative; min-height: 430px; border: 1.5px dashed rgba(139,94,77,.38); border-radius: 20px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #faf7f3, #f0e7e0); cursor: pointer; transition: border-color .2s, background .2s; }
.upload-box:hover, .upload-box.dragging { border-color: var(--accent); background: #f3e7df; }
.upload-box input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-box img { width: 100%; height: 100%; min-height: 430px; object-fit: contain; background: #eee8e3; }
.upload-prompt { text-align: center; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.upload-prompt b { font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
.upload-prompt small { color: var(--muted); }
.upload-box > button { position: absolute; right: 14px; bottom: 14px; border: 1px solid rgba(255,255,255,.8); background: rgba(31,27,25,.78); color: #fff; border-radius: 999px; padding: 9px 14px; cursor: pointer; z-index: 2; }
.option-stack { display: flex; flex-direction: column; gap: 18px; }
.option-fieldset { border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin: 0; }
.option-fieldset legend, .select-field > span, .access-code > span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #5e5550; }
.choice-card { display: block; cursor: pointer; margin-top: 10px; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card span { display: flex; flex-direction: column; gap: 5px; border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.choice-card input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(139,94,77,.12); background: #fdf9f6; }
.choice-card small { color: var(--muted); }
.select-field, .access-code { display: flex; flex-direction: column; gap: 9px; }
.select-field select { cursor: pointer; }
.access-code { max-width: 430px; margin-top: 22px; }
.consent-row { display: flex; align-items: flex-start; gap: 11px; margin: 24px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.55; cursor: pointer; }
.consent-row input { margin-top: 2px; accent-color: var(--accent); }
.generate-button { width: 100%; border: 0; border-radius: 15px; background: var(--ink); color: #fff; min-height: 58px; display: flex; align-items: center; justify-content: center; gap: 14px; cursor: pointer; font-weight: 700; letter-spacing: .02em; transition: background .2s, transform .2s; }
.generate-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.generate-button:disabled { cursor: wait; opacity: .58; transform: none; }
.generate-button i { font-style: normal; font-size: 20px; }
.form-message { min-height: 20px; margin: 12px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.form-message.error { color: #9c3e37; }

.progress-panel {
  --digital-mint: #a2f5df;
  --digital-violet: #c8b2ff;
  position: relative;
  isolation: isolate;
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(280px, .82fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(30px, 5vw, 64px);
  min-height: 510px;
  overflow: hidden;
  color: #fff;
  border-color: rgba(255,255,255,.12);
  background:
    radial-gradient(circle at 12% 18%, rgba(162,245,223,.14), transparent 32%),
    radial-gradient(circle at 92% 86%, rgba(200,178,255,.13), transparent 34%),
    linear-gradient(135deg, #181514 0%, #28211e 54%, #171515 100%);
  box-shadow: 0 28px 80px rgba(38,27,23,.22);
}
.progress-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .19;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 73%);
  mask-image: linear-gradient(90deg, #000, transparent 73%);
}
.development-stage, .progress-copy { position: relative; z-index: 1; }
.development-stage { display: grid; place-items: center; min-width: 0; perspective: 1000px; }
.developing-card {
  width: min(100%, 335px);
  padding: 13px 13px 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(255,255,255,.17), rgba(255,255,255,.055));
  box-shadow: 0 26px 60px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.18);
  backdrop-filter: blur(18px);
  transform: rotateY(2deg) rotateZ(-1deg);
  animation: card-float 5s ease-in-out infinite;
}
.developing-card-top, .developing-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.developing-card-top { height: 32px; padding: 0 3px 9px; font-size: 8px; font-weight: 750; letter-spacing: .17em; color: rgba(255,255,255,.72); }
.developing-card-top i { display: flex; align-items: center; gap: 6px; color: var(--digital-mint); font-style: normal; }
.developing-card-top i::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 13px currentColor; animation: digital-pulse 1.8s ease-in-out infinite; }
.developing-window { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 13px; background: #0d0d0e; box-shadow: inset 0 0 0 1px rgba(255,255,255,.11); }
.development-ghost, .development-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.development-ghost { opacity: .34; filter: grayscale(1) blur(8px) brightness(.68) contrast(.82); transform: scale(1.035); }
.development-image {
  clip-path: inset(0 0 95% 0);
  filter: saturate(.82) contrast(.94) brightness(1.08);
  transition: clip-path 1.2s ease, filter 1.2s ease;
}
.development-color-wash, .development-grid, .development-sweep, .development-scanline { position: absolute; pointer-events: none; }
.development-color-wash { inset: 0; opacity: .22; background: linear-gradient(155deg, rgba(162,245,223,.4), transparent 38%, rgba(200,178,255,.38)); mix-blend-mode: color; }
.development-grid { inset: 0; opacity: .17; background: repeating-linear-gradient(0deg, rgba(255,255,255,.22) 0 1px, transparent 1px 4px); mix-blend-mode: overlay; }
.development-sweep { left: -25%; right: -25%; height: 28%; top: -35%; background: linear-gradient(180deg, transparent, rgba(255,255,255,.15), rgba(162,245,223,.2), transparent); transform: skewY(-4deg); animation: digital-sweep 4.2s ease-in-out infinite; }
.development-scanline { left: 0; right: 0; top: 5%; height: 1px; background: linear-gradient(90deg, transparent, var(--digital-mint) 14%, #fff 50%, var(--digital-violet) 86%, transparent); box-shadow: 0 0 18px rgba(162,245,223,.8); transition: top 1.2s ease; }
.focus-corner { position: absolute; width: 22px; height: 22px; border-color: rgba(255,255,255,.63); }
.corner-a { left: 12px; top: 12px; border-left: 1px solid; border-top: 1px solid; }
.corner-b { right: 12px; top: 12px; border-right: 1px solid; border-top: 1px solid; }
.corner-c { left: 12px; bottom: 12px; border-left: 1px solid; border-bottom: 1px solid; }
.corner-d { right: 12px; bottom: 12px; border-right: 1px solid; border-bottom: 1px solid; }
.development-clock { position: absolute; right: 13px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: white; text-shadow: 0 1px 9px rgba(0,0,0,.8); }
.development-clock span { font-size: 7px; letter-spacing: .18em; opacity: .72; }
.development-clock b { font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.developing-card-bottom { padding: 14px 3px 0; }
.developing-card-bottom > span:first-child { overflow: hidden; color: rgba(255,255,255,.62); font-size: 8px; letter-spacing: .08em; text-overflow: ellipsis; white-space: nowrap; }
.signal-bars { display: inline-flex; height: 13px; flex: 0 0 auto; align-items: flex-end; gap: 2px; }
.signal-bars i { display: block; width: 2px; border-radius: 2px; background: var(--digital-mint); box-shadow: 0 0 7px rgba(162,245,223,.55); animation: signal-rise 1.2s ease-in-out infinite alternate; }
.signal-bars i:nth-child(1) { height: 4px; animation-delay: -.2s; }
.signal-bars i:nth-child(2) { height: 7px; animation-delay: -.55s; }
.signal-bars i:nth-child(3) { height: 10px; animation-delay: -.8s; }
.signal-bars i:nth-child(4) { height: 13px; animation-delay: -1s; }
.progress-copy { max-width: 570px; }
.progress-panel .kicker { color: var(--digital-mint); }
.progress-panel h2 { margin: 14px 0 13px; font-family: Georgia, serif; font-size: clamp(31px, 4vw, 48px); line-height: 1.06; font-weight: 500; letter-spacing: -.02em; }
.progress-panel .progress-copy > p { margin: 0; max-width: 530px; color: rgba(255,255,255,.68); line-height: 1.7; }
.development-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; width: min(100%, 430px); margin: 28px 0 19px; }
.development-steps span { position: relative; height: 3px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.14); }
.development-steps span::after { content: ""; position: absolute; inset: 0; opacity: 0; background: linear-gradient(90deg, var(--digital-mint), var(--digital-violet)); transform: scaleX(.25); transform-origin: left; transition: opacity .45s, transform .6s ease; }
.development-steps span.active::after { opacity: 1; transform: scaleX(1); }
.development-steps span.current::after { animation: step-glow 1.8s ease-in-out infinite; }
.progress-panel .progress-hint { padding-top: 17px; border-top: 1px solid rgba(255,255,255,.11); color: rgba(255,255,255,.43) !important; font-size: 11px; line-height: 1.55 !important; }
.progress-panel[data-mode="queued"] .developing-card-top i { color: #ffe4a6; }
.progress-panel[data-mode="queued"] .development-image { clip-path: inset(0 0 90% 0); }
.progress-panel[data-mode="queued"] .development-scanline { top: 10%; }
.progress-panel[data-mode="generating"] .development-image { animation: digital-develop 110s linear forwards; }
.progress-panel[data-mode="generating"] .development-scanline { animation: scanline-develop 110s linear forwards; }
.progress-panel[data-mode="finishing"] .developing-card { box-shadow: 0 28px 75px rgba(0,0,0,.36), 0 0 35px rgba(162,245,223,.13), inset 0 1px 0 rgba(255,255,255,.2); }
.progress-panel[data-mode="finishing"] .development-image { clip-path: inset(0); filter: saturate(.95) contrast(1) brightness(1); animation: none; }
.progress-panel[data-mode="finishing"] .development-scanline { top: 100%; animation: none; opacity: 0; }
@keyframes card-float { 0%, 100% { transform: rotateY(2deg) rotateZ(-1deg) translateY(0); } 50% { transform: rotateY(-1deg) rotateZ(-.35deg) translateY(-7px); } }
@keyframes digital-pulse { 0%, 100% { opacity: .42; transform: scale(.86); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes digital-sweep { 0% { top: -38%; opacity: 0; } 18% { opacity: 1; } 72% { opacity: .75; } 100% { top: 112%; opacity: 0; } }
@keyframes digital-develop { from { clip-path: inset(0 0 90% 0); } to { clip-path: inset(0 0 12% 0); } }
@keyframes scanline-develop { from { top: 10%; } to { top: 88%; } }
@keyframes signal-rise { from { opacity: .35; transform: scaleY(.55); } to { opacity: 1; transform: scaleY(1); } }
@keyframes step-glow { 0%, 100% { filter: brightness(.8); } 50% { filter: brightness(1.6); } }

.result-panel { margin-top: 22px; }
.result-heading { margin-bottom: 20px; }
.result-frame { border-radius: 20px; overflow: hidden; background: #eee8e3; min-height: 360px; display: grid; place-items: center; }
.result-frame img { display: block; max-width: 100%; max-height: 78vh; object-fit: contain; }
.result-frame img.result-developing { animation: result-develop 1.8s cubic-bezier(.2,.72,.2,1) both; }
@keyframes result-develop {
  0% { opacity: .12; filter: grayscale(1) blur(16px) brightness(2.15) contrast(.48); transform: scale(.985); }
  45% { opacity: .78; filter: grayscale(.45) blur(5px) brightness(1.35) contrast(.75); }
  100% { opacity: 1; filter: none; transform: scale(1); }
}
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.download-button, .secondary-button { min-height: 52px; display: grid; place-items: center; border-radius: 13px; text-decoration: none; cursor: pointer; font-weight: 650; }
.download-button { background: var(--ink); color: white; }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.result-note { color: var(--muted); text-align: center; font-size: 12px; line-height: 1.55; }

.privacy-strip { margin: 22px 0; padding: 24px 28px; display: grid; grid-template-columns: .55fr 1fr; gap: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.privacy-strip strong { font-family: Georgia, serif; font-size: 20px; font-weight: 500; }
.privacy-strip p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
footer { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 18px 0 35px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
footer a { color: inherit; }
.embedded .topbar, .embedded footer { display: none; }
.embedded .app-shell { padding-top: 26px; }
.empty-message { color: var(--muted); text-align: center; padding: 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 960px) {
  .method-grid { grid-template-columns: repeat(2, 1fr); }
  .shade-grid { grid-template-columns: repeat(4, 1fr); }
  .photo-options-grid { grid-template-columns: 1fr; }
  .upload-box, .upload-box img { min-height: 520px; }
  .progress-panel { grid-template-columns: minmax(245px, 310px) minmax(0, 1fr); gap: 30px; padding: 30px; }
}

@media (max-width: 760px) {
  .progress-panel { grid-template-columns: 1fr; min-height: 0; padding: 28px 18px; text-align: center; }
  .developing-card { width: min(82vw, 315px); }
  .progress-copy { margin: 0 auto; }
  .progress-panel .progress-copy > p { margin-left: auto; margin-right: auto; }
  .development-steps { margin-left: auto; margin-right: auto; }
}

@media (max-width: 640px) {
  .topbar { padding: 20px 18px 6px; }
  .app-shell { width: min(100% - 20px, 1180px); padding-top: 36px; }
  .hero { margin-bottom: 34px; }
  .hero h1 { font-size: 44px; }
  .hero > p { font-size: 15px; }
  .panel { padding: 22px 16px; border-radius: 21px; }
  .section-heading { gap: 12px; }
  .section-heading .step { width: 35px; height: 35px; }
  .section-heading h2 { font-size: 23px; }
  .section-heading p { font-size: 13px; }
  .method-grid { gap: 9px; }
  .method-card > span { min-height: 142px; padding: 12px; }
  .method-card small { font-size: 11px; }
  .shade-tools { display: block; }
  .search-box { display: block; min-width: 0; margin-bottom: 12px; }
  .shade-filters { justify-content: flex-start; }
  .shade-grid { grid-template-columns: repeat(3, 1fr); max-height: 470px; }
  .selected-shade { grid-template-columns: 70px 1fr; }
  .selected-shade img { width: 70px; height: 70px; }
  .selected-shade .product-preview { display: none; }
  .selected-copy strong { font-size: 18px; }
  .upload-box, .upload-box img { min-height: 400px; }
  .progress-panel { border-radius: 22px; }
  .developing-card { width: min(82vw, 290px); }
  .progress-panel h2 { font-size: 31px; }
  .result-actions { grid-template-columns: 1fr; }
  .privacy-strip { grid-template-columns: 1fr; gap: 9px; padding: 22px 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
