/* smplOS Website - Dark theme, no frameworks */

/* ---- Reset & base ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:        #0a0a0f;
  --bg-card:   #12121a;
  --bg-hover:  #1a1a26;
  --border:    #1e1e2e;
  --text:      #cdd6f4;
  --text-dim:  #6c7086;
  --accent:    #89b4fa;
  --accent2:   #a6e3a1;
  --white:     #ffffff;
  --radius:    12px;
  --max-w:     1120px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

code {
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "JetBrains Mono", "Fira Code", monospace;
}

img { max-width: 100%; height: auto; display: block; }

/* ---- Nav ---- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img { height: 32px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.btn-nav {
  background: var(--accent) !important;
  color: var(--bg) !important;
  padding: 6px 16px;
  border-radius: 6px;
  font-weight: 600 !important;
}

.btn-nav:hover { opacity: 0.9; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  border-color: var(--text-dim);
  background: var(--bg-card);
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.1rem;
}

/* ---- Sections ---- */
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 100px 0; }

section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--white);
}

.section-sub {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 48px;
}

/* ---- Story ---- */
.story {
  padding: 100px 0 0;
}

.story-content {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.story-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
}

.story-content p {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.8;
}

.story-content a {
  color: var(--accent);
}

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

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 64px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ---- Features ---- */
.features { background: var(--bg-card); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color 0.2s;
}

.feature-card:hover { border-color: var(--accent); }

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--accent);
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---- Rust Apps ---- */
.apps { background: var(--bg-card); }

.app-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.app-card {
  display: flex;
  gap: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.app-card:hover { border-color: var(--accent); }

.app-card a {
  flex: 0 0 55%;
  display: block;
}

.app-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-info {
  padding: 32px 32px 32px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-info h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 10px;
}

.app-info p {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .app-card {
    flex-direction: column;
  }

  .app-card a { flex: none; }

  .app-info {
    padding: 20px;
  }
}

/* ---- Screenshots ---- */
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.screenshot-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
  text-decoration: none !important;
}

.screenshot-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.screenshot-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.screenshot-card span {
  display: block;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text-dim);
  background: var(--bg-card);
}

/* ---- Editions ---- */
.editions { background: var(--bg-card); }

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

.edition-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s;
}

.edition-card:hover { border-color: var(--accent); }

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

.edition-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---- Keybindings ---- */
.kb-table-wrap {
  max-width: 500px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

table td:first-child {
  white-space: nowrap;
  padding-right: 32px;
}

kbd {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--white);
}

/* ---- Download ---- */
.download { background: var(--bg-card); }

.download-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.download-info h3 {
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 6px;
}

.download-info p {
  color: var(--text-dim);
  margin-bottom: 16px;
}

.download-details {
  list-style: none;
  padding: 0;
}

.download-details li {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 3px 0;
}

.download-details li::before {
  content: "\2713 ";
  color: var(--accent2);
  font-weight: 700;
}

.download-actions {
  text-align: center;
  flex-shrink: 0;
}

.download-hash {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.download-note {
  margin-top: 24px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.download-note p {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.download-note code {
  font-size: 0.85rem;
}

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

footer p {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 24px;
}

.footer-links a {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-links a:hover { color: var(--text); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-links a:not(.btn-nav) { display: none; }

  .hero { padding: 120px 0 80px; }

  .hero-stats { gap: 24px; }

  .stat-value { font-size: 1.2rem; }

  .feature-grid { grid-template-columns: 1fr; }

  .screenshot-grid { grid-template-columns: 1fr 1fr; }

  .download-card {
    flex-direction: column;
    text-align: center;
  }

  .download-details { text-align: left; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2rem; }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .screenshot-grid { grid-template-columns: 1fr; }

  .edition-grid { grid-template-columns: 1fr 1fr; }

  .hero-stats {
    flex-direction: column;
    gap: 16px;
  }
}

/* ---- Org badge ---- */
.org-badge {
  display: inline-block;
  background: rgba(137, 180, 250, 0.12);
  color: var(--accent);
  border: 1px solid rgba(137, 180, 250, 0.3);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* ---- Repos section ---- */
.repos { background: var(--bg-card); }

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.repo-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s;
}

.repo-card:hover { border-color: var(--accent); }

/* skeleton shimmer */
.repo-card.skeleton {
  height: 220px;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    var(--bg-hover) 50%,
    var(--bg-card) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.repo-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.repo-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.repo-icon { color: var(--text-dim); flex-shrink: 0; }

.repo-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.repo-name:hover { text-decoration: underline; }

.repo-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.repo-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.repo-stat svg { flex-shrink: 0; }

.repo-lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.repo-lang-label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.repo-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
  flex: 1;
}

.repo-heatmap {
  overflow: hidden;
  border-radius: 4px;
  line-height: 0;
}

.repo-heatmap svg { display: block; width: 100%; height: auto; }

.repo-heatmap-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
  letter-spacing: 0.03em;
}

/* ---- About section ---- */
.about { background: var(--bg); }

.about-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 64px;
  align-items: start;
}

.about-text h2 { margin-bottom: 24px; }

.about-text p {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-text p strong { color: var(--text); }

.about-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.about-links a {
  font-size: 0.9rem;
  font-weight: 500;
}

.about-side {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 8px;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.edition-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.edition-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.edition-row strong {
  color: var(--text);
  flex-shrink: 0;
  min-width: 110px;
}

.edition-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

/* ---- Responsive additions ---- */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
}

@media (max-width: 600px) {
  .repo-grid { grid-template-columns: 1fr; }
}
