  :root {
    --bg:        #0a0c12;
    --surface:   #111420;
    --surface2:  #181c2e;
    --border:    #222640;
    --red:       #e63946;
    --red-dim:   rgba(230,57,70,0.12);
    --blue:      #4895ef;
    --blue-dim:  rgba(72,149,239,0.12);
    --text:      #dde1f0;
    --muted:     #6b718f;
    --dim:       #353a54;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }

  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
  }

  /* NAV */
  nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10,12,18,0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0 clamp(1rem,5vw,3rem);
    display: flex; align-items: center; justify-content: space-between;
    height: 58px;
  }
  .nav-logo {
    font-family: 'Syne', sans-serif;
    font-weight: 800; font-size: 1rem;
    color: var(--red); letter-spacing: -0.02em;
  }
  .nav-links { display: flex; gap: 1.5rem; list-style: none; }
  .nav-links a {
    color: var(--muted); text-decoration: none;
    font-size: 0.83rem; font-weight: 500;
    transition: color 0.2s;
  }
  .nav-links a:hover { color: var(--text); }
  @media (max-width: 600px) { .nav-links { display: none; } }

  /* HERO */
  .hero {
    min-height: 88vh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    padding: clamp(3rem,10vw,6rem) clamp(1rem,5vw,3rem);
    position: relative; overflow: hidden;
  }
  .hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
      radial-gradient(ellipse 70% 45% at 30% 10%, rgba(230,57,70,0.13) 0%, transparent 65%),
      radial-gradient(ellipse 60% 40% at 75% 80%, rgba(72,149,239,0.11) 0%, transparent 60%);
    pointer-events: none;
  }
  .hero-tag {
    display: inline-block;
    background: var(--red-dim);
    border: 1px solid rgba(230,57,70,0.3);
    color: var(--red);
    font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.1em; text-transform: uppercase;
    padding: 0.3rem 1rem; border-radius: 100px;
    margin-bottom: 1.5rem;
    animation: fadeUp 0.5s ease both;
  }
  .hero h1 {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(2.4rem,7vw,5.2rem);
    line-height: 1.05; letter-spacing: -0.03em;
    max-width: 860px;
    animation: fadeUp 0.5s 0.1s ease both;
  }
  .hero h1 span { color: var(--blue); }
  .hero p {
    color: var(--muted);
    font-size: clamp(0.95rem,2vw,1.15rem);
    max-width: 540px; margin-top: 1.5rem; font-weight: 300;
    animation: fadeUp 0.5s 0.2s ease both;
  }
  .hero-cta {
    display: flex; gap: 1rem; margin-top: 2.5rem;
    flex-wrap: wrap; justify-content: center;
    animation: fadeUp 0.5s 0.3s ease both;
  }
  .btn {
    display: inline-flex; align-items: center;
    padding: 0.72rem 1.65rem;
    border-radius: 7px; font-size: 0.88rem; font-weight: 500;
    text-decoration: none; cursor: pointer; border: none;
    transition: transform 0.2s, opacity 0.2s;
  }
  .btn:hover { transform: translateY(-2px); opacity: 0.88; }
  .btn-primary  { background: var(--red);    color: #fff; }
  .btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }

  /* SECTIONS */
  main { max-width: 900px; margin: 0 auto; padding: 0 clamp(1rem,5vw,2.5rem); }
  .section { padding: 4.5rem 0; border-top: 1px solid var(--border); }
  .section-label {
    font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--blue); margin-bottom: 0.7rem;
  }
  .section h2 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem,4vw,2.3rem);
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem; line-height: 1.2;
  }
  .section h2 em { font-style: normal; color: var(--red); }
  .section > p { color: var(--muted); font-size: 1rem; max-width: 700px; margin-bottom: 1.75rem; }

  /* ALERT */
  .alert {
    display: flex; gap: 1rem; align-items: flex-start;
    background: var(--red-dim);
    border: 1px solid rgba(230,57,70,0.25);
    border-left: 3px solid var(--red);
    border-radius: 8px; padding: 1.2rem 1.4rem; margin: 1.75rem 0;
  }
  .alert-icon {
    width: 22px; height: 22px; flex-shrink: 0;
    background: var(--red); color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; margin-top: 0.1rem;
  }
  .alert-content strong { display: block; color: var(--red); margin-bottom: 0.3rem; font-weight: 600; }
  .alert-content p { color: var(--muted); font-size: 0.92rem; margin: 0; }
  .alert-blue {
    background: var(--blue-dim);
    border-color: rgba(72,149,239,0.22);
    border-left-color: var(--blue);
  }
  .alert-blue .alert-icon { background: var(--blue); }
  .alert-blue .alert-content strong { color: var(--blue); }

  /* CARDS */
  .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px,1fr));
    gap: 1.1rem; margin-top: 1.75rem;
  }
  .card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 1.6rem;
    transition: transform 0.22s, border-color 0.22s;
  }
  .card:hover { transform: translateY(-3px); border-color: var(--blue); }
  .card.cr { border-top: 3px solid var(--red); }
  .card.cb { border-top: 3px solid var(--blue); }
  .card.cm { border-top: 3px solid #a78bfa; }
  .card h3 {
    font-family: 'Syne', sans-serif; font-weight: 700;
    font-size: 1rem; margin-bottom: 0.55rem; color: var(--text);
  }
  .card p { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }

  /* COMPARE */
  .compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; margin-top: 1.75rem; }
  @media (max-width: 600px) { .compare { grid-template-columns: 1fr; } }
  .compare-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 1.6rem;
  }
  .compare-card.bad  { border-left: 3px solid var(--red); }
  .compare-card.good { border-left: 3px solid var(--blue); }
  .compare-card h3 {
    font-family: 'Syne', sans-serif; font-size: 0.98rem;
    font-weight: 700; margin-bottom: 0.65rem;
  }
  .compare-card.bad  h3 { color: var(--red); }
  .compare-card.good h3 { color: var(--blue); }
  .compare-card p { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }
  .note {
    display: inline-block; margin-top: 0.75rem;
    font-size: 0.78rem; font-weight: 600;
    padding: 0.22rem 0.7rem; border-radius: 4px;
  }
  .compare-card.bad  .note { background: var(--red-dim);  color: var(--red); }
  .compare-card.good .note { background: var(--blue-dim); color: var(--blue); }

  /* FORMATS */
  .fmt-list { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1.75rem; }
  .fmt-item {
    display: flex; align-items: center; gap: 1.2rem;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 9px; padding: 1rem 1.4rem;
    transition: border-color 0.2s;
  }
  .fmt-item:hover { border-color: var(--blue); }
  .fmt-badge {
    font-family: 'DM Mono', monospace; font-size: 0.78rem; font-weight: 500;
    padding: 0.28rem 0.7rem; border-radius: 5px;
    min-width: 68px; text-align: center; flex-shrink: 0;
  }
  .fmt-badge.best { background: rgba(72,149,239,0.15);  color: var(--blue); }
  .fmt-badge.ok   { background: rgba(100,200,160,0.12); color: #64c8a0; }
  .fmt-badge.warn { background: rgba(230,180,80,0.12);  color: #e6b450; }
  .fmt-badge.bad  { background: var(--red-dim);          color: var(--red); }
  .fmt-info { flex: 1; }
  .fmt-info strong { display: block; font-size: 0.92rem; margin-bottom: 0.18rem; color: var(--text); }
  .fmt-info span   { font-size: 0.83rem; color: var(--muted); }

  /* CODE */
  .code-wrap { position: relative; margin: 2rem 0; }
  .code-label {
    position: absolute; top: -10px; left: 1rem;
    background: var(--red); color: #fff;
    font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.07em; text-transform: uppercase;
    padding: 0.18rem 0.6rem; border-radius: 4px;
  }
  pre {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 2rem 1.4rem 1.4rem;
    overflow-x: auto;
    font-family: 'DM Mono', monospace;
    font-size: 0.83rem; line-height: 1.75; color: #c9d1d9;
  }
  .kw   { color: #e06c75; }
  .prop { color: #61afef; }
  .val  { color: #98c379; }
  .str  { color: #e5c07b; }
  .cmt  { color: #546e7a; font-style: italic; }

  /* font-display TABLE */
  .fd-table { width: 100%; border-collapse: collapse; margin-top: 1.75rem; font-size: 0.88rem; }
  .fd-table th {
    background: var(--surface2); color: var(--blue);
    font-family: 'Syne', sans-serif; font-size: 0.74rem;
    letter-spacing: 0.08em; text-transform: uppercase;
    padding: 0.85rem 1.1rem; text-align: left;
    border-bottom: 2px solid var(--border);
  }
  .fd-table td {
    padding: 0.8rem 1.1rem; border-bottom: 1px solid var(--border);
    vertical-align: top; color: var(--muted);
  }
  .fd-table tr:hover td { background: rgba(72,149,239,0.04); }
  .fd-table td:first-child {
    font-family: 'DM Mono', monospace;
    color: var(--red); font-size: 0.82rem; white-space: nowrap;
  }
  .badge-rec {
    display: inline-block;
    background: var(--blue-dim); color: var(--blue);
    font-size: 0.68rem; padding: 0.1rem 0.45rem;
    border-radius: 4px; margin-left: 0.35rem; font-weight: 700;
  }
  @media (max-width: 600px) {
    .fd-table { font-size: 0.78rem; }
    .fd-table th, .fd-table td { padding: 0.65rem 0.75rem; }
  }

  /* TIP BOX */
  .tip-box {
    background: linear-gradient(135deg, rgba(230,57,70,0.08) 0%, rgba(72,149,239,0.07) 100%);
    border: 1px solid rgba(72,149,239,0.2);
    border-radius: 10px; padding: 1.8rem;
    margin: 2rem 0; text-align: center;
  }
  .tip-box p { font-size: 1.02rem; color: var(--text); max-width: 600px; margin: 0 auto; }
  .tip-box strong { color: var(--blue); }

  /* GLOSSARY */
  .glossary { display: flex; flex-direction: column; margin-top: 1.75rem; }
  .gl-item {
    display: grid; grid-template-columns: 190px 1fr;
    gap: 1rem; align-items: baseline;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
  }
  .gl-item:last-child { border-bottom: none; }
  .gl-term {
    font-family: 'DM Mono', monospace; font-size: 0.85rem;
    font-weight: 500; color: var(--red);
  }
  .gl-def { font-size: 0.9rem; color: var(--muted); line-height: 1.6; }
  @media (max-width: 580px) {
    .gl-item { grid-template-columns: 1fr; gap: 0.25rem; }
  }

  /* SUMMARY */
  .summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px,1fr));
    gap: 0.9rem; margin-top: 1.75rem;
  }
  .summary-item {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 9px; padding: 1.15rem;
    display: flex; flex-direction: column; gap: 0.3rem;
  }
  .s-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.88rem; color: var(--text); }
  .s-desc  { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }

  /* FOOTER */
  footer {
    border-top: 1px solid var(--border);
    padding: 1.8rem clamp(1rem,5vw,3rem);
    text-align: center; color: var(--dim); font-size: 0.8rem;
  }

  /* ANIMATIONS */
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.5s ease, transform 0.5s ease; }
  .reveal.visible { opacity: 1; transform: translateY(0); }