/* ── Shared styles — Семейный архив Радкевич ── */

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

:root {
  --bg: #0d0f14;
  --surface: #161a23;
  --surface2: #1e2333;
  --border: rgba(255,255,255,0.07);
  --accent: #6c8ef7;
  --accent2: #a78bfa;
  --accent3: #34d399;
  --text: #e2e8f0;
  --muted: #8892a4;
}

html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 10%, rgba(108,142,247,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 90% 80%, rgba(167,139,250,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(52,211,153,0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Theme switcher ── */
.theme-switcher {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1000;
}

.theme-switcher-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.theme-switcher-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.t-chevron {
  opacity: 0.5;
  transition: transform 0.2s;
  flex-shrink: 0;
}
[aria-expanded="true"] .t-chevron { transform: rotate(180deg); }

/* Icons: show only the active one */
.ticon { display: none; align-items: center; }
[data-theme="dark"]     .ticon-dark     { display: inline-flex; }
[data-theme="light"]    .ticon-light    { display: inline-flex; }
[data-theme="terminal"] .ticon-terminal { display: inline-flex; font-family: monospace; font-size: 0.85rem; font-weight: 700; letter-spacing: -0.04em; }

/* Default (no attr set yet) = dark */
:root:not([data-theme]) .ticon-dark { display: inline-flex; }

/* Dropdown menu */
.theme-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  min-width: 170px;
}
.theme-menu.open { display: block; }

.theme-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.theme-opt:hover { background: var(--surface2); color: var(--text); }
.theme-opt.active { color: var(--accent); font-weight: 600; }

/* ── Light theme ── */
[data-theme="light"] {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface2: #eef1f6;
  --border: rgba(0,0,0,0.09);
  --accent: #4a6cf7;
  --accent2: #7c5ceb;
  --accent3: #059669;
  --text: #1a2036;
  --muted: #64748b;
}
[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 80% 60% at 10% 10%, rgba(108,142,247,0.1) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 90% 80%, rgba(167,139,250,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(52,211,153,0.05) 0%, transparent 60%);
}
[data-theme="light"] h1 {
  background: linear-gradient(135deg, #1a2036 0%, #4a5578 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Terminal theme ── */
[data-theme="terminal"] {
  --bg: #000000;
  --surface: #0d0d0d;
  --surface2: #1a1a1a;
  --border: rgba(0,255,65,0.2);
  --accent: #00ff41;
  --accent2: #00cc33;
  --accent3: #00ff41;
  --text: #00ff41;
  --muted: #1a7a2e;
}
[data-theme="terminal"] body {
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Menlo', monospace;
}
[data-theme="terminal"] body::before {
  background:
    radial-gradient(ellipse 70% 70% at 50% 50%, rgba(0,255,65,0.04) 0%, transparent 60%);
}
[data-theme="terminal"] body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}
[data-theme="terminal"] h1 {
  background: linear-gradient(135deg, #00ff41 0%, #00cc33 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="terminal"] .theme-switcher-btn {
  border-color: rgba(0,255,65,0.3);
  box-shadow: 0 0 8px rgba(0,255,65,0.1);
}
[data-theme="terminal"] .theme-switcher-btn:hover {
  box-shadow: 0 0 16px rgba(0,255,65,0.2);
}
[data-theme="terminal"] .theme-menu {
  box-shadow: 0 8px 32px rgba(0,0,0,0.8), 0 0 20px rgba(0,255,65,0.08);
}

/* ── Common components ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  margin-bottom: 40px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text); }
.back-link svg { width: 16px; height: 16px; fill: currentColor; }

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
  padding-left: 4px;
}
