/* ═══════════════════════════════════════════════════════════════
   TRATOK.ORG — FOUNDATION OVERLAY
   Additions layered on top of the tratok.info design system.
   Keeps the parent system intact; adds Foundation-specific polish.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Skip link (a11y) ─── */
.skip-link {
    position: absolute;
    top: -48px;
    left: 8px;
    padding: 10px 16px;
    background: var(--teal);
    color: var(--void);
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    z-index: 999;
    transition: top 0.2s var(--ease-out);
}
.skip-link:focus {
    top: 8px;
    color: var(--void);
    outline: 2px solid var(--teal-glow);
    outline-offset: 2px;
}

/* ─── Hero: radial wash + decorative globe ─── */
.hero-foundation {
    position: relative;
    padding-top: 60px;
    padding-bottom: 72px;
    overflow: hidden;
}

.hero-foundation::before {
    content: '';
    position: absolute;
    inset: -10% -10% 0 -10%;
    background:
        radial-gradient(720px circle at 20% 10%, rgba(245, 166, 35, 0.14), transparent 55%),
        radial-gradient(640px circle at 85% 70%, rgba(46, 205, 167, 0.10), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.hero-foundation > * { position: relative; z-index: 1; }

.hero-globe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%);
    width: min(900px, 95vw);
    height: min(900px, 95vw);
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
    filter: hue-rotate(-10deg);
}

.hero-globe svg { width: 100%; height: 100%; }

.hero-coin {
    width: 120px;
    height: 120px;
    margin: 0 auto 28px;
    display: block;
    filter: drop-shadow(0 16px 32px rgba(245, 166, 35, 0.25));
    animation: coinFloat 8s var(--ease-out) infinite;
}

@keyframes coinFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-8px) rotate(2deg); }
}

@media (max-width: 640px) {
    .hero-coin { width: 88px; height: 88px; margin-bottom: 20px; }
    .hero-globe { opacity: 0.1; }
}

/* ─── Sibling-ecosystem strip ─── */
.sibling-strip {
    padding: 20px 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.015);
}

.sibling-strip-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 28px;
    font-family: 'Sora', sans-serif;
    font-size: 0.82rem;
    color: var(--ghost);
    letter-spacing: 0.02em;
}

.sibling-strip-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    color: var(--ghost);
    opacity: 0.85;
}

.sibling-strip a {
    color: var(--mist);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease-out);
}

.sibling-strip a strong {
    color: var(--snow);
    font-weight: 600;
}

.sibling-strip a:hover {
    background: var(--glass);
    color: var(--teal-glow);
}

.sibling-strip a.current {
    background: rgba(245, 166, 35, 0.08);
    border: 1px solid rgba(245, 166, 35, 0.25);
}

.sibling-strip a.current strong { color: var(--amber-glow); }

.sibling-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.sibling-dot.teal   { background: var(--teal);   box-shadow: 0 0 8px var(--teal); }
.sibling-dot.amber  { background: var(--amber);  box-shadow: 0 0 8px var(--amber); }
.sibling-dot.ember  { background: var(--ember);  box-shadow: 0 0 8px var(--ember); }
.sibling-dot.violet { background: var(--violet); box-shadow: 0 0 8px var(--violet); }

/* ─── On-chain widget ─── */
.chain-widget {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(46, 205, 167, 0.06), rgba(245, 166, 35, 0.06));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin: 28px 0;
    transition: all var(--duration) var(--ease-out);
}

.chain-widget:hover {
    border-color: rgba(46, 205, 167, 0.25);
    background: linear-gradient(135deg, rgba(46, 205, 167, 0.09), rgba(245, 166, 35, 0.09));
}

.chain-widget .live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 12px var(--teal-glow);
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.chain-widget .live-dot.stale {
    background: var(--ghost);
    box-shadow: none;
    animation: none;
}

.chain-widget .label {
    font-family: 'Sora', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ghost);
    display: block;
    margin-bottom: 4px;
}

.chain-widget .val {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--snow);
    letter-spacing: -0.01em;
}

.chain-widget .val .unit {
    color: var(--amber-glow);
    font-weight: 600;
    margin-left: 4px;
}

.chain-widget .aside {
    text-align: right;
    font-size: 0.75rem;
    color: var(--ghost);
    line-height: 1.4;
}

.chain-widget .aside a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--teal-glow);
    font-weight: 500;
}

@media (max-width: 640px) {
    .chain-widget {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 10px 14px;
    }
    .chain-widget .aside {
        grid-column: 1 / -1;
        text-align: left;
        padding-top: 8px;
        border-top: 1px dashed var(--glass-border);
    }
}

/* ─── Mission allocation graphic ─── */
.mission-alloc {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 28px 0 8px;
}

.alloc-chip {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all var(--duration) var(--ease-out);
}
.alloc-chip:hover {
    background: var(--glass-hover);
    border-color: var(--glass-strong);
    transform: translateY(-2px);
}

.alloc-chip .num {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1;
    background: linear-gradient(135deg, var(--amber-glow), var(--ember-glow));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.alloc-chip .label {
    font-family: 'Sora', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ghost);
}
.alloc-chip .detail {
    color: var(--snow);
    font-size: 0.95rem;
}

/* ─── Pillar cards ─── */
.pillar-card {
    position: relative;
    min-height: 240px;
    padding-top: 32px;
}

.pillar-card .pillar-num {
    position: absolute;
    top: 16px;
    right: 20px;
    font-family: 'Sora', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--ghost);
    font-weight: 600;
    opacity: 0.5;
}

/* ─── Ribbon divider ─── */
.ribbon-divider {
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(245, 166, 35, 0.25) 20%,
        rgba(46, 205, 167, 0.25) 50%,
        rgba(232, 93, 58, 0.25) 80%,
        transparent 100%);
    margin: 24px auto;
    max-width: 800px;
}

/* ─── Committee roster ─── */
.committee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.seat-card {
    background: var(--glass);
    border: 1px dashed var(--glass-strong);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    transition: all var(--duration) var(--ease-out);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.seat-card:hover {
    background: var(--glass-hover);
    border-color: var(--teal);
}

.seat-card .seat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.seat-card .seat-title {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--white);
}

