/* 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%;
  height: 44vh;
  min-height: 260px;
  max-height: 440px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ddd;
}

.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; }
}

/* circular brand logo (replaces the dot) */
.brand-logo { width: 56px; height: 56px; border-radius: 50%; display: block; flex: none; }

/* ── Hero two-column layout + Migrant Mother demo ── */
.hero-grid { display: grid; gap: 30px; align-items: start; }
@media (min-width: 800px) {
  .hero-grid { grid-template-columns: 1fr minmax(260px, 330px); gap: 52px; }
}
.hero .pills { margin-top: 20px; }
.hero-media { display: flex; flex-direction: column; align-items: center; }
#heroSlider { width: 100%; max-width: 330px; aspect-ratio: 677 / 880; margin: 0 auto; }
.hero-cta {
  display: inline-block; margin-top: 24px; background: var(--accent); color: #fff;
  font-weight: 600; text-decoration: none; padding: 14px 26px; border-radius: 14px;
  box-shadow: var(--shadow); letter-spacing: -0.01em;
}
.hero-cta:hover { filter: brightness(1.06); }
.hero-cap { text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.55; margin: 13px auto 0; max-width: 400px; }
.hero-credit { opacity: 0.8; }

/* smooth scroll from hero CTA to upload */
html { scroll-behavior: smooth; }
#uploadSection { scroll-margin-top: 24px; }
.hero-media .hero-cta { margin-top: 18px; }

/* upload moved into hero left column (it is the CTA) */
.hero-text #uploadSection { margin-top: 22px; }
.hero-text #dropzone { padding: 26px 18px; }
@media (min-width: 800px) { .hero { padding-top: 30px; } }

/* ── Editorial full-bleed hero (variant D) ── */
.hero-ed{ display:grid; grid-template-columns:1fr 1fr; align-items:stretch; min-height:92vh; padding:0; border:0; margin:0; }
.he-media{ position:relative; overflow:hidden; background:#d9d2c6; }
.he-media #heroSlider{ position:absolute; inset:0; max-width:none; width:auto; aspect-ratio:auto; margin:0; border-radius:0; border:0; box-shadow:none; }
.he-panel{ background:#F1E7D6; display:flex; flex-direction:column; padding:clamp(22px,3vw,40px) clamp(24px,4vw,60px); }
.he-bar{ display:flex; align-items:center; justify-content:space-between; }
.he-body{ flex:1; display:flex; flex-direction:column; justify-content:center; max-width:540px; padding:24px 0; }
.he-title{ font-size:clamp(30px,3.6vw,46px); font-weight:700; letter-spacing:-.03em; line-height:1.05; margin:12px 0 24px; }
.he-credit{ color:var(--muted); font-size:12.5px; margin-top:16px; }
#langToggle{ font:inherit; font-size:13px; font-weight:600; border:1px solid var(--line); background:#fff; color:#4a4339; border-radius:999px; padding:6px 13px; cursor:pointer; flex:none; }
@media (max-width:820px){
  .hero-ed{ grid-template-columns:1fr; min-height:0; }
  .he-media{ height:56vh; }
  .he-body{ justify-content:flex-start; padding-top:14px; max-width:none; }
}

/* prevent the blue text/image selection while dragging sliders + crop canvas */
.ba, .ba *, #cropCanvas { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.ba img { -webkit-user-drag: none; }
.editor-controls { gap: 14px 22px; }

/* more prominent brand in the editorial panel */
.he-bar .brand { font-size: 30px; gap: 14px; letter-spacing: -.035em; }
.he-bar .brand-logo { width: 76px; height: 76px; }
.he-bar { margin-bottom: 8px; }

/* ── wordmark "ignition a" (sepi = flat sepia / old photo, colour ignites at the
   shared a, wake = full colour). NB: use background-image, not the `background`
   shorthand — the shorthand resets background-clip and kills the text clip. ── */
:root { --wm-sepia: #6E4F2A; --wm-gold: #E0A53B; --wm-teal: #1F8A70; }
.brand .wm { white-space: nowrap; }
.brand .wm-sep { color: var(--wm-sepia); }
.brand .wm-a,
.brand .wm-wake {
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.brand .wm-a    { background-image: radial-gradient(circle at 58% 55%, var(--wm-gold) 0%, var(--accent) 44%, var(--wm-sepia) 80%); }
.brand .wm-wake { background-image: linear-gradient(90deg, var(--accent), var(--wm-gold) 55%, var(--wm-teal)); }
