:root {
  --bg: #0f1115;
  --fg: #d8d8d8;
  --muted: #8a8f98;
  --accent: #ff3030;
  --rule: #1f232b;
  --code-bg: #161922;
}

body.theme-protocol    { --accent: #ff3030; }
body.theme-performance { --accent: #ffb020; }
body.theme-privacy     { --accent: #30d06a; }
body.theme-quantum     { --accent: #4aa8ff; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

header {
  margin-bottom: 3rem;
}

header h1 {
  font-size: 2rem;
  margin: 0 0 0.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tagline {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

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

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

section {
  margin-top: 2.75rem;
}

h2 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
  font-weight: 600;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.25rem;
  font-weight: 600;
}

article + article {
  margin-top: 1.5rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

p {
  margin: 0.5rem 0;
}

ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

li {
  margin: 0.25rem 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  background: var(--code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

table.spec {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}

table.spec th,
table.spec td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

table.spec th {
  color: var(--muted);
  font-weight: 600;
}

table.spec td:first-child {
  white-space: normal;
  width: 45%;
}

.contact-list {
  list-style: none;
  padding: 0;
}

.contact-list li {
  margin: 0.4rem 0;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.tile {
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1;
  padding: 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
  background: #14171f;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.tile:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.tile-protocol:hover    { border-color: #ff3030; color: #ff3030; }
.tile-performance:hover { border-color: #ffb020; color: #ffb020; }
.tile-privacy:hover     { border-color: #30d06a; color: #30d06a; }
.tile-quantum:hover     { border-color: #4aa8ff; color: #4aa8ff; }

.tile-icon {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.tile-icon svg {
  width: 45%;
  max-width: 96px;
  height: auto;
  opacity: 0.55;
  transition: opacity 0.15s ease;
}

.tile:hover .tile-icon svg {
  opacity: 1;
}

.tile-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

@media (max-width: 560px) {
  .tile-grid {
    gap: 0.6rem;
  }
  .tile {
    padding: 1rem;
  }
  .tile-title {
    font-size: 1rem;
  }
  .tile-icon svg {
    max-width: 64px;
  }
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.disclaimer {
  margin: 1rem 0 0;
  padding: 0.6rem 0.9rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--code-bg);
  border-radius: 2px;
}

nav.bottom-nav {
  display: block;
  margin-top: 2.5rem;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--rule);
  border-bottom: none;
}

footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}
