/* =====================================================================
   TitanCore — design system
   ---------------------------------------------------------------------
   Two themes, selected on <html data-theme="…">:
     obsidian  black obsidian + imperial gold. Sharp, engraved, architectural.
     sapphire  midnight sapphire + champagne gold. Soft, glass, nocturnal.
   Two directions, selected on <html dir="…">. Everything below uses logical
   properties (inline-start / inline-end), never left/right, so one stylesheet
   serves Persian (rtl) and English (ltr).

   The short token names at the bottom of each theme (--gold, --card, --text2 …)
   are kept for the contract-console pages carried over from Meet, which style
   themselves with them.
   ===================================================================== */

/* ---------- typography by language ---------- */
:root {
    --font-fa: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
    --font-en: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, Menlo, monospace;
}

html[lang="fa"] { --font-body: var(--font-fa); --font-display: var(--font-fa); }
html[lang="en"] { --font-body: var(--font-en); }
html[lang="en"][data-theme="obsidian"] { --font-display: "Cinzel", "Times New Roman", serif; }
html[lang="en"][data-theme="sapphire"] { --font-display: "Sora", var(--font-en); }

/* ---------- theme: obsidian ---------- */
html[data-theme="obsidian"] {
    --bg: #08080a;
    --surface: #101014;
    --surface-2: #16161c;
    --surface-3: #1d1d25;
    --inset: #050506;
    --line: #24242c;
    --line-strong: #363640;
    --text: #f4efe4;
    --text2: #aaa399;
    --muted: #8b857b;

    --gold: #d4a017;
    --gold-light: #f2c94c;
    --gold-deep: #9c7410;
    --on-gold: #140f03;
    --accent: var(--gold);
    --accent-soft: rgba(212, 160, 23, .12);
    --accent-line: rgba(212, 160, 23, .32);
    --accent-grad: linear-gradient(135deg, #f7dc7a 0%, #d4a017 55%, #a97c0e 100%);

    --ok: #3ecf8e;
    --warn: #f0a63c;
    --danger: #ef5d5d;

    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-pill: 6px;

    --shadow: 0 18px 40px -22px rgba(0, 0, 0, .9);
    --panel-bg: linear-gradient(180deg, #121217, #0c0c10);
    --panel-blur: none;
    --header-bg: rgba(8, 8, 10, .82);

    /* carried-over console pages */
    --bg2: var(--surface);
    --bg3: var(--surface-2);
    --card: var(--surface);
    --border: var(--line);
    --red: var(--danger);

    color-scheme: dark;
}

/* ---------- theme: sapphire ---------- */
html[data-theme="sapphire"] {
    --bg: #060a18;
    --surface: #0e1630;
    --surface-2: #131d3b;
    --surface-3: #1a2548;
    --inset: #050916;
    --line: rgba(140, 165, 230, .16);
    --line-strong: rgba(160, 185, 245, .28);
    --text: #ecf1ff;
    --text2: #a6b0cc;
    --muted: #8a95b4;

    --gold: #d8b26a;
    --gold-light: #f0d9a6;
    --gold-deep: #a9823f;
    --on-gold: #1b1405;
    --sapphire: #5b8cff;
    --accent: var(--gold);
    --accent-soft: rgba(216, 178, 106, .12);
    --accent-line: rgba(216, 178, 106, .34);
    --accent-grad: linear-gradient(135deg, #f5e3b8 0%, #d8b26a 50%, #b48a45 100%);

    --ok: #45d6a0;
    --warn: #f3b24e;
    --danger: #ff6b7a;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    --shadow: 0 24px 60px -28px rgba(0, 4, 20, .95);
    --panel-bg: linear-gradient(180deg, rgba(20, 31, 64, .78), rgba(12, 19, 42, .72));
    --panel-blur: blur(18px) saturate(140%);
    --header-bg: rgba(6, 10, 24, .7);

    --bg2: var(--surface);
    --bg3: var(--surface-2);
    --card: var(--surface);
    --border: var(--line);
    --red: var(--danger);

    color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html[data-theme="sapphire"] body {
    background:
        radial-gradient(1200px 600px at 85% -10%, rgba(91, 140, 255, .14), transparent 60%),
        radial-gradient(900px 500px at -10% 30%, rgba(216, 178, 106, .07), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-family: var(--font-display); font-weight: 700; text-wrap: balance; }
p { margin: 0; }
a { color: var(--gold-light); text-decoration: none; }
a:hover { color: var(--gold); }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
code, .mono { font-family: var(--font-mono); }

:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 2px; border-radius: var(--radius-sm); }

/* Addresses, hashes, amounts in code — always left-to-right, even in Persian. */
.ltr { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .ltr { text-align: end; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- page frame ---------- */
.tc-container { width: 100%; max-width: 1232px; margin-inline: auto; padding-inline: 16px; }
.site-main { flex: 1; width: 100%; max-width: 1232px; margin-inline: auto; padding: 32px 16px 56px; }
.site-main.is-wide { max-width: none; padding: 0; }

/* ---------- header ---------- */
.tc-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--line);
}

html[data-theme="obsidian"] .tc-header::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}

.tc-header-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }

.tc-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.tc-brand:hover { color: var(--text); }
.tc-brand svg { width: 34px; height: 34px; flex: none; }
.tc-brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; letter-spacing: .02em; }
html[lang="en"][data-theme="obsidian"] .tc-brand-name { letter-spacing: .14em; text-transform: uppercase; font-size: 1rem; }
.tc-brand-name b { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: inherit; }

.tc-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.tc-nav-end { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }

.tc-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 0;
    background: none;
    color: var(--text2);
    font-size: .92rem;
    font-weight: 500;
    cursor: pointer;
    transition: color .15s, background .15s;
    white-space: nowrap;
}
.tc-nav-link:hover, .tc-nav-link[aria-expanded="true"], .tc-nav-link.is-active { color: var(--gold-light); background: var(--accent-soft); }
.tc-nav-link .caret { width: 10px; height: 10px; transition: transform .2s; }
.tc-nav-link[aria-expanded="true"] .caret { transform: rotate(180deg); }

