:root {
  --ink: #143e32;
  --paper: #f3f0e7;
  --surface: #e4eadf;
  --line: rgba(20, 62, 50, 0.16);
  --acid: #bdd7c4;
  --accent: #5f927b;
  --mist: #d9e6db;
  --muted: #61736b;
  --white: #f8faf7;
  --danger: #8f4a43;
  --radius: 32px;
  --shadow: 0 32px 90px rgba(34, 54, 45, 0.14);
}

.top-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
}

.filter-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
  color: var(--ink);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content:center;
  gap: 0;
  font-size: 0;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.filter-toggle span {
  width: 17px;
  height: 11px;
  position:relative;
  border:1px solid currentColor;
  border-radius:70% 18% 70% 18%;
  background:transparent;
  box-shadow:none;
  transform:rotate(45deg);
}
.filter-toggle span::after{content:"";position:absolute;width:4px;height:4px;left:50%;top:50%;border-radius:50%;background:currentColor;transform:translate(-50%,-50%)}

.filter-toggle[aria-pressed="false"] span {
  opacity:.42;
  box-shadow: none;
}

.icon-button {
  justify-self: auto;
  background: rgba(255, 255, 255, 0.2);
}

.camera-frame { background: #26332e; }

#cameraSoft {
  z-index: 0;
  filter: blur(18px) saturate(0.58) brightness(0.62);
  transform: scaleX(-1) scale(1.08);
  transition: opacity 0.4s ease;
}

#camera {
  z-index: 1;
  /* The video is mirrored after clipping; invert x once here so the visible
     clear aperture and the untransformed veil share the same center. */
  clip-path: ellipse(var(--face-w, 34%) var(--face-h, 46%) at calc(100% - var(--face-x, 50%)) var(--face-y, 48%));
  filter: saturate(0.72) brightness(0.83) contrast(0.92);
  transition: clip-path 0.5s ease, filter 0.5s ease;
}

.focus-veil {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse var(--face-w, 34%) var(--face-h, 46%) at var(--face-x, 50%) var(--face-y, 48%), transparent 54%, rgba(30, 48, 40, 0.2) 76%, rgba(25, 40, 34, 0.52) 100%);
  transition: opacity 0.4s ease;
}