.seat-card .seat-status {
    font-family: 'Sora', sans-serif;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.seat-status.open {
    background: rgba(245, 166, 35, 0.12);
    color: var(--amber-glow);
    border: 1px solid rgba(245, 166, 35, 0.3);
}
.seat-status.filled {
    background: rgba(46, 205, 167, 0.12);
    color: var(--teal-glow);
    border: 1px solid rgba(46, 205, 167, 0.3);
}
.seat-status.seating {
    background: rgba(139, 92, 246, 0.12);
    color: var(--violet-glow);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.seat-card .seat-scope {
    color: var(--mist);
    font-size: 0.9rem;
}

.seat-card .seat-criteria {
    list-style: none;
    padding: 0;
    margin-top: 2px;
    display: grid;
    gap: 4px;
}

.seat-card .seat-criteria li {
    color: var(--snow);
    font-size: 0.85rem;
    padding-left: 16px;
    position: relative;
}

.seat-card .seat-criteria li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal);
    position: absolute;
    left: 0;
    top: 7px;
}

.seat-card .seat-action {
    margin-top: auto;
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--teal-glow);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.seat-card .seat-action:hover { color: var(--teal); }

/* ─── Announcements ─── */
.announce-list {
    display: grid;
    gap: 14px;
    max-width: 820px;
    margin: 0 auto;
}

.announce-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 20px;
    padding: 20px 24px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--duration) var(--ease-out);
}

.announce-item:hover {
    background: var(--glass-hover);
    border-color: var(--glass-strong);
}

.announce-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--amber-glow);
    letter-spacing: 0.02em;
    padding-top: 4px;
    border-right: 1px solid var(--glass-border);
    padding-right: 18px;
}

.announce-body h4 {
    margin-bottom: 6px;
    color: var(--white);
    font-size: 1.05rem;
}

.announce-body p {
    color: var(--mist);
    font-size: 0.95rem;
    margin: 0;
}

.announce-body .announce-tag {
    display: inline-block;
    font-family: 'Sora', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.announce-tag.charter   { background: rgba(46, 205, 167, 0.12); color: var(--teal-glow); }
.announce-tag.cycle     { background: rgba(245, 166, 35, 0.12); color: var(--amber-glow); }
.announce-tag.partner   { background: rgba(139, 92, 246, 0.12); color: var(--violet-glow); }
.announce-tag.governance{ background: rgba(232, 93, 58, 0.12); color: var(--ember-glow); }

@media (max-width: 640px) {
    .announce-item { grid-template-columns: 1fr; gap: 10px; }
    .announce-date { border-right: none; padding-right: 0; padding-bottom: 8px; border-bottom: 1px dashed var(--glass-border); }
}

/* ─── Grant application form ─── */
.grant-form {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-top: 24px;
}

.grant-form h3 {
    margin-bottom: 8px;
    color: var(--white);
}

.grant-form .form-lede {
    color: var(--mist);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field.full { grid-column: 1 / -1; }

.form-field label {
    font-family: 'Sora', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mist);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-field label .req {
    color: var(--ember-glow);
    font-size: 1rem;
    line-height: 1;
}

.form-field input,
.form-field select,
.form-field textarea {
    background: var(--abyss);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--snow);
    transition: all var(--duration) var(--ease-out);
    width: 100%;
}

.form-field textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(46, 205, 167, 0.15);
    background: var(--slate);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: var(--ghost);
}

.form-field .hint {
    font-size: 0.8rem;
    color: var(--ghost);
}

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

.form-footer .privacy-note {
    font-size: 0.8rem;
    color: var(--ghost);
    max-width: 480px;
    line-height: 1.5;
}

.form-footer .privacy-note a { color: var(--teal-glow); }

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--snow);
    font-size: 0.88rem;
    line-height: 1.5;
}

.form-checkbox input { margin-top: 3px; accent-color: var(--teal); }

.form-status {
    display: none;
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-status.visible { display: block; }
.form-status.success {
    background: rgba(46, 205, 167, 0.12);
    border: 1px solid rgba(46, 205, 167, 0.3);
    color: var(--teal-glow);
}
.form-status.error {
    background: rgba(232, 93, 58, 0.12);
    border: 1px solid rgba(232, 93, 58, 0.3);
    color: var(--ember-glow);
}

/* "Email client didn't open? Copy details to clipboard" — secondary action
   that lives inside the success status panel. */
.form-status .copy-fallback-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 14px;
    background: rgba(46, 205, 167, 0.18);
    border: 1px solid rgba(46, 205, 167, 0.45);
    border-radius: 999px;
    color: var(--teal-glow);
    font-family: 'Sora', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
}
.form-status .copy-fallback-btn:hover,
.form-status .copy-fallback-btn:focus-visible {
    background: rgba(46, 205, 167, 0.28);
    color: var(--white);
    outline: none;
    transform: translateY(-1px);
}

/* Field-level validation: red ring + error message under the input. */
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
    border-color: var(--ember-glow) !important;
    box-shadow: 0 0 0 3px rgba(232, 93, 58, 0.18);
}
.form-field .field-error {
    display: block;
    min-height: 1em;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--ember-glow);
    font-weight: 500;
}
.form-field .field-error:empty { display: none; }

.form-checkbox.has-error {
    color: var(--ember-glow);
}
.form-checkbox.has-error input {
    outline: 2px solid var(--ember-glow);
    outline-offset: 2px;
    border-radius: 3px;
}

@media (max-width: 640px) {
    .grant-form { padding: 20px; }
    .form-grid { grid-template-columns: 1fr; gap: 14px; }
    .form-status .copy-fallback-btn {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: 12px;
        padding: 12px 14px;
        font-size: 0.9rem;
    }
}

/* ─── Contact chip grid ─── */
.contact-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    max-width: 720px;
    margin: 24px auto 0;
}

.contact-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    text-align: left;
    transition: all var(--duration) var(--ease-out);
}

