/* Export · the export window's two choices (export/section.html): 01 format, 02 colour space, then the file.
   Script export/js/formats.js. On top of export.css (the title). */

.fx-steps { max-width: 1240px; margin: 0 auto; font-family: var(--display); }
/* Wide: the two choices side by side, one screen (≥ 1060 px); a hairline between them. Narrower: stacked. */
@media (min-width: 1060px) {
  .fx-steps { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.42fr); }
  .fx-step:first-child { padding-right: clamp(36px, 3.6vw, 64px); }
  /* the five rows share step 02's height, so both columns end on the same line */
  .fx-step:first-child { display: flex; flex-direction: column; }
  .fx-step:first-child .fx-fmts { flex: 1; grid-auto-rows: 1fr; }
  .fx-step + .fx-step { padding-left: clamp(36px, 3.6vw, 64px); border-left: 1px solid #ffffff17; }
}
@media (max-width: 1059px) {
  .fx-step + .fx-step { margin-top: clamp(56px, 7vw, 96px); padding-top: clamp(48px, 6vw, 80px); border-top: 1px solid #ffffff17; }
}

/* ---------- a step's head: the number, a big title, one line ---------- */
.fx-step__head { display: flex; align-items: flex-start; gap: clamp(14px, 1.4vw, 20px); margin-bottom: clamp(24px, 2.6vw, 36px); }
.fx-step__n {
  flex: none; display: grid; place-items: center;
  width: clamp(40px, 3.2vw, 48px); aspect-ratio: 1; border-radius: 50%;
  border: 1.5px solid #ffffff40; font: 600 clamp(14px, 1.1vw, 16px) var(--display); color: var(--text);
  margin-top: 0;
}
.fx-step__head h3 { margin: 0; font-size: clamp(30px, 2.9vw, 44px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.04; }
.fx-step__head p { margin: 6px 0 0; font-size: clamp(16px, 1.3vw, 19px); font-weight: 500; letter-spacing: -0.01em; color: var(--muted); }

/* ---------- 01 · formats: five tiles ---------- */
/* Wide: five compact rows, the name left, what it's for + bits · size right. Narrower: tiles. */
.fx-fmts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.fx-fmt {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name use" "name spec";
  align-items: center; column-gap: 14px; row-gap: 2px; padding: 12px 16px; text-align: left;
  border-radius: 14px; border: 1px solid #ffffff1a; background: #ffffff08; color: var(--text);
  font-family: var(--display); cursor: pointer;
  transition: border-color .25s, background .25s, transform .25s;
}
.fx-fmt:hover { border-color: #ffffff3a; }
.fx-fmt:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fx-fmt b { grid-area: name; font-size: clamp(24px, 2.1vw, 30px); font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.fx-fmt span { grid-area: use; justify-self: end; font-size: 14px; font-weight: 600; }
.fx-fmt em { grid-area: spec; justify-self: end; font: 500 11.5px var(--mono); font-style: normal; color: var(--muted); }
.fx-fmt[aria-checked="true"] { border-color: #fff; background: #ffffff14; box-shadow: 0 0 0 1px #fff; }
.fx-fmt[data-f="dng"] b { color: #ffe6dc; }
.fx-fmt[data-f="dng"] span::after { content: " ↓"; color: #ffe6dc; }

/* ---------- 02 · colour space: the diagram + four options ---------- */
.fx-cs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 3vw, 48px); align-items: center; transition: opacity .35s; }
.fx-explain { margin: 0 0 16px; font-size: clamp(17px, 1.5vw, 21px); font-weight: 500; letter-spacing: -0.015em; line-height: 1.3; color: var(--text); }
.fx-explain span { color: var(--muted); }

.fx-chart { position: relative; aspect-ratio: 340 / 380; width: min(100%, 360px); justify-self: center; }
.fx-paint, .fx-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-paint { opacity: 0; transition: opacity 1s ease; }
.fx.is-in .fx-paint { opacity: .78; }
.fx-svg { overflow: visible; }
.fx-locus { fill: none; stroke: #ffffff55; stroke-width: 1; }
.fx-dim { fill: #0b0c0c; opacity: 0; transition: opacity .45s ease; pointer-events: none; }
.fx-dim.is-on { opacity: .62; }
.fx-tri {
  fill: none; stroke: #ffffff59; stroke-width: 1.2; stroke-linejoin: round;
  stroke-dasharray: var(--len, 1200); stroke-dashoffset: var(--len, 1200);
  transition: stroke .3s, stroke-width .3s, stroke-dashoffset 1s cubic-bezier(.4, 0, .2, 1) calc(var(--k, 0) * 180ms + .3s);
}
.fx.is-in .fx-tri { stroke-dashoffset: 0; }
.fx-tri.is-on { stroke: #fff; stroke-width: 2.4; filter: drop-shadow(0 0 5px #0009); }
.fx-tlabel, .fx-eye { font: 600 13px var(--display, -apple-system); fill: #fff; paint-order: stroke; stroke: #0b0c0ccc; stroke-width: 3px; }
.fx-tlabel { opacity: 0; transition: opacity .3s; }
.fx-tlabel.is-on { opacity: 1; }
/* The horseshoe's name: a dot on its edge, a leader up, two lines above (room made by the chart's top margin). */
.fx-eye { font-size: 14px; }
.fx-eye__dot { fill: #fff; stroke: #0b0c0c; stroke-width: 2; }
.fx-eye__lead { fill: none; stroke: #ffffffcc; stroke-width: 1.2; }
.fx-chart { margin-top: 44px; }

.fx-spaces { display: grid; gap: 8px; }
.fx-space {
  display: grid; gap: 3px; padding: 11px 16px; text-align: left;
  border-radius: 14px; border: 1px solid #ffffff1a; background: #ffffff08; color: var(--text);
  font-family: var(--display); cursor: pointer;
  transition: border-color .25s, background .25s;
}
.fx-space:hover { border-color: #ffffff3a; }
.fx-space:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.fx-space b { font-size: clamp(18px, 1.5vw, 21px); font-weight: 700; letter-spacing: -0.02em; }
.fx-space span { font-size: 13px; line-height: 1.35; color: var(--muted); }
.fx-space[aria-checked="true"] { border-color: #fff; background: #ffffff14; box-shadow: 0 0 0 1px #fff; }
.fx-space[aria-checked="true"] span { color: #c9cfcc; }

/* DNG: no colour space to pick, as in the app. */
.fx-step--cs.is-off .fx-cs { opacity: .28; pointer-events: none; }
.fx-dngnote { margin: 18px 0 0; text-align: center; font-size: clamp(17px, 1.5vw, 21px); font-weight: 500; color: #ffe6dc; }
.fx-dngnote span { color: var(--muted); }

/* ---------- the file the two choices make ---------- */
.fx-file {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px;
  width: fit-content; max-width: 100%; margin: clamp(40px, 4vw, 64px) auto 0; padding: 14px 22px;
  border-radius: 999px; border: 1px solid #ffffff2e; background: linear-gradient(180deg, #181b1ae0, #0f1110eb);
  box-shadow: 0 24px 60px #00000066; font-family: var(--display);
}
.fx-file__icon { width: 14px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, #fff, #ffe6dc); box-shadow: 0 0 12px #e0644a; }
.fx-file b { font: 600 15px var(--mono); }
.fx-file span:last-child { font-size: 15px; color: var(--muted); }
.fx-file.is-new { animation: fx-pop .45s ease-out; }
@keyframes fx-pop { 40% { transform: scale(1.04); } }

.fx .cx__more { margin-top: clamp(40px, 4vw, 64px); }

@media (max-width: 1059px) {
  .fx-fmts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fx-fmt { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "use" "spec"; align-items: start; padding: 16px; }
  .fx-fmt span { justify-self: start; margin-top: 8px; }
  .fx-fmt em { justify-self: start; }
  .fx-cs { grid-template-columns: minmax(0, 1fr); }
  .fx-chart { width: min(100%, 380px); }
}
@media (max-width: 560px) {
  .fx-fmts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fx-fmt { padding: 14px 14px 14px; border-radius: 14px; }
  .fx-fmt[data-f="dng"] { grid-column: 1 / -1; }
  .fx-file { border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-tri { stroke-dashoffset: 0; transition: none; }
  .fx-paint { opacity: .78; transition: none; }
  .fx-file.is-new { animation: none; }
}
