:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #5d6764;
  --line: #cbdad5;
  --panel: #fbfffc;
  --paper: #eef6f3;
  --accent: #146c75;
  --accent-strong: #0b4f58;
  --warm: #d85f3d;
  --shadow: 0 22px 55px rgba(19, 48, 45, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(20, 108, 117, 0.18), transparent 34%),
    linear-gradient(315deg, rgba(216, 95, 61, 0.16), transparent 36%),
    var(--paper);
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
  align-items: stretch;
}

.control-pane,
.preview-pane {
  border: 1px solid rgba(72, 61, 45, 0.18);
  background: rgba(251, 255, 252, 0.94);
  box-shadow: var(--shadow);
}

.control-pane {
  padding: 28px;
}

.preview-pane {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 20px;
  padding: 20px;
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: start;
  justify-content: space-between;
}

.action-buttons {
  display: grid;
  gap: 10px;
  min-width: 230px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.primary-button {
  border: 0;
  border-radius: 8px;
  padding: 13px 16px;
  color: white;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(20, 108, 117, 0.25);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--accent-strong);
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: #eef8f5;
}

.secondary-button:disabled {
  color: #8a9591;
  cursor: not-allowed;
  opacity: 0.65;
}

.meter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 28px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.meter > div {
  min-width: 0;
  padding: 14px;
  background: #ffffff;
}

.meter-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.meter strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sliders {
  display: grid;
  gap: 22px;
}

.control-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
}

.control-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 16px;
}

.control-head h2 {
  margin: 0;
  font-size: 1rem;
}

.value-readout {
  color: var(--accent-strong);
  font-size: 1.25rem;
  font-weight: 900;
  white-space: nowrap;
}

.slider-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  gap: 12px;
  align-items: center;
}

.slider-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.brand-selector {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
}

.light-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 320px));
  gap: 14px;
}

.brand-selector span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.brand-selector select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: #ffffff;
  font: inherit;
  font-weight: 800;
}

.flash-controls {
  margin-top: 22px;
}

.flash-controls.is-disabled {
  opacity: 0.48;
}

.flash-controls.is-disabled input {
  cursor: not-allowed;
}

.scale {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.72rem;
}

.scale span {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-frame {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border-radius: 8px;
  background: #222;
}

.photo-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(to bottom, rgba(255, 236, 188, 0.95), rgba(89, 147, 154, 0.85) 52%, rgba(31, 74, 74, 0.95)),
    #7aa6a9;
  filter: brightness(var(--scene-brightness, 1)) contrast(var(--scene-contrast, 1)) saturate(var(--scene-saturation, 1));
  transition: filter 180ms ease, opacity 180ms ease;
}

.sun {
  position: absolute;
  top: 13%;
  right: 18%;
  width: 96px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffe29a;
  box-shadow: 0 0 56px rgba(255, 226, 154, 0.85);
}

.mountain {
  position: absolute;
  bottom: 20%;
  width: 78%;
  aspect-ratio: 1.7;
  transform: rotate(45deg);
  transform-origin: center;
}

.mountain-back {
  left: -18%;
  background: #4e8386;
  filter: blur(var(--background-blur, 0px));
}

.mountain-front {
  right: -28%;
  bottom: 12%;
  background: #245f61;
  filter: blur(var(--background-blur, 0px));
}

.motion-subject {
  position: absolute;
  right: 28%;
  bottom: 28%;
  width: 70px;
  height: 22px;
  border-radius: 999px;
  background: #f7d36f;
  box-shadow:
    calc(var(--motion-blur, 0px) * -1) 0 calc(var(--motion-blur, 0px) * 1.2) rgba(247, 211, 111, 0.55),
    calc(var(--motion-blur, 0px) * -2) 0 calc(var(--motion-blur, 0px) * 1.4) rgba(255, 255, 255, 0.25);
  filter: blur(calc(var(--motion-blur, 0px) * 0.25));
}

.motion-subject::before,
.motion-subject::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  background: #1d3f42;
}

.motion-subject::before {
  right: 8px;
  bottom: -8px;
  width: 15px;
  height: 15px;
}

.motion-subject::after {
  left: 10px;
  bottom: -8px;
  width: 15px;
  height: 15px;
}

.foreground {
  position: absolute;
  right: -10%;
  bottom: -16%;
  left: -10%;
  height: 38%;
  background:
    radial-gradient(circle at 28% 8%, #f3c16c 0 6px, transparent 7px),
    radial-gradient(circle at 58% 18%, #f3c16c 0 4px, transparent 5px),
    linear-gradient(160deg, #163f3d, #0e2e2c);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: var(--grain-opacity, 0.06);
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
}

.effect-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.effect-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 92px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.effect-row strong {
  overflow: hidden;
  color: var(--accent-strong);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.effect-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #dfe9e5, #6fa6a6);
}

.effect-track i {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 18px;
  height: 18px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--warm);
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}

#motionMarker {
  left: var(--motion-level, 0%);
}

#depthMarker {
  left: var(--depth-level, 50%);
}

#grainMarker {
  left: var(--grain-level, 0%);
}

#ndMarker {
  left: var(--nd-level, 0%);
}

.nd-row {
  display: none;
}

.nd-row.is-visible {
  display: grid;
}

@media (max-width: 880px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .action-buttons,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .meter {
    grid-template-columns: 1fr;
  }

  .light-panel {
    grid-template-columns: 1fr;
  }

  .photo-frame {
    min-height: 320px;
  }

  .effect-row {
    grid-template-columns: 76px minmax(0, 1fr) 82px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    margin: 10px auto;
  }

  .control-pane,
  .preview-pane {
    padding: 14px;
  }

  .slider-row {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .scale {
    grid-template-columns: repeat(4, 1fr);
  }
}
