/* RegisterMySite client-training guide
   Dark theme aligned with registermysite.com / the source deck.
   Fonts: Inter from Bunny Fonts (privacy-friendly). See README.txt. */

:root {
  --bg: #09090f;
  --bg-elev: #12121c;
  --bg-elev-2: #181825;
  --bg-header: rgba(12, 12, 20, 0.88);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f8;
  --muted: #9a9ab0;
  --faint: #6e6e86;
  --accent: #8b7cf7;
  --accent-2: #6ee7c3;
  --accent-soft: rgba(139, 124, 247, 0.16);
  --danger: #f87171;
  --focus: #c4b5fd;
  --stage-bg: #050508;
  --radius: 12px;
  --header-h: 58px;
  --footer-h: 46px;
  --rail-w: 168px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
}

a { color: var(--accent); }
a:hover { color: #c4b5fd; }

img { max-width: 100%; height: auto; display: block; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 80;
  background: var(--accent);
  color: #0b0b12;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--header-h);
  padding: 6px 12px;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  flex-wrap: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
  flex: 1;
}

.mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #8b7cf7, #4f46e5);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.brand-copy {
  min-width: 0;
}
.brand-copy strong {
  display: block;
  font-size: 13px;
  letter-spacing: 0.01em;
}
.brand-copy span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.utils {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.menu {
  position: relative;
}
.menu summary {
  list-style: none;
}
.menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 45;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: #161622;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.menu-panel .btn { justify-content: flex-start; width: 100%; }

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  padding: 7px 10px;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}
.btn:hover { background: var(--bg-elev-2); border-color: rgba(196, 181, 253, 0.4); }
.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.btn[aria-pressed="true"],
.btn.is-on {
  background: var(--accent-soft);
  border-color: rgba(139, 124, 247, 0.55);
  color: #e9e4ff;
}
.btn-ghost { background: transparent; }
.btn-primary {
  background: #6d5ef6;
  border-color: #7c6ef8;
  color: #fff;
}
.btn-primary:hover { background: #7c6ef8; }

.counter {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
  padding: 0 4px;
  white-space: nowrap;
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6ee7c3, #8b7cf7);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto;
}

.stage-wrap {
  background: var(--stage-bg);
  padding: 10px 10px 0;
}

.stage {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #07070c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  touch-action: pan-y;
}

.slide {
  position: absolute;
  inset: 0;
  display: none;
  background: #07070c;
}
.slide.is-current { display: block; }

.slide picture,
.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #07070c;
}

.slide-fallback {
  display: none;
  height: 100%;
  padding: 28px;
  color: var(--text);
}
.slide.is-missing img { display: none; }
.slide.is-missing .slide-fallback { display: block; }

/* No-JS: stack slides */
html:not(.js) .slide {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
html:not(.js) .stage {
  aspect-ratio: auto;
  height: auto;
  overflow: visible;
}

.rail {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 8px 8px 4px;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  gap: 8px;
  scrollbar-width: thin;
}

.thumb {
  flex: 0 0 auto;
  width: 132px;
  padding: 0;
  border: 1px solid var(--line);
  background: #0c0c14;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  text-align: left;
  font: inherit;
  text-decoration: none;
}
.thumb:hover { border-color: rgba(139, 124, 247, 0.5); }
.thumb:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.thumb.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #111;
}
.thumb figcaption {
  display: block;
  padding: 5px 7px 6px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thumb.is-current figcaption { color: var(--text); }

.notes-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 16px 18px 20px;
}
.notes-panel.is-open { display: block; }
.notes-panel h2 {
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.notes-panel .notes-body {
  margin: 0;
  color: #d7d7e4;
  max-width: 72ch;
  white-space: pre-wrap;
}
.notes-kicker {
  color: var(--faint);
  font-size: 12px;
  margin-bottom: 6px;
}

.site-footer {
  min-height: var(--footer-h);
  border-top: 1px solid var(--line);
  padding: 10px 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.contact-row { display: flex; flex-wrap: wrap; gap: 10px 16px; }

/* Document mode */
.doc-mode .stage-wrap,
.doc-mode .rail,
.doc-mode .notes-panel { display: none; }
.doc-frame {
  display: none;
  height: calc(100dvh - var(--header-h) - var(--footer-h) - 8px);
  padding: 10px;
}
.doc-mode .doc-frame { display: block; }
.doc-frame iframe {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111;
}

/* Present mode */
.present .topbar,
.present .rail,
.present .notes-panel,
.present .site-footer,
.present .welcome,
.present .help-overlay { display: none; }
.present .present-bar { display: flex; }
.present .layout { grid-template-rows: 1fr; }
.present .stage-wrap {
  padding: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
.present .stage {
  width: min(100vw, calc(100dvh * 16 / 9));
  height: min(100dvh, calc(100vw * 9 / 16));
  max-width: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.present-bar {
  display: none;
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 50;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.present-bar:hover,
.present-bar:focus-within,
.present .present-bar.is-visible { opacity: 1; }

/* Overlays */
.welcome,
.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 4, 10, 0.72);
  display: grid;
  place-items: center;
  padding: 16px;
}
.welcome[hidden],
.help-overlay[hidden] { display: none; }

.card {
  width: min(560px, 100%);
  background: #14141f;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 10px; font-size: 20px; }
.card p { margin: 0 0 10px; color: #c9c9d6; }
.card ul { margin: 0 0 14px; padding-left: 18px; color: #c9c9d6; }
.card kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  border: 1px solid var(--line-strong);
  background: #0d0d16;
  padding: 1px 6px;
  border-radius: 5px;
}
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.downloads-hint {
  color: var(--faint);
  font-size: 12px;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: var(--rail-w) 1fr;
    grid-template-rows: auto auto;
  }
  .rail {
    grid-row: 1 / span 2;
    grid-column: 1;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: calc(100dvh - var(--header-h) - var(--footer-h));
    border-top: 0;
    border-right: 1px solid var(--line);
    padding: 10px 8px;
  }
  .thumb { width: 100%; }
  .stage-wrap { grid-column: 2; }
  .notes-panel { grid-column: 2; }
  .topbar { padding-left: 16px; padding-right: 16px; }
}

.present-in-menu { display: none; }
@media (max-width: 720px) {
  .brand-copy { display: none; }
  .btn-label { display: none; }
  .utils .btn { padding: 8px 9px; }
  .stage-wrap { padding: 8px 8px 0; }
  .topbar { gap: 6px; padding: 6px 8px; }
  #btn-present { display: none; }
  .present-in-menu { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .topbar, .rail, .present-bar, .welcome, .help-overlay, .site-footer { display: none !important; }
  .notes-panel { display: block !important; }
  .stage { border: 0; box-shadow: none; }
  body { background: #fff; color: #111; }
}