.camera-frame.filter-off #camera { clip-path: inset(0); filter: saturate(0.86) brightness(0.92) contrast(0.96); }
.camera-frame.filter-off #cameraSoft,
.camera-frame.filter-off .focus-veil { opacity: 0; }
.camera-frame.bright-scene .camera-hud { color: #24332d; text-shadow: 0 1px 5px rgba(255, 255, 255, 0.45); }
.camera-frame.bright-scene .live-label,
.camera-frame.bright-scene .confidence { background: rgba(244, 247, 242, 0.74); backdrop-filter: blur(12px); border: 1px solid rgba(37, 52, 47, 0.12); border-radius: 100px; padding: 9px 12px; color: #24332d; }
.camera-frame.audio-only #camera { opacity: 0.08; filter: grayscale(1) brightness(0.35); }
.camera-frame.audio-only #cameraSoft { opacity: 0.08; }
.camera-frame.audio-only .focus-veil { background: rgba(27, 43, 36, 0.9); }
.camera-frame.audio-only::after { content: "NO SCREEN NEEDED"; position: absolute; z-index: 3; left: 50%; top: 45%; transform: translate(-50%, -50%); color: rgba(232, 240, 235, 0.72); font-size: 10px; font-weight: 750; letter-spacing: 0.18em; }
.iris-core { box-shadow: 0 0 50px rgba(168, 197, 180, 0.28); }
.step-index { color: #bed5c8; }
.target-orbit span { left:49%;top:48%;background:#c9ddd1;box-shadow:0 0 0 9px rgba(201,221,209,.13),0 0 34px rgba(201,221,209,.34);animation-duration:8s;animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-fill-mode:both; }
.camera-frame[data-exercise="horizontal"] .target-orbit span { animation-name:target-horizontal; }
.camera-frame[data-exercise="vertical"] .target-orbit span { animation-name:target-vertical; }
.camera-frame[data-exercise="orbit"] .target-orbit span { animation-name:target-orbit;animation-timing-function:linear; }
.camera-frame[data-exercise="pulse"] .target-orbit span { animation-name:target-pulse;left:50%;top:48%; }
.completion-mark { background: var(--mist); }
.strain-scale button.selected { background: var(--mist); border-color: var(--accent); }

.calibration-layer {
  position: fixed;
  z-index: 50;
  inset: 0;
  background: rgba(31, 47, 40, 0.94);
  backdrop-filter: blur(18px);
  color: var(--white);
}

.calibration-copy {
  position: absolute;
  top: clamp(28px, 5vw, 60px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(500px, 85vw);
}

.calibration-copy small { font-size: 9px; letter-spacing: 0.18em; color: #aabdb3; }
.calibration-copy strong { font: 800 clamp(27px, 4vw, 42px) "Nunito", sans-serif; }
.calibration-copy span { font-size: 12px; color: #b8c6bf; }

.calibration-point {
  position: absolute;
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  background: rgba(197, 218, 206, 0.1);
  display: grid;
  place-items: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: left 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), top 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.calibration-point::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(211, 229, 218, 0.35); border-radius: 50%; }
.calibration-point i { width: 12px; height: 12px; background: #d7e7de; border-radius: 50%; box-shadow: 0 0 24px rgba(215, 231, 222, 0.6); }
.calibration-point.collecting { animation: collect 1s ease-in-out infinite; }
.calibration-progress { position: absolute; left: 8vw; right: 8vw; bottom: 38px; height: 2px; background: rgba(255, 255, 255, 0.12); }
.calibration-progress span { display: block; width: 0; height: 100%; background: #c8ddd1; transition: width 0.25s ease; }

@keyframes collect { 50% { transform: translate(-50%, -50%) scale(0.86); } }
@keyframes target-horizontal { 0%, 100% { left: 6%; top: 48%; } 50% { left: 91%; top: 48%; } }
@keyframes target-vertical { 0%, 100% { left: 49%; top: 6%; } 50% { left: 49%; top: 88%; } }
@keyframes target-orbit { 0% { left: 49%; top: 4%; } 25% { left: 91%; top: 48%; } 50% { left: 49%; top: 90%; } 75% { left: 6%; top: 48%; } 100% { left: 49%; top: 4%; } }
@keyframes target-pulse { 0%, 100% { transform: scale(0.72); opacity: 0.55; } 50% { transform: scale(1.65); opacity: 1; } }

@media (max-width: 600px) {
  .filter-toggle { width: 44px; padding: 0; justify-content: center; font-size: 0; }
  .calibration-point { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .calibration-point { transition: none; }
}

.session-chrome { position: fixed; z-index: 42; left: 28px; right: 28px; top: 22px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; color: #edf4ef; pointer-events: none; }
.session-brand { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.session-brand .brand-mark i { border-color: #edf4ef; }
.session-mode { display: flex; align-items: center; gap: 9px; font-size: 9px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.session-mode span { width: 7px; height: 7px; border-radius: 50%; background: #bcd4c6; box-shadow: 0 0 0 5px rgba(188,212,198,.12); }
.session-chrome button { justify-self: end; pointer-events: auto; height: 40px; border: 1px solid rgba(255,255,255,.22); border-radius: 100px; background: rgba(20,35,29,.34); backdrop-filter: blur(12px); color: #edf4ef; padding: 0 13px; font-size: 10px; cursor: pointer; }
.session-actions { justify-self: end; display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.session-chrome kbd { margin-left: 8px; opacity: .55; font: inherit; }

body.session-active { overflow: hidden; background: #1f3029; }
body.session-active .topbar,
body.session-active .site-header,
body.session-active .intro,
body.session-active footer,
body.session-active .metrics,
body.session-active .ritual,
body.session-active .device-note,
body.session-active .manifesto,
body.session-active .final-cta,
body.session-active .stage-label { display: none; }
body.session-active .app-shell { position: fixed; inset: 0; display: block; max-width: none; min-height: 0; padding: 0; }
body.session-active .stage { width: 100%; height: 100%; padding: 0; border-radius: 0; }
body.session-active .stage::before { display: none; }
body.session-active .camera-frame { width: 100%; height: 100%; min-height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
body.session-active .camera-hud { top: 82px; left: 28px; right: 28px; }
body.session-active .coach-card { left: 50%; right: auto; bottom: 30px; width: min(820px, calc(100% - 56px)); transform: translateX(-50%); }
body.session-active .target-orbit { inset: 15% 12% 22%; }

.focus-setup-dialog { width: min(650px, calc(100% - 32px)); }
.focus-setup-list { margin: 28px 0 22px; border-top: 1px solid var(--line); }
.focus-setup-list > div { display: grid; grid-template-columns: 38px 1fr; gap: 3px 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.focus-setup-list span { grid-row: 1 / 3; font-size: 9px; color: var(--accent); padding-top: 3px; }
.focus-setup-list strong { font-size: 13px; }
.focus-setup-list small { color: var(--muted); font-size: 11px; }
.remember-focus { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.focus-setup-dialog .primary-button { margin-top: 24px; }
.focus-setup-dialog .primary-button svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7}

@media(max-width:600px) {
  .session-chrome { left: 12px; right: 12px; top: 10px; grid-template-columns: 1fr auto; }
  .session-mode { display: none; }
  .session-brand strong{font-size:10px}.session-chrome kbd{display:none}.session-chrome button{height:36px;padding:0 10px;font-size:9px}
  body.session-active .camera-hud { top: 58px; left: 12px; right: 12px; }
  body.session-active .camera-hud .confidence{display:none}
  body.session-active .coach-card { width:calc(100% - 20px);bottom:max(10px,env(safe-area-inset-bottom));grid-template-columns:34px 1fr 38px;gap:7px;padding:11px 12px;border-radius:16px }
  body.session-active .coach-card h2{font-size:16px;margin-bottom:2px}body.session-active .coach-card p{font-size:9px;line-height:1.3}body.session-active .step-index{font-size:8px}body.session-active .timer-ring{width:36px;height:36px;font-size:11px}
  body.session-active .target-orbit{inset:18% 8% 24%}
  .camera-frame.audio-only::after{top:42%;font-size:9px}
}
