/* ==========================================================================
   Mark — Pure Black & White Minimalist Design (Dark by Default)
   Seamless black background, zero-border hero image, scroll reveal animations,
   and mobile-optimized documentation layout with generous breathing room.
   ========================================================================== */

:root {
  --bg: #000000;
  --bg-subtle: #0d0d0d;
  --bg-card: #0a0a0a;
  --bg-hover: #141414;
  
  --text-primary: #ffffff;
  --text-secondary: #a3a3a3;
  --text-muted: #666666;
  
  --border: #222222;
  --border-hover: #ffffff;
  
  --accent-active: #ffffff;
  --accent-active-text: #000000;
  
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 12px 30px -10px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 24px 50px -15px rgba(0, 0, 0, 0.9);
  
  --container: 960px;
  --container-wide: 1140px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: #000000;
  color-scheme: dark;
}

body {
  font-family: var(--font);
  background-color: #000000;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.015em;
  overflow-x: hidden;
  width: 100%;
}

::selection {
  background: #ffffff;
  color: #000000;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* Containers */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
  width: 100%;
}

.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 28px;
  width: 100%;
}

.container-narrow {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 28px;
  width: 100%;
}

/* Header & Nav */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 100%;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.nav-brand:hover {
  opacity: 0.8;
}

.nav-brand img {
  height: 28px;
  width: 28px;
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

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

.nav-links a:hover, .nav-links a.active {
  color: #ffffff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-nav {
  background: #ffffff;
  color: #000000;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: #111111;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
}

.badge:hover {
  border-color: #555555;
  color: #ffffff;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Typography & Visual Hierarchy */
.title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
  color: #ffffff;
}

.subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 640px;
}

.subtitle strong {
  color: #ffffff;
}

.section-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
  margin-bottom: 10px;
  color: #ffffff;
}

.section-intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  max-width: 580px;
}

/* Buttons & CTAs */
.btn-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  font-size: 0.94rem;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
}

.btn-primary {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.btn-primary:hover {
  background: #e5e5e5;
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(255, 255, 255, 0.15);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #0d0d0d;
  color: #ffffff;
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #181818;
  border-color: #555555;
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  padding: 60px 0 50px;
}

.hero-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.hero-header {
  margin-bottom: 28px;
}

/* Pure Screenshot */
.hero-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 48px auto 0;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  transform: none !important;
}

/* Features Grid */
.features-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease, background-color 0.28s ease;
  position: relative;
}

.feature-box:hover {
  transform: translateY(-4px);
  border-color: #ffffff;
  box-shadow: var(--shadow-md);
  background: var(--bg-hover);
}

.feature-box h3 {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}

.feature-box p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.6;
}

.feature-box p strong {
  color: #ffffff;
  font-weight: 600;
}

/* The Story Section */
.story-section {
  padding: 70px 0;
  border-top: 1px solid var(--border);
  background: #050505;
}

