/* Screen Light — two-column tool (photo/preview stage + settings panel), the fullscreen light
   layer, and page-specific explainer pieces. Shared rows and the CTA card live in
   ../css/tool-pages.css. Locale editions load this same file. */

[hidden] { display: none !important; }

/* ── Tool shell ── */
.sl-tool {
  background:
    radial-gradient(ellipse 70% 60% at 15% 0%, rgba(37, 99, 235, 0.16), transparent 70%),
    #05070a;
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--page-pad-inline, 1.25rem) clamp(2rem, 5vw, 3.5rem);
}
.sl-tool__inner { max-width: 1280px; margin: 0 auto; }

.sl-intro {
  display: grid;
  gap: 0.75rem 2.5rem;
  align-items: end;
  margin-bottom: clamp(1rem, 2.5vw, 1.5rem);
}
@media (min-width: 960px) {
  .sl-intro { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.sl-intro__title {
  margin: 0;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #f8fafc;
}
.sl-intro__title span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.5em;
  letter-spacing: -0.01em;
  color: var(--accent-bright, #60a5fa);
}
.sl-intro__lead { margin: 0 0 0.75rem; color: #cbd5e1; font-size: 1rem; line-height: 1.6; }
.sl-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.sl-chips li {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sl-grid { display: grid; gap: 1rem; }
@media (min-width: 960px) {
  .sl-grid { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); align-items: stretch; }
}

/* ── Left: stage with the photo ── */
.sl-stage {
  position: relative;
  min-height: 420px;
  border-radius: 20px;
  overflow: hidden;
  background: #070b14;
  border: 1px solid rgba(96, 165, 250, 0.16);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
@media (min-width: 960px) { .sl-stage { min-height: 560px; } }

.sl-hero { position: absolute; inset: 0; display: flex; align-items: center; padding: clamp(1.5rem, 4vw, 3rem); }
.sl-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.sl-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 9, 18, 0.9) 0%, rgba(5, 9, 18, 0.7) 32%, rgba(5, 9, 18, 0.05) 62%, rgba(5, 9, 18, 0) 100%);
}
.sl-hero__copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  max-width: 19rem;
}
.sl-hero__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #fff;
  background: rgba(250, 204, 21, 0.18);
  border: 1px solid rgba(253, 224, 71, 0.55);
  box-shadow: 0 0 0 10px rgba(250, 204, 21, 0.07), 0 0 40px rgba(250, 204, 21, 0.3);
}
.sl-start-btn {
  padding: 1rem 1.9rem;
  border: none;
  border-radius: 999px;
  background: var(--accent, #3b82f6);
  color: #fff;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--glow, rgba(37, 99, 235, 0.35));
  transition: background 0.15s;
}
.sl-start-btn:hover { background: var(--accent-bright, #60a5fa); }
.sl-note { margin: 0; font-size: 0.875rem; line-height: 1.5; color: #cbd5e1; }
.sl-privacy { margin: 0; font-size: 0.8125rem; color: #94a3b8; }

@media (max-width: 959px) {
  .sl-hero { align-items: flex-end; }
  .sl-hero__img { object-position: 62% 30%; }
  .sl-hero::after { background: linear-gradient(180deg, rgba(5, 9, 18, 0) 20%, rgba(5, 9, 18, 0.75) 55%, rgba(5, 9, 18, 0.96) 100%); }
  .sl-hero__copy { max-width: none; }
  .sl-hero__icon { display: none; }
}

/* ── Right: settings panel ── */
.sl-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
  border-radius: 20px;
  background: linear-gradient(180deg, #0f1a30 0%, #0b1324 100%);
  border: 1px solid rgba(96, 165, 250, 0.16);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.sl-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(96, 165, 250, 0.1);
}
.sl-panel__title { margin: 0; font-family: var(--font-display, "Sora", sans-serif); font-size: 1.1rem; color: #f1f5f9; }

/* Small live preview of the light, drawn the same way as the fullscreen layer */
.sl-preview {
  position: relative;
  width: 92px;
  aspect-ratio: 16 / 10;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #1e293b;
  background: #000;
}
.sl-preview .sl-ring { border-width: 5px; }
.sl-preview .sl-edge { box-shadow: inset 0 0 0 6px var(--sl-color, #fff); }

.calc-label {
  display: block;
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
.sl-group { display: grid; gap: 0.15rem; }

.sl-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.sl-preset {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  background: #0a1122;
  color: #e2e8f0;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.2;
  text-align: start;
  cursor: pointer;
}
.sl-preset:hover { border-color: rgba(96, 165, 250, 0.5); }
.sl-preset[aria-pressed="true"], .sl-preset.is-active { border-color: #60a5fa; background: rgba(59, 130, 246, 0.18); box-shadow: 0 0 0 1px #60a5fa inset; }
.sl-swatch {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: var(--sw, #fff);
}
.sl-preset--custom { position: relative; }
.sl-preset--custom input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.sl-tests { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.sl-tests .sl-preset { min-height: 2rem; padding: 0.3rem 0.55rem; }

.sl-range { display: flex; align-items: center; gap: 0.75rem; }
.sl-range input { flex: 1; accent-color: #60a5fa; }
.sl-range output { min-width: 3.2rem; text-align: end; color: #e2e8f0; font-variant-numeric: tabular-nums; font-size: 0.9rem; }

.sl-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.35rem; padding: 0.25rem; border-radius: 12px; background: #0a1122; border: 1px solid rgba(96, 165, 250, 0.16); }
.sl-seg button {
  min-height: 2.3rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.sl-seg button[aria-pressed="true"] { background: rgba(59, 130, 246, 0.28); color: #fff; }

.sl-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; padding-top: 0.25rem; }
.sl-actions .sl-start-btn { padding: 0.8rem 1.4rem; font-size: 0.95rem; }
.ghost-btn {
  padding: 0.55rem 1rem;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #bfdbfe;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.ghost-btn:hover { background: rgba(59, 130, 246, 0.22); border-color: rgba(96, 165, 250, 0.6); }
.sl-panel .sl-note { color: #94a3b8; font-size: 0.8125rem; }

/* ── The light itself (fullscreen layer, also used inside the preview) ── */
.sl-light {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  cursor: none;
  overflow: hidden;
}
.sl-light.is-ui { cursor: default; }
.sl-preview .sl-face { position: absolute; inset: 0; }
.sl-face { position: absolute; inset: 0; background: #000; }
.sl-face.is-full { background: var(--sl-color, #fff); }
.sl-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--sl-ring-size, 82vmin);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: var(--sl-ring-width, 9vmin) solid var(--sl-color, #fff);
  box-shadow: 0 0 6vmin var(--sl-glow, rgba(255, 255, 255, 0.5)), inset 0 0 6vmin var(--sl-glow, rgba(255, 255, 255, 0.5));
}
.sl-preview .sl-ring { width: 76%; box-shadow: none; }
.sl-edge { position: absolute; inset: 0; box-shadow: inset 0 0 0 var(--sl-edge-width, 9vmin) var(--sl-color, #fff); }

/* Controls that float over the light and hide after a few seconds of no movement */
.sl-bar {
  position: absolute;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  max-width: calc(100vw - 2rem);
  padding: 0.6rem 0.75rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  color: #e2e8f0;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.875rem;
  transition: opacity 0.3s;
}
.sl-light:not(.is-ui) .sl-bar { opacity: 0; pointer-events: none; }
.sl-bar__dots { display: flex; gap: 0.35rem; }
.sl-bar__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: var(--sw, #fff);
  cursor: pointer;
  padding: 0;
}
.sl-bar__dot[aria-pressed="true"] { border-color: #60a5fa; box-shadow: 0 0 0 2px #60a5fa; }
.sl-bar label { display: flex; align-items: center; gap: 0.4rem; }
.sl-bar input[type="range"] { width: 110px; accent-color: #60a5fa; }
.sl-bar button.sl-bar__btn {
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.sl-toast {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  max-width: min(36rem, calc(100vw - 2rem));
  padding: 0.65rem 1rem;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.88);
  color: #f1f5f9;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
  transition: opacity 0.5s;
}
.sl-toast.is-hidden { opacity: 0; }

html.sl-locked, html.sl-locked body { overflow: hidden; }

/* ── Explainer pieces ── */
.sl-steps { max-width: 44rem; margin: 2rem auto 0; padding-left: 1.3rem; display: grid; gap: 0.6rem; color: #cbd5e1; line-height: 1.65; }
.sl-steps strong { color: #f1f5f9; }

.sl-temps {
  display: grid;
  gap: 0.6rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border-radius: 18px;
  background: #0b1324;
  border: 1px solid rgba(96, 165, 250, 0.16);
}
.sl-temps__row { display: grid; grid-template-columns: 3.2rem 1fr; gap: 0.8rem; align-items: center; }
.sl-temps__chip { aspect-ratio: 1; border-radius: 12px; background: var(--sw); border: 1px solid rgba(255, 255, 255, 0.2); }
.sl-temps__row strong { display: block; color: #f1f5f9; font-size: 0.95rem; }
.sl-temps__row span { color: #94a3b8; font-size: 0.85rem; line-height: 1.4; }
.sl-temps figcaption, .sl-plan figcaption { margin-top: 0.4rem; color: #94a3b8; font-size: 0.85rem; }

/* Top-down placement diagram */
.sl-plan {
  padding: clamp(1rem, 3vw, 1.5rem);
  border-radius: 18px;
  background: #0b1324;
  border: 1px solid rgba(96, 165, 250, 0.16);
}
.sl-plan__map { position: relative; aspect-ratio: 4 / 3; }
.sl-plan__map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sl-plan__tag {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
  white-space: nowrap;
}
.sl-plan__tag--light { border-color: rgba(253, 224, 71, 0.6); color: #fef08a; }
.sl-plan__tag--you { border-color: rgba(96, 165, 250, 0.6); color: #bfdbfe; }
.sl-bar .sl-bar__select {
  appearance: none;
  -webkit-appearance: none;
  padding: 0.45rem 2rem 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f1f5f9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.8rem center;
  color: #f1f5f9;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.sl-bar .sl-bar__select option { color: #0f172a; background: #fff; }
