:root,
[data-theme="light"] {
    --ink: #f6f3fb;
    --ink-deep: #ebe4f7;
    --fog: #1a1228;
    --muted: rgba(26, 18, 40, 0.62);
    --purple: #7c3aed;
    --violet: #a78bfa;
    --lilac: #c4b5fd;
    --plum: #5b21b6;
    --glass: rgba(255, 255, 255, 0.62);
    --line: rgba(91, 33, 182, 0.14);
    --shadow: 0 18px 40px rgba(91, 33, 182, 0.12);
    --brand-grad: linear-gradient(120deg, #2e1065 0%, #7c3aed 50%, #a78bfa 100%);
    --atm-1: rgba(124, 58, 237, 0.22);
    --atm-2: rgba(167, 139, 250, 0.28);
    --atm-base: linear-gradient(165deg, #f8f5ff 0%, #efe8fb 45%, #e8e0f5 100%);
    --font-fa: 'Vazirmatn', sans-serif;
    --font-display: 'Syne', 'Vazirmatn', sans-serif;
}

[data-theme="dark"] {
    --ink: #0d0814;
    --ink-deep: #160e22;
    --fog: #f0eaff;
    --muted: rgba(240, 234, 255, 0.62);
    --purple: #a78bfa;
    --violet: #c4b5fd;
    --lilac: #ddd6fe;
    --plum: #8b5cf6;
    --glass: rgba(18, 10, 32, 0.55);
    --line: rgba(196, 181, 253, 0.14);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
    --brand-grad: linear-gradient(120deg, #f5f3ff 0%, #c4b5fd 45%, #a78bfa 100%);
    --atm-1: rgba(124, 58, 237, 0.4);
    --atm-2: rgba(167, 139, 250, 0.25);
    --atm-base: linear-gradient(165deg, #09060f 0%, #120a1c 45%, #1a1028 100%);
}

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

html,
body {
    min-height: 100%;
}

body {
    font-family: var(--font-fa);
    color: var(--fog);
    background: var(--ink);
    overflow-x: hidden;
    transition: background 0.35s ease, color 0.35s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

.atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(120% 80% at 100% 0%, var(--atm-1), transparent 55%),
        radial-gradient(90% 70% at 0% 100%, var(--atm-2), transparent 50%),
        var(--atm-base);
    transition: background 0.45s ease;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    animation: drift 14s ease-in-out infinite alternate;
}

.orb-a {
    width: 42vw;
    height: 42vw;
    max-width: 480px;
    max-height: 480px;
    top: -8%;
    left: -6%;
    background: var(--atm-1);
}

.orb-b {
    width: 36vw;
    height: 36vw;
    max-width: 420px;
    max-height: 420px;
    right: -4%;
    bottom: 8%;
    background: var(--atm-2);
    animation-delay: -4s;
}

.grid-fade {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(color-mix(in srgb, var(--fog) 6%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--fog) 6%, transparent) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
    opacity: 0.45;
}

@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(3%, 4%) scale(1.08); }
}

.topbar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 2rem);
    max-width: 960px;
    margin: 0 auto;
}

.clock-box {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--line);
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 0.9rem;
    box-shadow: var(--shadow);
    font-variant-numeric: tabular-nums;
}

.clock-day {
    font-weight: 700;
    color: var(--purple);
    font-size: 0.92rem;
}

.clock-date {
    font-size: 0.82rem;
    color: var(--muted);
}

.clock-time {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.04em;
    direction: ltr;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--line);
    background: var(--glass);
    backdrop-filter: blur(16px);
    color: var(--fog);
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--violet);
    box-shadow: var(--shadow);
}

.theme-icon { font-size: 0.95rem; line-height: 1; }
[data-theme="light"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: none; }

.back-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--purple);
    padding: 0.45rem 0.2rem;
}

.hub {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 5rem);
    min-height: calc(100dvh - 5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(1.75rem, 5vh, 3rem);
    padding: 0 clamp(1.5rem, 4vw, 3rem) clamp(2rem, 5vh, 3rem);
    max-width: 920px;
    margin: 0 auto;
}

.brand-block {
    text-align: center;
    animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-mark {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.35em;
    font-size: 0.78rem;
    color: var(--purple);
    margin-bottom: 0.85rem;
}

.brand-title {
    font-family: var(--font-fa);
    font-weight: 800;
    font-size: clamp(3rem, 10vw, 5.2rem);
    line-height: 1;
    letter-spacing: -0.03em;
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.75rem;
}

.brand-tagline {
    font-size: clamp(0.95rem, 2.4vw, 1.1rem);
    color: var(--muted);
    max-width: 28ch;
    margin: 0 auto;
    line-height: 1.7;
}

.entries {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    animation: rise 1s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (min-width: 720px) {
    .entries {
        grid-template-columns: 1fr 1fr;
        gap: 1.15rem;
    }
}

.entry {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 1.45rem 1.35rem 1.35rem;
    border: 1px solid var(--line);
    background: var(--glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 1.1rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.35s ease,
                box-shadow 0.35s ease;
}

.entry::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    background: linear-gradient(135deg, color-mix(in srgb, var(--purple) 22%, transparent), transparent 60%);
}

.entry:hover,
.entry:focus-visible {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--purple) 45%, transparent);
    outline: none;
}

.entry:hover::before,
.entry:focus-visible::before {
    opacity: 1;
}

.entry-kicker {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--purple);
}

.entry-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
}

.entry-desc {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.6;
}

.entry-arrow {
    margin-top: 0.85rem;
    font-size: 1.25rem;
    opacity: 0.55;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.entry:hover .entry-arrow {
    transform: translateX(-6px);
    opacity: 1;
}

.why-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1.15rem 1.4rem;
    border-radius: 1.15rem;
    border: 1px solid color-mix(in srgb, var(--purple) 35%, transparent);
    background: linear-gradient(135deg, var(--plum), var(--purple) 55%, #9333ea);
    color: #fff;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 14px 36px color-mix(in srgb, var(--purple) 35%, transparent);
    animation: rise 1s 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.why-btn:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 20px 44px color-mix(in srgb, var(--purple) 45%, transparent);
}

.why-btn-glow {
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), transparent 45%);
    animation: shimmer 5s ease-in-out infinite;
    pointer-events: none;
}

.why-btn-text {
    position: relative;
    font-size: 1.1rem;
    font-weight: 800;
}

.why-btn-hint {
    position: relative;
    font-size: 0.8rem;
    opacity: 0.85;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(8%) translateY(4%); opacity: 0.5; }
    50% { transform: translateX(-6%) translateY(-3%); opacity: 0.9; }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .orb, .brand-block, .entries, .why-btn, .why-btn-glow {
        animation: none !important;
    }
}
