:root {
  --bg: #0f1115;
  --surface: #171a21;
  --border: #2a2e38;
  --text: #e8e9ec;
  --text-muted: #9499a6;
  --accent: #4f8cff;
  --accent-text: #0f1115;
  --danger: #ff6b6b;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

header .logo {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text);
}

header nav a {
  margin-left: 1.25rem;
  text-decoration: none;
  font-size: 0.95rem;
}

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

.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}

.hero h1 {
  font-size: 2.1rem;
  margin-bottom: 0.75rem;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 1.75rem;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.feature h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 380px;
  margin: 0 auto;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  margin-top: 1rem;
}

label:first-child {
  margin-top: 0;
}

input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #11141a;
  color: var(--text);
  font-size: 0.95rem;
}

input:focus {
  outline: 1px solid var(--accent);
}

form .btn {
  width: 100%;
  margin-top: 1.5rem;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  background: #fff;
  color: #1f1f1f;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border);
}

.btn-google:hover {
  background: #f1f1f1;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.75rem;
  min-height: 1.2em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
}

code {
  background: #11141a;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
}

.inline-form input {
  flex: 1;
}

.inline-form button {
  flex-shrink: 0;
}

/* About / how-it-works page */

.about-main {
  max-width: 820px;
}

.about-section {
  margin: 3rem 0;
}

.about-section h2 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.about-section > p.muted {
  margin-top: 0;
  max-width: 640px;
}

.diagram-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.25rem;
  margin-top: 1.25rem;
}

.flow-diagram {
  width: 100%;
  height: auto;
  display: block;
}

.zone {
  fill: rgba(79, 140, 255, 0.04);
  stroke: var(--border);
  stroke-width: 1;
}

.zone-label {
  fill: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
}

.zone-label-dim {
  fill: var(--text-muted);
  opacity: 0.8;
  font-style: italic;
}

.boundary {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.box {
  stroke-width: 1.5;
}

.box-server {
  fill: #1a2030;
  stroke: var(--text-muted);
}

.box-device {
  fill: rgba(79, 140, 255, 0.12);
  stroke: var(--accent);
}

.box-relay {
  fill: rgba(255, 107, 107, 0.08);
  stroke: var(--danger);
  stroke-dasharray: 5 3;
}

.box-title {
  fill: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}

.box-sub {
  fill: var(--text-muted);
  font-size: 11px;
  font-family: inherit;
}

.flow-label {
  fill: var(--text-muted);
  font-size: 11px;
  font-family: inherit;
}

.arrow {
  fill: none;
  stroke-width: 1.75;
}

.arrow-direct {
  stroke: var(--accent);
}

.arrow-relay {
  stroke: var(--danger);
  stroke-dasharray: 5 3;
}

.arrow-meta {
  stroke: var(--text-muted);
  stroke-dasharray: 2 3;
}

.arrowhead-direct {
  fill: var(--accent);
}

.arrowhead-relay {
  fill: var(--danger);
}

.arrowhead-meta {
  fill: var(--text-muted);
}

.diagram-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.diagram-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

.swatch-direct {
  background: var(--accent);
}

.swatch-relay {
  background: var(--danger);
  background-image: linear-gradient(90deg, var(--danger) 60%, transparent 60%);
  background-size: 6px 3px;
}

.swatch-meta {
  background: var(--text-muted);
  background-image: linear-gradient(90deg, var(--text-muted) 40%, transparent 40%);
  background-size: 4px 3px;
}

.steps {
  padding-left: 1.25rem;
}

.steps li {
  margin-bottom: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.steps li strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.15rem;
}

.split-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.split-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.split-col h3 {
  margin-top: 0;
  font-size: 1rem;
}

.split-col ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.split-col ul li {
  margin-bottom: 0.4rem;
}

.tech-list {
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.tech-list li {
  margin-bottom: 0.6rem;
}

.tech-list strong {
  color: var(--text);
}
