:root {
  --bg:        #0b0a0c;
  --bg-soft:   #131015;
  --card:      #14162200;
  --card-bg:   rgba(255, 255, 255, 0.025);
  --card-bg-2: rgba(255, 255, 255, 0.05);
  --border:    rgba(255, 255, 255, 0.10);
  --border-2:  rgba(255, 138, 92, 0.40);
  --text:      #f4f1ef;
  --muted:     #b3aaa6;
  --muted-2:   #837975;
  --accent:    #ff1500;
  --accent-2:  #ff4e00;
  --accent-3:  #ff6a2b;
  --t-shadow:  #300500;
  --radius:    20px;
  --maxw:      1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 12% -8%, rgba(255, 77, 61, 0.10), transparent 60%),
    radial-gradient(1000px 620px at 100% 0%, rgba(255, 157, 46, 0.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
}

a { color: inherit; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Hero ---------- */
header.hero {
  padding: clamp(56px, 9vw, 120px) 0 clamp(28px, 5vw, 56px);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 7px 14px;
  border: 1px solid var(--border-2);
  border-radius: 999px;
  background: rgba(255, 77, 61, 0.07);
}
.kicker .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px 1px var(--accent);
}

h1.title {
  margin: 22px 0 0;
  font-size: clamp(2.1rem, 5.4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  max-width: 16ch;
}
h1.title .grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-3) 45%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The site meta description, made prominent. */
p.lead {
  margin: 24px 0 0;
  font-size: clamp(1.08rem, 1.9vw, 1.32rem);
  font-weight: 500;
  color: #e9e2dd;
  max-width: 62ch;
  border-left: 3px solid var(--accent);
  padding-left: 18px;
}

.intro {
  margin: 30px 0 0;
  max-width: 70ch;
  color: var(--muted);
  font-size: 1.04rem;
}
.intro p { margin: 0 0 16px; }
.intro strong { color: var(--text); font-weight: 600; }

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: clamp(40px, 7vw, 76px) 0 26px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-head span {
  color: var(--muted-2);
  font-size: 0.92rem;
  font-weight: 500;
}

/* ---------- Tool cards ---------- */
.tools {
  display: grid;
  gap: 18px;
  padding-bottom: 40px;
}

.card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: clamp(18px, 3vw, 30px);
  align-items: center;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.card:hover {
  border-color: var(--border-2);
  background: var(--card-bg-2);
}

.icon-box {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
.icon-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.card-body { min-width: 0; }

.card-name {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 11px 0 0;
}
.chip {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--muted);
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
}

.card-desc {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 1rem;
  max-width: 62ch;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  text-shadow: 1px 1px 2px var(--t-shadow);
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, color 0.14s ease, filter 0.14s ease;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:active { transform: translateY(1px); }

.btn-download {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: #eeeeee;
  box-shadow: 0 8px 22px -12px rgba(255, 106, 43, 0.7);
}
.btn-download:hover { filter: brightness(1.06); }

.btn-source {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}
.btn-source:hover { border-color: var(--border-2); background: rgba(255, 106, 43, 0.10); }

.btn-more {
  background: rgba(255, 106, 43, 0.10);
  border-color: var(--border-2);
  color: var(--accent-2);
}
.btn-more:hover { background: rgba(255, 106, 43, 0.18); }

.btn-soon {
  background: transparent;
  border: 1px dashed var(--muted-2);
  color: var(--muted-2);
  cursor: default;
}

/* ---------- Footer ---------- */
footer {
  margin-top: 30px;
  border-top: 1px solid var(--border);
  padding: 34px 0 60px;
  color: var(--muted-2);
  font-size: 0.92rem;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .row { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; }

/* ============================================================
   Screenshots, homepage showcase & per-app detail pages
   ============================================================ */

/* Framed screenshot. The app shots already include their own window
   chrome, so we frame with a border + glow rather than fake chrome. */
.shot {
  display: block;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-2);
  background: #0c0b0d;
  box-shadow:
    0 24px 60px -36px rgba(255, 106, 43, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}
.shot img { display: block; width: 100%; height: auto; }
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 28%);
}

/* Homepage eye-grabber band */
.showcase { margin: clamp(34px, 6vw, 60px) 0 0; }
.showcase-cap {
  margin: 16px 4px 0;
  color: var(--muted-2);
  font-size: 0.95rem;
}
.showcase-cap a { color: var(--accent); text-decoration: none; font-weight: 600; }
.showcase-cap a:hover { text-decoration: underline; }

/* Back link on detail pages */
.backlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: clamp(30px, 6vw, 48px) 0 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.backlink:hover { color: var(--text); }

/* Detail hero */
.detail-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(26px, 4vw, 44px);
  padding: 20px 0 0;
  align-items: center;
}
@media (min-width: 900px) {
  .detail-hero { grid-template-columns: 0.92fr 1.08fr; }
}
.dh-head { display: flex; gap: 18px; align-items: center; }
.dh-head .icon-box { width: 88px; height: 88px; padding: 13px; flex: none; }
.detail-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4.6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.04;
}
.detail-hero .pitch {
  margin: 16px 0 0;
  color: #e9e2dd;
  font-size: clamp(1.05rem, 1.7vw, 1.26rem);
  font-weight: 500;
  max-width: 48ch;
}
.detail-hero .links { margin-top: 22px; }

