/* ArashMidus (after Archimedes) — midnight navy with crown gold. Hand-written, no build step. */

@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('/fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
    --bg: #0a0f1f;
    --bg-2: #0f1630;
    --surface: rgba(255, 255, 255, .04);
    --surface-2: rgba(255, 255, 255, .07);
    --line: rgba(255, 255, 255, .09);
    --line-strong: rgba(255, 255, 255, .16);
    --text: #eef1f8;
    --muted: #9aa5c2;
    --gold: #e6ac3f;
    --gold-hi: #f7d98b;
    --gold-lo: #b9781c;
    --gold-grad: linear-gradient(135deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
    --danger: #f2707a;
    --success: #4fd18b;
    --info: #63b3ff;
    --warning: #f5b84a;
    --radius: 16px;
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 16px;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--gold-hi); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.4; margin: 0 0 .5rem; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
h3, .h3 { font-size: 1.12rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: isolate; }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.glow {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(230, 172, 63, .16), transparent 60%),
        radial-gradient(800px 600px at -10% 30%, rgba(80, 110, 255, .12), transparent 60%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
}

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }
.section { padding: 48px 16px; }
.section-head { margin-bottom: 24px; }

/* ---------- header / footer ---------- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(10, 15, 31, .78);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 12px; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links form { margin: 0; }
.nav-link { color: var(--muted); padding: 6px 10px; border-radius: 10px; }
.nav-link:hover { color: var(--text); text-decoration: none; background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.1rem; }
.brand-name { direction: ltr; letter-spacing: .02em; }
.brand-text small { color: var(--gold); font-size: .72rem; }
.brand-sm .logo { width: 30px; height: 30px; }

.footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 32px 0; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.footer p { margin: 0; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 11px 22px; border-radius: 12px; border: 1px solid transparent;
    font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
    transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-gold { background: var(--gold-grad); color: #1d1405; box-shadow: 0 10px 30px -12px rgba(230, 172, 63, .7); }
.btn-gold:hover { box-shadow: 0 14px 34px -10px rgba(230, 172, 63, .85); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 14px; font-size: .9rem; border-radius: 10px; }
.btn-block { width: 100%; }
.row-gap { display: flex; gap: 8px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center; padding-top: 56px; padding-bottom: 24px; }
.eyebrow {
    display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .85rem;
    color: var(--gold-hi); background: rgba(230, 172, 63, .1); border: 1px solid rgba(230, 172, 63, .3);
    margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2rem, 5.5vw, 3.3rem); line-height: 1.35; }
.lead { font-size: 1.08rem; color: #c4cbe0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 28px; }
.hero-stats { display: flex; gap: 28px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.4rem; color: var(--gold-hi); }
.hero-stats span { color: var(--muted); font-size: .85rem; }

.hero-art { display: flex; justify-content: center; }
.orbit {
    position: relative; width: min(380px, 80vw); aspect-ratio: 1;
    border-radius: 50%; border: 1px dashed rgba(230, 172, 63, .3);
}
.orbit::before {
    content: ''; position: absolute; inset: 16%; border-radius: 50%;
    border: 1px solid rgba(230, 172, 63, .18);
}
.coin {
    position: absolute; inset: 31%; border-radius: 50%; display: grid; place-items: center;
    background: radial-gradient(circle at 35% 30%, rgba(247, 217, 139, .25), rgba(230, 172, 63, .06) 70%);
    box-shadow: 0 0 80px -10px rgba(230, 172, 63, .5);
    animation: float 6s ease-in-out infinite;
}
.coin .logo { width: 70%; height: 70%; }
.orbit-chip {
    position: absolute; padding: 6px 12px; border-radius: 999px; font-size: .82rem; white-space: nowrap;
    background: rgba(15, 22, 48, .92); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.chip-0 { top: 4%; right: 50%; transform: translateX(50%); }
.chip-1 { top: 44%; left: -8%; }
.chip-2 { bottom: 4%; right: 50%; transform: translateX(50%); }
.chip-3 { top: 44%; right: -8%; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- steps ---------- */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step-no {
    display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; margin-bottom: 10px;
    background: var(--gold-grad); color: #1d1405; font-weight: 700;
}

