/* ============================================================
   MarkLab Editor — Website Styles
   ============================================================ */

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

:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #1d1d1f;
  --color-text-secondary: #6e6e73;
  --color-accent: #0071e3;
  --color-accent-hover: #0077ed;
  --color-border: #e0e0e0;
  --color-footer-bg: #1d1d1f;
  --color-footer-text: #a1a1a6;
  --color-footer-link: #d1d1d6;
  --color-shadow: rgba(0, 0, 0, 0.08);
  --color-shadow-hover: rgba(0, 0, 0, 0.06);
  --color-nav-bg: rgba(255, 255, 255, 0.85);
  --color-nav-mobile-bg: rgba(255, 255, 255, 0.98);
  --radius: 12px;
  --max-width: 980px;
  --transition: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #111111;
    --color-surface: #1c1c1e;
    --color-text: #f5f5f7;
    --color-text-secondary: #a1a1a6;
    --color-accent: #2997ff;
    --color-accent-hover: #5ab4ff;
    --color-border: #2c2c2e;
    --color-footer-bg: #000000;
    --color-footer-text: #6e6e73;
    --color-footer-link: #a1a1a6;
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-shadow-hover: rgba(0, 0, 0, 0.4);
    --color-nav-bg: rgba(17, 17, 17, 0.85);
    --color-nav-mobile-bg: rgba(17, 17, 17, 0.98);
  }
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

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

/* --- Navigation --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
}

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

.site-nav .nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-text);
  text-decoration: none;
}

.site-nav .nav-brand:hover {
  text-decoration: none;
}

.site-nav .nav-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

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

.site-nav .nav-links a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  transition: color var(--transition);
}

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

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  color: var(--color-text);
}

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

.hero .app-icon {
  width: 128px;
  height: 128px;
  border-radius: 28px;
  margin: 0 auto 24px;
  box-shadow: 0 4px 24px var(--color-shadow);
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 540px;
  margin: 0 auto 32px;
}

.hero .app-store-badge img,
.hero .app-store-badge svg {
  height: 48px;
  transition: opacity var(--transition);
}

.hero .app-store-badge:hover img,
.hero .app-store-badge:hover svg {
  opacity: 0.85;
}

.hero .app-store-badge svg {
  height: 48px;
  width: auto;
  transition: opacity var(--transition);
}

@media (prefers-color-scheme: dark) {
  .hero .app-store-badge svg rect {
    fill: #fff;
  }
  .hero .app-store-badge svg text {
    fill: #000;
  }
  .hero .app-store-badge svg g {
    fill: #000;
  }
}

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

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

/* --- Features --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  transition: box-shadow var(--transition), transform var(--transition);
}

.feature-card:hover {
  box-shadow: 0 4px 20px var(--color-shadow-hover);
  transform: translateY(-2px);
}

.feature-card .feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* --- Screenshots --- */
.screenshots-container {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 16px;
  scroll-snap-type: x mandatory;
}

.screenshots-container .screenshot-placeholder {
  flex: 0 0 auto;
  width: 560px;
  height: 360px;
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  scroll-snap-align: start;
}

.screenshots-container img {
  flex: 0 0 auto;
  max-height: 400px;
  width: auto;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}

.screenshots-container img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 24px var(--color-shadow);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.lightbox.active img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity var(--transition);
}

.lightbox-close:hover {
  opacity: 1;
}

/* --- What's New --- */
.whats-new-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.whats-new-card .version {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.whats-new-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.whats-new-card p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

/* --- System Requirements --- */
.sys-req {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  padding: 20px 24px 60px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.sys-req strong {
  color: var(--color-text);
}

/* --- Page Content (about, contact, press kit, privacy) --- */
.page-header {
  text-align: center;
  padding: 60px 24px 20px;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
}

.page-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 24px 80px;
  font-size: 1rem;
  line-height: 1.75;
}

.page-content h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 32px 0 12px;
}

.page-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 24px 0 8px;
}

.page-content p {
  margin-bottom: 16px;
  color: var(--color-text-secondary);
}

.page-content ul, .page-content ol {
  margin: 0 0 16px 20px;
  color: var(--color-text-secondary);
}

.page-content li {
  margin-bottom: 6px;
}

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

/* --- Press Kit Downloads --- */
.press-assets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.press-asset-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.press-asset-card .asset-preview {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  border-radius: 18px;
}

.press-asset-card h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.press-asset-card p {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}

.btn-download {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background var(--transition);
}

.btn-download:hover {
  background: var(--color-accent-hover);
  color: #fff;
  text-decoration: none;
}

/* --- Footer --- */
.site-footer {
  margin-top: auto;
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 40px 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
}

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

.footer-links a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-copyright {
  font-size: 0.8rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .hero .tagline {
    font-size: 1.05rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .screenshots-container .screenshot-placeholder {
    width: 320px;
    height: 200px;
  }

  .nav-toggle {
    display: block;
  }

  .site-nav .nav-links {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-nav-mobile-bg);
    backdrop-filter: blur(20px);
    padding: 16px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
  }

  .site-nav .nav-links.open {
    display: flex;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 48px 16px 40px;
  }

  .hero .app-icon {
    width: 96px;
    height: 96px;
    border-radius: 22px;
  }

  .section {
    padding: 40px 16px;
  }
}
