/* ==========================================================================
   BEYOND PIXELS — ACCESSIBLE DESIGN SYSTEM & CORE STYLESHEET
   WCAG 2.1 AA/AAA Compliant | Semantic | Responsive | Theme-Aware
   ========================================================================== */

:root {
  /* Dark Theme (Default) */
  --bg: #090d16;
  --bg-subtle: #0d1322;
  --surface: #131a29;
  --surface-hover: #1a2336;
  --surface-elevated: #1f2a40;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: #1e293b;
  --border-light: rgba(255, 255, 255, 0.1);
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-subtle: rgba(59, 130, 246, 0.12);
  --accent-glow: rgba(59, 130, 246, 0.3);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --focus-ring: #60a5fa;
  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border);
  --hero-gradient: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.18), transparent 70%);

  /* Compatibility & Semantic Aliases */
  --surface-2: #162032;
  --line: #1e293b;
  --blue: #3b82f6;
  --cyan: #38bdf8;
  --coral: #f87171;
  --card-bg: var(--surface);
  --text-color: var(--text);
  --border-color: var(--border);
}

/* Light Theme Overrides */
html[data-theme="light"] {
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --surface: #ffffff;
  --surface-hover: #f8fafc;
  --surface-elevated: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --border: #e2e8f0;
  --border-light: rgba(0, 0, 0, 0.08);
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: rgba(37, 99, 235, 0.08);
  --accent-glow: rgba(37, 99, 235, 0.2);
  --focus-ring: #2563eb;
  --card-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 0 0 1px var(--border);
  --hero-gradient: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08), transparent 70%);

  /* Compatibility & Semantic Aliases (Light) */
  --surface-2: #f1f5f9;
  --line: #cbd5e1;
  --blue: #2563eb;
  --cyan: #0284c7;
  --coral: #dc2626;
  --card-bg: var(--surface);
  --text-color: var(--text);
  --border-color: var(--border);
}

@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) {
    --bg: #f8fafc;
    --bg-subtle: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --surface-elevated: #ffffff;
    --text: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    --border: #e2e8f0;
    --border-light: rgba(0, 0, 0, 0.08);
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-subtle: rgba(37, 99, 235, 0.08);
    --accent-glow: rgba(37, 99, 235, 0.2);
    --focus-ring: #2563eb;
    --card-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 0 0 1px var(--border);
    --hero-gradient: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08), transparent 70%);
  }
}

/* ==========================================================================
   RESET & ACCESSIBILITY BASE
   ========================================================================== */

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

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image: var(--hero-gradient);
  background-repeat: no-repeat;
  background-position: top center;
  color: var(--text);
}

/* Skip to content link (Keyboard Accessibility) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent);
  color: #ffffff;
  padding: 12px 20px;
  min-height: 48px;
  min-width: 48px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  z-index: 9999;
  transition: top 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  touch-action: manipulation;
}

.skip-link:focus {
  top: 16px;
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

/* Visible Focus Indicator */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Container */
.container,
.site-header,
main,
footer {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

.site-header {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  transition: background-color 0.2s ease;
}

html[data-theme="light"] .site-header {
  background: rgba(248, 250, 252, 0.88);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  touch-action: manipulation;
}

.brand img {
  border-radius: 10px;
  display: block;
  aspect-ratio: 1 / 1;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  min-height: 48px;
  min-width: 48px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  touch-action: manipulation;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-hover);
}

.nav-links a[aria-current="page"] {
  font-weight: 600;
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
  touch-action: manipulation;
}

.theme-toggle-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--text-muted);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ==========================================================================
   BUTTONS & CTAs
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease;
  min-height: 48px;
  min-width: 48px;
  touch-action: manipulation;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.btn-sm {
  min-height: 48px;
  min-width: 48px;
  padding: 10px 18px;
  font-size: 0.92rem;
  border-radius: 10px;
}

.btn-play-store svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero {
  padding: 64px 0 72px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
}

.hero-copy {
  max-width: 620px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--accent-subtle);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-hover);
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 999px;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

html[data-theme="light"] .badge {
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.25);
}

.badge-live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
}

h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 20px;
}