/* ---------- dropdown ---------- */
.tc-dropdown { position: relative; }

.tc-menu {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    min-width: 290px;
    padding: 8px;
    list-style: none;
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .16s, transform .16s, visibility .16s;
}
html[data-theme="sapphire"] .tc-menu { background: rgba(14, 22, 48, .96); -webkit-backdrop-filter: var(--panel-blur); backdrop-filter: var(--panel-blur); }
.tc-dropdown.is-open > .tc-menu { opacity: 1; visibility: visible; transform: none; }
.tc-menu.align-end { inset-inline-start: auto; inset-inline-end: 0; }

.tc-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text);
    font-size: .92rem;
    text-align: start;
    cursor: pointer;
}
.tc-menu-item:hover, .tc-sub.is-open > .tc-menu-item { background: var(--accent-soft); color: var(--gold-light); }
.tc-menu-item.is-accent { color: var(--gold-light); }
.tc-menu-ico { width: 18px; height: 18px; flex: none; color: var(--gold); }
.tc-menu-ico svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tc-menu-item .chev { width: 10px; height: 10px; margin-inline-start: auto; opacity: .6; }
html[dir="rtl"] .tc-menu-item .chev { transform: scaleX(-1); }
.tc-menu-sep { height: 1px; margin: 6px 4px; background: var(--line); }

/* Submenus fly out towards the inline end on wide screens. */
.tc-sub { position: relative; }
.tc-sub > .tc-menu {
    top: -9px;
    inset-inline-start: calc(100% + 6px);
    min-width: 250px;
}
.tc-sub.is-open > .tc-menu { opacity: 1; visibility: visible; transform: none; }

/* ---------- language switch & user ---------- */
.tc-lang {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    font-size: .78rem;
    font-weight: 600;
}
.tc-lang a { padding: 4px 10px; border-radius: var(--radius-pill); color: var(--text2); }
.tc-lang a.is-current { background: var(--accent-grad); color: var(--on-gold); }

.tc-user { display: inline-flex; align-items: center; gap: 8px; color: var(--text2); font-size: .85rem; max-width: 220px; }
.tc-user-avatar {
    width: 30px; height: 30px; border-radius: 50%; flex: none;
    display: grid; place-items: center;
    background: var(--accent-soft); border: 1px solid var(--accent-line);
    color: var(--gold-light); font-weight: 700; font-size: .8rem;
}
.tc-user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tc-auth { display: inline-flex; align-items: center; gap: 8px; }
.tc-burger { display: none; width: 42px; height: 42px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: none; color: var(--text); cursor: pointer; }
.tc-burger svg { width: 20px; height: 20px; }