.contact-chip:hover {
    background: var(--glass-hover);
    border-color: var(--glass-strong);
    transform: translateY(-2px);
}

.contact-chip .chip-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.contact-chip.teal   .chip-icon { background: rgba(46, 205, 167, 0.15); color: var(--teal-glow); }
.contact-chip.ember  .chip-icon { background: rgba(232, 93, 58, 0.15); color: var(--ember-glow); }
.contact-chip.amber  .chip-icon { background: rgba(245, 166, 35, 0.15); color: var(--amber-glow); }
.contact-chip.violet .chip-icon { background: rgba(139, 92, 246, 0.15); color: var(--violet-glow); }

.contact-chip .chip-label {
    font-family: 'Sora', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ghost);
    display: block;
    margin-bottom: 2px;
}

.contact-chip .chip-email {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 0.9rem;
    color: var(--snow);
    font-weight: 500;
    overflow-wrap: anywhere;
    display: block;
}

.contact-chip:hover .chip-email { color: var(--teal-glow); }
.contact-chip > span:last-child { flex: 1; min-width: 0; }

/* ─── Status pill ─── */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(245, 166, 35, 0.10);
    border: 1px solid rgba(245, 166, 35, 0.3);
    border-radius: var(--radius-full);
    font-family: 'Sora', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--amber-glow);
    margin-bottom: 20px;
}

.status-pill::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 10px var(--amber-glow);
    animation: pulse 2s infinite;
}

/* ─── Language switcher (inline) ─── */
.lang-switcher-inline {
    position: relative;
}

.lang-switcher-inline .lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--snow);
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
}

.lang-switcher-inline .lang-btn:hover {
    background: var(--glass-hover);
    border-color: var(--glass-strong);
    color: var(--white);
}

.lang-switcher-inline .lang-btn svg { width: 14px; height: 14px; }

.lang-switcher-inline .lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--abyss);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: all var(--duration-fast) var(--ease-out);
}

.lang-switcher-inline .lang-menu.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.lang-switcher-inline .lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--snow);
    font-family: 'Sora', sans-serif;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: background var(--duration-fast);
}

.lang-switcher-inline .lang-option:hover {
    background: var(--glass-hover);
    color: var(--white);
}

.lang-switcher-inline .lang-option.active {
    background: rgba(46, 205, 167, 0.12);
    color: var(--teal-glow);
}

.lang-switcher-inline .lang-option .soon {
    margin-left: auto;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ghost);
}

/* ─── Back to top FAB ─── */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--abyss);
    border: 1px solid var(--glass-strong);
    color: var(--snow);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 90;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--duration) var(--ease-out);
    box-shadow: var(--shadow-lg);
}

.back-to-top svg { width: 18px; height: 18px; }

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--teal);
    color: var(--void);
    border-color: var(--teal);
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    .back-to-top { bottom: 16px; right: 16px; width: 42px; height: 42px; }
}

/* ─── FAQ enhancements ─── */
.faq-question .faq-icon {
    transition: transform var(--duration) var(--ease-out);
}
.faq-item[open] .faq-icon {
    transform: rotate(45deg);
}

