@font-face { font-family: "Vazirmatn"; src: url("/assets/vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #050b17;
  --bg2: #0a1630;
  --panel: rgba(9, 20, 42, 0.78);
  --panel-solid: #0b1a36;
  --line: rgba(87, 160, 255, 0.22);
  --text: #e9f2ff;
  --muted: #94abcf;
  --accent: #2f8cff;
  --accent-2: #27d0ff;
  --accent-ink: #04122a;
  --ok: #3ddc97;
  --bad: #ff6573;
  --warn: #ffc857;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --hero: url("/assets/hero-dark.webp");
  --veil: linear-gradient(90deg, rgba(5, 11, 23, 0.94) 0%, rgba(5, 11, 23, 0.72) 48%, rgba(5, 11, 23, 0.35) 100%);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #eef4fc; --bg2: #e1ecfa; --panel: rgba(255, 255, 255, 0.86); --panel-solid: #ffffff;
    --line: rgba(15, 90, 190, 0.2); --text: #0a1c3a; --muted: #496187;
    --accent: #0f62d6; --accent-2: #0a8fd6; --accent-ink: #ffffff;
    --ok: #0f8f5b; --bad: #cf2339; --warn: #9a6200;
    --shadow: 0 18px 50px rgba(20, 60, 120, 0.16);
    --hero: url("/assets/hero-light.webp");
    --veil: linear-gradient(90deg, rgba(238, 244, 252, 0.95) 0%, rgba(238, 244, 252, 0.78) 48%, rgba(238, 244, 252, 0.3) 100%);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif; line-height: 1.85; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; display: block; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* ---------- landing ---------- */
.top { position: absolute; inset-inline: 0; top: 0; z-index: 5; padding-top: max(18px, env(safe-area-inset-top, 0px)); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top img { height: 34px; width: auto; filter: brightness(1.9) saturate(1.15) drop-shadow(0 0 10px rgba(47,140,255,.35)); }
.top a.link { color: var(--muted); text-decoration: none; font-size: 14px; }
.top a.link:hover { color: var(--text); }

.hero {
  position: relative; min-height: 640px; display: flex; align-items: center; padding: 110px 0 70px;
  background: var(--hero) center/cover no-repeat; isolation: isolate; border-bottom: 1px solid var(--line);
}
.hero::before { content: ""; position: absolute; inset: 0; background: var(--veil); z-index: -1; }
.hero::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 120px; background: linear-gradient(to bottom, transparent, var(--bg)); z-index: -1; }
.hero h1 { font-size: clamp(34px, 6vw, 64px); line-height: 1.25; font-weight: 800; margin: 0 0 18px; letter-spacing: -0.01em; max-width: 14ch; }
.hero p.lead { font-size: clamp(16px, 2.2vw, 19px); color: var(--muted); max-width: 52ch; margin: 0 0 30px; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 28px; border-radius: 12px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); font: 700 17px "Vazirmatn", sans-serif; text-decoration: none;
  box-shadow: 0 10px 34px rgba(47, 140, 255, 0.35);
}
.btn:hover { filter: brightness(1.08); }
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.meta { color: var(--muted); font-size: 14px; }
.meta b { color: var(--text); font-weight: 600; }

/* the one memorable element: the 10-second pulse */
.pulse { margin-top: 38px; max-width: 520px; }
.pulse svg { width: 100%; height: 64px; display: block; overflow: visible; }
.pulse .base { stroke: var(--line); stroke-width: 1.5; fill: none; }
.pulse .beat { stroke: var(--accent-2); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 260 1000; stroke-dashoffset: 260; animation: beat 10s linear infinite; filter: drop-shadow(0 0 6px var(--accent-2)); }
.pulse small { color: var(--muted); font-size: 13px; }
@keyframes beat { 0% { stroke-dashoffset: 260; } 70%, 100% { stroke-dashoffset: -520; } }
@media (prefers-reduced-motion: reduce) { .pulse .beat { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; } }

section.block { padding: 72px 0 8px; }
h2 { font-size: clamp(24px, 3.4vw, 34px); margin: 0 0 10px; font-weight: 800; }
.sub { color: var(--muted); margin: 0 0 32px; max-width: 62ch; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; counter-reset: s; }
.step { padding: 26px 26px 28px; border-inline-start: 1px solid var(--line); counter-increment: s; }
.step:first-child { border-inline-start: 0; }
.step::before { content: counter(s, persian); display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: 12px; }
.step h3 { margin: 0 0 6px; font-size: 18px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } .step { border-inline-start: 0; border-top: 1px solid var(--line); } .step:first-child { border-top: 0; } }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.col { border: 1px solid var(--line); border-radius: 16px; background: var(--panel); padding: 24px 26px; }
.col h3 { margin: 0 0 12px; font-size: 18px; }
.col ul { margin: 0; padding-inline-start: 20px; color: var(--muted); font-size: 15px; }
.col li { margin: 5px 0; }
.col.never { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.col.never h3 { color: var(--ok); }

details { border-bottom: 1px solid var(--line); padding: 14px 4px; }
details summary { cursor: pointer; font-weight: 700; }
details p { color: var(--muted); margin: 10px 0 2px; font-size: 15px; }
footer { padding: 54px 0 40px; color: var(--muted); font-size: 14px; text-align: center; }
footer img { height: 40px; margin: 0 auto 12px; filter: brightness(1.9) saturate(1.15); }

/* ---------- admin ---------- */
body.admin { background: var(--bg); }
.login { min-height: 100vh; display: grid; place-items: center; background: var(--hero) center/cover; position: relative; isolation: isolate; padding: 20px; }
.login::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 82%, transparent); z-index: -1; }
.login form { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 30px; backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.login img { height: 40px; margin: 0 auto 18px; filter: brightness(1.9) saturate(1.15); }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: color-mix(in srgb, var(--panel-solid) 90%, transparent); color: var(--text); font: 15px "Vazirmatn", sans-serif;
}
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.6; direction: ltr; text-align: left; min-height: 420px; }
input[dir=ltr] { direction: ltr; text-align: left; }
.err { color: var(--bad); font-size: 14px; min-height: 22px; margin-top: 10px; }