/* ---------- drawer (narrow screens) ---------- */
.tc-drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .55); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.tc-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    z-index: 90;
    width: min(340px, 88vw);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    background: var(--surface);
    border-inline-end: 1px solid var(--line-strong);
    transform: translateX(-100%);
    transition: transform .25s ease;
}
html[dir="rtl"] .tc-drawer { transform: translateX(100%); }
body.drawer-open .tc-drawer { transform: none; }
body.drawer-open .tc-drawer-backdrop { opacity: 1; visibility: visible; }
.tc-drawer .tc-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: none; padding: 0 0 0 0; min-width: 0; display: none; }
.tc-drawer .tc-sub.is-open > .tc-menu { display: block; padding-inline-start: 18px; border-inline-start: 1px solid var(--line); margin-inline-start: 18px; }
.tc-drawer .tc-sub > .tc-menu-item .chev { transform: rotate(90deg); }
.tc-drawer .tc-sub.is-open > .tc-menu-item .chev { transform: rotate(-90deg); }
.tc-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tc-drawer-title { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 12px 12px 2px; }

@media (max-width: 1080px) {
    .tc-nav, .tc-nav-end .tc-user, .tc-nav-end .tc-auth { display: none; }
    .tc-header-inner { gap: 12px; }
    .tc-burger { display: inline-grid; place-items: center; }
    .tc-nav-end { margin-inline-start: auto; }
}

@media (max-width: 400px) {
    .tc-brand svg { width: 30px; height: 30px; }
    .tc-brand-name { font-size: 1rem; }
    html[lang="en"][data-theme="obsidian"] .tc-brand-name { font-size: .86rem; letter-spacing: .1em; }
    .tc-lang a { padding: 4px 8px; }
}

/* ---------- footer ---------- */
.tc-footer { border-top: 1px solid var(--line); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); color: var(--muted); font-size: .85rem; }
.tc-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- buttons ---------- */
.btn, .tc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text);
    font-weight: 600;
    font-size: .92rem;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, box-shadow .2s, border-color .15s, background .15s, color .15s;
    white-space: nowrap;
}
.btn:hover, .tc-btn:hover { border-color: var(--accent-line); color: var(--gold-light); }
.btn:disabled, .tc-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn svg, .tc-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.btn-gold, .tc-btn-primary { background: var(--accent-grad); color: var(--on-gold); border-color: transparent; }
.btn-gold:hover, .tc-btn-primary:hover { color: var(--on-gold); transform: translateY(-1px); box-shadow: 0 10px 28px -10px var(--accent-line); border-color: transparent; }
html[lang="en"][data-theme="obsidian"] .tc-btn-primary { text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; }

.btn-outline-gold, .tc-btn-outline { border-color: var(--accent-line); color: var(--gold-light); }
.btn-outline-gold:hover, .tc-btn-outline:hover { background: var(--accent-soft); }
.tc-btn-ghost { border-color: transparent; color: var(--text2); }
.tc-btn-danger { border-color: rgba(239, 93, 93, .4); color: var(--danger); }
.tc-btn-danger:hover { background: rgba(239, 93, 93, .08); color: var(--danger); border-color: var(--danger); }
.btn-sm, .tc-btn-sm { min-height: 34px; padding: 6px 12px; font-size: .82rem; }
.tc-btn-block { width: 100%; }

/* ---------- panels & cards ---------- */
.card, .tc-panel {
    position: relative;
    background: var(--panel-bg);
    -webkit-backdrop-filter: var(--panel-blur);
    backdrop-filter: var(--panel-blur);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
}
html[data-theme="obsidian"] .tc-panel::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline: 14%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}
.card h2 { font-size: 1.1rem; margin-bottom: 16px; }