/* ---------- cards / grid ---------- */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow);
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.agent-card { display: flex; flex-direction: column; transition: border-color .2s, transform .2s; }
.agent-card:hover { border-color: rgba(230, 172, 63, .45); transform: translateY(-2px); }
.agent-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.agent-icon {
    display: inline-grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; font-size: 1.5rem;
    border-radius: 14px; background: rgba(230, 172, 63, .1); border: 1px solid rgba(230, 172, 63, .25);
}
.agent-icon-lg { width: 64px; height: 64px; font-size: 2rem; }
.tag { font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.ticks { list-style: none; padding: 0; margin: 8px 0 16px; }
.ticks li { position: relative; padding-right: 24px; margin-bottom: 4px; font-size: .95rem; }
.ticks li::before { content: '✦'; position: absolute; right: 0; color: var(--gold); }
.agent-card-foot {
    margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
}
.price { font-weight: 700; color: var(--gold-hi); font-size: .92rem; }

.cta {
    display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
    padding: 32px; border-radius: 22px;
    background: linear-gradient(135deg, rgba(230, 172, 63, .14), rgba(80, 110, 255, .08));
    border: 1px solid rgba(230, 172, 63, .3);
}
.cta h2 { margin-bottom: 4px; }
.cta p { margin: 0; }

/* ---------- detail ---------- */
.back { display: inline-block; margin-bottom: 16px; color: var(--muted); }
.detail { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.detail-side { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 12px; }
.side-row { display: flex; justify-content: space-between; gap: 8px; }

/* ---------- forms ---------- */
.auth { display: flex; justify-content: center; padding: 48px 16px; }
.auth-card { width: 100%; max-width: 440px; }
.form-card fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.form-card legend { font-weight: 700; color: var(--gold-hi); margin-bottom: 10px; padding: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-title { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.form-title h1 { margin: 0; font-size: 1.4rem; }
.form-title p { margin: 0; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: .92rem; font-weight: 500; }
.req { color: var(--gold); }
input, select, textarea {
    width: 100%; padding: 11px 14px; border-radius: 12px; font: inherit; color: var(--text);
    background: rgba(0, 0, 0, .25); border: 1px solid var(--line-strong); outline: none;
    transition: border-color .15s, box-shadow .15s;
}
select option { background: var(--bg-2); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230, 172, 63, .18); }
input[dir="ltr"] { text-align: left; }
.invalid { border-color: var(--danger); }
.error { color: var(--danger); font-size: .85rem; margin: 4px 0 0; }
.help { color: var(--muted); font-size: .85rem; margin: 4px 0 0; }
.check { display: flex; gap: 8px; align-items: center; margin: 4px 0 16px; cursor: pointer; }
.check input { width: auto; accent-color: var(--gold); }

.flash, .alert, .note { border-radius: 12px; padding: 12px 16px; margin: 16px 0; }
.flash { background: rgba(79, 209, 139, .1); border: 1px solid rgba(79, 209, 139, .35); color: #b6f0cf; }
.alert { background: rgba(242, 112, 122, .1); border: 1px solid rgba(242, 112, 122, .35); color: #ffc7cc; }
.note { background: rgba(230, 172, 63, .08); border: 1px solid rgba(230, 172, 63, .3); }
.note p { margin: 4px 0 0; }

/* ---------- panel ---------- */
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.empty { text-align: center; padding: 28px 0 12px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th { text-align: right; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.badge { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: .82rem; font-weight: 500; border: 1px solid; }
.badge-lg { padding: 4px 16px; font-size: .95rem; }
.badge-warning { color: var(--warning); border-color: rgba(245, 184, 74, .4); background: rgba(245, 184, 74, .08); }
.badge-info { color: var(--info); border-color: rgba(99, 179, 255, .4); background: rgba(99, 179, 255, .08); }
.badge-primary { color: var(--gold-hi); border-color: rgba(230, 172, 63, .45); background: rgba(230, 172, 63, .1); }
.badge-success { color: var(--success); border-color: rgba(79, 209, 139, .4); background: rgba(79, 209, 139, .08); }
.badge-danger { color: var(--danger); border-color: rgba(242, 112, 122, .4); background: rgba(242, 112, 122, .08); }
.badge-gray { color: var(--muted); border-color: var(--line-strong); }

.progress { list-style: none; padding: 0; margin: 8px 0 22px; display: grid; grid-template-columns: repeat(4, 1fr); }
.progress li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); text-align: center; }
.progress li::before {
    content: ''; position: absolute; top: 8px; right: 50%; width: 100%; height: 2px; background: var(--line-strong); z-index: 0;
}
.progress li:first-child::before { display: none; }
.progress .dot { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; background: var(--bg-2); border: 2px solid var(--line-strong); }
.progress li.done { color: var(--text); }
.progress li.done::before { background: var(--gold); }
.progress li.done .dot { background: var(--gold); border-color: var(--gold); }
.progress li.current .dot { box-shadow: 0 0 0 5px rgba(230, 172, 63, .2); }

.details { margin: 0; display: grid; gap: 0; }
.details div { display: grid; grid-template-columns: 200px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.details div:last-child { border-bottom: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- panel shell ---------- */
.panel-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; padding-top: 28px; padding-bottom: 28px; align-items: start; }
.sidebar {
    position: sticky; top: 88px; min-height: calc(100vh - 120px);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
    display: flex; flex-direction: column;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-link {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
    color: var(--text); font-size: .95rem;
}
.side-link:hover { background: var(--surface-2); text-decoration: none; }
.side-link.active { background: rgba(230, 172, 63, .14); color: var(--gold-hi); box-shadow: inset -3px 0 0 var(--gold); }
.side-ico { width: 22px; text-align: center; flex-shrink: 0; }
.side-group { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.side-title { color: var(--muted); font-size: .8rem; padding: 4px 12px; font-weight: 500; }
.side-empty { color: var(--muted); font-size: .82rem; padding: 4px 12px; margin: 0; line-height: 1.7; }
.side-add { color: var(--muted); font-size: .88rem; }
.side-settings { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.side-settings summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; font-size: .95rem; color: var(--text); padding: 9px 12px; border-radius: 10px; }
.side-settings summary::-webkit-details-marker { display: none; }
.side-settings summary::after { content: '‹'; margin-right: auto; transition: transform .2s; }
.side-settings[open] summary::after { transform: rotate(-90deg); }
.side-settings summary:hover { background: var(--surface-2); }
.side-sub { padding-right: 24px; font-size: .9rem; }
.panel-main { min-width: 0; }
.panel-main .section { padding: 0 0 28px; }
.panel-main .wrap { padding: 0; max-width: none; }

/* ---------- workspace bits ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 16px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--gold-hi); border-color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat strong { display: block; font-size: 1.5rem; line-height: 1.3; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.ok strong { color: var(--success); }
.stat.bad strong { color: var(--danger); }
.stat.warn strong { color: var(--warning); }
.stat.gold strong { color: var(--gold-hi); }
.dropzone {
    display: block; border: 2px dashed rgba(230, 172, 63, .4); border-radius: 16px; padding: 26px; text-align: center;
    background: rgba(230, 172, 63, .04); cursor: pointer; transition: background .15s;
}
.dropzone:hover { background: rgba(230, 172, 63, .09); }
.dropzone input { display: block; margin: 12px auto 0; max-width: 320px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; margin-bottom: 8px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--gold); background: rgba(230, 172, 63, .08); }
.choice input { width: auto; margin-top: 6px; accent-color: var(--gold); }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.hermes-says { display: flex; gap: 12px; align-items: flex-start; }
.hermes-says .agent-icon { flex-shrink: 0; }
.hermes-says ul { margin: 6px 0 0; padding-right: 18px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 1; background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb form { position: absolute; top: 6px; left: 6px; margin: 0; }
.thumb button { background: rgba(10, 15, 31, .85); color: var(--danger); border: 0; border-radius: 8px; padding: 2px 8px; cursor: pointer; font: inherit; font-size: .8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .85rem; color: var(--text); }
.chip:hover { text-decoration: none; border-color: var(--gold); }
.chip.active { border-color: var(--gold); color: var(--gold-hi); }
.chip small { color: var(--muted); }
.row-problem td { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(242, 112, 122, .4); }
.btn-danger:hover { background: rgba(242, 112, 122, .1); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.pagination { display: flex; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; }
.pagination li > * { display: inline-block; padding: 4px 14px; border-radius: 10px; border: 1px solid var(--line-strong); }
.pagination .disabled { opacity: .4; }
.soon { text-align: center; padding: 34px 20px; }
.soon .agent-icon { margin: 0 auto 12px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .panel-layout { grid-template-columns: 1fr; padding-top: 16px; }
    .sidebar { position: static; min-height: 0; }
    .side-settings { margin-top: 14px; }
}
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; padding-top: 32px; }
    .hero-art { order: -1; }
    .orbit { width: min(300px, 72vw); }
    .detail { grid-template-columns: 1fr; }
    .detail-side { position: static; }
}
@media (max-width: 680px) {
    .hide-sm { display: none; }
    .brand-text small { display: none; }
    .steps { grid-template-columns: 1fr; }
    .grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .details div { grid-template-columns: 1fr; gap: 2px; }
    .section { padding: 32px 16px; }
    .card { padding: 18px; }
    .orbit-chip { font-size: .72rem; padding: 4px 9px; }
    .chip-1 { left: -4%; }
    .chip-3 { right: -4%; }
    .form-foot { flex-direction: column-reverse; align-items: stretch; }
    .inline-fields { grid-template-columns: 1fr; }
}