.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
@media (max-width: 860px) { .shell { grid-template-columns: 1fr; } }
.side { border-inline-end: 1px solid var(--line); background: var(--panel-solid); padding: 22px 16px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 860px) { .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; } }
.side img.logo { height: 34px; width: auto; margin: 0 6px 18px; align-self: flex-start; filter: brightness(1.9) saturate(1.15); }
.side button.nav { text-align: start; background: transparent; border: 0; color: var(--muted); padding: 10px 14px; border-radius: 10px; font: 600 15px "Vazirmatn", sans-serif; cursor: pointer; }
.side button.nav:hover { color: var(--text); }
.side button.nav[aria-current="true"] { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
.side .spacer { flex: 1; }
.main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.main h1 { font-size: 24px; margin: 0 0 4px; }
.stats { display: flex; flex-wrap: wrap; gap: 28px; padding: 14px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.stat b { display: block; font-size: 30px; line-height: 1.2; font-weight: 800; }
.stat span { color: var(--muted); font-size: 13px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
td.wrap-ok { white-space: normal; min-width: 240px; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
td.ltr { direction: ltr; text-align: start; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.tag { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; border: 1px solid currentColor; }
.tag.ok { color: var(--ok); } .tag.bad { color: var(--bad); } .tag.warn { color: var(--warn); } .tag.mute { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.row > div { flex: 1 1 180px; }
button.sm { padding: 7px 14px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--text); font: 600 13px "Vazirmatn", sans-serif; cursor: pointer; }
button.sm:hover { border-color: var(--accent-2); }
button.sm.danger { color: var(--bad); }
.note { background: color-mix(in srgb, var(--warn) 14%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); border-radius: 12px; padding: 12px 16px; font-size: 14px; margin: 0 0 16px; }
.keybox { direction: ltr; text-align: left; font-family: ui-monospace, Consolas, monospace; background: var(--panel-solid); border: 1px dashed var(--accent-2); border-radius: 10px; padding: 12px 14px; word-break: break-all; user-select: all; }
.hide { display: none !important; }
.muted { color: var(--muted); }

@media (prefers-color-scheme: light) { .top img, .side img.logo, footer img, .login img { filter: none; } }