.tc-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
}
html[lang="fa"] .tc-eyebrow { letter-spacing: 0; font-size: .82rem; }
.tc-eyebrow::before { content: ""; width: 26px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
html[dir="rtl"] .tc-eyebrow::before { background: linear-gradient(270deg, transparent, var(--gold)); }

.tc-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.tc-page-head h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); margin-top: 6px; }
.tc-page-head p { color: var(--text2); margin-top: 8px; max-width: 62ch; }
.tc-gold-text { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ---------- forms ---------- */
.form-group, .tc-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.form-group label, .tc-label { font-size: .85rem; color: var(--text2); font-weight: 500; }
.form-input, .form-control-dark, .tc-input {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    background: var(--inset);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: .95rem;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
html[data-theme="sapphire"] .form-input, html[data-theme="sapphire"] .tc-input { background: rgba(5, 9, 22, .6); }
.form-input:focus, .tc-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-input::placeholder, .tc-input::placeholder { color: var(--muted); }
textarea.tc-input, textarea.form-input { min-height: 96px; resize: vertical; }
select.tc-input { cursor: pointer; }
.tc-help { font-size: .8rem; color: var(--muted); }
.text-danger, .tc-error { color: var(--danger) !important; font-size: .82rem; }
.validation-summary-valid { display: none; }

/* ---------- alerts ---------- */
.alert-danger, .alert-success, .tc-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid;
    font-size: .9rem;
    margin-bottom: 18px;
}
.alert-danger, .tc-alert.is-danger { background: rgba(239, 93, 93, .1); color: #ff9a9a; border-color: rgba(239, 93, 93, .3); }
.alert-success, .tc-alert.is-success { background: rgba(62, 207, 142, .1); color: #7de8b6; border-color: rgba(62, 207, 142, .3); }
.tc-alert.is-info { background: var(--accent-soft); color: var(--gold-light); border-color: var(--accent-line); }
.tc-alert ul { margin: 0; padding-inline-start: 18px; }

/* ---------- badges ---------- */
.tc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: .74rem;
    font-weight: 600;
    border: 1px solid var(--accent-line);
    color: var(--gold-light);
    background: var(--accent-soft);
    white-space: nowrap;
}
.tc-badge.is-muted { color: var(--text2); border-color: var(--line-strong); background: transparent; }
.tc-badge.is-ok { color: var(--ok); border-color: rgba(62, 207, 142, .35); background: rgba(62, 207, 142, .08); }

/* ---------- toast ---------- */
#tcToast {
    position: fixed;
    top: 22px;
    left: 50%;
    z-index: 9999;
    max-width: calc(100vw - 32px);
    padding: 12px 22px;
    border-radius: var(--radius);
    background: var(--accent-grad);
    color: var(--on-gold);
    font-weight: 700;
    font-size: .92rem;
    text-align: center;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -12px);
    transition: opacity .18s, transform .18s;
}
#tcToast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* ---------- modal ---------- */
.tc-modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(0, 0, 0, .68); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.tc-modal.is-open { display: flex; }
.tc-modal-card {
    width: 100%;
    max-width: 480px;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    animation: tc-pop .18s ease-out;
}
html[data-theme="sapphire"] .tc-modal-card { background: linear-gradient(180deg, #131d3b, #0d1530); }
.tc-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.tc-modal-head h3 { font-size: 1.15rem; }
.tc-icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: none; color: var(--text2); cursor: pointer; flex: none; }
.tc-icon-btn:hover { color: var(--gold-light); border-color: var(--accent-line); }
.tc-icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

@keyframes tc-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes tc-spin { to { transform: rotate(360deg); } }
@keyframes tc-shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.tc-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--gold-light); animation: tc-spin .8s linear infinite; display: inline-block; }
.tc-skeleton { border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: tc-shimmer 1.4s linear infinite; }

/* =====================================================================
   HOME
   ===================================================================== */
.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(64px, 9vw, 128px) 0 clamp(56px, 7vw, 96px);
    isolation: isolate;
}
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }

