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

:root {
  --ink: #191d1b;
  --muted: #68706b;
  --paper: #f3f2ed;
  --surface: #faf9f5;
  --line: #d9d9d1;
  --accent: #9bd41f;
  --accent-dark: #638f0c;
  --radius: 22px;
  font-family: "Geist", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100dvh; }
button, input { font: inherit; }
button, label, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, label:focus-within { outline: 3px solid rgba(99, 143, 12, .32); outline-offset: 3px; }
[hidden] { display: none !important; }

.site-header, .viewer-header {
  min-height: 78px; padding: 0 clamp(22px, 4vw, 64px); display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--line);
}
.brand { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
.brand-logo { display: block; width: 62px; height: auto; }
.header-note, .eyebrow, .result-kicker { font: 600 11px/1 "Geist Mono", monospace; letter-spacing: .13em; }
.header-note { color: var(--muted); }

.upload-page { background-image: radial-gradient(circle at 75% 18%, rgba(155,212,31,.1), transparent 26%); }
.upload-layout { width: min(1360px, calc(100% - 48px)); min-height: calc(100dvh - 132px); margin: auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .75fr); gap: clamp(56px, 9vw, 150px); align-items: center; padding: 72px 0; }
.intro { align-self: center; padding-left: clamp(0px, 5vw, 76px); }
.eyebrow { color: var(--accent-dark); margin: 0 0 24px; }
.intro h1 { font-size: clamp(54px, 7vw, 108px); line-height: .9; letter-spacing: -.075em; margin: 0; font-weight: 600; }
.lead { max-width: 540px; margin: 38px 0 28px; color: var(--muted); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; }
.capabilities { display: flex; flex-wrap: wrap; gap: 9px; }
.capabilities span { border: 1px solid var(--line); border-radius: 100px; padding: 8px 13px; color: #555d58; font: 500 12px/1 "Geist Mono", monospace; }

.upload-panel { position: relative; background: var(--surface); border: 1px solid #e1e0d8; border-radius: var(--radius); padding: clamp(24px, 3vw, 42px); box-shadow: 0 30px 80px -50px rgba(28, 35, 31, .35), inset 0 1px 0 rgba(255,255,255,.8); }
.panel-heading { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 26px; }
.step-number { font: 600 10px/1 "Geist Mono", monospace; color: var(--accent-dark); padding-top: 7px; }
.panel-heading h2, .result h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.drop-zone { min-height: 270px; border: 1px dashed #b9bbb2; border-radius: 15px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: transform .3s cubic-bezier(.16,1,.3,1), background .3s, border-color .3s; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--accent); background: #f1f6e6; transform: translateY(-2px); }
.drop-zone.has-file { min-height: 130px; }
.object-glyph { width: 66px; height: 66px; margin-bottom: 22px; position: relative; border: 1px solid #b4b7b1; transform: rotate(30deg); transition: transform .5s cubic-bezier(.16,1,.3,1); }
.object-glyph::before, .object-glyph::after, .object-glyph span { content: ""; position: absolute; inset: 10px; border: 1px solid #b4b7b1; transform: rotate(60deg); }
.object-glyph::after { transform: rotate(120deg); }
.object-glyph span { inset: 20px; transform: none; background: var(--accent); border: 0; }
.drop-zone:hover .object-glyph { transform: rotate(75deg) scale(1.05); }
.drop-zone strong { font-size: 16px; }
.drop-zone > span:last-child { color: var(--muted); font-size: 13px; margin-top: 6px; }
.file-row { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; margin-top: 12px; padding: 13px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.file-type { width: 42px; height: 42px; display: grid; place-items: center; background: #e9e7df; font: 600 10px "Geist Mono", monospace; }
.file-info { min-width: 0; display: flex; flex-direction: column; }
.file-info strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-info span { color: var(--muted); font-size: 12px; }
.text-button, .new-upload { border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 12px; }
.primary-button, .secondary-button { min-height: 52px; display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 18px; border: 0; border-radius: 12px; color: var(--ink); background: var(--accent); font-weight: 650; text-decoration: none; cursor: pointer; transition: transform .2s, background .2s, color .2s; }
.primary-button:hover, .secondary-button:hover { color: white; background: var(--accent-dark); }
.primary-button:active, .secondary-button:active { transform: translateY(1px) scale(.99); }
.primary-button:disabled { background: #d5d4cc; color: #8c908d; cursor: not-allowed; }
.button-progress { display: none; width: 80%; height: 2px; background: rgba(255,255,255,.35); overflow: hidden; }
.button-progress::after { content: ""; display: block; width: 42%; height: 100%; background: white; animation: loading 1s ease-in-out infinite; }
.is-loading .button-label { display: none; }
.is-loading .button-progress { display: block; }
@keyframes loading { from { transform: translateX(-120%); } to { transform: translateX(270%); } }
.form-error { color: #9b3721; background: #fae7df; padding: 12px 14px; border-radius: 10px; font-size: 13px; margin: 12px 0 0; }
.result { padding: 25px 0 4px; animation: rise .5s cubic-bezier(.16,1,.3,1) both; }
.result-kicker { color: var(--accent-dark); margin-bottom: 14px; }
.result h2 { font-size: 30px; max-width: 370px; }
.link-field { display: grid; grid-template-columns: 1fr auto; margin-top: 28px; background: #ebe9e2; border-radius: 12px; padding: 5px; }
.link-field input { min-width: 0; border: 0; background: transparent; padding: 10px; color: #545a56; outline: 0; font-size: 13px; }
.link-field button, .header-button, .viewer-actions button { border: 0; background: var(--ink); color: white; border-radius: 8px; padding: 10px 15px; cursor: pointer; font-weight: 600; font-size: 12px; transition: transform .2s, opacity .2s; }
.link-field button:active, .header-button:active, .viewer-actions button:active { transform: scale(.97); }
.new-upload { display: block; margin: 18px auto 0; }
footer { height: 54px; padding: 0 clamp(22px, 4vw, 64px); border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: var(--muted); font: 500 10px "Geist Mono", monospace; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.viewer-page { overflow: hidden; background: #e9e8e2; }
.viewer-header { position: relative; background: rgba(243,242,237,.92); min-height: 70px; }
.model-title { position: absolute; left: 50%; transform: translateX(-50%); text-align: center; display: flex; flex-direction: column; max-width: 38vw; }
.model-title span { color: var(--muted); font: 600 9px/1.6 "Geist Mono", monospace; letter-spacing: .14em; }
.model-title strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-button { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.viewer-shell { height: calc(100dvh - 70px); position: relative; background-image: linear-gradient(rgba(94,100,96,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(94,100,96,.08) 1px, transparent 1px); background-size: 48px 48px; }
model-viewer { width: 100%; height: 100%; --poster-color: transparent; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 20px; z-index: 1; }
.viewer-loading p { color: var(--muted); font: 500 11px "Geist Mono", monospace; letter-spacing: .08em; }
.skeleton-object { width: 130px; height: 130px; background: #d8d8d1; clip-path: polygon(50% 0, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%); animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; transform: scale(.96); } }
.viewer-error { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; }
.viewer-error h1 { margin: 0 0 22px; font-size: clamp(30px, 5vw, 56px); letter-spacing: -.055em; }
.viewer-error .secondary-button { width: auto; padding: 0 22px; }
.viewer-help { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); display: flex; gap: 22px; background: rgba(250,249,245,.86); border: 1px solid rgba(255,255,255,.65); box-shadow: inset 0 1px 0 white; backdrop-filter: blur(14px); border-radius: 100px; padding: 13px 18px; color: var(--muted); font-size: 11px; white-space: nowrap; animation: rise .5s .15s both; }
.viewer-help b { color: var(--ink); font: 600 9px "Geist Mono", monospace; margin-right: 4px; }
.viewer-actions { position: absolute; right: 24px; bottom: 24px; display: flex; gap: 7px; animation: rise .5s .25s both; }
.viewer-actions button { background: rgba(25,29,27,.88); backdrop-filter: blur(10px); }

@media (max-width: 800px) {
  .upload-layout { width: min(100% - 32px, 600px); grid-template-columns: 1fr; gap: 46px; padding: 48px 0; }
  .intro { padding: 0; }
  .intro h1 { font-size: clamp(52px, 15vw, 78px); }
  .upload-panel { padding: 22px; }
  .drop-zone { min-height: 220px; }
  .model-title { display: none; }
  .viewer-help { bottom: 80px; max-width: calc(100% - 30px); overflow-x: auto; justify-content: flex-start; }
  .viewer-actions { left: 15px; right: 15px; bottom: 15px; }
  .viewer-actions button { flex: 1; }
}

@media (max-width: 480px) {
  .site-header, .viewer-header { padding: 0 16px; }
  .brand-logo { width: 54px; }
  .header-note { display: none; }
  .upload-layout { width: calc(100% - 28px); }
  .intro h1 { letter-spacing: -.065em; }
  .file-row { grid-template-columns: auto 1fr; }
  .file-row .text-button { grid-column: 2; justify-self: start; }
  footer span:first-child { max-width: 70%; }
}

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