/* SignLearn: sign in with your face, then learn three ASL signs with the camera.
 * Colors, type and radii come from Caligrafy's look (public/css/look.css, --design-* tokens), or from a design style
 * when DESIGN_STYLE selects one (public/css/designs/<name>.css, linked after look.css). */

[v-cloak] { display: none; }

:root {
  --sl-canvas: var(--design-canvas, #fff);
  --sl-ash: var(--design-ash, var(--design-surface, #f4f4f4));
  --sl-carbon: var(--design-carbon, var(--design-ink, #171a20));
  --sl-graphite: var(--design-graphite, var(--design-body, #393c41));
  --sl-pewter: var(--design-pewter, var(--design-muted, #5c5e62));
  --sl-fog: var(--design-fog, var(--design-placeholder, #8e8e8e));
  --sl-cloud: var(--design-cloud, var(--design-hairline, #e2e3e3));
  --sl-silver: var(--design-silver, var(--design-hairline-strong, #d0d1d2));
  --sl-blue: var(--design-primary, #000000);           /* the main action: Caligrafy black */
  --sl-blue-hover: var(--design-primary-hover, #333333);
  --sl-error: var(--design-error, #b3261e);
  --sl-success: var(--design-success, #1f7a3a);
  --sl-focus: var(--design-focus-ring, rgba(23, 26, 32, .35));
  --sl-display: var(--design-font-display, var(--design-font, Inter, -apple-system, Arial, sans-serif));
  --sl-text: var(--design-font-body, var(--design-font, Inter, -apple-system, Arial, sans-serif));
  --sl-radius: var(--design-radius-control, 4px);
  --sl-radius-card: var(--design-radius-card, 12px);
  --sl-ease: var(--design-ease, cubic-bezier(.5, 0, 0, .75));
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--sl-canvas);
  color: var(--sl-graphite);
  font: 400 14px/1.43 var(--sl-text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--sl-display); font-weight: 500; color: var(--sl-carbon); margin: 0; letter-spacing: normal; }
p { margin: 0; }
button { font: inherit; }

/* ---------- navigation: floats over the hero, frosted on light sections ---------- */
.sl-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 24px;
  color: #fff;
  transition: background-color .33s, color .33s;
}
.sl-nav.is-light { background: var(--design-frost, rgba(255, 255, 255, .75)); backdrop-filter: blur(12px); color: var(--sl-carbon); }
.sl-wordmark { font-family: var(--sl-display); font-weight: 500; font-size: 15px; letter-spacing: .32em; text-transform: uppercase; color: inherit; text-decoration: none; }
.sl-nav-links { display: flex; align-items: center; gap: 4px; }
.sl-nav-link {
  background: transparent; border: 0; color: inherit; cursor: pointer;
  font-weight: 500; font-size: 14px; padding: 6px 16px; min-height: 32px; border-radius: var(--sl-radius);
  text-decoration: none; transition: background-color .33s, color .33s;
}
.sl-nav-link:hover, .sl-nav-link.is-active { background: rgba(128, 128, 128, .18); }
.sl-nav-link:focus-visible, .sl-btn:focus-visible, .sl-input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--sl-focus); }
.sl-nav-user { font-size: 14px; padding: 0 12px; opacity: .8; }

/* ---------- buttons: 4px radius, 40px tall, color-only transitions ---------- */
.sl-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 200px; min-height: 44px; padding: 4px 24px;
  border: 3px solid transparent; border-radius: var(--sl-radius);
  font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none;
  transition: border-color .33s, background-color .33s, color .33s, box-shadow .25s;
}
.sl-btn-primary { background: var(--sl-blue); color: #fff; }
.sl-btn-primary:hover { background: var(--sl-blue-hover); }
.sl-btn-secondary { background: rgba(244, 244, 244, .9); color: var(--sl-graphite); }
.sl-btn-secondary:hover { background: #fff; color: var(--sl-carbon); }
.sl-btn:disabled { background: var(--sl-fog); color: #fff; cursor: default; }
.sl-btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.sl-link {
  background: none; border: 0; padding: 2px 0; cursor: pointer;
  color: var(--sl-pewter); font-size: 14px; text-decoration: none;
  transition: color .33s, box-shadow .33s var(--sl-ease);
}
.sl-link:hover { color: var(--sl-carbon); box-shadow: inset 0 -1px 0 currentColor; }
.sl-hero .sl-link { color: rgba(255, 255, 255, .8); }
.sl-hero .sl-link:hover { color: #fff; }

/* ---------- hero: the live camera is the photography ---------- */
.sl-hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 104px 16px 48px; overflow: hidden;
  background: var(--sl-carbon); color: #fff; text-align: center;
}
.sl-camera { position: absolute; inset: 0; }
.sl-camera video, .sl-camera canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scaleX(-1);   /* mirror, like a selfie camera */
}
.sl-camera::after {      /* keeps the white type readable over any room */
  content: ''; position: absolute; inset: 0; background: rgba(23, 26, 32, .35); pointer-events: none;
}
.sl-hero > *:not(.sl-camera):not(.sl-oval) { position: relative; z-index: 2; }
.sl-hero h1 { font-size: 40px; line-height: 1.2; color: #fff; }
.sl-hero .sl-sub { margin-top: 8px; font-size: 17px; line-height: 1.4; color: rgba(255, 255, 255, .88); min-height: 1.4em; }
.sl-hero .sl-sub.is-error { color: #ffb4ab; }

/* face guide: an oval that dims the rest of the picture */
.sl-oval {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  width: min(42vw, 300px); aspect-ratio: 3 / 4;
  transform: translate(-50%, -48%);
  border: 2px solid rgba(255, 255, 255, .55); border-radius: 50%;
  box-shadow: 0 0 0 200vmax rgba(23, 26, 32, .35);
  transition: border-color .33s;
  pointer-events: none;
}
.sl-oval.is-aligned { border-color: #fff; }
.sl-oval.is-scanning { border-color: var(--sl-blue); border-width: 3px; }
.sl-oval.is-success { border-color: #6fd08c; border-width: 3px; }
.sl-oval.is-failed { border-color: #ff8a80; }

.sl-prompt {
  display: inline-block; margin-top: 12px; padding: 8px 16px; border-radius: var(--sl-radius);
  background: rgba(23, 26, 32, .7); color: #fff; font-weight: 500; font-size: 15px;
}
.sl-hero-foot { display: flex; flex-direction: column; align-items: center; gap: 16px; }

/* ---------- sheet: the white panel for forms (password, account) ---------- */
.sl-sheet {
  position: relative; z-index: 3;
  width: 100%; max-width: 400px;
  background: var(--sl-canvas); color: var(--sl-graphite);
  border-radius: var(--sl-radius-card); padding: 32px 24px 24px; text-align: left;
}
.sl-sheet h2 { font-size: 24px; line-height: 1.25; margin-bottom: 4px; }
.sl-sheet .sl-note { color: var(--sl-pewter); margin-bottom: 20px; }
.sl-field { display: block; margin-bottom: 16px; }
.sl-field span { display: block; font-weight: 500; color: var(--sl-carbon); margin-bottom: 6px; }
.sl-input {
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--sl-silver); border-radius: var(--sl-radius);
  background: var(--sl-canvas); color: var(--sl-carbon); font-size: 15px;
  transition: border-color .33s;
}
.sl-input::placeholder { color: var(--sl-fog); }
.sl-input:focus { border-color: var(--sl-carbon); }
.sl-sheet .sl-btn { width: 100%; margin-top: 8px; }
.sl-sheet .sl-switch { margin-top: 16px; text-align: center; }
.sl-error { color: var(--sl-error); margin-top: 12px; }
.sl-sheet-backdrop { position: absolute; inset: 0; z-index: 2; background: var(--design-overlay, rgba(128, 128, 128, .65)); }
.sl-hero-center { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; }

/* =================================== learn =================================== */
.sl-learn { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(360px, 1fr); min-height: 100vh; min-height: 100svh; }
.sl-stage { position: relative; background: var(--sl-carbon); overflow: hidden; min-height: 60vh; }
.sl-stage .sl-camera::after { background: rgba(23, 26, 32, .12); }
.sl-stage-status {
  position: absolute; left: 50%; bottom: 32px; z-index: 2; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 20px; border-radius: var(--sl-radius);
  background: rgba(23, 26, 32, .78); color: #fff; font-size: 17px; font-weight: 500; text-align: center;
  transition: background-color .33s;
}
.sl-stage-status.is-good { background: var(--sl-blue); }
.sl-stage-status.is-done { background: var(--sl-success); }
.sl-stage-loading { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .8); font-size: 15px; padding: 16px; text-align: center; }

.sl-panel { display: flex; flex-direction: column; padding: 96px 40px 40px; background: var(--sl-canvas); }
.sl-steps { display: flex; gap: 8px; margin-bottom: 32px; }
.sl-steps li {
  list-style: none; flex: 1; height: 4px; border-radius: 2px; background: var(--sl-cloud);
  transition: background-color .33s;
}
.sl-steps { padding: 0; }
.sl-steps li.is-current { background: var(--sl-carbon); }
.sl-steps li.is-done { background: var(--sl-blue); }
.sl-eyebrow { color: var(--sl-pewter); font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.sl-panel h1 { font-size: 40px; line-height: 1.2; }
.sl-meaning { color: var(--sl-pewter); font-size: 17px; margin-top: 4px; }

.sl-figure { display: flex; gap: 24px; align-items: center; margin: 32px 0 24px; }
.sl-figure svg { flex: 0 0 auto; width: 112px; height: 140px; background: var(--sl-ash); border-radius: var(--sl-radius-card); padding: 12px; }
.sl-figure p { color: var(--sl-graphite); font-size: 14px; line-height: 1.5; }

.sl-instruction { font-family: var(--sl-display); font-weight: 500; font-size: 22px; line-height: 1.3; color: var(--sl-carbon); min-height: 2.6em; }
.sl-hold { height: 4px; border-radius: 2px; background: var(--sl-cloud); margin: 16px 0 24px; overflow: hidden; }
.sl-hold span { display: block; height: 100%; width: 0; background: var(--sl-blue); transition: width .15s linear; }

.sl-fingers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 0; margin: 0 0 32px; }
.sl-fingers li {
  list-style: none; text-align: center; padding: 10px 4px; border-radius: var(--sl-radius);
  background: var(--sl-ash); font-size: 12px; color: var(--sl-pewter);
  transition: background-color .33s, color .33s;
}
.sl-fingers li b { display: block; font-weight: 500; font-size: 13px; color: var(--sl-carbon); margin-bottom: 2px; }
.sl-fingers li.is-ok { background: var(--sl-ash); color: var(--sl-blue); }
.sl-fingers li.is-ok b { color: var(--sl-blue); }
.sl-fingers li.is-wrong { background: var(--sl-ash); color: var(--sl-error); }
.sl-panel-foot { margin-top: auto; display: flex; gap: 16px; flex-wrap: wrap; }
.sl-panel-foot .sl-btn { min-width: 0; flex: 1; }
.sl-panel .sl-btn-secondary { background: var(--sl-ash); }
.sl-panel .sl-btn-secondary:hover { background: var(--sl-cloud); }

/* celebration: one message per screen */
.sl-done {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px 16px; text-align: center; background: var(--sl-canvas);
}
.sl-done[hidden] { display: none; }
.sl-done canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sl-done > *:not(canvas) { position: relative; }
.sl-done h1 { font-size: 40px; line-height: 1.2; }
.sl-done p { font-size: 17px; color: var(--sl-pewter); max-width: 460px; }
.sl-done .sl-badges { display: flex; gap: 12px; margin: 24px 0 32px; }
.sl-done .sl-badges span { padding: 8px 16px; border-radius: var(--sl-radius); background: var(--sl-ash); color: var(--sl-carbon); font-weight: 500; }

/* ---------- phone ---------- */
@media (max-width: 900px) {
  .sl-learn { grid-template-columns: 1fr; }
  .sl-stage { min-height: 56vh; }
  .sl-panel { padding: 32px 16px 32px; }
}
@media (max-width: 767px) {
  .sl-nav { padding: 0 16px; }
  .sl-nav-user { display: none; }
  .sl-nav-link { padding: 6px 10px; }
  .sl-wordmark { letter-spacing: .22em; font-size: 14px; }
  .sl-hero h1, .sl-panel h1, .sl-done h1 { font-size: 28px; }
  .sl-hero { padding-top: 88px; }
  .sl-btn-row { flex-direction: column; width: 100%; max-width: 360px; }
  .sl-btn { width: 100%; }
  .sl-oval { width: 62vw; }
  .sl-figure svg { width: 88px; height: 112px; }
  .sl-instruction { font-size: 19px; }
  .sl-stage-status { font-size: 15px; bottom: 16px; }
}
.sl-stage-loading[hidden] { display: none; }

/* the design style's site-wide rules (links, header) must not reach the app's own controls */
html body a.sl-wordmark, html body a.sl-wordmark:hover { color: inherit; box-shadow: none; }
html body a.sl-nav-link, html body a.sl-nav-link:hover { color: inherit; box-shadow: none; }
html body a.sl-btn-primary, html body a.sl-btn-primary:hover { color: #fff; box-shadow: none; }
html body a.sl-btn-secondary, html body a.sl-btn-secondary:hover { color: var(--sl-graphite); box-shadow: none; }
html body .sl-btn, html body .sl-nav-link, html body .sl-wordmark, html body .sl-field span { font-weight: 500; }
.sl-hero-head { max-width: 100%; }

/* links inside the white sheet: the hero's white links would vanish on it */
.sl-hero .sl-sheet .sl-link { color: var(--sl-pewter); }
.sl-hero .sl-sheet .sl-link:hover { color: var(--sl-carbon); }
