:root {
  --ink: #17211c;
  --paper: #f3f0e8;
  --cream: #e9e4d7;
  --orange: #ee613e;
  --acid: #d9ed72;
  --line: rgba(23, 33, 28, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; min-height: 100vh; }
button { color: inherit; font: inherit; }
.grain { position: fixed; inset: 0; pointer-events: none; opacity: .14; z-index: 10; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E"); }

.topbar { max-width: 1240px; margin: auto; padding: 26px 32px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 11px; align-items: center; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: -.03em; }
.brand-mark { width: 28px; height: 28px; border: 1.5px solid; border-radius: 50%; display: grid; place-items: center; position: relative; }
.brand-mark i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.brand-mark i:first-child { transform: translate(-5px, -2px); }
.brand-mark i:last-child { transform: translate(5px, 2px); background: var(--orange); }
.privacy-pill { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.privacy-pill span { width: 7px; height: 7px; border-radius: 50%; background: #5b9a66; box-shadow: 0 0 0 4px rgba(91,154,102,.12); }

main { max-width: 1240px; margin: auto; padding: 0 32px; }
.hero { padding: 72px 0 62px; text-align: center; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .2em; margin-bottom: 22px; }
.eyebrow b { color: var(--orange); margin: 0 5px; }
h1, h2 { font-family: "Instrument Serif", serif; font-weight: 400; letter-spacing: -.045em; line-height: .87; margin: 0; }
h1 { font-size: clamp(68px, 8.5vw, 118px); }
h1 em, h2 em { color: var(--orange); font-weight: 400; }
.lede { max-width: 590px; margin: 30px auto 44px; line-height: 1.65; color: #59615c; font-size: 16px; }

.single-upload { max-width: 760px; margin: auto; }
.single-upload .drop-zone { aspect-ratio: 16 / 8.5; }
.upload-card { min-width: 0; position: relative; }
.card-number { position: absolute; left: 15px; top: 15px; z-index: 2; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font: 600 12px "DM Sans"; }
.drop-zone { width: 100%; aspect-ratio: 4 / 3; border: 1.5px dashed #9a9c92; border-radius: 3px; background: rgba(255,255,255,.25); cursor: pointer; display: grid; place-items: center; overflow: hidden; transition: .2s ease; padding: 12px; }
.drop-zone:hover, .upload-card.dragging .drop-zone { border-color: var(--orange); background: rgba(238,97,62,.04); transform: translateY(-2px); }
.upload-card.loaded .drop-zone { padding: 0; border-style: solid; border-color: var(--ink); background: #d8d4c8; }
.empty-state { display: flex; flex-direction: column; gap: 5px; align-items: center; }
.empty-state strong { margin-top: 5px; font-size: 14px; }
.empty-state small { color: #7d827e; }
.upload-icon { font-size: 30px; transform: rotate(-45deg); font-weight: 300; }
.preview { width: 100%; height: 100%; object-fit: contain; display: none; }
.loaded .preview { display: block; }
.loaded .empty-state { display: none; }
.file-meta { height: 32px; display: flex; align-items: flex-end; justify-content: space-between; font-size: 9px; font-weight: 700; letter-spacing: .12em; color: #787d78; }
.remove { border: 0; background: none; font-size: 21px; line-height: 1; cursor: pointer; opacity: 0; pointer-events: none; }
.loaded .remove { opacity: .6; pointer-events: auto; }
.crop-editor { max-width: 980px; margin: 28px auto 0; text-align: left; }
.crop-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 10px; }
.crop-head strong { display: block; font-size: 15px; }
.crop-head small { display: block; margin-top: 4px; color: #747a75; font-size: 11px; }
.crop-head button { flex: none; border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; font-size: 11px; cursor: pointer; }
.crop-stage { background: #d8d4c8; border: 1.5px solid var(--ink); padding: 8px; touch-action: none; user-select: none; }
#cropCanvas { width: 100%; height: auto; max-height: none; cursor: crosshair; touch-action: none; }
.crop-key { display: flex; gap: 18px; margin-top: 9px; color: #69706b; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.crop-key span { display: flex; gap: 6px; align-items: center; }
.crop-key i { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: white; font-style: normal; font-weight: 700; }
.crop-key .one { background: var(--orange); }
.crop-key .two { background: #367b73; }
.versus { display: grid; place-items: center; }
.versus span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 10px; font-weight: 700; background: var(--paper); }
.auto-steps { margin: 24px auto 0; display: flex; justify-content: center; align-items: center; gap: 18px; color: #727873; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.auto-steps span { display: flex; gap: 7px; align-items: center; }
.auto-steps b { color: var(--orange); font-size: 9px; }
.auto-steps i { font-style: normal; color: #afb0a9; }

.actions { margin-top: 32px; display: flex; align-items: center; flex-direction: column; gap: 14px; }
.solve-btn { min-width: 285px; border: 0; padding: 17px 18px 17px 25px; display: flex; align-items: center; justify-content: space-between; border-radius: 2px; background: var(--ink); color: white; font-weight: 600; cursor: pointer; transition: .2s; box-shadow: 0 6px 0 #b9b4a9; }
.solve-btn b { display: grid; place-items: center; border-radius: 50%; width: 27px; height: 27px; background: var(--acid); color: var(--ink); }
.solve-btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.solve-btn:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 8px 0 #b9b4a9; }
.demo-btn, .text-btn { border: 0; background: none; text-decoration: underline; text-underline-offset: 4px; font-size: 12px; cursor: pointer; }
.format-note { margin: 28px 0 0; font-size: 9px; letter-spacing: .14em; color: #8b8e88; }

.results { padding: 66px 0 70px; }
.results-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 38px; }
.results-head .eyebrow { margin-bottom: 17px; }
h2 { font-size: clamp(62px, 8vw, 104px); }
.text-btn { margin-bottom: 10px; font-size: 13px; }
.viewer-shell { border: 1.5px solid var(--ink); background: #e5e0d4; box-shadow: 9px 9px 0 var(--ink); }
.viewer-toolbar, .viewer-foot { height: 58px; padding: 0 18px; display: flex; justify-content: space-between; align-items: center; background: var(--paper); }
.viewer-toolbar { border-bottom: 1px solid var(--line); }
.viewer-foot { border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 5px; }
.tab { border: 0; background: transparent; padding: 9px 13px; border-radius: 2px; font-size: 11px; font-weight: 600; cursor: pointer; }
.tab.active { background: var(--ink); color: white; }
.viewer-meta, .legend { display: flex; align-items: center; gap: 8px; color: #6c736e; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.viewer-meta .dot { width: 6px; height: 6px; background: #5c9f66; border-radius: 50%; }
.canvas-wrap { position: relative; min-height: 340px; background-color: #cbc6ba; background-image: linear-gradient(45deg, #c0baad 25%, transparent 25%), linear-gradient(-45deg, #c0baad 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #c0baad 75%), linear-gradient(-45deg, transparent 75%, #c0baad 75%); background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0px; display: grid; place-items: center; overflow: hidden; }
canvas { display: block; max-width: 100%; max-height: 72vh; }
.compare-layer { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; clip-path: inset(0 50% 0 0); pointer-events: none; }
.slider-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: white; box-shadow: 0 0 0 1px rgba(0,0,0,.2); display: none; pointer-events: none; }
.slider-line span { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 38px; height: 38px; border-radius: 50%; background: white; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
#compareSlider { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; display: none; cursor: ew-resize; }
.loading { position: absolute; inset: 0; z-index: 4; background: var(--ink); color: white; display: none; place-items: center; align-content: center; gap: 9px; }
.loading.active { display: grid; }
.loading small { color: #a9b0ac; }
.loader { width: 42px; height: 42px; border: 2px solid #59615c; border-top-color: var(--acid); border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.legend i { width: 12px; height: 12px; border: 2px solid var(--orange); border-radius: 50%; }
.download-btn { border: 0; background: var(--acid); padding: 10px 12px 10px 15px; font-size: 11px; font-weight: 700; cursor: pointer; }
.download-btn span { margin-left: 12px; font-size: 15px; }
.results-note { display: flex; gap: 16px; align-items: center; margin-top: 28px; }
.results-note span { font-size: 9px; background: var(--orange); color: white; padding: 5px 7px; font-weight: 700; }
.results-note p { margin: 0; font-size: 12px; color: #69706b; }
footer { max-width: 1240px; margin: auto; border-top: 1px solid var(--line); padding: 24px 32px 35px; display: flex; justify-content: space-between; font-size: 9px; letter-spacing: .12em; color: #777d78; }

@media (max-width: 700px) {
  .topbar, main, footer { padding-left: 18px; padding-right: 18px; }
  .privacy-pill { font-size: 0; }
  .privacy-pill:after { content: "Private"; font-size: 11px; }
  .hero { padding-top: 52px; }
  h1 { font-size: 63px; }
  .single-upload .drop-zone { aspect-ratio: 4 / 3; }
  .crop-head { align-items: start; }
  .crop-head small { max-width: 240px; }
  .auto-steps { gap: 8px; flex-wrap: wrap; }
  .auto-steps i { display: none; }
  .drop-zone { aspect-ratio: 16 / 10; }
  .results-head { align-items: start; }
  h2 { font-size: 55px; }
  .viewer-meta { display: none; }
  .viewer-toolbar { padding: 0 9px; }
  .tab { padding: 8px 9px; }
  .viewer-foot { height: 52px; }
  .canvas-wrap { min-height: 230px; }
}