/* Detail sections */
.detail-section { margin: clamp(40px, 7vw, 72px) 0 0; }
.detail-section > h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.prose { color: var(--muted); max-width: 70ch; font-size: 1.05rem; }
.prose p { margin: 0 0 16px; }
.prose strong { color: var(--text); font-weight: 600; }

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 13px;
  grid-template-columns: 1fr;
  max-width: 76ch;
}
@media (min-width: 680px) { .feature-list { grid-template-columns: 1fr 1fr; } }
.feature-list li { position: relative; padding-left: 26px; color: var(--muted); }
.feature-list li strong { color: var(--text); font-weight: 600; }
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* Screenshot gallery */
.gallery {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 680px) { .gallery { grid-template-columns: 1fr 1fr; } }
.gallery figure { margin: 0; }
.gallery figcaption { margin-top: 9px; color: var(--muted-2); font-size: 0.86rem; }

/* Quick start steps */
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 20px;
  max-width: 74ch;
}
.steps > li { position: relative; padding-left: 52px; }
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: -3px;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-weight: 700;
  color: #1a0d06;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px -12px rgba(255, 106, 43, 0.7);
}
.steps h3 { margin: 5px 0 6px; font-size: 1.08rem; font-weight: 600; }
.steps p { margin: 0; color: var(--muted); }
.steps a { color: var(--accent); text-decoration: none; font-weight: 600; }
.steps a:hover { text-decoration: underline; }

/* Code block with copy button */
.code {
  position: relative;
  margin: 14px 0 0;
  background: #0c0b0d;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.code pre {
  margin: 0;
  padding: 16px 58px 16px 16px;
  overflow: auto;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.86rem;
  color: #ded7d2;
  line-height: 1.65;
}
.code .copy {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  font-family: inherit;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.code .copy:hover { color: var(--text); border-color: var(--border-2); }
.code .copy.copied { color: #9fe6a0; border-color: rgba(90, 160, 44, 0.5); }

/* Requirements */
.req { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; max-width: 70ch; }
.req li { color: var(--muted); padding-left: 24px; position: relative; }
.req li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.req li strong { color: var(--text); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 620px) {
  .card {
    grid-template-columns: 1fr;
    justify-items: start;
    text-align: left;
  }
  .icon-box { width: 96px; height: 96px; }
  .links { width: 100%; }
}

/* ============================================================
   Top navigation (all pages)
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 10, 12, 0.80);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text);
  margin-right: auto;
}
.nav-brand .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 1px var(--accent);
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 9px;
  transition: color 0.14s ease, background 0.14s ease;
}
.nav-links a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(88, 101, 242, 0.12);
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.btn-discord:hover { background: rgba(88, 101, 242, 0.22); border-color: rgba(88, 101, 242, 0.6); }
.btn-discord:active { transform: translateY(1px); }
.btn-discord img { width: 18px; height: 18px; display: block; }

@media (max-width: 600px) {
  .nav-links { display: none; }
}

/* ============================================================
   Screenshot carousel (homepage)
   ============================================================ */
.carousel { margin: clamp(34px, 6vw, 60px) 0 0; position: relative; }
.carousel-viewport {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--border-2);
  background: #0c0b0d;
  overflow: hidden;
  box-shadow:
    0 24px 60px -36px rgba(255, 106, 43, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}
.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  padding: 10px;
  background:
    radial-gradient(90% 90% at 50% 0%, rgba(255, 106, 43, 0.06), transparent 70%),
    #0c0b0d;
}
.carousel-slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-2);
  background: rgba(11, 10, 12, 0.66);
  color: var(--text);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  backdrop-filter: blur(4px);
  transition: background 0.14s ease, border-color 0.14s ease;
}
.carousel-btn:hover { background: rgba(11, 10, 12, 0.92); border-color: var(--accent-2); }
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 0;
}
.carousel-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: background 0.14s ease, transform 0.14s ease;
}
.carousel-dots button.active {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  transform: scale(1.35);
}
.carousel-cap {
  margin: 14px 4px 0;
  color: var(--muted-2);
  font-size: 0.95rem;
  text-align: center;
}
.carousel-cap a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.carousel-cap a:hover { text-decoration: underline; }