.story-content {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.story-content:hover {
  border-color: #555555;
  box-shadow: var(--shadow-md);
}

.story-text {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.story-text p {
  margin-bottom: 14px;
}

.story-text p strong {
  color: #ffffff;
  font-weight: 600;
}

.story-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.story-author-name {
  font-weight: 700;
  color: #ffffff;
}

.story-author-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Download Section */
.download-section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 36px;
}

.download-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.download-card:hover {
  transform: translateY(-5px);
  border-color: #ffffff;
  box-shadow: var(--shadow-lg);
}

.download-card.recommended {
  border: 2px solid #ffffff;
  background: #0e0e0e;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.08);
}

.download-rec-badge {
  position: absolute;
  top: -12px;
  right: 18px;
  background: #ffffff;
  color: #000000;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.download-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.download-os-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: #161616;
  border: 1px solid var(--border);
}

.download-os-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.download-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.download-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.download-btn {
  margin-top: auto;
  width: 100%;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  gap: 10px;
}

.download-footer-links {
  margin-top: 36px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.download-footer-links a {
  text-decoration: underline;
  color: #ffffff;
  font-weight: 500;
}

/* Documentation Page Styles (docs.html) */
.docs-page {
  padding: 40px 0 80px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  margin-top: 30px;
}

.docs-sidebar {
  position: sticky;
  top: 84px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 10px;
}

.docs-menu-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 12px;
}

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

.docs-menu li {
  margin-bottom: 4px;
}

/* Mobile Quick Navigation Chips (Visible only on mobile) */
.mobile-docs-nav {
  display: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  gap: 8px;
  padding: 10px 0 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.mobile-docs-nav::-webkit-scrollbar {
  display: none;
}

.mobile-doc-chip {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  scroll-snap-align: start;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.mobile-doc-chip:active {
  background: #ffffff;
  color: #000000;
}

/* Illuminated Active State for Docs Menu */
.docs-menu a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 2px solid transparent;
  font-weight: 500;
}

.docs-menu a:hover {
  color: #ffffff;
  background: var(--bg-hover);
}

.docs-menu a.active {
  color: #000000 !important;
  background: #ffffff !important;
  font-weight: 700 !important;
  border-left-color: #ffffff !important;
  box-shadow: var(--shadow-sm);
  transform: translateX(3px);
}

.docs-main {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
  width: 100%;
}

.doc-section {
  scroll-margin-top: 90px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 36px;
  width: 100%;
}

.doc-section:last-child {
  border-bottom: none;
}

.doc-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  color: #ffffff;
}

.doc-section p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 16px;
}

.doc-kbd {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: #161616;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  color: #ffffff;
  font-weight: 600;
}

.code-snippet {
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.55;
  color: #f0f0f0;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.doc-note {
  background: #111111;
  border-left: 3px solid #ffffff;
  padding: 14px 18px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.6;
}

.doc-note strong {
  color: #ffffff;
}

/* Shortcuts Table */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-width: 100%;
  margin-top: 14px;
}

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

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

th {
  background: #111111;
  font-weight: 700;
  color: #ffffff;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: #000000;
  width: 100%;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   Scroll Reveal Fade-Up Animations
   -------------------------------------------------------------------------- */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Delay Helpers */
.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.16s; }
.delay-3 { transition-delay: 0.24s; }
.delay-4 { transition-delay: 0.32s; }

/* --------------------------------------------------------------------------
   Responsive Mobile Enhancements (Generous Margins & Clean Spacing)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .container, .container-wide, .container-narrow {
    padding: 0 20px;
  }
  
  .title { font-size: 2.1rem; }
  .subtitle { font-size: 1.05rem; }
  .section-title { font-size: 1.7rem; }
  
  /* On mobile: Hide optional links, keep ONLY Docs & GitHub */
  .nav-item-optional {
    display: none !important;
  }
  
  .nav-links {
    gap: 16px;
  }

  .nav-actions {
    display: none;
  }
  
  .features-grid { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  
  /* Documentation Page Mobile Enhancements */
  .docs-page {
    padding: 28px 0 60px;
  }
  
  .docs-layout {
    grid-template-columns: 100%;
    gap: 24px;
    margin-top: 16px;
  }
  
  .docs-sidebar {
    display: none;
  }
  
  .mobile-docs-nav {
    display: flex;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 4px;
  }
  
  .docs-main {
    gap: 36px;
    width: 100%;
  }
  
  .doc-section {
    scroll-margin-top: 80px;
    padding-bottom: 32px;
  }
  
  .doc-section h2 {
    font-size: 1.3rem;
    line-height: 1.3;
    gap: 10px;
  }
  
  .doc-section p {
    font-size: 0.94rem;
    line-height: 1.65;
  }
  
  .code-snippet {
    font-size: 0.82rem;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
  }
  
  .doc-note {
    padding: 12px 14px;
    font-size: 0.86rem;
  }
  
  table th, table td {
    padding: 10px 14px;
    font-size: 0.84rem;
  }
  
  .story-content { padding: 24px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 480px) {
  .container, .container-wide, .container-narrow {
    padding: 0 18px;
  }
  
  .title { font-size: 1.85rem; }
  .doc-section h2 { font-size: 1.2rem; }
}