:root {
  --dark-page-bg: #081a3a;
  --dark-section-bg: #0b2860;
  --dark-surface: #123a7a;
  --dark-surface-elevated: #174993;
  --dark-border: rgba(108, 166, 255, 0.38);
  --dark-text-primary: #f7faff;
  --dark-text-secondary: #c2d1ee;
  --dark-text-tertiary: #9db4dd;
  --dark-cyan: #20d9ff;
  --dark-blue: #2f6bff;
  --dark-violet: #8247ff;
  --dark-magenta: #f044d0;
  --dark-gradient-background:
    radial-gradient(circle at 78% 22%, rgba(32, 217, 255, 0.3), transparent 29%),
    radial-gradient(circle at 16% 16%, rgba(47, 107, 255, 0.42), transparent 38%),
    radial-gradient(circle at 52% 0%, rgba(130, 71, 255, 0.24), transparent 32%),
    radial-gradient(circle at 94% 92%, rgba(240, 68, 208, 0.12), transparent 25%),
    linear-gradient(180deg, #103170 0%, var(--dark-page-bg) 100%);
  --dark-glow-shadow: 0 0 36px rgba(32, 217, 255, 0.34);
  --dark-premium-glow: 0 0 56px rgba(130, 71, 255, 0.24), 0 0 24px rgba(240, 68, 208, 0.1), 0 28px 70px rgba(3, 10, 29, 0.28);
  --ink: #071734;
  --muted: #5f6f91;
  --line: #dbe5ff;
  --panel: #ffffff;
  --wash: #f5f8ff;
  --brand: #12cfe3;
  --brand-dark: #071734;
  --accent: #bd39ef;
  --accent-blue: #3e74ff;
  --home-text: var(--dark-text-primary);
  --home-muted: var(--dark-text-secondary);
  --home-soft: var(--dark-text-tertiary);
  --home-line: var(--dark-border);
  --home-cyan: var(--dark-cyan);
}

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --home-text: #061633;
  --home-muted: #43577d;
  --home-soft: #60749a;
  --home-line: rgba(38, 77, 139, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  max-width: none;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: var(--dark-text-primary);
  background:
    radial-gradient(circle at 16% 10%, rgba(47, 107, 255, 0.3), transparent 34%),
    radial-gradient(circle at 84% 6%, rgba(32, 217, 255, 0.18), transparent 28%),
    radial-gradient(circle at 88% 82%, rgba(240, 68, 208, 0.13), transparent 30%),
    linear-gradient(180deg, var(--dark-section-bg) 0%, var(--dark-page-bg) 48%, #0a2450 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 24px 52px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 54px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--dark-text-primary);
  font-weight: 700;
}

.app-mark {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  box-shadow: 0 12px 28px rgba(7, 23, 52, 0.18);
  object-fit: cover;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 15px;
}

.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  width: 78px;
  height: 42px;
  min-height: 42px;
  border: 1px solid rgba(108, 166, 255, 0.28);
  border-radius: 999px;
  padding: 3px;
  color: var(--dark-text-primary);
  background: rgba(4, 16, 40, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px rgba(3, 10, 29, 0.18);
  backdrop-filter: blur(16px);
  font: inherit;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.theme-toggle:hover {
  border-color: rgba(32, 217, 255, 0.58);
  background: rgba(7, 27, 62, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 28px rgba(32, 217, 255, 0.16);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(32, 217, 255, 0.48);
  outline-offset: 3px;
}

.theme-toggle::before {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  content: "";
  transform: translateX(36px);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), background 180ms ease, box-shadow 180ms ease;
}

.theme-toggle-icon,
.theme-toggle-text {
  position: relative;
  z-index: 1;
  display: block;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  overflow: hidden;
  color: rgba(194, 209, 238, 0.38);
  font-size: 0;
  line-height: 0;
  transition: color 180ms ease;
}

.theme-toggle-icon::before,
.theme-toggle-text::before {
  position: absolute;
  inset: 6px;
  background: currentColor;
  content: "";
}

.theme-toggle-icon::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 1h2v3h-2V1Zm0 19h2v3h-2v-3ZM3.51 4.93l1.42-1.42 2.12 2.13-1.41 1.41-2.13-2.12Zm13.44 13.43 1.41-1.41 2.13 2.12-1.42 1.42-2.12-2.13ZM1 11h3v2H1v-2Zm19 0h3v2h-3v-2ZM3.51 19.07l2.13-2.12 1.41 1.41-2.12 2.13-1.42-1.42ZM16.95 5.64l2.12-2.13 1.42 1.42-2.13 2.12-1.41-1.41ZM12 6a6 6 0 1 1 0 12 6 6 0 0 1 0-12Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M11 1h2v3h-2V1Zm0 19h2v3h-2v-3ZM3.51 4.93l1.42-1.42 2.12 2.13-1.41 1.41-2.13-2.12Zm13.44 13.43 1.41-1.41 2.13 2.12-1.42 1.42-2.12-2.13ZM1 11h3v2H1v-2Zm19 0h3v2h-3v-2ZM3.51 19.07l2.13-2.12 1.41 1.41-2.12 2.13-1.42-1.42ZM16.95 5.64l2.12-2.13 1.42 1.42-2.13 2.12-1.41-1.41ZM12 6a6 6 0 1 1 0 12 6 6 0 0 1 0-12Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.theme-toggle-text::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20.7 15.3A8.5 8.5 0 0 1 8.7 3.3 9 9 0 1 0 20.7 15.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20.7 15.3A8.5 8.5 0 0 1 8.7 3.3 9 9 0 1 0 20.7 15.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.theme-toggle-text {
  color: #f7faff;
}

nav a,
footer a {
  color: var(--dark-text-secondary);
}

nav a:hover,
footer a:hover {
  color: var(--dark-cyan);
}

.document {
  max-width: 840px;
  margin: 0 auto;
  border: 1px solid var(--dark-border);
  border-radius: 8px;
  padding: 34px;
  color: var(--dark-text-secondary);
  background: linear-gradient(180deg, rgba(23, 73, 147, 0.94), rgba(18, 58, 122, 0.92));
  box-shadow: var(--dark-premium-glow);
  backdrop-filter: blur(18px);
}

.contents {
  border: 1px solid var(--dark-border);
  border-radius: 8px;
  padding: 18px;
  background: rgba(11, 33, 72, 0.68);
}

.contents h2 {
  margin-top: 0;
}

.contents ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 0;
  padding-left: 20px;
}

.contents li {
  margin-bottom: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--dark-text-primary);
}

h1 {
  letter-spacing: 0;
}

.date,
footer,
.document footer {
  color: var(--dark-text-tertiary);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.document .footer-links {
  margin-top: 10px;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--dark-text-secondary);
}

.social-icon-mark {
  display: block;
  width: 20px;
  height: 20px;
  background-color: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

.social-icon-x {
  mask-image: url("x.svg");
}

.social-icon-instagram {
  mask-image: url("instagram.svg");
}

.social-icon-threads {
  mask-image: url("threads.svg");
}

.social-icon-bluesky {
  mask-image: url("bluesky.svg");
}

.social-icon-tiktok {
  mask-image: url("tiktok.svg");
}

.social-icon-youtube {
  mask-image: url("youtube.svg");
}

.social-icon:hover {
  color: var(--dark-cyan);
}

.document p,
.document li {
  color: var(--dark-text-secondary);
}

a {
  color: var(--dark-cyan);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: underline;
}

hr {
  border: 0;
  border-top: 1px solid var(--dark-border);
}

html[data-theme="light"] body {
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 15%, rgba(62, 116, 255, 0.18), transparent 34%),
    radial-gradient(circle at 78% 4%, rgba(18, 207, 227, 0.18), transparent 28%),
    radial-gradient(circle at 82% 78%, rgba(189, 57, 239, 0.12), transparent 30%),
    linear-gradient(180deg, #f7faff 0%, #ffffff 48%, #f6f9ff 100%);
}

html[data-theme="light"] .brand {
  color: var(--ink);
}

html[data-theme="light"] nav a,
html[data-theme="light"] footer a {
  color: #2853b8;
}

html[data-theme="light"] .social-icon {
  color: #2853b8;
}

html[data-theme="light"] nav a:hover,
html[data-theme="light"] footer a:hover {
  color: #7a32d8;
}

html[data-theme="light"] .social-icon:hover {
  color: #7a32d8;
}

html[data-theme="light"] .theme-toggle {
  border-color: rgba(62, 116, 255, 0.22);
  color: var(--ink);
  background: rgba(220, 229, 246, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64), 0 12px 28px rgba(7, 23, 52, 0.08);
}

html[data-theme="light"] .theme-toggle::before {
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(7, 23, 52, 0.14), inset 0 1px 0 #ffffff;
  transform: translateX(0);
}

html[data-theme="light"] .theme-toggle-icon {
  color: #245fd1;
}

html[data-theme="light"] .theme-toggle-text {
  color: rgba(67, 87, 125, 0.42);
}

html[data-theme="light"] .theme-toggle:hover {
  border-color: rgba(62, 116, 255, 0.38);
  background: #fff;
}

html[data-theme="light"] .document {
  border-color: rgba(62, 116, 255, 0.16);
  color: #1f3156;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 70px rgba(7, 23, 52, 0.1);
}

html[data-theme="light"] .contents {
  border-color: rgba(62, 116, 255, 0.14);
  background: #f8fbff;
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4 {
  color: var(--ink);
}

html[data-theme="light"] .date,
html[data-theme="light"] footer,
html[data-theme="light"] .document footer {
  color: var(--muted);
}

html[data-theme="light"] .document p,
html[data-theme="light"] .document li {
  color: #1f3156;
}

html[data-theme="light"] a {
  color: #2853b8;
}

html[data-theme="light"] hr {
  border-top-color: rgba(62, 116, 255, 0.16);
}

html[data-theme="light"] body.home-page {
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 15%, rgba(62, 116, 255, 0.18), transparent 34%),
    radial-gradient(circle at 78% 4%, rgba(18, 207, 227, 0.18), transparent 28%),
    radial-gradient(circle at 82% 78%, rgba(189, 57, 239, 0.12), transparent 30%),
    linear-gradient(180deg, #f7faff 0%, #ffffff 48%, #f6f9ff 100%);
}

html[data-theme="light"] .home-page .brand,
html[data-theme="light"] .home-page h1,
html[data-theme="light"] .home-page h2 {
  color: var(--ink);
}

html[data-theme="light"] .home-page h1 {
  text-shadow: 0 18px 44px rgba(62, 116, 255, 0.16);
}

html[data-theme="light"] .home-page nav a,
html[data-theme="light"] .home-page footer a {
  color: #2853b8;
}

html[data-theme="light"] .subtitle,
html[data-theme="light"] .card p,
html[data-theme="light"] .independent-note {
  color: #4f6388;
}

html[data-theme="light"] .card {
  border-color: rgba(62, 116, 255, 0.16);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 24px 60px rgba(7, 23, 52, 0.09);
}

html[data-theme="light"] .home-page footer {
  color: var(--muted);
  border-top-color: rgba(62, 116, 255, 0.16);
}

html[data-theme="light"] .button.secondary {
  border-color: rgba(62, 116, 255, 0.24);
  color: #2853b8;
  background: rgba(255, 255, 255, 0.76);
}

html[data-theme="light"] .home-page .button.secondary {
  color: #2853b8;
}

@media (max-width: 720px) {
  .page {
    padding: 22px 18px 36px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 34px;
  }

  .header-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .theme-toggle {
    top: 18px;
    right: 18px;
    padding: 3px;
  }

  .document {
    padding: 24px 20px;
  }

  .contents ul {
    grid-template-columns: 1fr;
  }

  .hero-logo {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .theme-toggle::before,
  .theme-toggle-icon,
  .theme-toggle-text {
    transition: none;
  }
}