/* ============================================================
   Selling points (homepage)
   ============================================================ */
.selling {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  margin: clamp(40px, 7vw, 72px) 0 0;
}
@media (min-width: 720px) { .selling { grid-template-columns: 1fr 1fr; } }
.selling-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  padding: 26px;
}
.selling-card .sp-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  margin-bottom: 15px;
  color: var(--accent-2);
  background: linear-gradient(135deg, rgba(255, 77, 61, 0.18), rgba(255, 157, 46, 0.18));
  border: 1px solid var(--border-2);
}
.selling-card .sp-icon svg { width: 22px; height: 22px; }
.selling-card h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.selling-card p { margin: 10px 0 0; color: var(--muted); font-size: 1.02rem; }
.selling-card strong { color: var(--text); font-weight: 600; }

/* ============================================================
   Protocol page: diagrams, tables, byte map
   ============================================================ */
.diagram {
  margin: 18px 0 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  overflow-x: auto;
  background:
    radial-gradient(90% 90% at 50% 0%, rgba(255, 106, 43, 0.05), transparent 70%),
    #0c0b0d;
}
.diagram svg { display: block; width: 100%; height: auto; min-width: 540px; }
/* The hero transport diagram sits in a narrow two-column slot; let it scale
   to the column instead of forcing the 540px min-width (which caused a scrollbar). */
.detail-hero .diagram svg { min-width: 0; }
.diagram svg text { font-family: 'Inter', system-ui, sans-serif; }
.diagram-cap { margin: 12px 2px 0; color: var(--muted-2); font-size: 0.88rem; }

/* SVG theme tokens */
.dg-surface { fill: rgba(255, 255, 255, 0.035); stroke: rgba(255, 255, 255, 0.14); }
.dg-accent  { fill: rgba(255, 106, 43, 0.14); stroke: rgba(255, 138, 92, 0.55); }
.dg-life    { stroke: rgba(255, 255, 255, 0.20); stroke-dasharray: 4 5; }
.dg-asend   { stroke: var(--accent-2); stroke-width: 2; fill: none; }
.dg-arecv   { stroke: var(--accent); stroke-width: 2; fill: none; }
.dg-mk-send { fill: var(--accent-2); }
.dg-mk-recv { fill: var(--accent); }
.dg-rule    { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.dg-head    { fill: var(--text); font-size: 15px; font-weight: 700; }
.dg-label   { fill: var(--text); font-size: 13px; font-weight: 600; }
.dg-sub     { fill: var(--muted); font-size: 11px; }
.dg-phase   { fill: var(--muted-2); font-size: 11px; font-weight: 700; letter-spacing: 0.10em; }
.dg-note    { fill: var(--muted); font-size: 12px; }

.table-wrap {
  margin: 18px 0 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 480px; }
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table thead th {
  color: var(--muted-2);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.02);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.mono, .data-table code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: var(--accent-2);
}

.bytemap { display: flex; gap: 6px; margin: 18px 0 0; flex-wrap: wrap; }
.bytemap .field {
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: rgba(255, 106, 43, 0.06);
  padding: 12px 14px;
  text-align: center;
  flex: 1 1 0;
  min-width: 84px;
}
.bytemap .field .fname { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.bytemap .field .fmeta {
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--muted-2);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