/* ─── Mobile nav drawer ─── */
@media (max-width: 968px) {
    /* backdrop-filter on .site-header traps fixed descendants;
       disable at mobile so the nav drawer can escape to the viewport. */
    .site-header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(11, 14, 23, 0.95);
    }

    .nav {
        padding: 20px 18px 28px;
        box-shadow: -20px 0 40px rgba(0, 0, 0, 0.4);
    }
    .nav::before {
        content: '';
        display: block;
        height: 4px;
        width: 32px;
        border-radius: 2px;
        background: var(--glass-strong);
        margin: 0 auto 16px;
        opacity: 0.5;
    }
    .nav-link {
        position: relative;
        border-bottom: 1px solid var(--glass-border);
        border-radius: 0;
        padding: 16px 6px;
        font-size: 1.05rem;
    }
    .nav-link:last-of-type { border-bottom: none; }
    .nav-link.active::after { display: none; }
    .nav-link.active {
        color: var(--amber-glow);
    }

    .nav.open::after {
        content: '';
        position: fixed;
        inset: var(--header-h) 100% 0 -100vw;
        width: 200vw;
        background: rgba(0, 0, 0, 0.55);
        z-index: -1;
        pointer-events: none;
        animation: fadeIn 0.3s var(--ease-out);
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

/* ─── Mobile refinements (legacy block kept thin; new system below) ─── */
@media (max-width: 640px) {
    .section-sm { padding: 40px 0; }
    .footer-grid { gap: 24px; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE EXPERIENCE OVERHAUL
   Mobile-first ground-up redesign: typography, spacing, touch
   targets, new components (status cards, bottom CTA bar, full-
   screen menu, compact lang switcher, scrollable sibling pills).
   Engaged at <= 640px (phones) and <= 968px (small tablets).
   ═══════════════════════════════════════════════════════════════ */

/* Kill any horizontal overflow at the root */
html, body {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}
/* Defensive: nothing inside body should ever exceed its container */
body * {
    max-width: 100%;
}
/* Explicit overrides for things that legitimately can be wider via CSS */
body .hero-globe,
body .hero-globe svg,
body .hero-foundation::before,
body::before,
body::after,
body .nav.open::after { max-width: none; }

/* Long titles never break out of their container */
h1, h2, h3, h4 {
    overflow-wrap: break-word;
    word-wrap: break-word;
    -webkit-hyphens: none;
    hyphens: none;
}

/* CRITICAL: the slide-out mobile nav drawer (when closed) extends past
   the viewport via transform. Constrain it to zero size when closed so
   browsers (especially headless renderers) don't grow body width. */
@media (max-width: 968px) {
    .nav:not(.open) {
        visibility: hidden;
        pointer-events: none;
        /* belt-and-braces: use right:-9999px so layout-overflow detectors don't see it */
    }
}
/* When the nav is opened, restore */
.nav.open { visibility: visible; pointer-events: auto; }

/* ─── PHONE: 0–640px ─── */
@media (max-width: 640px) {

    /* Typography rescale (overrides clamp() from main.css with tighter mobile values).
       Conservative — title stays comfortably inside even narrow phone viewports. */
    .hero h1 {
        font-size: clamp(1.4rem, 5.2vw, 1.85rem) !important;
        line-height: 1.2;
        letter-spacing: -0.02em;
        word-break: normal;
        overflow-wrap: break-word;
        hyphens: none;
        margin-bottom: 18px;
        max-width: 100%;
        text-shadow: none;
    }
    .hero h1 span { display: inline; }
    .hero-lede {
        font-size: 0.98rem !important;
        line-height: 1.6;
        margin-bottom: 26px;
        max-width: 100%;
        text-shadow: none;
    }
    /* Section H2s — tighten as well */
    .section-header h2,
    section h2,
    .prose h2 {
        font-size: clamp(1.35rem, 5.2vw, 1.85rem) !important;
        line-height: 1.22;
    }
    .section-header h2,
    section h2 {
        font-size: clamp(1.5rem, 6vw, 1.85rem) !important;
        line-height: 1.2;
    }
    .section-header p,
    .hero-lede {
        font-size: 1rem !important;
    }
    .prose h2 {
        font-size: 1.45rem !important;
        margin-top: 32px;
    }
    .prose h3 {
        font-size: 1.15rem !important;
    }
    .prose p,
    .prose li {
        font-size: 0.98rem;
    }

    /* Container breathing room — keep content off the viewport edges. */
    .container { padding: 0 20px; }
    .container-narrow { padding: 0 20px; }

    /* ─── Header: slim, focused ─── */
    .site-header { height: 60px; }
    .header-inner { padding: 0 18px; gap: 8px; }
    .brand { gap: 8px; font-size: 1rem; }
    .brand-mark { width: 32px; height: 32px; }
    .brand > span:nth-child(2) { font-size: 1rem; }
    .brand-tag { font-size: 0.6rem; padding: 2px 6px; }

    /* Hide the desktop "Apply" pill in header (we have the bottom CTA bar) */
    .header-actions .btn-primary.btn-sm { display: none; }

    /* Compact language switcher: show only the flag, drop the EN/AR/etc code */
    .lang-switcher-inline .lang-btn {
        padding: 8px 10px;
        gap: 4px;
    }
    .lang-switcher-inline .lang-btn .lang-code { display: none !important; }
    .lang-switcher-inline .lang-btn svg { width: 12px; height: 12px; }
    .lang-switcher-inline .lang-menu {
        right: 0;
        min-width: 220px;
        padding: 8px;
    }
    .lang-switcher-inline .lang-option { padding: 12px 14px; }

    .nav-toggle { width: 44px; height: 44px; }

    /* ─── Hero ─── */
    .hero { padding: 32px 0 48px !important; }
    .hero-foundation { padding-top: 24px !important; padding-bottom: 40px !important; }
    .hero-globe { display: none; }       /* Decorative — hide on phones */
    .hero-coin {
        width: 84px; height: 84px;
        margin: 0 auto 18px;
    }
    .hero-eyebrow { margin-bottom: 14px; }
    .hero-eyebrow .eyebrow {
        font-size: 0.68rem;
        padding: 5px 12px;
    }
    .hero-actions {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 32px;
    }
    .hero-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 52px;
        font-size: 1rem;
    }

    /* Hero stats: 2×2 grid, bigger values, generous spacing */
    .hero-stats {
        grid-template-columns: 1fr 1fr;
        gap: 14px 12px;
        padding: 18px 14px;
        border-radius: var(--radius-lg);
    }
    .hero-stat-value {
        font-size: 1.5rem !important;
        line-height: 1;
        margin-bottom: 6px;
    }
    .hero-stat-label {
        font-size: 0.7rem;
        line-height: 1.35;
        letter-spacing: 0.06em;
    }

    /* ─── Sibling strip → 2×2 mini-grid ─── */
    .sibling-strip { padding: 14px 0; }
    .sibling-strip-inner {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .sibling-strip-label {
        grid-column: 1 / -1;
        text-align: center;
        margin-bottom: 2px;
        font-size: 0.62rem;
    }
    .sibling-strip a {
        padding: 12px 12px;
        background: var(--glass);
        border: 1px solid var(--glass-border);
        font-size: 0.78rem;
        justify-content: flex-start;
        min-height: 44px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .sibling-strip a strong { font-size: 0.78rem; }

    /* ─── Mission section ─── */
    section { padding: 48px 0; }
    .section-header { margin-bottom: 28px; }
    article.prose .eyebrow,
    .section-header .eyebrow { font-size: 0.65rem; padding: 5px 10px; }

    .mission-alloc {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 22px 0 8px;
    }
    .alloc-chip {
        padding: 16px 18px;
        gap: 4px;
    }
    .alloc-chip .num { font-size: 1.4rem; }
    .alloc-chip .label { font-size: 0.7rem; }
    .alloc-chip .detail { font-size: 0.9rem; }

    /* Chain widget: stack vertically, generous tap area */
    .chain-widget {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px 18px;
    }
    .chain-widget > .live-dot {
        position: absolute;
        top: 18px;
        right: 18px;
    }
    .chain-widget {
        position: relative;
        padding-right: 36px;
    }
    .chain-widget .label { font-size: 0.65rem; }
    .chain-widget .val { font-size: 1.05rem; }
    .chain-widget .aside {
        text-align: left;
        padding-top: 10px;
        border-top: 1px dashed var(--glass-border);
    }

    /* ─── Pillar / partner / committee cards ─── */
    .grid { gap: 14px; }
    .card { padding: 22px 20px; }
    .card h3 { font-size: 1.15rem; margin-bottom: 8px; }
    .card p { font-size: 0.95rem; }
    .card-icon { width: 44px; height: 44px; font-size: 1.2rem; margin-bottom: 14px; }
    .pillar-card { min-height: 0; padding-top: 28px; }
    .pillar-card .pillar-num { top: 14px; right: 18px; font-size: 0.62rem; }
    .card-link {
        margin-top: 18px;
        font-size: 0.95rem;
        padding: 10px 0;
    }

    /* "We fund / We don't fund" lists — bigger spacing */
    .grid > .card ul {
        gap: 12px !important;
        margin-top: 14px !important;
    }
    .grid > .card ul li {
        font-size: 0.95rem;
        line-height: 1.5;
        padding-left: 24px !important;
    }

    /* ─── How-it-works timeline ─── */
    .timeline {
        padding-left: 38px;
    }
    .timeline::before { left: 14px; }
    .timeline-dot {
        left: -38px;
        width: 28px; height: 28px;
        font-size: 0.78rem;
    }
    .timeline-content {
        padding: 16px 18px;
        border-radius: var(--radius-md);
    }
    .timeline-phase { font-size: 0.68rem; }
    .timeline-content h3 { font-size: 1.05rem; margin-bottom: 6px; }
    .timeline-content p { font-size: 0.93rem; }

    /* ─── Grant form ─── */
    .grant-form { padding: 22px 20px; border-radius: var(--radius-lg); }
    .form-grid { grid-template-columns: 1fr; gap: 14px; }
    .form-field label { font-size: 0.72rem; letter-spacing: 0.06em; }
    .form-field input,
    .form-field select,
    .form-field textarea {
        padding: 14px 14px;
        font-size: 1rem;
        min-height: 50px;
        border-radius: var(--radius-sm);
    }
    .form-field textarea {
        min-height: 110px;
    }
    .form-field .hint { font-size: 0.78rem; }
    .form-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .form-footer .btn { width: 100%; justify-content: center; min-height: 52px; }
    .form-checkbox { font-size: 0.85rem; line-height: 1.55; }
    .form-checkbox input { transform: scale(1.15); margin-top: 2px; }

    /* ─── Contact chips ─── */
    .contact-chip-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .contact-chip {
        padding: 14px 16px;
        min-height: 64px;
    }
    .contact-chip .chip-icon { width: 38px; height: 38px; font-size: 1.05rem; }
    .contact-chip .chip-label { font-size: 0.68rem; }
    .contact-chip .chip-email { font-size: 0.88rem; }

    /* CTA block compression */
    .cta-block { padding: 36px 20px; border-radius: var(--radius-lg); }
    .cta-block h2 { font-size: 1.5rem !important; }
    .cta-block p { font-size: 0.95rem; }
    .cta-actions { flex-direction: column; gap: 10px; }
    .cta-actions .btn { width: 100%; justify-content: center; min-height: 52px; }

    /* ─── Status: hide table, show stacked cards ─── */
    .table-wrap { border-radius: var(--radius-lg); }
    #status .table-wrap > .table {
        display: none;
    }
    #status .table-wrap {
        border: none;
        background: transparent;
        overflow: visible;
    }
    #status .table-wrap::before {
        content: '';
        display: block;
    }
    .status-card-list {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }
    .status-card {
        background: var(--glass);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-lg);
        padding: 16px 18px;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .status-card .sc-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
    }
    .status-card .sc-comp {
        font-family: 'Sora', sans-serif;
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--white);
        line-height: 1.3;
        flex: 1;
    }
    .status-card .sc-notes {
        font-size: 0.88rem;
        color: var(--mist);
        line-height: 1.5;
    }

    /* ─── FAQ ─── */
    .faq-question { padding: 18px 20px; font-size: 0.98rem; gap: 12px; }
    .faq-icon { width: 26px; height: 26px; }
    .faq-answer { padding: 0 20px 20px; font-size: 0.93rem; line-height: 1.65; }

    /* ─── Announcements ─── */
    .announce-item {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px 18px;
    }
    .announce-date {
        border-right: none;
        padding-right: 0;
        padding-bottom: 6px;
        border-bottom: 1px dashed var(--glass-border);
        font-size: 0.78rem;
    }
    .announce-body h4 { font-size: 0.98rem; }
    .announce-body p { font-size: 0.92rem; }

    /* ─── Committee ─── */
    .seat-card { padding: 18px 20px; }
    .seat-card .seat-title { font-size: 1rem; }
    .seat-card .seat-status { font-size: 0.62rem; padding: 3px 8px; }
    .seat-card .seat-scope { font-size: 0.92rem; }
    .seat-card .seat-criteria li { font-size: 0.82rem; }
    .seat-card .seat-action { font-size: 0.9rem; padding: 6px 0; }

    /* ─── Transparency feature rows ─── */
    .feature-row {
        grid-template-columns: 44px 1fr;
        gap: 14px;
        padding: 18px 18px;
    }
    .feature-row-icon {
        width: 40px; height: 40px;
        font-size: 1.05rem;
    }
    .feature-row h4 { font-size: 1rem; }
    .feature-row p { font-size: 0.92rem; }

    /* ─── Footer ─── */
    .site-footer { padding: 48px 0 110px; /* leave room for bottom CTA bar */ }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; margin-bottom: 32px; }
    .footer-brand p { font-size: 0.92rem; }
    .footer-col h5 { font-size: 0.7rem; margin-bottom: 14px; }
    .footer-col a { font-size: 0.92rem; padding: 6px 0; display: inline-block; }
    .footer-bottom { flex-direction: column; gap: 14px; text-align: center; padding-top: 22px; }
    .footer-bottom .footer-copy { font-size: 0.78rem; line-height: 1.5; }

    /* ─── Hide back-to-top FAB on mobile (covered by bottom CTA bar) ─── */
    .back-to-top {
        bottom: 84px;
        right: 12px;
        width: 40px; height: 40px;
    }

    /* ─── Ribbon divider tighter ─── */
    .ribbon-divider { margin: 14px auto; }
}