.hero-lead {
  font-size: clamp(1.1rem, 1.8vw, 1.25rem);
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.phone-mockup {
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 6px solid #1e293b;
  border-radius: 36px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

html[data-theme="light"] .phone-mockup {
  border-color: #cbd5e1;
  box-shadow: 0 25px 50px -15px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.phone-mockup picture {
  display: block;
  width: 100%;
}

.phone-mockup img {
  width: 100%;
  height: auto;
  aspect-ratio: 640 / 1409;
  display: block;
}

/* ==========================================================================
   SECTIONS & LAYOUT
   ========================================================================== */

section {
  padding: 80px 0;
  border-top: 1px solid var(--border-light);
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 48px;
}

.eyebrow {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 14px;
}

.section-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   WHY BEYOND PIXELS & CARDS
   ========================================================================== */

.problem-statement-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  margin-bottom: 40px;
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text);
  box-shadow: var(--card-shadow);
}

.problem-statement-card p + p {
  margin-top: 16px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease;
}

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

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  font-size: 1.28rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.card p {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

/* ==========================================================================
   ACCESSIBILITY CHECKLIST SECTION
   ========================================================================== */

.a11y-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px;
  box-shadow: var(--card-shadow);
}

.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  margin-top: 32px;
}

.a11y-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.a11y-check {
  width: 28px;
  height: 28px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.a11y-check svg {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}

.a11y-item h3,
.a11y-item h4 {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.a11y-item p {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

/* ==========================================================================
   SCREENSHOTS SHOWCASE
   ========================================================================== */

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.screenshot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--card-shadow);
}

.screenshot-card figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.screenshot-card picture {
  display: block;
  width: 100%;
}

.screenshot-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 240 / 528;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: #05070b;
  display: block;
}

.screenshot-card figcaption {
  margin-top: 16px;
  padding: 0 4px;
}

.screenshot-card figcaption strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.screenshot-card figcaption span {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: block;
}

/* ==========================================================================
   STORY TEASER BANNER
   ========================================================================== */

.story-teaser-banner {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-subtle) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 56px 48px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.story-teaser-banner blockquote {
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.story-teaser-banner p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 28px;
  line-height: 1.6;
}

/* Developer & Trust Section */
.developer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 28px;
  align-items: center;
  box-shadow: var(--card-shadow);
}

.dev-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.dev-info h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.dev-info p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.dev-links {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.dev-links a {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  touch-action: manipulation;
}

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

/* ==========================================================================
   CONVERSION BANNER
   ========================================================================== */

.conversion-banner {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 64px 32px;
  box-shadow: var(--card-shadow);
}

.conversion-banner h2 {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  margin-bottom: 16px;
}

.conversion-banner p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 36px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

footer.site-footer {
  border-top: 1px solid var(--border-light);
  padding: 64px 0 40px;
  margin-top: auto;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand p {
  margin-top: 12px;
  color: var(--text-dim);
  max-width: 300px;
  line-height: 1.5;
}

.footer-col h3,
.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 2px;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 4px 0;
  touch-action: manipulation;
}

.footer-col a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
  gap: 16px;
}

/* ==========================================================================
   LONG-FORM ARTICLE / STORY PAGE STYLING
   ========================================================================== */

.article-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 0 96px;
}

.article-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 0;
}

/* Accessible Language Switcher */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.lang-option {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 18px;
  min-height: 48px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.2;
  touch-action: manipulation;
}

.lang-option:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.lang-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-option.is-active,
.lang-option[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
  background: var(--surface-hover);
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.lang-divider {
  color: var(--border-light);
  user-select: none;
  font-size: 0.8rem;
  line-height: 1;
}

/* Screen Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tamil Typography Polish */
html[lang="ta"] {
  line-height: 1.8;
}

html[lang="ta"] .article-content {
  font-size: 1.15rem;
  line-height: 1.85;
}

html[lang="ta"] .article-content blockquote {
  font-style: normal;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 6px 8px;
  touch-action: manipulation;
}

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

.article-header {
  margin-bottom: 40px;
}

.article-header h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}

.article-subtitle {
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
  color: var(--text-dim);
}

.article-meta strong {
  color: var(--text);
}

.article-meta .meta-dot {
  color: var(--accent);
  opacity: 0.7;
  font-size: 0.9rem;
  user-select: none;
}

/* Article Table of Contents */
.toc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 28px;
  margin: 36px 0;
}

.toc-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: 14px;
}

.toc-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-card a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 6px 0;
  gap: 8px;
  touch-action: manipulation;
}

.toc-card a:hover {
  text-decoration: underline;
}

/* Article Body Typography */
.article-content {
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--text);
}

.article-content p {
  margin-bottom: 24px;
}

.article-content h2 {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 56px;
  margin-bottom: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  letter-spacing: -0.02em;
}

.article-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 14px;
  color: var(--text);
}

.article-content ul,
.article-content ol {
  margin-bottom: 24px;
  padding-left: 28px;
}

.article-content li {
  margin-bottom: 10px;
}

.article-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  margin: 32px 0;
  background: var(--surface);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  font-size: 1.18rem;
  color: var(--text);
}

