:root {
  --bg: #0b0d10;
  --surface: #141820;
  --border: #2a3140;
  --text: #e8ecf1;
  --muted: #9aa3b2;
  --accent: #6ee7b7;
  --accent2: #818cf8;
  --max: 68rem;
  --radius: 0.65rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

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

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--text);
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--text);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.hero {
  margin-top: 1.5rem;
}

.hero-text {
  max-width: 38rem;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.2;
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.hero-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  min-height: 10rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, #0f1724 0%, #1a1f3a 45%, #0d2818 100%);
}

.hero-canvas-wrap.no-webgl {
  background: linear-gradient(120deg, #12182a, #1e293b 40%, #134e4a);
}

#hero-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.section {
  margin-top: 3.5rem;
}

.section h2 {
  font-size: 1.5rem;
  margin: 0 0 1.25rem;
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: #3d4a5f;
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.card p {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(110, 231, 183, 0.08);
  padding: 0.2rem 0.45rem;
  border-radius: 0.25rem;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.note time {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent2);
  margin-bottom: 0.35rem;
}

.note h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.about p {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.error-page h1 {
  font-size: 4rem;
  margin: 0;
  color: var(--accent2);
  font-weight: 700;
}

.error-page p {
  color: var(--muted);
  margin: 0.5rem 0 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-nav {
  align-items: center;
  min-width: 0;
}

body {
  overflow-wrap: break-word;
}

.site-nav a.nav-signin {
  margin-left: 0.35rem;
  padding: 0.28rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  line-height: 1.4;
}

.site-nav a.nav-signin:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.site-nav a.nav-signin[aria-current="page"] {
  color: var(--accent);
  border-color: var(--accent);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 0.35rem;
  color: var(--muted);
}

main > h1,
.breadcrumb + h1 {
  font-size: clamp(1.7rem, 4vw, 2.15rem);
  line-height: 1.2;
  font-weight: 700;
  margin: 0.7rem 0 0.55rem;
}

main > h1 {
  margin-top: 1.5rem;
}

.lede {
  margin: 0 0 1.75rem;
  max-width: 40rem;
  color: var(--muted);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 1.25rem;
}

.section-head h2 {
  margin: 0;
}

.section-head a {
  font-size: 0.92rem;
  text-decoration: none;
}

.section-head a:hover {
  text-decoration: underline;
}

.card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.note h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.card h2 a,
.card h3 a,
.note h2 a,
.note h3 a {
  color: inherit;
  text-decoration: none;
}

.card h2 a:hover,
.card h3 a:hover,
.note h2 a:hover,
.note h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.badge-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}

.lock-icon {
  position: relative;
  display: inline-block;
  width: 0.55rem;
  height: 0.4rem;
  margin-top: 0.22rem;
  border: 1.5px solid currentColor;
  border-radius: 1.5px;
  flex: 0 0 auto;
  box-sizing: border-box;
}

.lock-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% - 1px);
  width: 0.34rem;
  height: 0.26rem;
  transform: translateX(-50%);
  border: 1.5px solid currentColor;
  border-bottom: 0;
  border-radius: 0.28rem 0.28rem 0 0;
  box-sizing: border-box;
}

.note .badge-lock {
  margin-top: 0.65rem;
}

.about .more-link {
  margin: 0.9rem 0 0;
}

.about h2 {
  margin: 1.6rem 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.about p + p {
  margin-top: 0.9rem;
}

.about h2 + p {
  margin-top: 0;
}

.restricted {
  margin-top: 2.5rem;
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  max-width: 42rem;
}

.restricted h2 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.restricted p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.auth-block h2 {
  margin: 2rem 0 0.85rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 24rem;
}

.auth-form .form-field > label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.auth-form input[type="text"],
.auth-form input[type="password"] {
  display: block;
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit;
  color: var(--text);
  background: #0e131a;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
}

.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.auth-form .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-form .form-check input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
}

.auth-form .form-check label {
  display: inline;
  margin: 0;
  font-size: 0.92rem;
}

.auth-form button {
  width: 100%;
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 600;
  color: #0b0d10;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.auth-form button:hover {
  background: #8aefc6;
}

.auth-form button:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

.auth-help {
  max-width: 24rem;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.alert-error {
  max-width: 24rem;
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  color: #ffd7da;
  background: rgba(176, 48, 58, 0.22);
  border: 1px solid #e08a92;
  border-radius: var(--radius);
  font-size: 0.92rem;
}

@media (max-width: 520px) {
  .site-header {
    align-items: flex-start;
    row-gap: 0.7rem;
  }

  .site-nav {
    flex: 1 1 100%;
    max-width: 100%;
    gap: 0.45rem 0.85rem;
  }

  .site-nav a.nav-signin {
    margin-left: auto;
  }
}

@media (max-width: 400px) {
  .site-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  main,
  .site-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

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

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-canvas-wrap {
    aspect-ratio: 16 / 10;
  }
}

main.error-page > h1 {
  margin: 0;
  font-size: 4rem;
  color: var(--accent2);
}
