  :root {
    --accent: #3b82f6;
    --accent-dark: #2563eb;
    --accent-light: #60a5fa;
    --bg: #ffffff;
    --bg-alt: #f5f7fb;
    --text: #12151a;
    --text-secondary: #545c6b;
    --text-tertiary: #8891a1;
    --border: #e5e9f0;
    --radius: 14px;
    --max-width: 1100px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  a { color: inherit; text-decoration: none; }
  img, svg { display: block; max-width: 100%; }
  .wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

  /* Header */
  header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.85);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .nav {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
  }
  .brand {
    display: flex; align-items: center; gap: 8px;
    font-weight: 800; font-size: 20px; letter-spacing: -0.02em;
  }
  .brand .mark {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; color: #fff;
  }
  .nav-links { display: flex; gap: 28px; font-size: 15px; font-weight: 500; color: var(--text-secondary); }
  .nav-links a:hover { color: var(--text); }
  .nav-cta { display: flex; gap: 10px; align-items: center; }
  .btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 999px;
    font-weight: 600; font-size: 15px;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    white-space: nowrap;
  }
  .btn-primary { background: var(--accent); color: #fff; }
  .btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(59,130,246,.35); }
  .btn-ghost { background: var(--bg-alt); color: var(--text); }
  .btn-ghost:hover { background: var(--border); }
  .btn-lg { padding: 15px 28px; font-size: 16px; }
  .menu-toggle { display: none; }

  /* Hero */
  .hero {
    padding: 96px 0 72px;
    text-align: center;
    background:
      radial-gradient(60% 50% at 50% 0%, rgba(59,130,246,.10), transparent 70%);
  }
  .hero h1 {
    font-size: clamp(38px, 6vw, 68px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.06;
    margin-bottom: 20px;
  }
  .hero h1 span {
    background: linear-gradient(100deg, var(--accent-dark), var(--accent-light));
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .hero p {
    font-size: 19px;
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto 36px;
  }
  .hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
  .hero-note { font-size: 13px; color: var(--text-tertiary); }
  .hero-note a { color: var(--accent); font-weight: 600; }

  /* Device mock */
  .device-strip {
    margin-top: 64px;
    display: flex; justify-content: center; gap: 20px;
  }
  .device {
    width: 220px; height: 400px;
    border-radius: 30px;
    background: linear-gradient(160deg, #eef2f9, #fff);
    border: 1px solid var(--border);
    box-shadow: 0 30px 60px -20px rgba(20,30,60,.25);
    padding: 16px;
    display: flex; flex-direction: column; gap: 8px;
  }
  .device .bubble { border-radius: 14px; padding: 10px 14px; font-size: 13px; max-width: 78%; }
  .device .bubble.in { background: #eef1f6; align-self: flex-start; }
  .device .bubble.out { background: var(--accent); color: #fff; align-self: flex-end; }
  .device .dim { color: var(--text-tertiary); font-size: 11px; align-self: center; margin: 6px 0; }
  .device-browser { width: 300px; height: 220px; align-self: center; padding: 0; overflow: hidden; }
  .browser-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .browser-bar span { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
  .browser-url { margin-left: 8px; font-size: 11px; color: var(--text-tertiary); background: var(--bg-alt); border-radius: 999px; padding: 3px 10px; flex: 1; }
  .device-browser .bubble, .device-browser .dim { margin: 0 16px; }
  .device-browser .bubble:first-of-type { margin-top: 16px; }

  /* About blurb (mirrors telegram.org's short "cloud-based messaging app" pitch) */
  .about-band { padding: 0 0 88px; text-align: center; }
  .about-band p { max-width: 680px; margin: 0 auto; font-size: 17px; color: var(--text-secondary); }
  .about-band strong { color: var(--text); }

  /* Sections */
  section { padding: 88px 0; }
  .section-alt { background: var(--bg-alt); }
  .section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
  .section-head .kicker {
    display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
  }
  .section-head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; }
  .section-head p { color: var(--text-secondary); font-size: 17px; }

  /* Features grid */
  .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }
  .feature {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
  }
  .feature .icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: rgba(59,130,246,.12); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 21px; margin-bottom: 18px;
  }
  .feature h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
  .feature p { font-size: 14.5px; color: var(--text-secondary); }

  /* Original, hand-drawn animated feature icons (SVG + CSS only, not sourced from
     any third party) - each loops indefinitely at a slow, subtle pace. */
  .icon-anim svg { width: 24px; height: 24px; overflow: visible; }

  .ico-simple .dot { animation: iconDotPulse 1.4s ease-in-out infinite; }
  .ico-simple .d1 { animation-delay: 0s; }
  .ico-simple .d2 { animation-delay: .18s; }
  .ico-simple .d3 { animation-delay: .36s; }
  @keyframes iconDotPulse { 0%,60%,100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-1.5px); } }

  .ico-private .shackle { transform-origin: 12px 11px; animation: iconLock 2.6s ease-in-out infinite; }
  @keyframes iconLock { 0%,70%,100% { transform: rotate(0deg); } 35% { transform: rotate(-8deg) translateX(-1px); } }

  .ico-sync .spin { transform-origin: 12px 12px; animation: iconSpin 3.2s linear infinite; }
  @keyframes iconSpin { to { transform: rotate(360deg); } }

  .ico-fast .bolt { transform-origin: 12px 12px; animation: iconBolt 1.6s ease-in-out infinite; }
  @keyframes iconBolt { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.14); opacity: .75; } }

  .ico-power .bar { animation: iconBar 1.8s ease-in-out infinite; transform-origin: bottom; }
  .ico-power .b1 { animation-delay: .3s; }
  .ico-power .b2 { animation-delay: .1s; }
  .ico-power .b3 { animation-delay: 0s; }
  @keyframes iconBar { 0%,100% { transform: scaleY(.55); } 50% { transform: scaleY(1); } }

  .ico-open .ring { transform-origin: 12px 12px; animation: iconRing 3s ease-in-out infinite; }
  @keyframes iconRing { 0%,100% { stroke-dashoffset: 0; transform: rotate(0deg); } 50% { stroke-dashoffset: 22; transform: rotate(180deg); } }

  .ico-secure .check { stroke-dasharray: 12; animation: iconCheck 2.4s ease-in-out infinite; }
  @keyframes iconCheck { 0%,20% { stroke-dashoffset: 12; opacity: 0; } 45%,80% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }

  .ico-social .p { animation: iconBounce 1.8s ease-in-out infinite; }
  .ico-social .p1 { animation-delay: 0s; }
  .ico-social .p2 { animation-delay: .2s; }
  .ico-social .p3 { animation-delay: .4s; }
  @keyframes iconBounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-2px); } }

  .ico-expressive .sw { animation: iconSwatch 2.4s ease-in-out infinite; }
  .ico-expressive .sw1 { animation-delay: 0s; }
  .ico-expressive .sw2 { animation-delay: .3s; }
  .ico-expressive .sw3 { animation-delay: .6s; }
  .ico-expressive .sw4 { animation-delay: .9s; }
  @keyframes iconSwatch { 0%,100% { opacity: .4; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }

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

  /* Stats */
  .stats { display: flex; justify-content: center; gap: 64px; flex-wrap: wrap; text-align: center; }
  .stat b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
  .stat span { color: var(--text-tertiary); font-size: 14px; }

  /* Download */
  .download-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .dl-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 32px; background: #fff;
    display: flex; flex-direction: column; gap: 14px;
  }
  .dl-card .icon { font-size: 30px; }
  .dl-card h3 { font-size: 20px; font-weight: 700; }
  .dl-card p { color: var(--text-secondary); font-size: 14.5px; flex: 1; }

  /* FAQ */
  .faq { max-width: 760px; margin: 0 auto; }
  .faq-item { border-bottom: 1px solid var(--border); padding: 22px 0; }
  .faq-item summary {
    cursor: pointer; font-weight: 700; font-size: 16.5px;
    list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  }
  .faq-item summary::-webkit-details-marker { display: none; }
  .faq-item summary::after { content: "+"; font-size: 22px; color: var(--text-tertiary); font-weight: 400; flex-shrink: 0; }
  .faq-item[open] summary::after { content: "−"; }
  .faq-item p { color: var(--text-secondary); margin-top: 12px; font-size: 15px; }

  /* CTA band */
  .cta-band {
    text-align: center; border-radius: 28px;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent-light));
    color: #fff; padding: 72px 32px;
  }
  .cta-band h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; margin-bottom: 14px; }
  .cta-band p { opacity: .92; margin-bottom: 32px; font-size: 16.5px; }
  .cta-band .btn-primary { background: #fff; color: var(--accent-dark); }
  .cta-band .btn-primary:hover { background: #f0f4ff; box-shadow: 0 8px 20px rgba(0,0,0,.2); }

  /* Footer */
  footer { border-top: 1px solid var(--border); padding: 64px 0 32px; }
  .footer-grid {
    display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px;
    margin-bottom: 48px;
  }
  .footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); margin-bottom: 16px; }
  .footer-col a, .footer-col p { display: block; font-size: 14.5px; color: var(--text-secondary); margin-bottom: 10px; }
  .footer-col a:hover { color: var(--accent); }
  .footer-brand .brand { margin-bottom: 12px; }
  .footer-brand p { color: var(--text-tertiary); font-size: 14px; max-width: 260px; }
  .footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid var(--border); padding-top: 24px;
    font-size: 13px; color: var(--text-tertiary); flex-wrap: wrap; gap: 12px;
  }

  @media (max-width: 860px) {
    .nav-links { display: none; }
    .grid { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .device-strip { display: none; }
    .download-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 560px) {
    .grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .stats { gap: 32px; }
    section { padding: 64px 0; }
  }

/* Content pages (FAQ/Apps/Safety/Privacy/Terms) */
.page-hero { padding: 64px 0 24px; text-align: center; }
.page-hero .kicker {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.page-hero h1 { font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; }
.page-hero p { color: var(--text-secondary); font-size: 17px; max-width: 620px; margin: 0 auto; }
.article { max-width: 760px; margin: 0 auto; padding: 24px 0 96px; }
.article h2 { font-size: 24px; font-weight: 800; margin: 40px 0 14px; letter-spacing: -0.01em; }
.article h2:first-child { margin-top: 0; }
.article p { color: var(--text-secondary); font-size: 16px; margin-bottom: 14px; }
.article ul, .article ol { color: var(--text-secondary); font-size: 16px; margin: 0 0 14px 22px; }
.article li { margin-bottom: 6px; }
.article strong { color: var(--text); }
.breadcrumb { font-size: 14px; color: var(--text-tertiary); margin-bottom: 8px; }
.breadcrumb a { color: var(--accent); font-weight: 600; }

/* Standalone document pages (FAQ/Privacy/Terms/Features) - deliberately NOT the marketing
   homepage's header/footer chrome, matching how real telegram.org/faq or /privacy read as
   plain reference documents rather than a landing page. */
.doc-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 50; }
.doc-header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.doc-nav { display: flex; gap: 20px; font-size: 14px; font-weight: 500; color: var(--text-secondary); flex-wrap: wrap; }
.doc-nav a:hover { color: var(--accent); }
.doc-nav a.current { color: var(--accent); font-weight: 700; }
.doc-hero { padding: 40px 0 8px; }
.doc-hero .kicker {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 10px;
}
.doc-hero h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.doc-hero p { color: var(--text-secondary); font-size: 16px; max-width: 640px; }
.doc-toc { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0 8px; }
.doc-toc h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-tertiary); margin-bottom: 10px; font-weight: 700; }
.doc-toc ul { columns: 2; column-gap: 28px; list-style: none; margin: 0; padding: 0; }
.doc-toc li { margin-bottom: 6px; break-inside: avoid; font-size: 14.5px; }
.doc-toc a { color: var(--accent); font-weight: 500; }
.doc-toc a:hover { text-decoration: underline; }
.doc-body { max-width: 780px; margin: 0 auto; padding: 24px 0 80px; }
.doc-body h2 { font-size: 22px; font-weight: 800; margin: 44px 0 6px; letter-spacing: -0.01em; scroll-margin-top: 72px; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { font-size: 16px; font-weight: 700; margin: 26px 0 4px; color: var(--text-secondary); scroll-margin-top: 72px; }
.doc-body p { color: var(--text-secondary); font-size: 15.5px; margin-bottom: 12px; }
.doc-body ul, .doc-body ol { color: var(--text-secondary); font-size: 15.5px; margin: 0 0 12px 22px; }
.doc-body li { margin-bottom: 5px; }
.doc-body strong { color: var(--text); }
.doc-body a { color: var(--accent); font-weight: 600; }
.doc-body a:hover { text-decoration: underline; }
.doc-changelog { font-size: 14px; color: var(--text-tertiary); }
.doc-changelog b { color: var(--text-secondary); }
.doc-qa { border-bottom: 1px solid var(--border); padding: 18px 0; scroll-margin-top: 72px; }
.doc-qa summary {
  cursor: pointer; font-weight: 700; font-size: 15.5px; color: var(--text);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.doc-qa summary::-webkit-details-marker { display: none; }
.doc-qa summary::after { content: "+"; font-size: 20px; color: var(--text-tertiary); font-weight: 400; flex-shrink: 0; }
.doc-qa[open] summary::after { content: "\2212"; }
.doc-qa p, .doc-qa ul { color: var(--text-secondary); margin-top: 10px; font-size: 15px; }
.doc-footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: 24px; }
.doc-footer .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--text-tertiary); }
.doc-footer a { color: var(--accent); font-weight: 600; }
@media (max-width: 700px) {
  .doc-nav { display: none; }
  .doc-toc ul { columns: 1; }
}