/* ─── Very small phones (≤ 380px): one final tighten ─── */
@media (max-width: 380px) {
    .container, .container-narrow { padding: 0 16px; }
    .header-inner { padding: 0 14px; }
    .hero h1 { font-size: 1.5rem !important; }
    .hero-lede { font-size: 0.94rem !important; }
    .hero-stats { padding: 16px 12px; gap: 12px 8px; }
    .hero-stat-value { font-size: 1.35rem !important; }
    .sibling-strip a { padding: 9px 10px; font-size: 0.74rem; }
    .card { padding: 20px 18px; }
    .alloc-chip .num { font-size: 1.3rem; }
}

/* ───────────────────────────────────────────────────────────────
   MOBILE BOTTOM CTA BAR
   Sticky bar at the bottom of the viewport — Apply + Menu — so
   the primary actions are always one thumb-tap away.
   ─────────────────────────────────────────────────────────────── */
.mobile-cta-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 95;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(11, 14, 23, 0.94);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-top: 1px solid var(--glass-strong);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.3s var(--ease-out);
}
.mobile-cta-bar.hidden { transform: translateY(110%); }
.mobile-cta-bar-inner {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.mobile-cta-bar .cta-menu-btn {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--snow);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease-out);
}
.mobile-cta-bar .cta-menu-btn:hover,
.mobile-cta-bar .cta-menu-btn:active {
    background: var(--glass-hover);
    color: var(--white);
}
.mobile-cta-bar .cta-menu-btn svg { width: 20px; height: 20px; }
.mobile-cta-bar .cta-apply-btn {
    flex: 1;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--ember), var(--ember-deep));
    color: var(--white);
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-ember);
}
.mobile-cta-bar .cta-apply-btn:hover {
    color: var(--white);
    transform: translateY(-1px);
}
.mobile-cta-bar .cta-apply-btn svg { width: 16px; height: 16px; }

