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

:root {
  --bg: #0e1117;
  --bg-raised: #161b22;
  --bg-panel: #1c2129;
  --border: rgba(255,255,255,0.07);
  --text: #c9d1d9;
  --text-bright: #e6edf3;
  --text-muted: #7d8590;
  --accent: #e09136;
  --accent-dim: rgba(224,145,54,0.12);
  --accent-glow: rgba(224,145,54,0.25);
  --green: #3fb950;
  --blue: #79c0ff;
  --red: #f85149;
  --yellow: #d29922;
  --radius: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(14,17,23,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 2rem;
}
.nav-logo {
  font-family: 'Space Mono', monospace;
  font-size: 1.1rem; font-weight: 700;
  color: var(--text-bright);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1.75rem; list-style: none; }
.nav-links a {
  text-decoration: none; color: var(--text-muted);
  font-size: 0.85rem; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-bright); }
.nav-links a.active { color: var(--accent); }
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
  background: none; border: none; padding: 0; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 100%; height: 2px;
  background: var(--text-bright); border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-tag {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  color: var(--green);
  background: rgba(63,185,80,0.1);
  border: 1px solid rgba(63,185,80,0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 100px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* HERO (index) */
.hero {
  min-height: 90vh;
  display: flex; align-items: center;
  padding: 7rem 2rem 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -20%; right: -15%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--accent-glow), transparent 65%);
  pointer-events: none;
  filter: blur(80px);
}
.hero-inner {
  max-width: 1100px; margin: 0 auto; width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-text { position: relative; }
.hero h1 {
  font-family: 'Space Mono', monospace;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-bright);
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.hero h1 .accent { color: var(--accent); }
.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 460px;
  line-height: 1.7;
  margin-bottom: 2rem;
}
.hero-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.92rem; font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-primary svg { width: 16px; height: 16px; }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: transparent;
  color: var(--text);
  font-size: 0.92rem; font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text-bright); }
.hero-meta {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  font-family: 'Space Mono', monospace;
  color: var(--text-muted);
}
.hero-meta span { color: var(--green); }

/* HERO SCREENSHOT */
.hero-screenshot {
  position: relative;
}
.hero-screenshot img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.hero-screenshot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  pointer-events: none;
}

/* SECTION SHARED (index) */
section { padding: 5rem 2rem; }
.container { max-width: 1100px; margin: 0 auto; }
.section-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.section-heading {
  font-family: 'Space Mono', monospace;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.section-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
}

/* FEATURES — panel layout (index) */
.features { border-top: 1px solid var(--border); }
.features-header { margin-bottom: 3rem; }
.features-panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel {
  background: var(--bg-raised);
  padding: 2rem;
}
.panel-header {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.panel-header svg {
  width: 16px; height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}
.panel-header h3 {
  font-family: 'Space Mono', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}
.panel p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* SCREENSHOTS (index) */
.screenshots { border-top: 1px solid var(--border); }
.screenshots-header { margin-bottom: 2.5rem; }
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.ss-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ss-card:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.ss-card.ss-wide { grid-column: 1 / -1; }
.ss-card img {
  width: 100%;
  display: block;
}
.ss-caption {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-family: 'Space Mono', monospace;
  color: var(--text-muted);
}
.ss-caption::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ABOUT (index) */
.about { border-top: 1px solid var(--border); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
  margin-top: 2.5rem;
}
.about-prose p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
}
.about-sig {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 2rem;
}
.about-stats {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.stat-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.stat-value {
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-bright);
}

/* CHANGELOG — shared list style, page-scoped item styles */
.cl-list { list-style: none; }

