:root {
      --ink: #0d0f14;
      --paper: #f0f3f8;
      --accent: #2a6dd9;
      --accent2: #1a4fa8;
      --gold: #7aaef5;
      --muted: #707a8a;
      --border: rgba(240, 243, 248, 0.1);
      --card-bg: rgba(240, 243, 248, 0.04);
      --font-heb: 'Noto Serif Hebrew', serif;
    }

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

    body {
      font-family: 'DM Sans', sans-serif;
      background: var(--ink);
      color: var(--paper);
      min-height: 100vh;
      overflow-x: hidden;
    }

    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
      pointer-events: none;
      z-index: 9999;
      opacity: 0.4;
    }

    .grid-bg {
      position: fixed;
      inset: 0;
      background-image:
        linear-gradient(rgba(240, 243, 248, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 243, 248, 0.025) 1px, transparent 1px);
      background-size: 60px 60px;
      pointer-events: none;
    }

    .glow {
      position: fixed;
      top: 30%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 800px;
      height: 800px;
      background: radial-gradient(circle, rgba(42, 109, 217, 0.1) 0%, transparent 65%);
      pointer-events: none;
      animation: pulse 5s ease-in-out infinite;
    }

    @keyframes pulse {

      0%,
      100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
      }

      50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.6;
      }
    }

    /* NAV */
    nav {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 100;
      padding: 1.25rem 2rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: rgba(13, 15, 20, 0.7);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid var(--border);
    }

    .logo {
      font-family: 'Playfair Display', serif;
      font-weight: 900;
      font-size: 1.35rem;
      color: rgba(240, 243, 248, 0.85);
      text-decoration: none;
      letter-spacing: -0.02em;
    }

    .logo span {
      color: var(--accent);
    }

    .nav-tabs {
      display: flex;
      gap: 0.25rem;
      list-style: none;
    }

    .nav-tabs button {
      background: none;
      border: none;
      font-family: 'DM Mono', monospace;
      font-size: 0.7rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: rgba(240, 243, 248, 0.4);
      padding: 0.5rem 1rem;
      cursor: pointer;
      border-radius: 2px;
      transition: all 0.2s;
    }

    .nav-tabs button:hover {
      color: rgba(240, 243, 248, 0.8);
      background: rgba(240, 243, 248, 0.04);
    }

    .nav-tabs button.active {
      color: var(--accent);
      background: rgba(42, 109, 217, 0.1);
    }

    /* MAIN */
    main {
      padding-top: 5rem;
      min-height: 100vh;
    }

    .section {
      display: none;
      padding: 3rem 2rem;
      max-width: 1200px;
      margin: 0 auto;
      animation: fadeUp 0.5s ease forwards;
    }

    .section.active {
      display: block;
    }

    @keyframes fadeUp {
      from {
        opacity: 0;
        transform: translateY(20px);
      }

      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* HERO */
    .hero {
      text-align: center;
      padding: 5rem 2rem 3rem;
    }

    .mono-tag {
      font-family: 'DM Mono', monospace;
      font-size: 0.7rem;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--accent);
      display: inline-flex;
      align-items: center;
      gap: 0.75rem;
      margin-bottom: 1.5rem;
    }

    .mono-tag::before,
    .mono-tag::after {
      content: '';
      display: block;
      width: 2rem;
      height: 1px;
      background: var(--accent);
      opacity: 0.5;
    }

    .hero h1 {
      font-family: 'Playfair Display', serif;
      font-weight: 900;
      font-size: clamp(2.5rem, 8vw, 5rem);
      line-height: 1;
      letter-spacing: -0.04em;
      margin-bottom: 1rem;
    }

    .hero h1 em {
      font-style: italic;
      color: var(--accent);
    }

    .hero .hebrew-big {
      font-family: var(--font-heb);
      font-size: clamp(3rem, 10vw, 7rem);
      color: transparent;
      -webkit-text-stroke: 1px rgba(42, 109, 217, 0.4);
      display: block;
      margin-bottom: 0.5rem;
      direction: rtl;
      letter-spacing: 0.1em;
    }

    .hero p {
      color: rgba(240, 243, 248, 0.45);
      font-size: 1rem;
      font-weight: 300;
      line-height: 1.7;
      max-width: 42ch;
      margin: 0 auto 2.5rem;
    }

    .hero-cards {
      display: flex;
      gap: 1rem;
      justify-content: center;
      flex-wrap: wrap;
      margin-top: 3rem;
    }

    .hero-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 1.5rem;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
      min-width: 140px;
    }

    .hero-card:hover {
      border-color: rgba(42, 109, 217, 0.4);
      background: rgba(42, 109, 217, 0.06);
      transform: translateY(-3px);
    }

    .hero-card .num {
      font-family: 'Playfair Display', serif;
      font-size: 2rem;
      font-weight: 900;
      color: var(--accent);
      display: block;
    }

    .hero-card small {
      font-family: 'DM Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: rgba(240, 243, 248, 0.4);
    }

    /* SECTION TITLE */
    .section-title {
      font-family: 'Playfair Display', serif;
      font-size: 1.8rem;
      font-weight: 700;
      letter-spacing: -0.03em;
      margin-bottom: 0.5rem;
    }

    .section-title em {
      font-style: italic;
      color: var(--accent);
    }

    .section-sub {
      font-size: 0.875rem;
      color: rgba(240, 243, 248, 0.4);
      font-weight: 300;
      margin-bottom: 2.5rem;
    }

    /* ALPHABET GRID */
    .alphabet-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
      gap: 0.75rem;
    }

    .letter-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 1rem 0.75rem;
      cursor: pointer;
      transition: all 0.25s;
      text-align: center;
      position: relative;
      overflow: hidden;
    }

    .letter-card::before {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 2px;
      background: var(--accent);
      transform: scaleX(0);
      transition: transform 0.2s;
    }

    .letter-card:hover {
      border-color: rgba(42, 109, 217, 0.4);
      background: rgba(42, 109, 217, 0.06);
      transform: translateY(-3px);
    }

    .letter-card:hover::before {
      transform: scaleX(1);
    }

    .letter-card.sofit {
      border-color: rgba(122, 174, 245, 0.2);
    }

    .letter-card.sofit .letter-badge {
      background: rgba(122, 174, 245, 0.1);
      color: #7aaef5;
    }

    .letter-card.dagesh {
      border-color: rgba(42, 109, 217, 0.25);
    }

    .letter-card.dagesh .letter-badge {
      background: rgba(42, 109, 217, 0.12);
      color: var(--accent);
    }

    .letter-card.diacritic {
      border-color: rgba(100, 160, 255, 0.2);
    }

    .letter-card.diacritic .letter-badge {
      background: rgba(100, 160, 255, 0.1);
      color: #64a0ff;
    }

    .letter-heb {
      font-size: 2.5rem;
      font-family: var(--font-heb);
      line-height: 1;
      display: block;
      margin-bottom: 0.4rem;
      direction: rtl;
    }

    .letter-name {
      font-family: 'Playfair Display', serif;
      font-size: 0.85rem;
      font-weight: 700;
      display: block;
      margin-bottom: 0.15rem;
    }

    .letter-translit {
      font-family: 'DM Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.1em;
      color: rgba(240, 243, 248, 0.4);
      display: block;
      margin-bottom: 0.4rem;
    }

    .letter-badge {
      font-family: 'DM Mono', monospace;
      font-size: 0.55rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      padding: 0.2rem 0.4rem;
      border-radius: 2px;
      display: inline-block;
    }

    .letter-num {
      font-family: 'DM Mono', monospace;
      font-size: 0.6rem;
      color: rgba(240, 243, 248, 0.2);
      position: absolute;
      top: 0.4rem;
      right: 0.5rem;
    }

    .sound-btn {
      background: rgba(42, 109, 217, 0.15);
      border: 1px solid rgba(42, 109, 217, 0.3);
      border-radius: 2px;
      color: var(--accent);
      font-size: 0.65rem;
      font-family: 'DM Mono', monospace;
      letter-spacing: 0.1em;
      padding: 0.25rem 0.5rem;
      cursor: pointer;
      transition: all 0.2s;
      margin-top: 0.4rem;
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
    }

    .sound-btn:hover {
      background: rgba(42, 109, 217, 0.3);
    }

    /* FILTER TAGS */
    .filter-bar {
      display: flex;
      gap: 0.5rem;
      margin-bottom: 1.5rem;
      flex-wrap: wrap;
    }

    .filter-btn {
      background: none;
      border: 1px solid var(--border);
      color: rgba(240, 243, 248, 0.4);
      font-family: 'DM Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      padding: 0.4rem 0.85rem;
      border-radius: 2px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .filter-btn:hover {
      color: rgba(240, 243, 248, 0.8);
      border-color: rgba(240, 243, 248, 0.2);
    }

    .filter-btn.active {
      background: rgba(42, 109, 217, 0.12);
      border-color: rgba(42, 109, 217, 0.4);
      color: var(--accent);
    }

    /* MODAL */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(13, 15, 20, 0.85);
      backdrop-filter: blur(8px);
      z-index: 500;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 2rem;
    }

    .modal-overlay.open {
      display: flex;
    }

    .modal {
      background: #12151c;
      border: 1px solid rgba(42, 109, 217, 0.3);
      border-radius: 6px;
      padding: 2.5rem;
      max-width: 480px;
      width: 100%;
      position: relative;
      animation: fadeUp 0.3s ease;
    }

    .modal-close {
      position: absolute;
      top: 1rem;
      right: 1rem;
      background: none;
      border: none;
      color: rgba(240, 243, 248, 0.4);
      font-size: 1.2rem;
      cursor: pointer;
      padding: 0.25rem 0.5rem;
      transition: color 0.2s;
    }

    .modal-close:hover {
      color: var(--paper);
    }

    .modal-letter-big {
      font-size: 5rem;
      font-family: var(--font-heb);
      text-align: center;
      display: block;
      direction: rtl;
      margin-bottom: 0.5rem;
      line-height: 1;
    }

    .modal-sofit {
      text-align: center;
      margin-bottom: 1.5rem;
    }

    .modal-sofit .sofit-char {
      font-size: 3rem;
      font-family: var(--font-heb);
      direction: rtl;
      color: rgba(122, 174, 245, 0.7);
      margin-left: 0.5rem;
    }

    .modal-sofit small {
      font-family: 'DM Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: rgba(122, 174, 245, 0.5);
      display: block;
      margin-top: 0.25rem;
    }

    .modal-name {
      font-family: 'Playfair Display', serif;
      font-size: 1.5rem;
      font-weight: 900;
      text-align: center;
      margin-bottom: 0.25rem;
    }

    .modal-meta {
      display: flex;
      gap: 0.75rem;
      justify-content: center;
      margin-bottom: 1.5rem;
      flex-wrap: wrap;
    }

    .meta-tag {
      font-family: 'DM Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      padding: 0.3rem 0.6rem;
      border-radius: 2px;
    }

    .meta-tag.blue {
      background: rgba(42, 109, 217, 0.15);
      color: var(--accent);
      border: 1px solid rgba(42, 109, 217, 0.3);
    }

    .meta-tag.light {
      background: rgba(122, 174, 245, 0.1);
      color: #7aaef5;
      border: 1px solid rgba(122, 174, 245, 0.2);
    }

    .meta-tag.muted {
      background: rgba(240, 243, 248, 0.05);
      color: rgba(240, 243, 248, 0.4);
      border: 1px solid var(--border);
    }

    .modal-desc {
      font-size: 0.875rem;
      font-weight: 300;
      color: rgba(240, 243, 248, 0.6);
      line-height: 1.7;
      margin-bottom: 1.5rem;
      padding-top: 1rem;
      border-top: 1px solid var(--border);
    }

    .modal-dagesh-info {
      background: rgba(42, 109, 217, 0.06);
      border: 1px solid rgba(42, 109, 217, 0.15);
      border-radius: 4px;
      padding: 1rem;
      margin-bottom: 1.25rem;
      font-size: 0.825rem;
      color: rgba(240, 243, 248, 0.5);
      line-height: 1.6;
    }

    .modal-dagesh-info strong {
      color: var(--accent);
      font-weight: 500;
    }

    .modal-play-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      width: 100%;
      background: var(--accent);
      color: white;
      font-family: 'DM Sans', sans-serif;
      font-size: 0.875rem;
      font-weight: 500;
      padding: 0.9rem;
      border: none;
      border-radius: 3px;
      cursor: pointer;
      transition: background 0.2s, transform 0.2s;
      letter-spacing: 0.02em;
    }

    .modal-play-btn:hover {
      background: #3a7de9;
      transform: translateY(-1px);
    }

    /* VOWELS */
    .vowel-group {
      margin-bottom: 2.5rem;
    }

    .vowel-group-title {
      font-family: 'DM Mono', monospace;
      font-size: 0.7rem;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--accent);
      display: flex;
      align-items: center;
      gap: 0.75rem;
      margin-bottom: 1rem;
    }

    .vowel-group-title::after {
      content: '';
      flex: 1;
      height: 1px;
      background: rgba(42, 109, 217, 0.2);
    }

    .vowel-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      gap: 0.75rem;
    }

    .vowel-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 1.25rem 1rem;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
    }

    .vowel-card:hover {
      border-color: rgba(42, 109, 217, 0.4);
      background: rgba(42, 109, 217, 0.06);
      transform: translateY(-2px);
    }

    .vowel-symbol {
      font-size: 2.2rem;
      font-family: var(--font-heb);
      direction: rtl;
      display: block;
      margin-bottom: 0.4rem;
      line-height: 1.2;
    }

    .vowel-name {
      font-family: 'Playfair Display', serif;
      font-size: 0.8rem;
      font-weight: 700;
      display: block;
      margin-bottom: 0.15rem;
    }

    .vowel-translit {
      font-family: 'DM Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.1em;
      color: rgba(240, 243, 248, 0.4);
      display: block;
      margin-bottom: 0.3rem;
    }

    .vowel-desc {
      font-size: 0.7rem;
      color: rgba(240, 243, 248, 0.35);
      line-height: 1.4;
    }

    /* QUIZ */
    .quiz-wrap {
      max-width: 560px;
      margin: 0 auto;
      text-align: center;
    }

    .quiz-card {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 3rem 2rem;
      margin-bottom: 1.5rem;
      min-height: 220px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }

    .quiz-question-letter {
      font-size: 6rem;
      font-family: var(--font-heb);
      direction: rtl;
      line-height: 1;
      margin-bottom: 1rem;
    }

    .quiz-question-text {
      font-size: 0.875rem;
      color: rgba(240, 243, 248, 0.4);
      font-weight: 300;
    }

    .quiz-options {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.75rem;
      margin-bottom: 1.5rem;
    }

    .quiz-opt {
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 3px;
      padding: 1rem;
      cursor: pointer;
      font-family: 'Playfair Display', serif;
      font-size: 1rem;
      font-weight: 700;
      color: var(--paper);
      transition: all 0.15s;
    }

    .quiz-opt.heb-opt {
      font-family: var(--font-heb);
      font-size: 2rem;
      padding: 0.75rem;
      direction: rtl;
    }

    .quiz-opt:hover {
      background: rgba(42, 109, 217, 0.08);
      border-color: rgba(42, 109, 217, 0.3);
    }

    .quiz-opt.correct {
      background: rgba(42, 109, 217, 0.18);
      border-color: var(--accent);
      color: #7aaef5;
    }

    .quiz-opt.wrong {
      background: rgba(180, 50, 50, 0.12);
      border-color: rgba(180, 50, 50, 0.4);
      color: rgba(240, 100, 100, 0.8);
    }

    .quiz-opt:disabled {
      pointer-events: none;
    }

    .quiz-stats {
      display: flex;
      gap: 2rem;
      justify-content: center;
      margin-bottom: 1.5rem;
    }

    .quiz-stat {
      text-align: center;
    }

    .quiz-stat .val {
      font-family: 'Playfair Display', serif;
      font-size: 2rem;
      font-weight: 900;
      color: var(--accent);
      display: block;
    }

    .quiz-stat small {
      font-family: 'DM Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: rgba(240, 243, 248, 0.3);
    }

    .quiz-mode-bar {
      display: flex;
      gap: 0.5rem;
      justify-content: center;
      margin-bottom: 2rem;
      flex-wrap: wrap;
    }

    .quiz-mode-btn {
      background: none;
      border: 1px solid var(--border);
      color: rgba(240, 243, 248, 0.4);
      font-family: 'DM Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      padding: 0.5rem 1rem;
      border-radius: 2px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .quiz-mode-btn:hover {
      color: rgba(240, 243, 248, 0.8);
    }

    .quiz-mode-btn.active {
      background: rgba(42, 109, 217, 0.12);
      border-color: rgba(42, 109, 217, 0.4);
      color: var(--accent);
    }

    .btn-next {
      display: inline-flex;
      align-items: center;
      gap: 0.6rem;
      background: var(--accent);
      color: white;
      font-size: 0.875rem;
      font-weight: 500;
      padding: 0.85rem 2rem;
      border: none;
      border-radius: 2px;
      cursor: pointer;
      transition: all 0.2s;
      letter-spacing: 0.02em;
    }

    .btn-next:hover {
      background: #3a7de9;
      transform: translateY(-2px);
    }

    .feedback-msg {
      font-size: 0.875rem;
      font-weight: 500;
      margin: 0.75rem 0;
      min-height: 1.4rem;
      transition: all 0.2s;
    }

    .feedback-msg.ok {
      color: #7aaef5;
    }

    .feedback-msg.err {
      color: rgba(240, 100, 100, 0.8);
    }

    /* DAGESH */
    .dagesh-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 1rem;
      margin-bottom: 2.5rem;
    }

    .dagesh-card {
      background: var(--card-bg);
      border: 1px solid rgba(42, 109, 217, 0.15);
      border-radius: 4px;
      padding: 1.25rem;
    }

    .dagesh-pair {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 1rem;
      margin-bottom: 0.75rem;
      direction: rtl;
    }

    .dagesh-pair .without {
      font-size: 2.5rem;
      font-family: var(--font-heb);
      color: rgba(240, 243, 248, 0.3);
    }

    .dagesh-pair .arrow {
      font-size: 0.8rem;
      color: rgba(240, 243, 248, 0.2);
    }

    .dagesh-pair .with {
      font-size: 2.5rem;
      font-family: var(--font-heb);
      color: var(--accent);
    }

    .dagesh-card-name {
      font-family: 'Playfair Display', serif;
      font-size: 0.9rem;
      font-weight: 700;
      margin-bottom: 0.25rem;
    }

    .dagesh-card-rule {
      font-size: 0.75rem;
      color: rgba(240, 243, 248, 0.4);
      line-height: 1.5;
    }

    /* FLASHCARD */
    .flashcard-wrap {
      max-width: 480px;
      margin: 0 auto;
      text-align: center;
    }

    .flashcard {
      background: var(--card-bg);
      border: 1px solid rgba(42, 109, 217, 0.25);
      border-radius: 6px;
      padding: 3.5rem 2rem;
      min-height: 260px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.3s;
      margin-bottom: 1.5rem;
      position: relative;
      overflow: hidden;
    }

    .flashcard:hover {
      border-color: rgba(42, 109, 217, 0.5);
      background: rgba(42, 109, 217, 0.05);
    }

    .flashcard .front {
      display: block;
    }

    .flashcard .back {
      display: none;
    }

    .flashcard.flipped .front {
      display: none;
    }

    .flashcard.flipped .back {
      display: block;
    }

    .flashcard-letter {
      font-size: 5.5rem;
      font-family: var(--font-heb);
      direction: rtl;
      line-height: 1;
      margin-bottom: 0.5rem;
    }

    .flashcard-hint {
      font-family: 'DM Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.15em;
      color: rgba(240, 243, 248, 0.25);
      text-transform: uppercase;
    }

    .flashcard-answer {
      font-family: 'Playfair Display', serif;
      font-size: 1.8rem;
      font-weight: 900;
      margin-bottom: 0.5rem;
    }

    .flashcard-answer.is-heb {
      font-family: var(--font-heb);
      font-size: 5rem;
      direction: rtl;
      line-height: 1.1;
    }

    .flashcard-answer em {
      color: var(--accent);
      font-style: italic;
    }

    .flashcard-details {
      font-size: 0.8rem;
      color: rgba(240, 243, 248, 0.5);
      line-height: 1.6;
    }

    .flashcard-nav {
      display: flex;
      gap: 1rem;
      justify-content: center;
      align-items: center;
    }

    .fc-btn {
      background: none;
      border: 1px solid var(--border);
      color: rgba(240, 243, 248, 0.4);
      padding: 0.65rem 1.25rem;
      border-radius: 2px;
      cursor: pointer;
      font-family: 'DM Mono', monospace;
      font-size: 0.7rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      transition: all 0.2s;
    }

    .fc-btn:hover {
      color: rgba(240, 243, 248, 0.8);
      border-color: rgba(240, 243, 248, 0.25);
    }

    .fc-btn.primary {
      background: rgba(42, 109, 217, 0.12);
      border-color: rgba(42, 109, 217, 0.4);
      color: var(--accent);
    }

    .fc-progress {
      font-family: 'DM Mono', monospace;
      font-size: 0.7rem;
      color: rgba(240, 243, 248, 0.3);
      letter-spacing: 0.1em;
    }

    .progress-bar {
      width: 100%;
      height: 2px;
      background: rgba(240, 243, 248, 0.08);
      border-radius: 1px;
      margin-bottom: 1.5rem;
      overflow: hidden;
    }

    .progress-fill {
      height: 100%;
      background: var(--accent);
      border-radius: 1px;
      transition: width 0.3s ease;
    }

    /* TABLE */
    .table-wrap {
      overflow-x: auto;
    }

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

    thead tr {
      border-bottom: 1px solid rgba(42, 109, 217, 0.3);
    }

    th {
      font-family: 'DM Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: var(--accent);
      padding: 0.75rem 1rem;
      text-align: left;
      font-weight: 400;
    }

    td {
      padding: 0.75rem 1rem;
      color: rgba(240, 243, 248, 0.75);
      border-bottom: 1px solid rgba(240, 243, 248, 0.04);
    }

    .td-heb {
      font-size: 1.5rem;
      font-family: var(--font-heb);
      direction: rtl;
    }

    tr:hover td {
      background: rgba(42, 109, 217, 0.04);
    }

    /* SPEAKER ICON */
    .icon-speak {
      width: 14px;
      height: 14px;
      fill: none;
      stroke: currentColor;
      stroke-width: 2;
      vertical-align: middle;
    }

    /* ALT / SOFIT rows inside letter card */
    .letter-alt-row {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
      margin: 0.4rem 0 0.2rem;
      direction: rtl;
    }

    .letter-alt-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.1rem;
    }

    .letter-alt-char {
      font-size: 1.5rem;
      line-height: 1;
    }

    .letter-alt-label {
      font-family: 'DM Mono', monospace;
      font-size: 0.5rem;
      letter-spacing: 0.06em;
      color: rgba(240, 243, 248, 0.3);
      text-transform: uppercase;
      direction: ltr;
    }

    .letter-alt-sep {
      color: rgba(240, 243, 248, 0.15);
      font-size: 1rem;
      align-self: center;
    }

    .letter-sofit-row {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin-top: 0.2rem;
      direction: rtl;
    }

    /* Modal alt block */
    .modal-alt-block {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 1.5rem;
      background: rgba(42, 109, 217, 0.05);
      border: 1px solid rgba(42, 109, 217, 0.12);
      border-radius: 4px;
      padding: 0.75rem 1rem;
      margin-bottom: 1rem;
      direction: rtl;
    }

    .modal-alt-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.2rem;
    }

    .modal-alt-char {
      font-size: 2.2rem;
      font-family: var(--font-heb);
      line-height: 1;
    }

    .modal-alt-lbl {
      font-family: 'DM Mono', monospace;
      font-size: 0.6rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: rgba(240, 243, 248, 0.35);
      direction: ltr;
    }

    .modal-alt-arrow {
      color: rgba(240, 243, 248, 0.15);
      font-size: 1.2rem;
      align-self: center;
    }

    /* BOTTOM NAV MOBILE */
    .bottom-nav {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 200;
      background: rgba(13, 15, 20, 0.97);
      backdrop-filter: blur(16px);
      border-top: 1px solid var(--border);
      padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
      justify-content: space-around;
    }

    .bottom-nav button {
      background: none;
      border: none;
      color: rgba(240, 243, 248, 0.35);
      font-family: 'DM Mono', monospace;
      font-size: 0.55rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.3rem;
      padding: 0.4rem 0.6rem;
      cursor: pointer;
      transition: color 0.2s;
      min-width: 52px;
    }

    .bottom-nav button svg {
      width: 20px;
      height: 20px;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.8;
    }

    .bottom-nav button.active {
      color: var(--accent);
    }

    /* =====================
       GUIA VISUAL DE VOGAIS
    ===================== */
    .vg-wrap {
      display: flex;
      flex-direction: column;
      gap: 0.6rem;
    }

    .vg-group {
      display: flex;
      align-items: flex-start;
      gap: 1rem;
      background: var(--card-bg);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 1rem 1.25rem;
    }

    .vg-group-header {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      min-width: 52px;
      padding-top: 0.6rem;
      flex-shrink: 0;
    }

    .vg-vowel-pt {
      font-family: 'Playfair Display', serif;
      font-size: 2.2rem;
      font-weight: 900;
      line-height: 1;
    }

    .vg-arrow {
      font-size: 0.9rem;
      color: rgba(240, 243, 248, 0.2);
    }

    .vg-cards {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      flex: 1;
    }

    .vg-card {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      background: rgba(240, 243, 248, 0.03);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 0.6rem 0.9rem;
      cursor: pointer;
      transition: all 0.18s;
      min-width: 190px;
      flex: 1;
    }

    .vg-card:hover {
      transform: translateY(-2px);
      border-color: rgba(42, 109, 217, 0.35);
      background: rgba(42, 109, 217, 0.06);
    }

    .vg-cat-long  { border-left: 3px solid #4a90e8; }
    .vg-cat-short { border-left: 3px solid #e05c5c; }
    .vg-cat-sheva { border-left: 3px solid #8e44ad; }

    .vg-mark {
      font-family: var(--font-heb);
      font-size: 2.4rem;
      direction: rtl;
      line-height: 1.3;
      min-width: 2.2rem;
      text-align: center;
      color: var(--paper);
      flex-shrink: 0;
    }

    .vg-card-body {
      display: flex;
      flex-direction: column;
      gap: 0.08rem;
    }

    .vg-card-name {
      font-family: 'Playfair Display', serif;
      font-size: 0.85rem;
      font-weight: 700;
      color: var(--paper);
    }

    .vg-card-translit {
      font-family: 'DM Mono', monospace;
      font-size: 0.7rem;
      color: var(--accent);
      letter-spacing: 0.08em;
    }

    .vg-card-cat {
      font-family: 'DM Mono', monospace;
      font-size: 0.55rem;
      letter-spacing: 0.12em;
      text-transform: uppercase;
    }
    .vg-cat-long  .vg-card-cat { color: #4a90e8; }
    .vg-cat-short .vg-card-cat { color: #e05c5c; }
    .vg-cat-sheva .vg-card-cat { color: #8e44ad; }

    .vg-card-desc {
      font-size: 0.7rem;
      color: rgba(240, 243, 248, 0.38);
      line-height: 1.4;
      margin-top: 0.15rem;
    }

    /* Sinal isolado no canto direito */
    .vg-sign-wrap {
      margin-left: auto;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      width: 3.5rem;
      height: 3.5rem;
      background: rgba(240, 243, 248, 0.03);
      border: 1px solid rgba(240, 243, 248, 0.07);
      border-radius: 6px;
    }

    .vg-sign-ghost {
      font-family: var(--font-heb);
      font-size: 2rem;
      direction: rtl;
      line-height: 1;
    }
    .vg-cat-long  .vg-sign-ghost { color: #6aabf0; }
    .vg-cat-short .vg-sign-ghost { color: #e07070; }
    .vg-cat-sheva .vg-sign-ghost { color: #b07edf; }

    /* Canvas gerado por JS — ocupa o mesmo espaço */
    .vg-sign-wrap canvas {
      border-radius: 3px;
    }

    /* Mobile */
    @media (max-width: 700px) {
      .vg-group {
        flex-direction: column;
        gap: 0.6rem;
        padding: 0.85rem 1rem;
      }
      .vg-group-header {
        padding-top: 0;
        flex-direction: row;
        align-items: center;
      }
      .vg-card {
        min-width: 0;
        width: 100%;
      }
      .vg-vowel-pt { font-size: 1.8rem; }
    }

    /* =====================
       TABELA MASSORÉTICA
    ===================== */
    .vt-filter-bar {
      display: flex;
      gap: 0.5rem;
      margin-bottom: 1.5rem;
      flex-wrap: wrap;
    }

    .vt-scroll {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      border: 1px solid var(--border);
      border-radius: 6px;
    }

    .vt-table {
      width: max-content;
      min-width: 100%;
      border-collapse: collapse;
      font-size: 0.85rem;
    }

    /* Cabeçalho das letras */
    .vt-th-letter {
      background: rgba(42, 109, 217, 0.07);
      border-bottom: 1px solid rgba(42, 109, 217, 0.25);
      border-right: 1px solid var(--border);
      padding: 0.5rem 0.4rem;
      text-align: center;
      min-width: 52px;
      position: sticky;
      top: 0;
      z-index: 2;
    }

    .vt-col-heb {
      font-family: var(--font-heb);
      font-size: 1.4rem;
      display: block;
      direction: rtl;
      line-height: 1.2;
      color: var(--paper);
    }

    .vt-col-name {
      font-family: 'DM Mono', monospace;
      font-size: 0.45rem;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: rgba(240, 243, 248, 0.3);
      display: block;
      margin-top: 0.15rem;
    }

    /* Cabeçalho fixo esquerdo */
    .vt-th-vowel {
      background: rgba(13, 15, 20, 0.95);
      border-bottom: 1px solid rgba(42, 109, 217, 0.25);
      border-right: 1px solid rgba(42, 109, 217, 0.2);
      padding: 0.6rem 0.75rem;
      font-family: 'DM Mono', monospace;
      font-size: 0.6rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: var(--accent);
      white-space: nowrap;
      position: sticky;
      top: 0;
      left: 0;
      z-index: 3;
      min-width: 120px;
    }

    .vt-th-translit {
      background: rgba(13, 15, 20, 0.95);
      border-bottom: 1px solid rgba(42, 109, 217, 0.25);
      border-right: 1px solid var(--border);
      padding: 0.6rem 0.5rem;
      font-family: 'DM Mono', monospace;
      font-size: 0.6rem;
      letter-spacing: 0.12em;
      color: rgba(240, 243, 248, 0.3);
      text-align: center;
      position: sticky;
      top: 0;
      z-index: 2;
      min-width: 44px;
    }

    /* Células de dados */
    .vt-cell {
      border-right: 1px solid rgba(240, 243, 248, 0.04);
      border-bottom: 1px solid rgba(240, 243, 248, 0.04);
      padding: 0.35rem 0.2rem;
      text-align: center;
      cursor: pointer;
      transition: background 0.15s;
    }

    .vt-cell:hover {
      background: rgba(42, 109, 217, 0.12);
    }

    .vt-cell-empty {
      border-right: 1px solid rgba(240, 243, 248, 0.03);
      border-bottom: 1px solid rgba(240, 243, 248, 0.03);
      padding: 0.35rem 0.2rem;
      text-align: center;
    }

    .vt-char {
      font-family: var(--font-heb);
      font-size: 1.5rem;
      direction: rtl;
      display: block;
      line-height: 1.5;
    }

    /* Cor por categoria */
    .vt-cell-long   .vt-char { color: #4a90e8; }
    .vt-cell-short  .vt-char { color: #c0392b; }
    .vt-cell-sheva  .vt-char { color: #8e44ad; }
    .vt-cell-empty  .vt-char { color: rgba(240, 243, 248, 0.1); font-size: 0.8rem; }

    /* Coluna de nome da vogal (fixa à esquerda) */
    .vt-td-vowel {
      position: sticky;
      left: 0;
      background: rgba(13, 15, 20, 0.97);
      border-right: 1px solid rgba(42, 109, 217, 0.2);
      border-bottom: 1px solid rgba(240, 243, 248, 0.05);
      padding: 0.5rem 0.75rem;
      white-space: nowrap;
      z-index: 1;
    }

    .vt-vowel-name {
      font-family: 'Playfair Display', serif;
      font-size: 0.85rem;
      font-weight: 700;
      display: block;
      color: var(--paper);
    }

    .vt-vowel-note {
      font-family: 'DM Mono', monospace;
      font-size: 0.55rem;
      letter-spacing: 0.06em;
      color: rgba(240, 243, 248, 0.3);
      display: block;
      margin-top: 0.1rem;
      text-transform: uppercase;
    }

    /* Coluna de transliteração */
    .vt-td-translit {
      border-right: 1px solid var(--border);
      border-bottom: 1px solid rgba(240, 243, 248, 0.05);
      padding: 0.5rem 0.4rem;
      text-align: center;
      font-family: 'DM Mono', monospace;
      font-size: 0.75rem;
      color: var(--accent);
    }

    /* Separadores visuais entre grupos */
    .vt-row-long   .vt-td-vowel { border-left: 3px solid #4a90e8; }
    .vt-row-short  .vt-td-vowel { border-left: 3px solid #c0392b; }
    .vt-row-sheva  .vt-td-vowel { border-left: 3px solid #8e44ad; }

    /* Hover na linha inteira */
    .vt-table tbody tr:hover .vt-cell,
    .vt-table tbody tr:hover .vt-cell-empty {
      background: rgba(42, 109, 217, 0.04);
    }

    /* Legenda */
    .vt-legend {
      display: flex;
      gap: 1.5rem;
      margin-top: 1rem;
      flex-wrap: wrap;
    }

    .vt-legend-item {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      font-family: 'DM Mono', monospace;
      font-size: 0.65rem;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: rgba(240, 243, 248, 0.4);
    }

    .vt-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      display: inline-block;
    }

    .vt-dot.long  { background: #4a90e8; }
    .vt-dot.short { background: #c0392b; }
    .vt-dot.sheva { background: #8e44ad; }

    /* =====================
       FIM TABELA MASSORÉTICA
    ===================== */

    /* RESPONSIVE */
    @media (max-width: 700px) {

      /* Hide desktop nav tabs, show bottom nav */
      .nav-tabs {
        display: none;
      }

      .bottom-nav {
        display: flex;
      }

      nav {
        padding: 0.9rem 1.25rem;
        justify-content: center;
      }

      main {
        padding-top: 4rem;
        padding-bottom: 5rem;
      }

      .section {
        padding: 1.5rem 1rem;
      }

      /* Hero */
      .hero {
        padding: 2rem 1rem 1.5rem;
      }

      .hero .hebrew-big {
        font-size: clamp(2.5rem, 18vw, 5rem);
      }

      .hero h1 {
        font-size: clamp(1.8rem, 7vw, 3rem);
      }

      .hero p {
        font-size: 0.875rem;
      }

      .hero-cards {
        gap: 0.6rem;
      }

      .hero-card {
        min-width: 100px;
        padding: 1rem 0.75rem;
      }

      .hero-card .num {
        font-size: 1.6rem;
      }

      /* Section titles */
      .section-title {
        font-size: 1.4rem;
      }

      /* Alphabet */
      .alphabet-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
      }

      .letter-card {
        padding: 0.75rem 0.5rem;
      }

      .letter-heb {
        font-size: 2rem;
      }

      .letter-name {
        font-size: 0.75rem;
      }

      .sound-btn {
        font-size: 0.6rem;
        padding: 0.2rem 0.4rem;
      }

      /* Filter bar */
      .filter-bar {
        gap: 0.35rem;
      }

      .filter-btn {
        font-size: 0.6rem;
        padding: 0.35rem 0.6rem;
      }

      /* Modal */
      .modal {
        padding: 1.75rem 1.25rem;
        margin: 0.5rem;
      }

      .modal-letter-big {
        font-size: 4rem;
      }

      .modal-name {
        font-size: 1.25rem;
      }

      /* Vowels */
      .vowel-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
      }

      .vowel-card {
        padding: 0.9rem 0.75rem;
      }

      .vowel-symbol {
        font-size: 1.8rem;
      }

      /* Dagesh */
      .dagesh-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
      }

      /* Table — hide tabela de vogais no mobile, mas NÃO a massorética */
      .table-wrap:not(.vt-scroll) {
        display: none;
      }

      /* Tabela massorética mobile: scroll horizontal funcional */
      .vt-scroll {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 4px;
        /* força o scroll a funcionar no iOS */
        max-width: 100%;
      }

      /* Sticky columns: desativa no mobile pois causam glitch no iOS */
      .vt-th-vowel,
      .vt-td-vowel {
        position: static;
      }

      /* Reduz tamanho das células na tabela para caber melhor */
      .vt-th-letter {
        min-width: 38px;
        padding: 0.35rem 0.2rem;
      }

      .vt-col-heb {
        font-size: 1.1rem;
      }

      .vt-col-name {
        display: none;
      }

      .vt-th-vowel {
        min-width: 90px;
        padding: 0.4rem 0.5rem;
        font-size: 0.5rem;
      }

      .vt-th-translit {
        min-width: 32px;
        padding: 0.4rem 0.2rem;
        font-size: 0.55rem;
      }

      .vt-td-vowel {
        padding: 0.35rem 0.5rem;
        min-width: 90px;
      }

      .vt-vowel-name {
        font-size: 0.75rem;
      }

      .vt-vowel-note {
        display: none;
      }

      .vt-td-translit {
        padding: 0.35rem 0.2rem;
        font-size: 0.65rem;
        min-width: 32px;
      }

      .vt-cell,
      .vt-cell-empty {
        padding: 0.2rem 0.1rem;
        min-width: 38px;
      }

      .vt-char {
        font-size: 1.15rem;
        line-height: 1.6;
      }

      /* Guia visual mobile */
      .vg-group {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem 0.85rem;
      }

      .vg-group-header {
        padding-top: 0;
      }

      .vg-vowel-pt {
        font-size: 1.8rem;
      }

      .vg-cards {
        flex-direction: column;
        gap: 0.4rem;
      }

      .vg-card {
        min-width: 0;
        width: 100%;
        padding: 0.5rem 0.7rem;
        gap: 0.6rem;
      }

      .vg-mark {
        font-size: 1.8rem;
        min-width: 1.8rem;
      }

      .vg-card-name {
        font-size: 0.8rem;
      }

      .vg-card-desc {
        font-size: 0.65rem;
      }

      .vg-sign-wrap {
        width: 2.8rem;
        height: 2.8rem;
      }

      .vg-sign-ghost {
        font-size: 1.6rem;
      }

      /* Flashcard */
      .flashcard-wrap {
        padding: 0 0.5rem;
      }

      .flashcard {
        padding: 2.5rem 1.25rem;
        min-height: 200px;
      }

      .flashcard-letter {
        font-size: 4.5rem;
      }

      .flashcard-answer {
        font-size: 1.4rem;
      }

      .flashcard-nav {
        gap: 0.5rem;
      }

      .fc-btn {
        padding: 0.55rem 0.9rem;
        font-size: 0.65rem;
      }

      /* Quiz */
      .quiz-wrap {
        padding: 0 0.25rem;
      }

      .quiz-card {
        padding: 2rem 1.25rem;
        min-height: 180px;
      }

      .quiz-question-letter {
        font-size: 4.5rem;
      }

      .quiz-options {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
      }

      .quiz-opt {
        padding: 0.85rem 0.5rem;
        font-size: 0.875rem;
      }

      .quiz-stats {
        gap: 1.25rem;
      }

      .quiz-stat .val {
        font-size: 1.6rem;
      }

      .quiz-mode-bar {
        gap: 0.35rem;
      }

      .quiz-mode-btn {
        font-size: 0.6rem;
        padding: 0.4rem 0.6rem;
      }
    }

    @media (max-width: 360px) {
      .alphabet-grid {
        grid-template-columns: repeat(3, 1fr);
      }

      .vowel-grid {
        grid-template-columns: 1fr 1fr;
      }

      .hero-card {
        min-width: 80px;
      }
    }