@media (max-width: 968px) {
    .mobile-cta-bar { display: block; }
}

/* ───────────────────────────────────────────────────────────────
   FULLSCREEN MOBILE MENU
   Replaces the side drawer at <= 640px with a full-screen overlay
   that has bigger tap targets, language switcher, and CTAs.
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .nav.open {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: none !important;
        background: var(--void) !important;
        border-left: none !important;
        padding: 24px 20px 100px !important;
        overflow-y: auto !important;
        gap: 0 !important;
        box-shadow: none !important;
    }
    .nav.open::before { display: none; }
    .nav.open .nav-link {
        padding: 18px 4px !important;
        font-size: 1.15rem !important;
        font-weight: 600;
        border-bottom: 1px solid var(--glass-border);
    }
    .nav.open::after {
        display: none !important;
    }
}

/* ───────────────────────────────────────────────────────────────
   TABLET (641–968px) — refinements between phone and desktop
   ─────────────────────────────────────────────────────────────── */
@media (min-width: 641px) and (max-width: 968px) {
    .hero h1 { font-size: clamp(2.25rem, 5vw, 2.85rem) !important; }
    .hero-stats { grid-template-columns: repeat(4, 1fr); gap: 18px; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .committee-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .container { padding: 0 24px; }
    .header-actions .btn-primary.btn-sm { display: inline-flex; }
}

/* ───────────────────────────────────────────────────────────────
   COMMON: better tap-target hygiene everywhere
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 968px) {
    /* Min 44×44 target for primary interactive elements */
    .btn { min-height: 44px; }
    .nav-link { min-height: 44px; display: flex; align-items: center; }
    .seat-action,
    .card-link {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    /* Prevent text from being too tightly underlined when tapped */
    a { -webkit-tap-highlight-color: rgba(46, 205, 167, 0.15); }
    button, .btn { -webkit-tap-highlight-color: transparent; }
}

/* ─── Focus rings (a11y) ─── */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--teal-glow);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Keep form inputs' normal focus (already styled above) */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline-offset: 0;
}

/* ─── Anchor scroll offset ─── */
section[id] { scroll-margin-top: calc(var(--header-h) + 20px); }

/* ─── RTL support preserved from parent ─── */
[dir="rtl"] .sibling-strip-inner { flex-direction: row-reverse; }
[dir="rtl"] .back-to-top { right: auto; left: 24px; }
[dir="rtl"] .announce-item { grid-template-columns: 1fr 110px; }
[dir="rtl"] .announce-date { border-right: none; border-left: 1px solid var(--glass-border); padding-right: 0; padding-left: 18px; }

/* RTL: flip arrows and reverse-direction iconography */
[dir="rtl"] .seat-action,
[dir="rtl"] .card-link,
[dir="rtl"] .nav-link.active::after { direction: rtl; }
[dir="rtl"] .seat-action,
[dir="rtl"] .card-link svg { transform: scaleX(-1); }
[dir="rtl"] .card-link:hover svg { transform: scaleX(-1) translateX(4px); }

/* RTL: We-fund bullets need their arrow on the right */
[dir="rtl"] .grid > .card ul li {
    padding-left: 0 !important;
    padding-right: 22px;
}
[dir="rtl"] .grid > .card ul li > span[aria-hidden] {
    left: auto !important;
    right: 0;
}

/* RTL: timeline aligned right */
[dir="rtl"] .timeline { padding-left: 0; padding-right: 48px; }
[dir="rtl"] .timeline::before { left: auto; right: 16px; }
[dir="rtl"] .timeline-dot { left: auto; right: -48px; }

/* RTL: alloc chip & contact chip natural flow */
[dir="rtl"] .alloc-chip { text-align: right; }
[dir="rtl"] .contact-chip { text-align: right; }

/* RTL: 404 tiles & mission alloc need text-align right */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .hero, [dir="rtl"] .section-header,
[dir="rtl"] .cta-block { text-align: center; }
[dir="rtl"] .footer-grid > .footer-col h5,
[dir="rtl"] .footer-grid > .footer-brand p { text-align: right; }
[dir="rtl"] .footer-bottom { flex-direction: row-reverse; }
[dir="rtl"] .footer-col ul { padding-right: 0; }

/* RTL: form labels right-aligned */
[dir="rtl"] .form-field label,
[dir="rtl"] .form-field input,
[dir="rtl"] .form-field select,
[dir="rtl"] .form-field textarea { text-align: right; }
[dir="rtl"] .form-field input,
[dir="rtl"] .form-field textarea,
[dir="rtl"] .form-field select { direction: rtl; }
[dir="rtl"] input[type="url"],
[dir="rtl"] input[type="email"],
[dir="rtl"] code { direction: ltr; unicode-bidi: embed; text-align: left; }

