/* Home · Edit (from variants/edit-a, integrated 2026-11-10): two chapters, Light & Color and Geometry. */
/* Edit, variant A: two chapters, each hands-on (Light & Color, then Geometry), zig-zag.
   Reuses .cx, .cx__head, .c-glass, .c-seg, .c-kbd from css/home-edit-retouch.css. Everything else is .eda. */

/* The glow reaches past the sides; clip it there so the page never scrolls sideways. */
.eda { overflow-x: clip; }
.eda::before {
  inset: 8% -10% 0;
  background:
    radial-gradient(30% 26% at 30% 30%, #c2412f, transparent 70%),
    radial-gradient(28% 24% at 66% 36%, #6f8f3a, transparent 70%),
    radial-gradient(30% 26% at 70% 74%, #6f8f3a, transparent 70%),
    radial-gradient(24% 22% at 38% 78%, #c2412f99, transparent 70%);
  opacity: .32;
}

/* ---------- Blocks: visual on one side, text on the other ---------- */

.eda__block {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  grid-template-areas: "visual text";
  align-items: start;              /* the text starts on the photo's top edge */
  gap: clamp(40px, 5vw, 84px);
  max-width: 1280px;
  margin: 0 auto;
}
.eda__block + .eda__block { margin-top: clamp(88px, 10vw, 150px); }
.eda__block--geo { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); grid-template-areas: "text visual"; }
.eda__visual { grid-area: visual; min-width: 0; }
.eda__text { grid-area: text; min-width: 0; max-width: 460px; }
.eda__block--color .eda__text { justify-self: start; }
.eda__block--geo .eda__text { justify-self: end; }

/* ---------- Text ---------- */

.eda__kicker { display: flex; align-items: center; gap: 10px; margin: 0; }
.eda__kicker span {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 20px; padding: 0 6px;
  border-radius: 6px; border: 1px solid #ffffff24; color: var(--text);
}
.eda__text h3 {
  margin: 16px 0 0;
  font-size: clamp(30px, 3.2vw, 44px);
  letter-spacing: -0.03em; line-height: 1.06; text-wrap: balance;
  background: linear-gradient(180deg, #ffffff 30%, #aab5b0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.eda__lede { margin: 16px 0 0; color: var(--muted); font-size: clamp(16px, 1.3vw, 18px); line-height: 1.5; text-wrap: pretty; }
.eda__points { margin: 26px 0 0; padding: 0; list-style: none; }
.eda__points li {
  display: grid; gap: 3px;
  padding: 13px 0;
  border-top: 1px solid #ffffff14;
  font-size: 15px; line-height: 1.45;
}
.eda__points li:last-child { border-bottom: 1px solid #ffffff14; }
.eda__points b { font-weight: 600; letter-spacing: -0.01em; }
.eda__points span { color: var(--muted); }
.eda__points .c-kbd { vertical-align: 1px; margin: 0 1px; }

/* ---------- Stage (the photo) ---------- */

.eda__stage {
  position: relative;
  aspect-ratio: 1600 / 1067;
  border-radius: 24px;
  overflow: hidden;
  background: #1d2412;
  box-shadow: 0 50px 120px #00000080, 0 0 0 1px #ffffff1c;
  isolation: isolate;
}
.eda__stage > img, .eda__stage > canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.eda__stage [hidden] { display: none; }
.eda__photo { position: relative; }
/* Geometry: a dark editing canvas with a strip on top for the hint and Replay, so they never cover a handle */
.eda__stage--geo { aspect-ratio: 1600 / 1150; background: #0d0f0e; }

/* Glass over a bright photo: darker so labels stay readable on the green */
.eda .eda__photo .c-glass { background: linear-gradient(180deg, #181b1ae0, #0f1110eb); border-color: #ffffff2e; box-shadow: inset 0 1px 0 #ffffff1f, 0 4px 16px #0000004d; }

.eda__replay {
  position: absolute; right: 12px; top: 12px; z-index: 3;
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 34px; padding: 0 13px;
  border-radius: 999px; cursor: pointer;
  font-size: 12px; font-weight: 600;
}
.eda__replay:hover { color: var(--text); }

.eda__hint {
  position: absolute; left: 12px; top: 12px; z-index: 3;
  margin: 0; padding: 7px 13px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.eda__hint.is-on { opacity: 1; transform: none; }

/* Band on the photo: Edited · n and Before | After (StackResultEditBandView's info row) */
.eda__band {
  position: absolute; left: 12px; bottom: 12px; z-index: 3;
  display: flex; align-items: center; gap: 8px;
  padding: 5px;
  border-radius: 999px;
  font-size: 12px; white-space: nowrap;
  transition: opacity .25s;
}
.eda__band.is-empty { opacity: 0; pointer-events: none; }
.eda__chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 11px;
  border-radius: 999px; border: 1px solid #ffffff24; background: #ffffff12;
  font-size: 12px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums;
}
.eda__chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #c9cfcc; }
.eda__chip:hover { background: #ffffff1f; }
.eda__chip[hidden] { display: none; }
.eda__band .c-seg { width: 150px; flex: none; }
.eda__band .c-seg button { min-height: 26px; }

/* ---------- Deck: the controls under the photo ---------- */

.eda__deck {
  margin-top: 12px;
  padding: 14px 18px 12px;
  border-radius: 20px;
  font-size: 12px;
}
.eda__deck--color {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.5fr);
  gap: 0 22px;
}
.eda__group--light { padding-left: 22px; border-left: 1px solid #ffffff14; }

.eda__ghead { display: flex; align-items: center; gap: 7px; min-height: 30px; margin-bottom: 4px; }
.eda__ghead svg { flex: none; color: var(--muted); }
.eda__ghead b { font-size: 13px; font-weight: 700; }
.eda__badge { padding: 1px 7px; border-radius: 999px; background: #ffffff1c; color: #c9cfcc; font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.eda__badge[hidden] { display: none; }
.eda__group.is-flash .eda__ghead b { animation: eda-flash 1s ease-out; }
@keyframes eda-flash { 0%, 40% { color: var(--accent); } 100% { color: inherit; } }

.eda__reset {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin-left: auto;
  border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer;
}
.eda__reset:hover { background: #ffffff14; color: var(--text); }
.eda__reset[hidden] { display: none; }
.eda__reset--card { color: var(--text); }

.eda__rows--two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 22px; }

/* White balance pad: temperature across (mired scale), tint up and down, magenta on top */
.eda__pad {
  position: relative; height: 72px; margin: 2px 0 6px;
  border-radius: 8px; overflow: hidden;
  background:
    linear-gradient(180deg, #e06dd699, #e06dd600 50%, #6ed68200 50%, #6ed68299),
    linear-gradient(90deg, #5b86ff, #b9c2d6 52%, #ffb54f);
  box-shadow: inset 0 0 0 1px #ffffff1f;
  cursor: crosshair; touch-action: none;
}
.eda__pad::before, .eda__pad::after { content: ''; position: absolute; background: #ffffff66; pointer-events: none; }
.eda__pad::before { left: var(--px, 50%); top: 0; bottom: 0; width: 1px; }
.eda__pad::after { top: var(--py, 50%); left: 0; right: 0; height: 1px; }
.eda__pad i { position: absolute; bottom: 0; width: 1px; height: 6px; background: #0b0c0c99; }
.eda__puck {
  position: absolute; left: var(--px, 50%); top: var(--py, 50%); z-index: 1;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; border: 2px solid #fff; background: #ffffff40;
  box-shadow: 0 1px 4px #0009; pointer-events: none;
}
.eda__pad.is-demo .eda__puck { box-shadow: 0 0 0 4px #ffffff40, 0 1px 4px #0009; }

/* Slider row: title, value at the far end (a reset button once edited), track filled from neutral */
.eda__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 1px 0; }
.eda__row label { color: #c3cac6; font-size: 12px; user-select: none; -webkit-user-select: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eda__val {
  min-width: 58px; min-height: 22px; padding: 0 0 0 8px;
  border: 0; background: none; text-align: right;
  color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums;
}
.eda__val:disabled { cursor: default; }
.eda__row.is-edited label { color: var(--text); }
.eda__row.is-edited .eda__val { color: var(--accent); cursor: pointer; }
.eda__row.is-edited .eda__val:hover span { display: none; }
.eda__row.is-edited .eda__val:hover::after { content: '↺'; font-size: 14px; }
.eda__row input { grid-column: 1 / -1; }
.eda__row.is-demo label { color: var(--text); }

/* Straighten: the icon slider row (StackEditIconSliderRow), value stays grey. The card already says
   "Straighten", so the row's own title is only read out, and the value sits at the end of the track. */
.eda__row--icon { position: relative; grid-template-columns: 18px minmax(0, 1fr) 18px 40px; column-gap: 8px; }
.eda__row--icon label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eda__row--icon .eda__val { grid-column: 4; grid-row: 1; justify-self: end; min-width: 0; padding: 0; font-size: 13px; }
.eda__row--icon input { grid-column: 2; grid-row: 1; }
.eda__row--icon svg:first-of-type { grid-column: 1; grid-row: 1; }
.eda__row--icon svg:last-of-type { grid-column: 3; grid-row: 1; }
.eda__row--icon svg { color: var(--muted); }
.eda__row--icon.is-edited .eda__val { color: var(--muted); cursor: default; }
.eda__row--icon.is-edited .eda__val:hover span { display: inline; }
.eda__row--icon.is-edited .eda__val:hover::after { content: none; }

.eda input[type="range"] { --rail: linear-gradient(90deg, #ffffff24 var(--a), #e9eeebd9 var(--a) var(--b), #ffffff24 var(--b)); }
.eda input.temp { --rail: linear-gradient(90deg, #6e96ff, #ffffff38, #ffb54f); }
.eda input.tint { --rail: linear-gradient(90deg, #6ed682, #ffffff38, #e06dd6); }
.eda input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 13px; margin-top: -5px;
  border-radius: 7px; border: 0; background: #dfe4e1;
  box-shadow: 0 1px 4px #0009, 0 0 0 .5px #0005;
  transition: box-shadow .2s;
}
.eda input[type="range"]::-moz-range-thumb { width: 20px; height: 13px; border-radius: 7px; border: 0; background: #dfe4e1; box-shadow: 0 1px 4px #0009; }
.eda input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px #46fac866, 0 1px 4px #0009; }
.eda .is-demo input[type="range"]::-webkit-slider-thumb { box-shadow: 0 0 0 4px #ffffff33, 0 1px 4px #0009; }
.eda .is-demo input[type="range"]::-moz-range-thumb { box-shadow: 0 0 0 4px #ffffff33, 0 1px 4px #0009; }

/* ---------- Geometry deck: section cards ---------- */

.eda__deck--geo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  grid-template-areas: "rot aspect" "overlay aspect";
  gap: 10px;
  padding: 10px;
}
.eda__card { padding: 10px 12px 12px; border-radius: 12px; border: 1px solid #ffffff12; background: #ffffff0d; }
.eda__card--rot { grid-area: rot; }
.eda__card--aspect { grid-area: aspect; }
.eda__card--overlay { grid-area: overlay; }
.eda__card header { display: flex; align-items: center; justify-content: space-between; min-height: 26px; margin-bottom: 4px; }
.eda__card header b { font-size: 13px; font-weight: 700; }

.eda__ratios { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 2px; }
.eda__ratio {
  display: grid; justify-items: center; align-content: center; gap: 5px;
  min-width: 0; min-height: 52px; padding: 6px 2px;
  border-radius: 9px; border: 1px solid #ffffff14; background: #ffffff08;
  color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.eda__ratio:hover { color: var(--text); background: #ffffff12; }
.eda__ratio[aria-checked="true"] { color: var(--text); border-color: #ffffff3d; background: linear-gradient(180deg, #ffffff2b, #ffffff17); box-shadow: inset 0 1px 0 #ffffff38; }
.eda__ratio.is-press { transform: scale(.94); }
.eda__ratio { transition: background .15s, color .15s, border-color .15s, transform .15s; }
.eda__ratio i { display: grid; place-items: center; width: 18px; height: 18px; }
.eda__ratio i::before { content: ''; width: var(--w); height: var(--h); border-radius: 2.5px; background: currentColor; opacity: .85; }
.eda__ratio i.is-free::before { width: 15px; height: 15px; background: none; border: 1.5px dashed currentColor; box-sizing: border-box; }

.eda__select {
  width: 100%; min-height: 30px; padding: 0 10px;
  border-radius: 8px; border: 1px solid #ffffff1f; background: #ffffff12;
  color: var(--text); font: 500 13px var(--font);
}

/* ---------- Geometry stage: the photo inside the crop frame ---------- */

.eda__frame {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  overflow: hidden;
  background: #1d2412;
}
.eda__frame img {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  transform: rotate(var(--rot, 0deg)) scale(var(--zoom, 1));
}

/* Crop overlay (StackResultCropOverlayView): dim outside, overlay lines, corner and edge handles */
.eda__crop {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 2;
  border: 1px solid #ffffffd9;
  box-shadow: 0 0 0 200vmax #000000a6;
  cursor: move;
  touch-action: none;
  transition: left .45s, top .45s, width .45s, height .45s;
  transition-timing-function: cubic-bezier(.2, .7, .2, 1);
}
.eda__crop.is-full { touch-action: pan-y; }
.eda.is-dragging .eda__crop { transition: none; }
.eda__lines { position: absolute; inset: 0; pointer-events: none; }
.eda__lines b { position: absolute; background: #ffffff66; }
.eda__lines b.v { top: 0; bottom: 0; width: 1px; margin-left: -.5px; }
.eda__lines b.h { left: 0; right: 0; height: 1px; margin-top: -.5px; }
.eda__crop i { position: absolute; width: 34px; height: 34px; touch-action: none; }
.eda__crop i::after { content: ''; position: absolute; border: 0 solid #fff; }
.eda__crop i[data-h="nw"] { left: -17px; top: -17px; cursor: nwse-resize; }
.eda__crop i[data-h="ne"] { right: -17px; top: -17px; cursor: nesw-resize; }
.eda__crop i[data-h="sw"] { left: -17px; bottom: -17px; cursor: nesw-resize; }
.eda__crop i[data-h="se"] { right: -17px; bottom: -17px; cursor: nwse-resize; }
.eda__crop i[data-h="nw"]::after { left: 14px; top: 14px; width: 18px; height: 18px; border-width: 3px 0 0 3px; }
.eda__crop i[data-h="ne"]::after { right: 14px; top: 14px; width: 18px; height: 18px; border-width: 3px 3px 0 0; }
.eda__crop i[data-h="sw"]::after { left: 14px; bottom: 14px; width: 18px; height: 18px; border-width: 0 0 3px 3px; }
.eda__crop i[data-h="se"]::after { right: 14px; bottom: 14px; width: 18px; height: 18px; border-width: 0 3px 3px 0; }
.eda__crop i[data-h="n"], .eda__crop i[data-h="s"] { left: calc(50% - 17px); cursor: ns-resize; }
.eda__crop i[data-h="n"] { top: -17px; } .eda__crop i[data-h="s"] { bottom: -17px; }
.eda__crop i[data-h="e"], .eda__crop i[data-h="w"] { top: calc(50% - 17px); cursor: ew-resize; }
.eda__crop i[data-h="w"] { left: -17px; } .eda__crop i[data-h="e"] { right: -17px; }
.eda__crop i[data-h="n"]::after, .eda__crop i[data-h="s"]::after { left: 6px; top: 15px; width: 22px; height: 3px; background: #fff; border-radius: 2px; }
.eda__crop i[data-h="e"]::after, .eda__crop i[data-h="w"]::after { left: 15px; top: 6px; width: 3px; height: 22px; background: #fff; border-radius: 2px; }

/* ---------- Narrower: one column, text above its visual ---------- */

@media (max-width: 1059px) {
  .eda__block, .eda__block--geo {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "text" "visual";
    gap: 28px;
    max-width: 760px;
  }
  .eda__block .eda__text { justify-self: start; max-width: 600px; }
}

@media (max-width: 640px) {
  .eda__stage { border-radius: 18px; }
  .eda__replay { right: 8px; top: 8px; min-height: 30px; padding: 0 11px; font-size: 11px; }
  .eda__hint { left: 8px; top: 8px; padding: 6px 11px; font-size: 11px; }
  .eda__band { position: static; width: fit-content; margin-top: 10px; padding: 4px; gap: 6px; }
  .eda__band.is-empty { opacity: .45; }
  .eda__stage--geo { aspect-ratio: 1600 / 1250; }
  .eda__chip { min-height: 26px; padding: 0 9px; font-size: 11px; }
  .eda__band .c-seg { width: 132px; }
  .eda__band .c-seg button { min-height: 24px; font-size: 11px; padding: 0 8px; }
  .eda__deck { padding: 12px 14px 10px; border-radius: 18px; }
  .eda__deck--color { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .eda__group--light { padding: 10px 0 0; border-left: 0; border-top: 1px solid #ffffff14; }
  .eda__rows--two { gap: 2px 16px; }
  .eda__deck--geo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "rot" "aspect" "overlay"; padding: 8px; gap: 8px; }
  .eda__points li { font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .eda *, .eda *::before, .eda *::after { transition: none !important; animation: none !important; }
}

/* On the home page: the Edit sheet's surface (css/sep-b.css styles .ce, this section is .eda). */
.sb-slot > .eda { background: var(--sb-light), var(--sb-b); }
