/* tunnl.sh static site — shared styles */
/* No external dependencies. System fonts only. */

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

:root {
  --bg:        #0f1117;
  --bg-card:   #161b22;
  --bg-subtle: #1c2128;
  --border:    #30363d;
  --text:      #e6edf3;
  --text-muted:#8b949e;
  --text-dim:  #6e7681;
  --green:     #10b981;
  --green-dim: #059669;
  --blue:      #58a6ff;
  --red:       #f85149;
  --orange:    #f97316;
  --mono:      'SF Mono', 'Cascadia Code', 'Fira Code', ui-monospace, 'Courier New', monospace;
  --sans:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout ---- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.nav__logo-mark {
  width: 28px;
  height: 28px;
  background: var(--green);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  font-family: var(--mono);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.nav__links a:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.nav__links a.active {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
}

.btn--green {
  background: var(--green);
  color: #fff;
}
.btn--green:hover { background: var(--green-dim); color: #fff; }

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--outline:hover { background: var(--bg-subtle); border-color: var(--text-dim); }

/* ---- Hero ---- */
.hero {
  padding: 80px 0 64px;
  text-align: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 24px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--text);
}

.hero__title .accent { color: var(--green); }

.hero__sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.65;
}

.hero__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* ---- Code blocks ---- */
.code-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-align: left;
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.code-block__label {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--mono);
  letter-spacing: 0.03em;
}

.code-block__dots {
  display: flex;
  gap: 6px;
}

.code-block__dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

pre {
  padding: 20px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text);
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

.comment { color: var(--text-dim); }
.cmd     { color: var(--green); }

/* ---- Feature grid ---- */
.features {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.section-label {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.section-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 48px;
  font-size: 0.975rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}

.card__icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.card__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.card__body {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---- How it works ---- */
.how-it-works {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 640px;
  margin: 0 auto;
}

.step {
  display: flex;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; }

.step__num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green);
  font-family: var(--mono);
  margin-top: 2px;
}

.step__content {}
.step__title {
  font-weight: 700;
  margin-bottom: 4px;
  font-size: 0.975rem;
}
.step__body {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---- Links section ---- */
.links-section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.link-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.link-card:hover {
  border-color: var(--green);
  background: var(--bg-subtle);
}

.link-card__icon { font-size: 1.25rem; flex-shrink: 0; }
.link-card__text {}
.link-card__title { font-size: 0.9rem; font-weight: 700; }
.link-card__sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  text-align: center;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: center;
}

.footer__links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.15s;
}
.footer__links a:hover { color: var(--text-muted); }

.footer__copy {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ---- Docs layout ---- */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  padding: 48px 0;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 72px;
}

.docs-sidebar__title {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding: 0 8px;
}

.docs-sidebar__nav {
  list-style: none;
}

.docs-sidebar__nav li { margin-bottom: 2px; }

.docs-sidebar__nav a {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.docs-sidebar__nav a:hover,
.docs-sidebar__nav a.active {
  color: var(--text);
  background: var(--bg-subtle);
}

.docs-sidebar__nav a.active {
  color: var(--green);
}

.docs-content h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.docs-content .page-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.docs-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 48px 0 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}
.docs-content h2:first-of-type { border-top: none; }

.docs-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 28px 0 12px;
  scroll-margin-top: 80px;
}

.docs-content p { margin-bottom: 16px; color: var(--text-muted); line-height: 1.7; }
.docs-content p strong { color: var(--text); }

.docs-content ul, .docs-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.docs-content li { margin-bottom: 6px; line-height: 1.65; }
.docs-content li strong { color: var(--text); }

.docs-content .code-block { margin: 20px 0; }

/* checklist */
.checklist { list-style: none; padding: 0; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.checklist li:last-child { border-bottom: none; }
.checklist__box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  margin-top: 2px;
}

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; margin: 20px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-subtle);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}
td strong, td code { color: var(--text); }
tr:last-child td { border-bottom: none; }

/* ---- Callouts ---- */
.callout {
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.875rem;
  line-height: 1.65;
  display: flex;
  gap: 12px;
}
.callout--note {
  background: rgba(88, 166, 255, 0.08);
  border: 1px solid rgba(88, 166, 255, 0.25);
  color: var(--text-muted);
}
.callout--warn {
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.25);
  color: var(--text-muted);
}
.callout--tip {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--text-muted);
}
.callout__icon { flex-shrink: 0; font-size: 1rem; }
.callout__body {}
.callout__body strong { color: var(--text); }

/* ---- Changelog ---- */
.changelog-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  margin-bottom: 16px;
}

.changelog-entry__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.changelog-entry__version {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge--green { background: var(--green); color: #fff; }
.badge--blue  { background: rgba(88,166,255,0.15); color: var(--blue); border: 1px solid rgba(88,166,255,0.3); }
.badge--red   { background: rgba(248,81,73,0.15); color: var(--red); border: 1px solid rgba(248,81,73,0.3); }

.changelog-entry__date {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.changelog-entry__summary {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.changelog-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.changelog-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

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

.changelog-list__dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 6px;
}

.changelog-list__dot--green { background: var(--green); }
.changelog-list__dot--red   { background: var(--red); }
.changelog-list__dot--blue  { background: var(--blue); }

/* ---- Docs index cards ---- */
.doc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 32px;
}

.doc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.doc-card:hover { border-color: var(--green); background: var(--bg-subtle); }
.doc-card__title { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.doc-card__sub { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

/* ---- Misc ---- */
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }

.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-right: 4px;
}
.tag--required { background: rgba(248,81,73,0.15); color: var(--red); border: 1px solid rgba(248,81,73,0.3); }
.tag--optional { background: rgba(88,166,255,0.1); color: var(--blue); border: 1px solid rgba(88,166,255,0.25); }
.tag--default  { background: var(--bg-subtle); color: var(--text-dim); border: 1px solid var(--border); }

@media (max-width: 700px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; }
  .hero { padding: 48px 0 40px; }
  .nav__links .btn { display: none; }
}