/* Lang switcher: keep flag/code LTR even in RTL pages */
.lang-switcher-inline .lang-btn .lang-flag,
.lang-switcher-inline .lang-btn .lang-code,
.lang-switcher-inline .lang-option .lang-flag { direction: ltr; }

/* ───────────────────────────────────────────────────────────────
   FONT FALLBACKS for non-Latin scripts.
   Sora / DM Sans / JetBrains Mono don't ship CJK / Thai / Devanagari
   glyphs — pull in Noto Sans subsets and prepend them to the stack
   for the relevant <html lang> values.
   ─────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Sans+TC:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600;700&family=Noto+Sans+KR:wght@400;500;600;700&family=Noto+Sans+Thai:wght@400;500;600;700&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap');

html[lang="zh"] body,
html[lang="zh"] h1, html[lang="zh"] h2, html[lang="zh"] h3, html[lang="zh"] h4, html[lang="zh"] h5, html[lang="zh"] h6,
html[lang="zh"] .brand,
html[lang="zh"] button {
    font-family: 'Noto Sans SC', 'Sora', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

html[lang="th"] body,
html[lang="th"] h1, html[lang="th"] h2, html[lang="th"] h3, html[lang="th"] h4, html[lang="th"] h5, html[lang="th"] h6,
html[lang="th"] .brand,
html[lang="th"] button {
    font-family: 'Noto Sans Thai', 'Sora', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

html[lang="hi"] body,
html[lang="hi"] h1, html[lang="hi"] h2, html[lang="hi"] h3, html[lang="hi"] h4, html[lang="hi"] h5, html[lang="hi"] h6,
html[lang="hi"] .brand,
html[lang="hi"] button {
    font-family: 'Noto Sans Devanagari', 'Sora', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* Thai needs slightly more line-height to avoid clipped tone marks */
html[lang="th"] body { line-height: 1.75; }
html[lang="th"] h1, html[lang="th"] h2, html[lang="th"] h3 { line-height: 1.4; }

/* Hindi text-shadow can muddy Devanagari conjuncts; soften where applied */
html[lang="hi"] .hero h1 { text-shadow: none; }

/* ═══════════════════════════════════════════════════════════════
   POLICY PAGES (privacy / terms / accessibility)
   Two-column layout: sticky TOC on the left, numbered section
   cards on the right. Collapses to a single-column accordion on
   mobile.
   ═══════════════════════════════════════════════════════════════ */

.hero-policy { padding: 64px 0 32px; text-align: center; }
.hero-policy h1 {
    font-family: 'Sora', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 14px auto 16px;
    max-width: 16ch;
}
.hero-policy .hero-lede {
    color: var(--mist);
    max-width: 60ch;
    margin: 0 auto;
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.6;
}

.policy-meta {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
}
.policy-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    font-size: 0.8rem;
    color: var(--mist);
    font-family: 'Sora', sans-serif;
    font-weight: 500;
}
.policy-pill svg { width: 14px; height: 14px; opacity: 0.85; }
.policy-pill-teal { color: var(--teal-glow); border-color: rgba(46, 205, 167, 0.28); background: rgba(46, 205, 167, 0.08); }
.policy-pill-amber { color: var(--amber-glow); border-color: rgba(245, 166, 35, 0.28); background: rgba(245, 166, 35, 0.08); }

.policy-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 56px;
    align-items: start;
    padding-top: 32px;
    padding-bottom: 64px;
}

.policy-toc {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    padding: 4px 0 24px;
    border-left: 1px solid var(--glass-border);
}
.policy-toc-title {
    font-family: 'Sora', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ghost);
    margin: 0 0 14px 18px;
}
.policy-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.policy-toc-list a {
    display: block;
    padding: 8px 18px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--mist);
    font-size: 0.88rem;
    line-height: 1.4;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
}
.policy-toc-list a:hover {
    color: var(--snow);
    border-left-color: var(--glass-strong);
}
.policy-toc-list a.is-active {
    color: var(--teal-glow);
    border-left-color: var(--teal);
    background: linear-gradient(90deg, rgba(46, 205, 167, 0.08), transparent 60%);
    font-weight: 500;
}

.policy-content { min-width: 0; }

.policy-content > * + * { margin-top: 28px; }

.policy-section {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    scroll-margin-top: calc(var(--header-h) + 24px);
    transition: border-color var(--duration) var(--ease-out);
}
.policy-section:hover { border-color: var(--glass-strong); }

.policy-section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
}
.policy-section-num {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(46, 205, 167, 0.16), rgba(46, 205, 167, 0.04));
    border: 1px solid rgba(46, 205, 167, 0.28);
    color: var(--teal-glow);
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
}
.policy-section-num.num-ember {
    background: linear-gradient(135deg, rgba(232, 93, 58, 0.16), rgba(232, 93, 58, 0.04));
    border-color: rgba(232, 93, 58, 0.28);
    color: var(--ember-glow);
}
.policy-section-num.num-amber {
    background: linear-gradient(135deg, rgba(245, 166, 35, 0.16), rgba(245, 166, 35, 0.04));
    border-color: rgba(245, 166, 35, 0.28);
    color: var(--amber-glow);
}

.policy-section-head h2 {
    font-family: 'Sora', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--white);
}
.policy-section-anchor {
    margin-left: auto;
    color: var(--ghost);
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-out);
    text-decoration: none;
    line-height: 1;
}
.policy-section:hover .policy-section-anchor,
.policy-section-anchor:focus-visible { opacity: 1; }
.policy-section-anchor svg { width: 18px; height: 18px; }

.policy-section p {
    color: var(--snow);
    line-height: 1.7;
    margin: 0 0 14px;
    font-size: 1rem;
}
.policy-section p:last-child { margin-bottom: 0; }
.policy-section a {
    color: var(--teal-glow);
    border-bottom: 1px solid rgba(46, 205, 167, 0.3);
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
}
.policy-section a:hover { border-bottom-color: var(--teal-glow); }
.policy-section code {
    background: var(--abyss);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 0.88em;
    color: var(--amber-glow);
    font-family: 'JetBrains Mono', monospace;
}