/* Obsidian: an engraved grid and a single gold sunrise. */
html[data-theme="obsidian"] .hero::before {
    inset: 0;
    background-image:
        linear-gradient(rgba(212, 160, 23, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 160, 23, .07) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
html[data-theme="obsidian"] .hero::after {
    width: 900px; height: 900px; top: -520px; left: 50%; transform: translateX(-50%);
    background: radial-gradient(circle, rgba(242, 201, 76, .22), rgba(212, 160, 23, .06) 40%, transparent 65%);
}

/* Sapphire: two drifting auroras. */
html[data-theme="sapphire"] .hero::before {
    width: 720px; height: 720px; top: -260px; inset-inline-end: -160px; border-radius: 50%;
    background: radial-gradient(circle, rgba(91, 140, 255, .35), transparent 65%);
    filter: blur(20px);
    animation: tc-drift 18s ease-in-out infinite alternate;
}
html[data-theme="sapphire"] .hero::after {
    width: 640px; height: 640px; bottom: -300px; inset-inline-start: -180px; border-radius: 50%;
    background: radial-gradient(circle, rgba(216, 178, 106, .22), transparent 65%);
    filter: blur(24px);
    animation: tc-drift 22s ease-in-out infinite alternate-reverse;
}
@keyframes tc-drift { to { transform: translate(60px, 40px) scale(1.08); } }

.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 48px; }
.hero-title { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 4.1rem); line-height: 1.15; letter-spacing: -.01em; }
html[lang="en"][data-theme="obsidian"] .hero-title { letter-spacing: .02em; line-height: 1.12; }
.hero-title .tc-gold-text { display: inline; }
.hero-sub { margin-top: 18px; font-size: clamp(1.02rem, .95rem + .35vw, 1.2rem); color: var(--text2); max-width: 58ch; line-height: 1.95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-actions .tc-btn { min-height: 52px; padding-inline: 26px; }

.hero-emblem { position: relative; aspect-ratio: 1; max-width: 440px; justify-self: center; width: 100%; }
.hero-emblem svg { width: 100%; height: 100%; display: block; overflow: visible; }
.hero-emblem .ring { transform-origin: 50% 50%; animation: tc-spin 60s linear infinite; }
.hero-emblem .ring.rev { animation-direction: reverse; animation-duration: 90s; }

/* The four pillars the brief names: finance, education, AI, blockchain. */
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 44px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-width: 620px; }
.hero-stat { display: flex; align-items: center; gap: 10px; background: var(--bg); padding: 14px 16px; }
html[data-theme="sapphire"] .hero-stat { background: rgba(8, 13, 30, .85); }
.hero-stat-ico { width: 20px; height: 20px; flex: none; color: var(--gold); display: inline-flex; }
.hero-stat b { font-size: .92rem; color: var(--text); font-weight: 600; }
@media (max-width: 560px) { .hero-stats { grid-template-columns: repeat(2, 1fr); } }

.reveal-link { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--gold-light); font-size: .86rem; font-weight: 600; }
.reveal-link .flip-rtl { width: 15px; height: 15px; display: inline-flex; flex: none; }
/* Keep the gold phrase of the hero title on one line where there is room. */
@media (min-width: 640px) { .hero-title .tc-gold-text { white-space: nowrap; } }
html[dir="rtl"] .flip-rtl svg { transform: scaleX(-1); }

.tc-skip { position: absolute; top: -48px; inset-inline-start: 12px; z-index: 300; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--accent-grad); color: var(--on-gold); font-weight: 700; }
.tc-skip:focus { top: 10px; color: var(--on-gold); }
main:focus { outline: none; }

.section { padding: clamp(56px, 7vw, 96px) 0; }
.section.is-tight { padding-top: 0; }
.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head.is-center { margin-inline: auto; text-align: center; }
.section-head.is-center .tc-eyebrow { justify-content: center; }
.section-head h2 { font-size: clamp(1.6rem, 1.2rem + 1.7vw, 2.5rem); margin-top: 10px; }
.section-head p { color: var(--text2); margin-top: 14px; font-size: 1.04rem; }

/* whitepaper band */
.wp-band {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--accent-line);
    background:
        linear-gradient(110deg, var(--accent-soft), transparent 55%),
        var(--panel-bg);
}
.wp-doc { width: 76px; height: 96px; border-radius: var(--radius-sm); border: 1px solid var(--accent-line); background: var(--inset); display: grid; place-items: center; color: var(--gold); position: relative; }
.wp-doc svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.wp-doc::after { content: "PDF"; position: absolute; bottom: 8px; font-size: .62rem; letter-spacing: .14em; color: var(--gold-light); font-family: var(--font-en); }
.wp-band h3 { font-size: 1.35rem; }
.wp-band p { color: var(--text2); margin-top: 8px; }
.wp-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* unveilings */
.reveal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 18px; }
.reveal {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 26px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--panel-bg);
    -webkit-backdrop-filter: var(--panel-blur);
    backdrop-filter: var(--panel-blur);
    overflow: hidden;
    transition: transform .25s, border-color .25s, box-shadow .25s;
}
.reveal:hover { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: var(--shadow); }
.reveal-no {
    position: absolute;
    top: 14px;
    inset-inline-end: 18px;
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1px var(--accent-line);
    opacity: .9;
}
.reveal-ico { width: 52px; height: 52px; border-radius: var(--radius); display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--gold-light); }
html[data-theme="sapphire"] .reveal-ico { border-radius: 50%; }
.reveal-ico svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.reveal h3 { font-size: 1.12rem; padding-inline-end: 56px; }
.reveal p { color: var(--text2); font-size: .94rem; line-height: 1.85; }
.reveal.is-feature { grid-column: span 2; background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--panel-bg); border-color: var(--accent-line); }
@media (max-width: 760px) { .reveal.is-feature { grid-column: auto; } }

