:root {
  --ink: #14181f;
  --ink-soft: #465160;
  --paper: #f6f8fb;
  --paper-deep: #e8f0fb;
  --line: #d9e1ec;
  --blue: #1769e0;
  --blue-dark: #0e3f91;
  --blue-soft: #e7f0ff;
  --green: #14855f;
  --amber: #c47b16;
  --red: #b64242;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.22em;
}

code {
  padding: 0.08em 0.32em;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 800;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  padding: 14px 32px;
  color: var(--white);
  background: rgba(11, 28, 56, 0.74);
  backdrop-filter: blur(18px);
}

.site-header.solid {
  background: rgba(11, 28, 56, 0.96);
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  min-width: 88px;
  min-height: 40px;
  place-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--blue);
  box-shadow: 0 12px 26px rgba(23, 105, 224, 0.32);
  color: var(--white);
  font-size: 1.12rem;
  font-weight: 850;
  letter-spacing: 0;
}

nav {
  display: flex;
  gap: 20px;
  font-size: 0.94rem;
}

nav a,
.login-link,
.signup-link {
  text-decoration: none;
  font-weight: 700;
}

nav a {
  opacity: 0.88;
}

nav a:hover,
.login-link:hover {
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.login-link {
  opacity: 0.9;
}

.logout-form {
  margin: 0;
}

.logout-button {
  border: 0;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  font-weight: 800;
}

.signup-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 8px;
  background: var(--white);
  color: var(--blue-dark);
}

.hero {
  min-height: 82vh;
  display: flex;
  align-items: center;
  padding: 112px 32px 76px;
  color: var(--white);
  background-image:
    linear-gradient(90deg, rgba(5, 16, 38, 0.96), rgba(8, 31, 72, 0.76) 43%, rgba(8, 31, 72, 0.18)),
    url("hero-platform.png");
  background-position: center;
  background-size: cover;
}

.hero-inner {
  width: min(760px, 100%);
  margin-left: max(0px, calc((100vw - 1180px) / 2));
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: #8fc1ff;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 5rem;
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 700px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.91);
  font-size: 1.32rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.primary-action {
  border: 0;
  background: var(--blue);
  color: var(--white);
}

.secondary-action {
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: var(--white);
}

.intro-band,
.auth-band,
.funding-band {
  padding: 70px 32px;
  border-bottom: 1px solid var(--line);
}

.intro-band {
  background: var(--blue-dark);
  color: var(--white);
}

.auth-band,
.funding-band {
  background: var(--paper-deep);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 48px;
  width: min(1180px, 100%);
  margin: 0 auto;
  align-items: start;
}

.content-grid.reverse {
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1fr);
}

.content-grid h2,
.section-heading h2 {
  margin: 0;
  font-size: 2.35rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.content-grid p,
.stacked-copy p {
  margin: 0;
  color: inherit;
  font-size: 1.05rem;
}

.intro-band .content-grid p {
  color: rgba(255, 255, 255, 0.84);
}

.home-communities,
.principles,
.launch {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 78px 0;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 34px;
}

.community-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.community-chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #bfd0e6;
  border-radius: 8px;
  background: var(--white);
  color: var(--blue-dark);
  font-weight: 800;
  text-decoration: none;
}

.principle-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.principle-list article,
.community-card,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 18px 40px rgba(24, 37, 56, 0.08);
}

.principle-list article {
  min-height: 220px;
  padding: 26px;
}

.principle-list h3,
.community-card h3,
.timeline h3 {
  margin: 0 0 10px;
  font-size: 1.14rem;
  line-height: 1.25;
}

.principle-list p,
.community-card p,
.timeline p {
  margin: 0;
  color: var(--ink-soft);
}

.stacked-copy {
  display: grid;
  gap: 16px;
  padding-top: 4px;
}

.stacked-copy a,
.community-card a,
.auth-switch a {
  width: fit-content;
  color: var(--blue);
  font-weight: 800;
}

.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.timeline li {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 22px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.timeline span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: var(--white);
  font-weight: 850;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 32px;
  background: var(--ink);
  color: var(--white);
}

.site-footer p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.site-footer a {
  white-space: nowrap;
}

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

.document-page,
.directory-page,
.auth-page {
  background: var(--paper);
}

.document-page .site-header,
.directory-page .site-header,
.auth-page .site-header {
  position: fixed;
}

.document-shell,
.directory-shell {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 132px 0 80px;
}

.document-shell {
  width: min(820px, calc(100% - 48px));
}

.document-shell h1,
.directory-shell h1,
.auth-panel h1 {
  margin: 0;
  font-size: 3.2rem;
  line-height: 1.02;
  color: var(--ink);
}

.document-shell .lead,
.directory-shell .lead {
  max-width: 760px;
  margin: 22px 0 42px;
  color: var(--ink-soft);
  font-size: 1.2rem;
}

