:root {
  --ink: #253630;
  --muted: #718079;
  --paper: #f5f1e8;
  --cream: #ebe5d8;
  --white: #fffdf8;
  --coral: #e76d4e;
  --green: #29463d;
  --line: #d7d1c5;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button { font: inherit; }
[hidden] { display: none !important; }

.site-header { height: 80px; padding: 0 clamp(24px, 6vw, 92px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.site-header p { color: var(--muted); font-size: 12px; letter-spacing: .03em; }
.header-branding { display: flex; align-items: center; gap: clamp(20px, 3vw, 48px); }
.header-instructions { max-width: 390px; margin: 0; line-height: 1.5; }
.header-change-photo { display: none; margin-left: auto; white-space: nowrap; }
.privacy-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #6e9c74; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-family: Georgia, serif; font-size: 21px; text-decoration: none; }
.brand-mark { position: relative; width: 27px; height: 27px; transform: rotate(-5deg); }
.brand-mark i { position: absolute; background: var(--coral); }
.brand-mark i:nth-child(1), .brand-mark i:nth-child(2) { width: 3px; height: 25px; top: 1px; }
.brand-mark i:nth-child(1) { left: 4px; transform: rotate(-8deg); }.brand-mark i:nth-child(2) { right: 4px; transform: rotate(8deg); }
.brand-mark i:nth-child(3), .brand-mark i:nth-child(4) { height: 3px; width: 25px; left: 1px; }
.brand-mark i:nth-child(3) { top: 4px; transform: rotate(4deg); }.brand-mark i:nth-child(4) { bottom: 4px; transform: rotate(-4deg); }

main { overflow: hidden; }
.editing .hero, .editing .process, .editing footer, .editing .privacy-message { display: none; }
.editing .header-change-photo { display: inline-block; }
.editing .editor-view { margin-top: 28px; }
.hero { max-width: 850px; margin: 0 auto; padding: 78px 24px 44px; text-align: center; }
.eyebrow, .step-label { margin: 0 0 17px; color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
h1, h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; line-height: .98; letter-spacing: -.045em; }
h1 { font-size: clamp(49px, 7vw, 82px); }
h1 em, h2 em { color: var(--coral); font-weight: 400; }
.intro { max-width: 640px; margin: 27px auto 0; color: var(--muted); font-size: 16px; line-height: 1.7; }

.upload-view { width: min(860px, calc(100% - 40px)); margin: 8px auto 100px; }
.drop-zone { width: 100%; min-height: 305px; border: 1.5px dashed #a9aea4; border-radius: 4px; background: rgba(255,255,255,.25); color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: border-color .2s, background .2s, transform .2s; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--coral); background: rgba(255,255,255,.7); transform: translateY(-2px); }
.upload-icon { width: 55px; height: 55px; margin-bottom: 20px; border-radius: 50%; background: var(--green); color: white; display: grid; place-items: center; }
.upload-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone strong { font-family: Georgia, serif; font-size: 22px; font-weight: 400; }
.drop-zone > span:not(.upload-icon) { margin-top: 5px; color: var(--muted); font-size: 14px; }
.drop-zone small { margin-top: 22px; color: #9b9f99; font-size: 11px; letter-spacing: .04em; }
.error { min-height: 20px; color: #b64330; font-size: 13px; text-align: center; }

.editor-view { width: min(1240px, calc(100% - 40px)); margin: 16px auto 100px; }
.text-button { border: 0; border-bottom: 1px solid currentColor; padding: 3px 0; background: none; color: var(--ink); cursor: pointer; font-size: 13px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 28px; align-items: start; }
.canvas-wrap { position: relative; min-height: 160px; background: #d8d6cf; box-shadow: 0 14px 45px rgba(37,54,48,.12); overflow: hidden; display: grid; place-items: center; }
#source-canvas { display: block; max-width: 100%; width: auto; height: auto; }
#guide-canvas { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
#guide-canvas.panning { cursor: grabbing; }
#result-canvas { position: absolute; z-index: 1; display: block; max-width: none; max-height: none; box-shadow: 0 14px 45px rgba(37,54,48,.18); pointer-events: none; }
.primary-button, .secondary-button { min-height: 48px; padding: 0 22px; border-radius: 2px; cursor: pointer; font-size: 13px; font-weight: 700; transition: transform .15s, background .15s; }
.primary-button { border: 1px solid var(--green); background: var(--green); color: white; }
.primary-button span { margin-left: 20px; font-size: 18px; }.primary-button:hover { background: #1d352e; transform: translateY(-1px); }
.secondary-button { border: 1px solid #b9b7af; background: transparent; color: var(--ink); }.secondary-button:hover { background: white; }

.edit-controls { position: relative; z-index: 3; max-height: calc(100dvh - 132px); padding: 25px 24px 24px; border: 1px solid var(--line); background: rgba(255,253,248,.92); overflow-y: auto; overscroll-behavior: contain; }
.stretch-heading { padding-bottom: 21px; border-bottom: 1px solid var(--line); display: grid; align-items: start; gap: 14px; }
.stretch-heading .step-label { margin-bottom: 8px; }
.stretch-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 21px; font-weight: 400; }
.stretch-heading .text-button { justify-self: end; }
.apply-block { padding-top: 22px; }
.apply-block p { margin: 0 0 17px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.full-button { width: 100%; }
.control-divider { margin: 26px 0 0; border-top: 1px solid var(--line); }
.crop-button { margin-top: 22px; }
.slider-control { margin-top: 26px; }
.slider-label { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.slider-label label { font-size: 13px; font-weight: 700; }
.slider-label output { min-width: 48px; color: var(--coral); font-family: Georgia, serif; font-size: 16px; text-align: right; }
.slider-actions { display: flex; align-items: center; gap: 10px; }
.slider-actions .text-button { font-size: 11px; }
.slider-control input[type="range"] { width: 100%; height: 18px; margin: 0; background: transparent; cursor: ew-resize; accent-color: var(--coral); }
.slider-control input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: #c8c5bc; }
.slider-control input[type="range"]::-webkit-slider-thumb { width: 17px; height: 17px; margin-top: -7px; border: 2px solid var(--white); border-radius: 50%; background: var(--coral); box-shadow: 0 1px 4px rgba(37,54,48,.25); -webkit-appearance: none; }
.slider-control input[type="range"]::-moz-range-track { height: 3px; border: 0; border-radius: 2px; background: #c8c5bc; }
.slider-control input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid var(--white); border-radius: 50%; background: var(--coral); box-shadow: 0 1px 4px rgba(37,54,48,.25); }
.slider-scale { margin-top: 5px; color: var(--muted); display: flex; justify-content: space-between; font-size: 10px; }
.preview-hint { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.curve-control { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.curve-heading { margin-bottom: 13px; display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.curve-heading strong { font-size: 13px; }
.curve-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
#curve-canvas { display: block; width: 100%; height: auto; border: 1px solid #c9c5bb; background: #242d2a; cursor: crosshair; touch-action: none; }
#curve-canvas:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.curve-scale { margin-top: 6px; color: var(--muted); display: flex; justify-content: space-between; font-size: 10px; }
.resolution-readout { margin-top: 28px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 15px; }
.resolution-readout span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.resolution-readout output { color: var(--ink); font-family: Georgia, serif; font-size: 19px; white-space: nowrap; }
.crop-button[aria-pressed="true"] { border-color: var(--coral); background: #fff5f0; color: #b84f35; }
.stretch-note { margin: 16px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.process { margin-top: 20px; padding: 90px max(24px, calc((100vw - 1180px) / 2)); background: var(--cream); display: grid; grid-template-columns: .8fr 1.2fr; gap: 100px; }
.process h2 { font-size: clamp(42px, 5vw, 65px); }
.process ol { margin: 0; padding: 0; list-style: none; }
.process li { padding: 20px 0; border-top: 1px solid #c9c2b6; display: grid; grid-template-columns: 55px 1fr; }
.process li > span { color: var(--coral); font-family: Georgia, serif; font-size: 12px; }
.process strong { font-family: Georgia, serif; font-size: 20px; font-weight: 400; }
.process li p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
footer { min-height: 100px; padding: 0 clamp(24px, 6vw, 92px); background: var(--green); color: white; display: flex; align-items: center; justify-content: space-between; }
footer span { font-family: Georgia, serif; font-size: 21px; } footer p { color: #b9c5c0; font-size: 11px; }

@media (max-width: 760px) {
  .site-header { height: 66px; }.site-header p { display: none; }
  .hero { padding-top: 55px; }.upload-view { margin-bottom: 70px; }.drop-zone { min-height: 260px; }
  .workspace { grid-template-columns: 1fr; }
  .edit-controls { width: 100%; max-height: none; overflow-y: visible; overscroll-behavior: auto; }
  .process { padding-top: 65px; padding-bottom: 65px; grid-template-columns: 1fr; gap: 45px; }
  footer { flex-direction: column; justify-content: center; gap: 5px; }
}