.changelog .cl-item {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.changelog .cl-item:last-child { border-bottom: none; }

.changelog-body .cl-item {
  display: flex; align-items: baseline; gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1.55;
}
.changelog-body .cl-item:last-child { border-bottom: none; }

/* CHANGELOG (index) */
.changelog { border-top: 1px solid var(--border); }
.changelog-header { margin-bottom: 2rem; }
.cl-tag {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
  min-width: 50px;
  text-align: center;
}
.cl-tag.new { color: var(--green); background: rgba(63,185,80,0.1); border: 1px solid rgba(63,185,80,0.2); }
.cl-tag.improved { color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(224,145,54,0.2); }
.cl-tag.fixed { color: #79c0ff; background: rgba(121,192,255,0.08); border: 1px solid rgba(121,192,255,0.15); }

/* DOWNLOAD CTA (index) */
.download-cta {
  border-top: 1px solid var(--border);
  padding: 6rem 2rem;
}
.dl-box {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.dl-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.dl-box .section-heading { margin-bottom: 0.75rem; }
.dl-box p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}
.dl-box .btn-primary { font-size: 1rem; padding: 0.85rem 2.25rem; }
.dl-note {
  margin-top: 1.25rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* LAYOUT (download) */
.page { max-width: 820px; margin: 0 auto; padding: 6rem 2rem 4rem; }

.page-header { margin-bottom: 3rem; }
.page-header h1 {
  font-family: 'Space Mono', monospace;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.page-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* DOWNLOAD CARD (download) */
.dl-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
  position: relative;
}
.dl-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
}
.dl-card-body {
  padding: 2rem;
}
.dl-card-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dl-version {
  display: flex; align-items: center; gap: 0.75rem;
}
.dl-version h2 {
  font-family: 'Space Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-bright);
}
.dl-tag {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  color: var(--green);
  background: rgba(63,185,80,0.1);
  border: 1px solid rgba(63,185,80,0.2);
}
.dl-date {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.btn-download {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem; font-weight: 600;
  padding: 0.8rem 2rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-bottom: 1.25rem;
}
.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-download svg { width: 18px; height: 18px; }
.dl-filename {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* WARNING CALLOUT (download) */
.callout {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.callout svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.callout.warn {
  background: rgba(210,153,34,0.08);
  border: 1px solid rgba(210,153,34,0.2);
  color: var(--text);
}
.callout.warn svg { color: var(--yellow); }
.callout.info {
  background: rgba(121,192,255,0.06);
  border: 1px solid rgba(121,192,255,0.12);
  color: var(--text);
}
.callout.info svg { color: var(--blue); }
.callout a { color: var(--accent); text-decoration: none; }
.callout a:hover { text-decoration: underline; }

/* REGISTRATION CARD (download) */
.reg-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}
.reg-card::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.reg-card-body { padding: 2rem; }
.reg-card h3 {
  font-family: 'Space Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}
.reg-card > .reg-card-body > p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.65;
}
.reg-fields {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.reg-row {
  display: flex; align-items: center;
  padding: 0.75rem 1.25rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.82rem;
}
.reg-row + .reg-row { border-top: 1px solid var(--border); }
.reg-label {
  color: var(--text-muted);
  min-width: 70px;
  flex-shrink: 0;
}
.reg-value {
  color: var(--green);
  word-break: break-all;
  user-select: all;
  cursor: text;
}

/* REQUIREMENTS (download) */
.req-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
  padding: 2rem;
}
.req-card h3 {
  font-family: 'Space Mono', monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 1.25rem;
}
.req-table {
  width: 100%;
  border-collapse: collapse;
}
.req-table td {
  padding: 0.6rem 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.req-table tr:last-child td { border-bottom: none; }
.req-table td:first-child {
  color: var(--text-muted);
  width: 130px;
  font-weight: 500;
  padding-right: 1.5rem;
}
.req-table td:last-child { color: var(--text); }
.req-table a {
  color: var(--accent);
  text-decoration: none;
}
.req-table a:hover { text-decoration: underline; }

/* CHANGELOG SECTION (download) */
.changelog-section {
  margin-bottom: 2rem;
}
.changelog-toggle {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  color: var(--text-bright);
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  transition: border-color 0.2s;
}
.changelog-toggle:hover { border-color: rgba(255,255,255,0.12); }
.changelog-toggle svg {
  width: 18px; height: 18px;
  color: var(--text-muted);
  transition: transform 0.3s;
}
.changelog-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.changelog-toggle[aria-expanded="true"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}
.changelog-body {
  display: none;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-top: none;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  padding: 0.5rem 2rem 1.5rem;
  max-height: 600px;
  overflow-y: auto;
}
.changelog-body.open { display: block; }
.changelog-body::-webkit-scrollbar { width: 6px; }
.changelog-body::-webkit-scrollbar-track { background: transparent; }
.changelog-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.cl-dot {
  width: 5px; height: 5px;
  background: var(--text-muted);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.45rem;
}
.cl-dot.new { background: var(--green); }
.cl-dot.fix { background: var(--blue); }
.cl-dot.change { background: var(--accent); }

.prev-notes {
  margin-top: 1rem;
  text-align: center;
}
.prev-notes a {
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
}
.prev-notes a:hover { text-decoration: underline; }

/* ARTICLE / PROSE (releasenotes) */
.article { line-height: 1.7; }
.article h2 {
  font-family: 'Space Mono', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-bright);
  text-align: center;
  margin-bottom: 1.5rem;
}
.article p {
  color: var(--text);
  font-size: 0.9rem;
  margin: 0.5rem 0 0.75rem;
}
.article ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}
.article li {
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 0.35rem;
}
.article strong { color: var(--text-bright); }
.article a { color: var(--accent); text-decoration: none; }
.article a:hover { text-decoration: underline; }

.article .changelog-section { margin-bottom: 0.6rem; }
.article .changelog-section:last-child { margin-bottom: 0; }
.article .changelog-toggle { padding: 0.9rem 1.5rem; font-size: 0.85rem; }
.article .changelog-body { padding: 0.25rem 1.5rem 1.25rem; }
.article .changelog-body p:first-child { margin-top: 0.75rem; }

/* STORIES — cover grid (stories.htm) */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.story-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.story-card:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}
.story-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  margin-top: 2rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
}
footer p { font-size: 0.8rem; color: var(--text-muted); }
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a { color: var(--text-muted); font-size: 0.8rem; }
.footer-links a:hover { color: var(--text-bright); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .features-panels { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 2rem 1rem;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 0.75rem 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero { min-height: auto; padding-top: 6rem; }
  .features-panels { grid-template-columns: 1fr; }
  .screenshots-grid { grid-template-columns: 1fr; }
  .ss-card.ss-wide { grid-column: auto; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  section { padding: 3.5rem 1.5rem; }

  .page { padding: 5rem 1.25rem 3rem; }
  .dl-card-header { flex-direction: column; align-items: flex-start; }
  .reg-row { flex-direction: column; gap: 0.25rem; }
  .req-table td:first-child { width: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