/* why */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.why { background: var(--bg); padding: 28px; display: flex; gap: 16px; align-items: flex-start; }
html[data-theme="sapphire"] .why { background: rgba(8, 13, 30, .9); }
.why-mark { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--accent-line); color: var(--gold-light); }
.why-mark svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.why h3 { font-size: 1.02rem; font-family: var(--font-body); font-weight: 700; }
.why p { color: var(--text2); font-size: .9rem; margin-top: 6px; }
@media (max-width: 900px) { .why-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .why-grid { grid-template-columns: 1fr; } }

/* CTA */
.cta {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: clamp(44px, 6vw, 80px) 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--accent-line);
    background: radial-gradient(ellipse at 50% 0%, var(--accent-soft), transparent 70%), var(--panel-bg);
}
.cta h2 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.7rem); }
.cta p { color: var(--text2); margin: 14px auto 0; font-size: 1.1rem; max-width: 52ch; }
.cta .hero-actions { justify-content: center; }

/* app download */
.app-band { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.store-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
    display: inline-flex; align-items: center; gap: 12px;
    min-height: 58px; padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    background: var(--inset);
    color: var(--text);
}
.store-btn:hover { border-color: var(--accent-line); color: var(--text); }
.store-btn svg { width: 26px; height: 26px; fill: currentColor; }
.store-btn small { display: block; font-size: .7rem; color: var(--muted); line-height: 1.2; }
.store-btn b { display: block; font-size: 1rem; line-height: 1.3; }
.store-btn.is-soon { opacity: .55; pointer-events: none; }

@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-emblem { max-width: 300px; order: -1; }
    .wp-band { grid-template-columns: 1fr; text-align: start; }
    .app-band { grid-template-columns: 1fr; }
}

/* =====================================================================
   DASHBOARD
   ===================================================================== */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; }
.dash-tile {
    display: flex; flex-direction: column; gap: 12px;
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--panel-bg);
    -webkit-backdrop-filter: var(--panel-blur);
    backdrop-filter: var(--panel-blur);
    color: var(--text);
    transition: transform .2s, border-color .2s;
}
.dash-tile:hover { color: var(--text); transform: translateY(-3px); border-color: var(--accent-line); }
.dash-tile .reveal-ico { width: 46px; height: 46px; }
.dash-tile h3 { font-size: 1.02rem; font-family: var(--font-body); }
.dash-tile p { color: var(--text2); font-size: .88rem; }
.dash-tile .go { margin-top: auto; color: var(--gold-light); font-size: .85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.dash-tile .go svg { width: 15px; height: 15px; }
html[dir="rtl"] .dash-tile .go svg { transform: scaleX(-1); }
.tc-nav-link .caret { width: 12px; height: 12px; }
html[dir="rtl"] .hero-actions .tc-btn svg, html[dir="rtl"] .tc-btn > svg:last-child:not(:first-child) { transform: scaleX(-1); }
.dash-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* =====================================================================
   AUTH
   ===================================================================== */
.auth-wrap { min-height: calc(100vh - 220px); display: grid; place-items: center; padding: 24px 0; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .tc-panel { padding: 32px; }
.auth-card h1 { font-size: 1.7rem; margin-top: 8px; }
.auth-card .lead { color: var(--text2); margin: 8px 0 26px; }
.auth-foot { margin-top: 20px; text-align: center; color: var(--text2); font-size: .9rem; }
.tc-check { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text2); cursor: pointer; }
.tc-check input { width: 18px; height: 18px; accent-color: var(--gold); }

/* =====================================================================
   ADMIN — theme picker
   ===================================================================== */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 18px; }