/* Themed lists: ✓ for "what we do", ✗ for "what we don't", → for next steps */
.policy-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 8px;
    display: grid;
    gap: 12px;
}
.policy-list li {
    position: relative;
    padding: 12px 16px 12px 46px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--snow);
    font-size: 0.96rem;
    line-height: 1.55;
}
.policy-list li::before {
    position: absolute;
    left: 14px;
    top: 12px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}
.policy-list-no li::before {
    content: '✕';
    background: rgba(232, 93, 58, 0.15);
    border: 1px solid rgba(232, 93, 58, 0.4);
    color: var(--ember-glow);
}
.policy-list-yes li::before {
    content: '✓';
    background: rgba(46, 205, 167, 0.16);
    border: 1px solid rgba(46, 205, 167, 0.4);
    color: var(--teal-glow);
}
.policy-list-arrow li::before {
    content: '→';
    background: rgba(245, 166, 35, 0.14);
    border: 1px solid rgba(245, 166, 35, 0.36);
    color: var(--amber-glow);
}

.policy-callout {
    margin: 22px 0;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(46, 205, 167, 0.06), rgba(46, 205, 167, 0.02));
    border: 1px solid rgba(46, 205, 167, 0.22);
    border-left: 3px solid var(--teal);
    border-radius: var(--radius-md);
    color: var(--snow);
    font-size: 0.96rem;
    line-height: 1.6;
}
.policy-callout strong { color: var(--white); }
.policy-callout-ember {
    background: linear-gradient(135deg, rgba(232, 93, 58, 0.06), rgba(232, 93, 58, 0.02));
    border-color: rgba(232, 93, 58, 0.22);
    border-left-color: var(--ember);
}

/* Closing contact card */
.policy-contact {
    background: linear-gradient(135deg, rgba(46, 205, 167, 0.08), rgba(232, 93, 58, 0.04));
    border: 1px solid rgba(46, 205, 167, 0.22);
    border-radius: var(--radius-xl);
    padding: 36px 40px;
    text-align: center;
}
.policy-contact h3 {
    font-family: 'Sora', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 10px;
}
.policy-contact p {
    color: var(--mist);
    line-height: 1.6;
    max-width: 52ch;
    margin: 0 auto 22px;
    font-size: 0.96rem;
}
.policy-contact a code {
    font-family: 'JetBrains Mono', monospace;
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 0.95em;
}

/* Mobile / tablet: collapse the TOC into a "Jump to section" details box. */
@media (max-width: 968px) {
    .hero-policy { padding: 48px 0 24px; }
    .policy-shell {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top: 16px;
        padding-bottom: 48px;
    }
    .policy-toc {
        position: static;
        max-height: none;
        overflow: visible;
        padding: 0;
        border-left: none;
        background: var(--glass);
        border: 1px solid var(--glass-border);
        border-radius: var(--radius-lg);
    }
    .policy-toc summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        font-family: 'Sora', sans-serif;
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.14em;
        color: var(--mist);
        cursor: pointer;
        list-style: none;
    }
    .policy-toc summary::-webkit-details-marker { display: none; }
    .policy-toc summary::after {
        content: '';
        width: 10px; height: 10px;
        border-right: 2px solid var(--mist);
        border-bottom: 2px solid var(--mist);
        transform: rotate(45deg);
        transition: transform var(--duration) var(--ease-out);
    }
    .policy-toc[open] summary::after { transform: rotate(-135deg); }
    .policy-toc-title { display: none; }
    .policy-toc-list {
        padding: 4px 12px 16px;
    }
    .policy-toc-list a {
        padding: 10px 14px;
        margin-left: 0;
        border-left: none;
        border-radius: var(--radius-sm);
    }
    .policy-toc-list a.is-active {
        background: rgba(46, 205, 167, 0.1);
        border-left-color: transparent;
    }
    .policy-section { padding: 24px 22px; border-radius: var(--radius-lg); }
    .policy-section-head { gap: 12px; }
    .policy-section-num { width: 34px; height: 34px; font-size: 0.78rem; }
    .policy-section-head h2 { font-size: 1.18rem; }
    .policy-section p { font-size: 0.96rem; }
    .policy-section-anchor { display: none; }
    .policy-list li { padding: 12px 16px 12px 44px; font-size: 0.94rem; }
    .policy-contact { padding: 28px 22px; border-radius: var(--radius-lg); }
    .policy-contact h3 { font-size: 1.1rem; }
}

@media (max-width: 540px) {
    .hero-policy { padding: 36px 0 20px; }
    .policy-section { padding: 22px 18px; }
    .policy-list li { padding: 12px 14px 12px 40px; font-size: 0.92rem; }
    .policy-list li::before { left: 10px; width: 20px; height: 20px; font-size: 11px; }
    .policy-contact { padding: 24px 18px; }
    .hero-policy h1 { font-size: 1.85rem; }
}

/* RTL refinements */
[dir="rtl"] .policy-toc { border-left: none; border-right: 1px solid var(--glass-border); }
[dir="rtl"] .policy-toc-title { margin: 0 18px 14px 0; }
[dir="rtl"] .policy-toc-list a { border-left: none; border-right: 2px solid transparent; }
[dir="rtl"] .policy-toc-list a.is-active {
    border-right-color: var(--teal);
    background: linear-gradient(-90deg, rgba(46, 205, 167, 0.08), transparent 60%);
}
[dir="rtl"] .policy-section-anchor { margin-left: 0; margin-right: auto; }
[dir="rtl"] .policy-list li { padding: 12px 46px 12px 16px; }
[dir="rtl"] .policy-list li::before { left: auto; right: 14px; }
[dir="rtl"] .policy-callout { border-left: none; border-right: 3px solid var(--teal); }
[dir="rtl"] .policy-callout-ember { border-right-color: var(--ember); }
