/* sepiawake — Organic-warm visual system
   Light mode only. No Inter. Signature move: the before/after drag slider.
   ============================================================ */

:root {
  --canvas:      #F6F1E8;
  --ink:         #221F1A;
  --muted:       #6F665A;
  --line:        #E6DCCB;
  --card:        #FFFFFF;
  --accent:      #C25A38;
  --accent-soft: #F3E0D6;
  --teal:        #1F6F6B;
  --shadow:      0 1px 2px rgba(40,30,15,.04), 0 12px 28px -12px rgba(40,30,15,.12);
  --r:           20px;
  --font:        system-ui, -apple-system, "Avenir Next", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.01em;
  background-image:
    radial-gradient(60vw 50vw at 88% -8%, #F7E6DC 0%, transparent 60%),
    radial-gradient(48vw 40vw at -10% 18%, #E7EEEA 0%, transparent 55%);
  background-attachment: fixed;
}

/* ── Layout ──────────────────────────────── */

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 22px;
}

h1, h2, h3 {
  letter-spacing: -.025em;
  font-weight: 700;
  line-height: 1.08;
  margin: 0;
}

a { color: var(--accent); text-underline-offset: 3px; }

p { max-width: 64ch; margin: 0 0 .75em; }

/* Tabular nums on all numeric text */
.num { font-variant-numeric: tabular-nums; }

/* ── Header ──────────────────────────────── */

header.top {
  padding: 26px 0 20px;
  border-bottom: 1px solid var(--line);
}

header.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.03em;
  text-decoration: none;
  color: var(--ink);
}

.brand .dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex-shrink: 0;
}

/* Language toggle */
#langToggle {
  font: 600 13px/1 var(--font);
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  letter-spacing: .04em;
  transition: background .15s, color .15s, border-color .15s;
}

#langToggle:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ── Sections ────────────────────────────── */

section {
  padding: 54px 0;
  border-bottom: 1px solid var(--line);
}

section:last-of-type { border-bottom: 0; }

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ── Hero ────────────────────────────────── */

.hero-text h1 {
  font-size: clamp(30px, 5.5vw, 50px);
  margin-bottom: 14px;
}

.hero-text .lead {
  font-size: 19px;
  color: #3a352d;
  max-width: 58ch;
  margin-bottom: 32px;
}

/* Pill badges */
.pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 13px;
  font-weight: 600;
  color: #4a4339;
  margin: 0 5px 8px 0;
}

.pill b { color: var(--accent); }

/* ── Before/After Slider (signature move) ── */

.ba {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3.1;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: #ddd;
  user-select: none;
  touch-action: none;
  cursor: ew-resize;
}

.ba img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba .before-wrap {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0);
}

.ba .handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
  transform: translateX(-1px);
  pointer-events: none;
}

.ba .grab {
  position: absolute;
  top: 50%;
  left: var(--pos, 50%);
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: ew-resize;
  pointer-events: none;
}

.ba .grab::before {
  content: "\2329 \232A";
  font-size: 14px;
  letter-spacing: -2px;
  color: var(--accent);
  font-weight: 700;
}

.ba .tag {
  position: absolute;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  background: rgba(20,16,12,.55);
  backdrop-filter: blur(3px);
  pointer-events: none;
}

.ba .tag.l { left: 12px; }
.ba .tag.r { right: 12px; background: rgba(194,90,56,.85); }

/* ── Cards ───────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.card h3 { font-size: 17px; margin-bottom: 6px; }
.card p  { font-size: 14.5px; color: var(--muted); margin: 0; }

/* ── Upload dropzone ─────────────────────── */

#dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--r);
  background: var(--card);
  padding: 42px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  box-shadow: var(--shadow);
}

#dropzone:hover,
#dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

#dropzone .dz-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
}

#dropzone .dz-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#dropzone .dz-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

#dropzone .dz-sub {
  font-size: 14px;
  color: var(--muted);
}

/* visually hide the native file input but keep it accessible */
#fileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#privacyNote {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 12px;
  max-width: none;
}

/* ── Editor section ──────────────────────── */

#editor {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
}

#editor h2 {
  font-size: 20px;
  margin-bottom: 24px;
}

#cropCanvas {
  display: block;
  width: 100%;
  max-height: 480px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ddd;
  object-fit: contain;
}

.editor-controls {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ctrl-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

#rotate {
  accent-color: var(--accent);
  width: 180px;
  cursor: pointer;
}

.colour-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.colour-toggle input[type="checkbox"] {
  accent-color: var(--accent);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

/* Primary button */
#go {
  font: 600 16px/1 var(--font);
  padding: 14px 28px;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: opacity .15s, transform .1s;
  margin-left: auto;
}

#go:hover  { opacity: .88; }
#go:active { transform: scale(.98); }

#go:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

/* ── Result section ──────────────────────── */

#result {
  padding: 54px 0;
  border-bottom: 1px solid var(--line);
}

#result h2 {
  font-size: 22px;
  margin-bottom: 24px;
}

#resultSlider {
  width: 100%;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

#download {
  display: inline-block;
  font: 600 15px/1 var(--font);
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: opacity .15s;
}

#download:hover { opacity: .88; }

#quota {
  font-size: 13.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin: 0;
  max-width: none;
}

/* ── Turnstile placeholder ───────────────── */

#turnstile {
  margin: 24px 0 0;
}

/* ── Footer ──────────────────────────────── */

footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--ink); }

.footer-credit {
  font-size: 13px;
  color: var(--muted);
}

/* ── Crop overlay / handles ──────────────── */

/* Canvas cursor changes based on drag zone */
#cropCanvas {
  cursor: default;
}

#cropCanvas.drag-box    { cursor: move; }
#cropCanvas.drag-handle { cursor: nwse-resize; }

/* ── Responsive ──────────────────────────── */

@media (max-width: 600px) {
  .editor-controls { flex-direction: column; align-items: flex-start; }
  #go { margin-left: 0; width: 100%; text-align: center; }
  .result-actions { flex-direction: column; align-items: flex-start; }
}