.article-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 2043 / 770;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin: 32px 0;
  display: block;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding: 12px 20px;
  min-height: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 8px;
  touch-action: manipulation;
}

.back-to-top:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* ==========================================================================
   LEGAL & DOCUMENT SHELL
   ========================================================================== */

.doc-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 0 80px;
}

.doc-hero {
  margin-bottom: 32px;
}

.doc-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.92rem;
  color: var(--text-dim);
  margin-top: 8px;
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
}

.doc-card h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.doc-card p,
.doc-card li {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.doc-card p + p {
  margin-top: 12px;
}

.doc-card ul,
.doc-card ol {
  padding-left: 24px;
  margin-top: 12px;
}

.doc-card li + li {
  margin-top: 8px;
}

.doc-card strong {
  color: var(--text);
}

.doc-card a {
  color: var(--accent);
  text-decoration: none;
}

.doc-card a:hover {
  text-decoration: underline;
}

/* Highlight Notice Box */
.highlight-card {
  background: var(--accent-subtle);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.highlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  margin-bottom: 12px;
}

/* Interactive forms */
.form-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-top: 24px;
  box-shadow: var(--card-shadow);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* Contact Intent Cards */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  gap: 16px;
}

.contact-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE-FIRST POLISH)
   ========================================================================== */

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 40px 0 56px;
    gap: 36px;
    text-align: center;
  }

  .hero-copy {
    max-width: 100%;
  }

  .cta-row {
    justify-content: center;
  }

  .three-grid,
  .screenshots-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 720px) {
  .site-header {
    flex-wrap: wrap;
    padding: 14px 20px;
    min-height: auto;
  }

  .main-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 0;
    border-top: 1px solid var(--border-light);
  }

  .nav-links {
    width: max-content;
    min-width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .nav-links a {
    padding: 10px 14px;
    min-height: 48px;
    min-width: 48px;
    font-size: 0.92rem;
    white-space: nowrap;
  }

  .a11y-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .developer-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .dev-avatar {
    margin: 0 auto;
  }

  .dev-links {
    justify-content: center;
  }

  .story-teaser-banner {
    padding: 36px 24px;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .three-grid,
  .screenshots-grid {
    grid-template-columns: 1fr;
  }

  .cta-row {
    flex-direction: column;
    width: 100%;
  }

  .cta-row .btn {
    width: 100%;
  }

  .article-shell {
    padding: 24px 0 64px;
  }

  .article-header h1 {
    font-size: 2rem;
  }

  .article-content {
    font-size: 1.05rem;
    line-height: 1.7;
  }
}

/* ==========================================================================
   LIVE DEVELOPER SUPPORT CHAT WIDGET
   ========================================================================== */
.support-chat-wrapper {
  margin-top: 28px;
  margin-bottom: 28px;
}

.chat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

.chat-header {
  padding: 18px 24px;
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.chat-agent-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chat-avatar {
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.chat-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.chat-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.chat-text-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-text-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.chat-intro-body {
  padding: 24px;
}

.chat-intro-text {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .form-row-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.label-optional {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.8rem;
}

.label-required {
  color: var(--danger);
}

.chat-input,
.chat-textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input:focus,
.chat-textarea:focus,
.chat-reply-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.chat-textarea {
  resize: vertical;
  min-height: 80px;
}

.btn-chat-submit {
  align-self: flex-start;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chat-error-msg {
  color: var(--danger);
  font-size: 0.85rem;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Chat Messages Thread */
.chat-messages-box {
  height: 380px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg);
  scroll-behavior: smooth;
}

.chat-notice {
  background: var(--accent-subtle);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.5;
  text-align: center;
  margin-bottom: 8px;
}

.chat-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
}

.chat-user-row {
  justify-content: flex-end;
}

.chat-admin-row {
  justify-content: flex-start;
}

.chat-bubble-avatar {
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.chat-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 14px;
  word-break: break-word;
}

.chat-bubble-user {
  background: var(--accent);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.chat-bubble-user .chat-bubble-author,
.chat-bubble-user .chat-bubble-time {
  color: rgba(255, 255, 255, 0.85);
}

.chat-bubble-admin {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.chat-bubble-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 0.75rem;
}

.chat-bubble-author {
  font-weight: 700;
  color: var(--text-muted);
}

.chat-bubble-time {
  color: var(--text-dim);
}

.chat-bubble-text {
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Chat Reply Input Bar */
.chat-reply-box {
  padding: 14px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.chat-reply-textarea {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: 10px;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.4;
  box-sizing: border-box;
}

.chat-send-button {
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.1s ease;
}

.chat-send-button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.chat-send-button:active:not(:disabled) {
  transform: scale(0.96);
}

.chat-send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
