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

:root {
  --ink: #f5f3ed;
  --muted: #94939d;
  --muted-2: #6d6d77;
  --line: rgba(255, 255, 255, 0.1);
  --line-bright: rgba(255, 255, 255, 0.2);
  --panel: rgba(23, 24, 31, 0.88);
  --panel-deep: #16171e;
  --accent: #c9ff54;
  --accent-soft: rgba(201, 255, 84, 0.13);
  --violet: #bca8ff;
  --danger: #ff8f91;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #111218; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 8%, rgba(97, 72, 150, 0.18), transparent 30rem),
    radial-gradient(circle at 12% 35%, rgba(67, 95, 47, 0.1), transparent 25rem),
    #111218;
  font-family: 'Manrope', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

.page-shell { width: min(1420px, calc(100% - 48px)); margin: 0 auto; }

.topbar {
  min-height: 74px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); color: var(--muted); font: 11px 'DM Mono', monospace;
  letter-spacing: .04em; text-transform: uppercase;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #ffbd45; color: #211d2c; font: 800 16px Manrope, sans-serif; letter-spacing: -.08em; text-transform: lowercase; }
.topbar-meta { display: flex; align-items: center; gap: 8px; }
.status-dot { width: 7px; height: 7px; border-radius: 99px; background: #f2bd62; box-shadow: 0 0 0 4px rgba(242, 189, 98, .12); }
.status-dot.ready { background: var(--accent); box-shadow: 0 0 0 4px rgba(201, 255, 84, .12); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 4px rgba(255, 143, 145, .12); }

.hero { padding: 92px 0 66px; max-width: 800px; }
.eyebrow, .section-kicker { color: var(--accent); font: 11px 'DM Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 9px; }
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
h1 { margin: 18px 0 20px; font-size: clamp(54px, 8vw, 108px); line-height: .92; letter-spacing: -.075em; font-weight: 800; }
h1 em { color: var(--violet); font-style: normal; }
.hero-copy { max-width: 520px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.hero-links { display: flex; gap: 28px; margin-top: 28px; color: #d5d2db; font: 12px 'DM Mono', monospace; }
.hero-links a { text-decoration-color: rgba(255, 255, 255, .25); text-underline-offset: 5px; }
.hero-links a:hover { color: var(--accent); }

.workspace-grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.card { border: 1px solid var(--line); background: var(--panel); border-radius: 18px; box-shadow: 0 20px 80px rgba(0, 0, 0, .16); }
.control-card { padding: 28px; }
.card-heading, .viewer-head, .section-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card h2, .viewer-card h2, .how-section h2 { margin: 7px 0 0; font-size: 20px; letter-spacing: -.04em; }
.mini-badge, .live-badge { color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 7px 10px; font: 10px 'DM Mono', monospace; white-space: nowrap; }
.live-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--accent); border-color: rgba(201, 255, 84, .25); }
.live-badge i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.dropzone { min-height: 186px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; margin-top: 28px; border: 1px dashed #494a55; border-radius: 13px; background: rgba(255, 255, 255, .025); text-align: center; transition: .2s ease; }
.dropzone:hover, .dropzone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { display: none; }
.upload-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 5px; border: 1px solid var(--line-bright); border-radius: 50%; color: var(--accent); font-size: 20px; }
.dropzone strong { font-size: 13px; }
.dropzone span { color: var(--muted); font-size: 11px; }
.dropzone .browse-link { color: var(--accent); font: 11px 'DM Mono', monospace; text-decoration: underline; text-underline-offset: 4px; }
.preview-wrap { position: relative; overflow: hidden; margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: repeating-conic-gradient(#262832 0 25%, #202129 0 50%) 50% / 16px 16px; }
.preview-wrap img { display: block; width: 100%; max-height: 220px; object-fit: contain; }
.preview-label { display: flex; justify-content: space-between; gap: 10px; padding: 9px 11px; border-top: 1px solid var(--line); color: var(--muted); font: 10px 'DM Mono', monospace; white-space: nowrap; }
.preview-label span:first-child { overflow: hidden; text-overflow: ellipsis; }
.is-hidden { display: none !important; }
.sample-button { display: flex; justify-content: space-between; width: 100%; margin-top: 13px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 11px; text-align: left; }
.sample-button:hover { color: var(--accent); }
.sample-arrow { font-size: 17px; line-height: 12px; }

.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 25px 0 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toggle-copy { display: grid; gap: 4px; }
.toggle-copy strong { font-size: 12px; font-weight: 600; }
.toggle-copy small { color: var(--muted); font: 10px 'DM Mono', monospace; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { position: relative; width: 38px; height: 22px; flex: 0 0 auto; border-radius: 99px; background: #3a3b45; transition: .2s ease; }
.toggle-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #a7a6ae; transition: .2s ease; }
.toggle-row input:checked + .toggle-ui { background: var(--accent); }
.toggle-row input:checked + .toggle-ui::after { left: 19px; background: #20231a; }
.tip-box { display: flex; gap: 9px; padding: 12px; border: 1px solid rgba(188, 168, 255, .2); border-radius: 10px; color: var(--muted); background: rgba(188, 168, 255, .06); font-size: 10px; line-height: 1.5; }
.tip-icon { color: var(--violet); font-size: 14px; }
.primary-button { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 21px; padding: 15px 16px; border: 0; border-radius: 10px; color: #1d2118; background: var(--accent); font-size: 12px; font-weight: 800; transition: .2s ease; }
.primary-button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 10px 25px rgba(201, 255, 84, .18); }
.primary-button:disabled, .download-button:disabled { cursor: not-allowed; opacity: .45; }
.button-arrow { font-size: 18px; }

.viewer-card { min-width: 0; padding: 28px; }
.viewer-stage { position: relative; overflow: hidden; min-height: 500px; margin-top: 22px; border: 1px solid var(--line); border-radius: 13px; background: radial-gradient(circle at 50% 42%, rgba(102, 82, 160, .18), transparent 44%), #12131a; }
.viewer-stage::before { content: ''; position: absolute; inset: 0; opacity: .24; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, black, transparent 90%); pointer-events: none; }
#viewer-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewer-empty, .viewer-progress, .viewer-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; text-align: center; pointer-events: none; }
.viewer-empty { color: var(--muted); }
.viewer-empty strong, .viewer-progress strong, .viewer-error strong { color: var(--ink); font-size: 13px; }
.viewer-empty span, .viewer-progress span, .viewer-error span { max-width: 270px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.empty-orbit { display: grid; place-items: center; width: 82px; height: 82px; margin-bottom: 8px; border: 1px solid rgba(188, 168, 255, .35); border-radius: 50%; color: var(--violet); font-size: 43px; font-weight: 200; box-shadow: 0 0 0 18px rgba(188,168,255,.025), 0 0 0 36px rgba(188,168,255,.015); }
.viewer-progress { background: rgba(18, 19, 26, .8); backdrop-filter: blur(6px); }
.progress-ring { display: grid; place-items: center; width: 86px; height: 86px; margin-bottom: 8px; border: 1px solid rgba(201, 255, 84, .25); border-top-color: var(--accent); border-radius: 50%; color: var(--accent); font: 12px 'DM Mono', monospace; animation: spin 1.3s linear infinite; }
.progress-ring span { color: var(--accent); font: 12px 'DM Mono', monospace; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewer-error { z-index: 3; background: rgba(18, 19, 26, .92); backdrop-filter: blur(8px); pointer-events: auto; }
.error-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(255,143,145,.5); border-radius: 50%; color: var(--danger); }
.viewer-error button { margin-top: 8px; padding: 8px 12px; border: 1px solid var(--line-bright); border-radius: 7px; color: var(--ink); background: transparent; font-size: 11px; }
.viewer-toolbar { position: absolute; right: 13px; bottom: 12px; left: 13px; display: flex; justify-content: space-between; align-items: center; color: var(--muted-2); font: 10px 'DM Mono', monospace; pointer-events: none; }
.viewer-toolbar button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: rgba(18, 19, 26, .75); font: 10px 'DM Mono', monospace; pointer-events: auto; }
.viewer-toolbar button:hover { color: var(--ink); border-color: var(--line-bright); }
.viewer-foot { display: flex; align-items: center; gap: 25px; padding-top: 18px; }
.metric { display: grid; gap: 6px; min-width: 68px; }
.metric span { color: var(--muted-2); font: 9px 'DM Mono', monospace; letter-spacing: .07em; }
.metric strong { color: var(--ink); font: 13px 'DM Mono', monospace; font-weight: 500; }
.download-button { display: inline-flex; align-items: center; gap: 14px; margin-left: auto; padding: 12px 14px; border: 1px solid rgba(201, 255, 84, .35); border-radius: 8px; color: var(--accent); background: transparent; font: 11px 'DM Mono', monospace; }
.download-button:not(:disabled):hover { background: var(--accent-soft); }
.download-button span { font-size: 16px; }

.how-section { padding: 108px 0 94px; }
.section-heading-row p { max-width: 330px; margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: right; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.step-card { position: relative; min-height: 210px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.02); }
.step-card.step-accent { border-color: rgba(201,255,84,.28); background: linear-gradient(135deg, rgba(201,255,84,.08), rgba(188,168,255,.05)); }
.step-number { color: var(--muted-2); font: 10px 'DM Mono', monospace; }
.step-icon { margin-top: 27px; color: var(--violet); font-size: 28px; line-height: 1; }
.step-card h3 { margin: 18px 0 8px; font-size: 14px; }
.step-card p { max-width: 260px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 20px 0 30px; border-top: 1px solid var(--line); color: var(--muted-2); font: 10px 'DM Mono', monospace; }

@media (max-width: 900px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .control-card { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .control-card .card-heading, .control-card .dropzone, .control-card .preview-wrap, .control-card .sample-button, .control-card .primary-button { grid-column: 1 / -1; }
  .control-card .toggle-row { margin-top: 25px; }
  .viewer-stage { min-height: 440px; }
}
@media (max-width: 620px) {
  .page-shell { width: min(100% - 28px, 1420px); }
  .topbar { min-height: 62px; }
  .brand span:last-child { display: none; }
  .hero { padding: 64px 0 48px; }
  h1 { font-size: clamp(52px, 17vw, 82px); }
  .hero-copy { font-size: 14px; }
  .hero-links { gap: 16px; flex-wrap: wrap; }
  .control-card { display: block; padding: 20px; }
  .viewer-card { padding: 20px; }
  .viewer-stage { min-height: 350px; }
  .viewer-foot { gap: 12px; flex-wrap: wrap; }
  .download-button { width: 100%; justify-content: center; margin-left: 0; }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card { min-height: 160px; }
  .section-heading-row { display: block; }
  .section-heading-row p { margin-top: 14px; text-align: left; }
  .footer { display: block; line-height: 1.8; }
}