.theme-opt { position: relative; cursor: pointer; }
.theme-opt input { position: absolute; opacity: 0; }
.theme-card { display: block; padding: 16px; border-radius: var(--radius-lg); border: 2px solid var(--line); background: var(--surface); transition: border-color .15s; }
.theme-opt input:checked + .theme-card { border-color: var(--gold); box-shadow: 0 0 0 4px var(--accent-soft); }
.theme-opt input:focus-visible + .theme-card { outline: 2px solid var(--gold-light); outline-offset: 3px; }
.theme-preview { height: 150px; border-radius: 10px; overflow: hidden; position: relative; margin-bottom: 14px; }
.theme-preview.is-obsidian { background: radial-gradient(circle at 50% -20%, rgba(242, 201, 76, .35), transparent 60%), #08080a; border: 1px solid #2a2a33; }
.theme-preview.is-sapphire { background: radial-gradient(circle at 80% 0%, rgba(91, 140, 255, .5), transparent 55%), radial-gradient(circle at 0% 100%, rgba(216, 178, 106, .3), transparent 55%), #060a18; border: 1px solid rgba(140, 165, 230, .25); }
.theme-preview i { position: absolute; display: block; }
.theme-preview .bar { top: 0; inset-inline: 0; height: 22px; background: rgba(255, 255, 255, .04); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.theme-preview .t1 { top: 46px; inset-inline-start: 18px; width: 52%; height: 12px; }
.theme-preview .t2 { top: 68px; inset-inline-start: 18px; width: 36%; height: 7px; background: rgba(255, 255, 255, .18); }
.theme-preview .b1 { top: 96px; inset-inline-start: 18px; width: 86px; height: 26px; }
.theme-preview .c1 { top: 40px; inset-inline-end: 18px; width: 30%; height: 90px; border: 1px solid; }
.theme-preview.is-obsidian .t1, .theme-preview.is-obsidian .b1 { background: linear-gradient(135deg, #f7dc7a, #d4a017); border-radius: 2px; }
.theme-preview.is-obsidian .c1 { border-color: rgba(212, 160, 23, .4); border-radius: 4px; background: #101014; }
.theme-preview.is-sapphire .t1, .theme-preview.is-sapphire .b1 { background: linear-gradient(135deg, #f5e3b8, #d8b26a); border-radius: 999px; }
.theme-preview.is-sapphire .c1 { border-color: rgba(160, 185, 245, .3); border-radius: 14px; background: rgba(20, 31, 64, .7); }
.theme-card h3 { font-size: 1.05rem; font-family: var(--font-body); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.theme-card p { color: var(--text2); font-size: .88rem; margin-top: 6px; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: inline-flex; padding: 9px 16px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); color: var(--text2); font-size: .88rem; }
.seg input:checked + span { background: var(--accent-soft); border-color: var(--gold); color: var(--gold-light); }
.seg input:focus-visible + span { outline: 2px solid var(--gold-light); outline-offset: 2px; }

/* =====================================================================
   Contract console pages. They follow the page direction like everything
   else; only machine values (addresses, hashes, function names, amounts)
   are pinned left-to-right so a Persian line cannot reorder them.
   ===================================================================== */
.tc-console-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.tc-console code,
.tc-console .tc-addr,
.tc-console .mono,
.tc-console [dir="ltr"] { direction: ltr; unicode-bidi: isolate; }
.tc-console input[dir="ltr"] { text-align: left; }
/* The consoles space out their small caps labels; letter-spacing pulls joined
   Persian letters apart, so it is dropped in Persian (it beats the pages' own
   <style> blocks, hence !important). */
html[lang="fa"] .tc-console *:not(code):not([dir="ltr"]) { letter-spacing: 0 !important; }
/* Result boxes and summary values were built for hashes: a monospace face and
   break-anywhere wrapping. In Persian the words in them need the text face and
   whole-word wrapping; long addresses can still wrap anywhere. */
html[lang="fa"] .tc-console .tc-out,
html[lang="fa"] .tc-console .tc-sumcard .v,
html[lang="fa"] .tc-console .cp-sum .v { word-break: normal; overflow-wrap: anywhere; }
html[lang="fa"] .tc-console .tc-out { font-family: inherit; }
html[lang="fa"] .tc-console .tc-out [dir="ltr"] { font-family: Consolas, Menlo, monospace; }
html[lang="fa"] .tc-console .tc-out .kv .k { white-space: nowrap; }
/* The consoles' own grids were sized for Meet's 1200px column with no gutter. */
.tc-console input, .tc-console select, .tc-console textarea { max-width: 100%; }
