/* Shared styles for every app in this project. */
:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6a64;
  --border: #e3e1da;
  --accent: #2457d6;
  --accent-hover: #1b45ad;
  --accent-text: #ffffff;
  --danger: #b42318;
  --radius: 14px;
  color-scheme: light;
}

/* Dark: the visitor's choice (data-theme, set by shared/theme.js), otherwise the system theme (also without JavaScript). */
:root[data-theme="dark"] {
  --bg: #141413;
  --surface: #1e1e1c;
  --text: #efeee9;
  --muted: #9c9b94;
  --border: #34332f;
  --accent: #6c93f5;
  --accent-hover: #8aa9f8;
  --accent-text: #10151f;
  --danger: #f97066;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #141413;
    --surface: #1e1e1c;
    --text: #efeee9;
    --muted: #9c9b94;
    --border: #34332f;
    --accent: #6c93f5;
    --accent-hover: #8aa9f8;
    --accent-text: #10151f;
    --danger: #f97066;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.site-header a { text-decoration: none; font-size: 14px; }
.site-header a:hover { text-decoration: underline; }
/* Wordmark: name bold + domain suffix muted, as on the sextos.app home page. */
.site-header a.wm { color: var(--text); font-size: clamp(1.25rem, 5.6vw, 1.6rem); font-weight: 700; letter-spacing: -0.03em; }
.site-header a.wm:hover { text-decoration: none; }
.wm span { color: var(--muted); font-weight: 500; }
.site-tools { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.home-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}
.site-header a.home-btn:hover { border-color: var(--accent); text-decoration: none; }

/* Light/dark toggle: identical on every sextos.app page (see DESIGN.md). */
.theme {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
}
.theme::after {
  content: "☀️";
  position: absolute;
  top: 1px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border);
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  transition: transform 0.2s;
}
:root[data-theme="dark"] .theme::after { content: "🌙"; transform: translateX(18px); }
@media (prefers-reduced-motion: reduce) { .theme::after { transition: none; } }

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.03em; }
.lead { color: var(--muted); margin: 0 0 24px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