.document-shell section {
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.document-shell h2,
.topic-heading h2 {
  margin: 0 0 12px;
  font-size: 1.55rem;
  line-height: 1.2;
}

.document-shell p,
.document-shell li {
  color: var(--ink-soft);
}

.document-shell ul,
.document-shell ol {
  margin: 12px 0 0;
  padding-left: 22px;
}

.document-shell li + li {
  margin-top: 8px;
}

.topic-group {
  padding: 34px 0;
  border-top: 1px solid var(--line);
}

.topic-heading {
  display: grid;
  gap: 2px;
  margin-bottom: 18px;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.community-card {
  display: grid;
  gap: 12px;
  min-height: 176px;
  padding: 20px;
}

.community-card h3 {
  color: var(--blue-dark);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 118px 24px 60px;
  background:
    linear-gradient(135deg, rgba(23, 105, 224, 0.12), rgba(20, 133, 95, 0.08)),
    var(--paper);
}

.auth-panel {
  width: min(460px, 100%);
  padding: 30px;
}

.auth-panel .section-kicker {
  color: var(--blue);
}

.auth-form {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.auth-form label {
  color: var(--ink);
  font-weight: 800;
}

.auth-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c7d3e2;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
}

.auth-form input:focus {
  outline: 3px solid rgba(23, 105, 224, 0.18);
  border-color: var(--blue);
}

.form-action {
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  cursor: default;
}

.form-note,
.auth-switch {
  margin: 12px 0 0;
  color: var(--ink-soft);
}

.flash-stack {
  position: fixed;
  top: 82px;
  left: 50%;
  z-index: 20;
  width: min(760px, calc(100% - 32px));
  transform: translateX(-50%);
}

.flash-message,
.form-errors {
  border: 1px solid #bfd0e6;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 16px 32px rgba(24, 37, 56, 0.12);
}

.flash-message {
  margin: 0 0 10px;
  padding: 12px 14px;
}

.flash-success {
  border-color: rgba(20, 133, 95, 0.45);
}

.flash-info {
  border-color: rgba(23, 105, 224, 0.45);
}

.form-errors {
  display: grid;
  gap: 4px;
  margin-top: 20px;
  padding: 12px 14px;
  border-color: rgba(182, 66, 66, 0.38);
  background: #fff7f7;
}

.form-errors p {
  margin: 0;
  color: #7d2424;
}

.forum-shell {
  width: min(1040px, calc(100% - 48px));
  margin: 0 auto;
  padding: 132px 0 80px;
}

.community-cover,
.composer-panel,
.post-detail,
.topic-row,
.comment-card,
.rules-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 18px 40px rgba(24, 37, 56, 0.08);
}

.community-cover {
  padding: 30px;
}

.community-cover h1,
.post-detail h1 {
  margin: 0;
  color: var(--ink);
  font-size: 3rem;
  line-height: 1.04;
}

.community-cover .lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 1.12rem;
}

.rules-box {
  margin-top: 22px;
  padding: 18px;
  background: var(--blue-soft);
}

.rules-box h2,
.composer-panel h2,
.topic-list h2,
.comment-list h2 {
  margin: 0 0 12px;
  font-size: 1.32rem;
}

.rules-box p {
  margin: 0;
  color: var(--ink-soft);
}

.composer-panel,
.post-detail {
  margin-top: 18px;
  padding: 24px;
}

.topic-form {
  display: grid;
  gap: 10px;
}

.topic-form label {
  color: var(--ink);
  font-weight: 800;
}

.topic-form input,
.topic-form textarea {
  width: 100%;
  border: 1px solid #c7d3e2;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
}

.topic-form input:focus,
.topic-form textarea:focus {
  outline: 3px solid rgba(23, 105, 224, 0.18);
  border-color: var(--blue);
}

.topic-list,
.comment-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.topic-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
}

.topic-row h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.topic-row h3 a {
  color: var(--ink);
  text-decoration: none;
}

.topic-row h3 a:hover {
  color: var(--blue);
}

.vote-score {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 850;
}

.meta-line {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.post-body {
  margin-top: 22px;
  color: var(--ink);
  font-size: 1.06rem;
}

.vote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
}

.vote-actions form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.vote-actions button {
  min-height: 38px;
  border: 1px solid #bfd0e6;
  border-radius: 8px;
  background: var(--white);
  color: var(--blue-dark);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.comment-card {
  padding: 18px;
}

.not-found {
  min-height: 100vh;
  display: grid;
  align-content: center;
  padding-top: 60px;
}

.text-action {
  display: inline-flex;
  margin: 10px 18px 0 0;
  color: var(--blue);
  font-weight: 800;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto auto;
  }

  nav {
    order: 3;
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }

  .community-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-header {
    position: absolute;
    align-items: flex-start;
    padding: 14px 20px;
  }

  .hero {
    min-height: 82vh;
    padding: 132px 20px 54px;
    background-image:
      linear-gradient(180deg, rgba(5, 16, 38, 0.94), rgba(8, 31, 72, 0.64)),
      url("hero-platform.png");
  }

  h1 {
    font-size: 3.15rem;
  }

  .hero-copy {
    font-size: 1.08rem;
  }

  .intro-band,
  .auth-band,
  .funding-band {
    padding: 52px 20px;
  }

  .content-grid,
  .content-grid.reverse,
  .principle-list {
    grid-template-columns: 1fr;
  }

  .content-grid h2,
  .section-heading h2 {
    font-size: 1.85rem;
  }

  .home-communities,
  .principles,
  .launch {
    width: calc(100% - 40px);
    padding: 56px 0;
  }

  .principle-list article {
    min-height: 0;
  }

  .timeline li {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 16px;
  }

  .timeline span {
    width: 46px;
    height: 46px;
  }

  .site-footer {
    flex-direction: column;
    padding: 28px 20px;
  }

  .document-shell,
  .directory-shell,
  .forum-shell {
    width: calc(100% - 40px);
    padding-top: 150px;
  }

  .document-shell h1,
  .directory-shell h1,
  .auth-panel h1,
  .community-cover h1,
  .post-detail h1 {
    font-size: 2.35rem;
  }

  .document-shell .lead,
  .directory-shell .lead {
    font-size: 1.05rem;
  }
}

@media (max-width: 560px) {
  .site-header {
    display: grid;
    gap: 12px;
  }

  .header-actions {
    justify-content: space-between;
  }

  .brand-mark {
    min-width: 78px;
  }

  .hero-actions {
    display: grid;
  }

  .primary-action,
  .secondary-action {
    justify-content: center;
    width: 100%;
  }

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

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