/* === Nevsky IP Scan — Brand Design System === */

:root {
    --bg-primary: #0f1118;
    --bg-secondary: #161922;
    --bg-card: #1a1d2b;

    --accent: #c41e1e;
    --accent-light: #e63636;
    --accent-dark: #9b1617;
    --accent-glow: rgba(196, 30, 30, 0.25);

    --text-primary: #f0f0f5;
    --text-secondary: #a4a3a8;
    --text-muted: #64647a;

    --risk-critical: #E53E3E;
    --risk-high: #ED8936;
    --risk-medium: #ECC94B;
    --risk-low: #48BB78;
    --risk-ok: #38B2AC;

    --status-missing: #E53E3E;
    --status-weak: #ED8936;
    --status-present: #48BB78;

    --border: #2d2d44;
    --radius: 12px;
    --radius-sm: 8px;
    --font: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Space Grotesk', 'Manrope', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #f1f1f1;
    --bg-secondary: #e8e8e8;
    --bg-card: #ffffff;

    --accent: #9b1617;
    --accent-light: #c41e1e;
    --accent-dark: #7a1112;
    --accent-glow: rgba(155, 22, 23, 0.12);

    --text-primary: #201a1c;
    --text-secondary: #555555;
    --text-muted: #909090;

    --border: #d4d4d4;
}

[data-theme="light"] .tool-card:hover {
    background: #f0f0f0;
}

[data-theme="light"] .tool-card {
    background: #ffffff;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(13, 13, 13, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 2px;
    color: #ffffff;
}

.logo-sub {
    font-weight: 300;
    font-size: 14px;
    color: var(--accent);
    letter-spacing: 1px;
}

.header-link {
    color: #8888a0;
    text-decoration: none;
    font-size: 13px;
    transition: color var(--transition);
}

.header-link:hover {
    color: var(--accent);
}

/* === PORTAL LAYOUT === */

.portal-step {
    align-items: flex-start !important;
    justify-content: flex-start !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

.portal-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 24px 120px;
}

.portal-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.portal-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.portal-hero {
    padding: 20px 0;
}

.portal-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Hero */
.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--accent);
    border-radius: 100px;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 20px;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-glow);
    }
}

h1 {
    font-family: var(--font-heading);
    font-size: clamp(24px, 4vw, 34px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.accent {
    color: var(--accent);
}

.hero-desc,
.step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.hero-stats {
    display: flex;
    gap: 28px;
    margin-bottom: 8px;
}

.stat {
    text-align: center;
}

.stat-num {
    font-size: 24px;
    font-weight: 700;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

.tool-card:hover {
    border-color: var(--accent);
    background: #222238;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(196, 30, 30, 0.15);
}

.tool-card-wide {
    grid-column: 1 / -1;
}

.tool-icon {
    color: var(--accent);
    flex-shrink: 0;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
}

.tool-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.tool-badge {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(196, 30, 30, 0.15);
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(196, 30, 30, 0.1);
    color: var(--accent);
    transition: all var(--transition);
}

.tool-card:hover .tool-arrow {
    background: var(--accent);
    color: white;
    transform: translateX(2px);
}

/* Sidebar */
.sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.sidebar-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-digest {
    margin-bottom: 12px;
}

.sidebar-digest-summary {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 8px;
}

.sidebar-digest-trend {
    padding: 6px 10px;
    background: rgba(56, 178, 172, 0.1);
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--risk-ok);
    margin-bottom: 8px;
}

.sidebar-news {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-news-item {
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.sidebar-news-item:hover {
    background: var(--border);
}

.sidebar-news-item a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    display: block;
}

.sidebar-news-item a:hover {
    color: var(--accent);
}

.sidebar-news-cat {
    display: inline-block;
    font-size: 9px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.sidebar-news-source {
    font-size: 10px;
    color: var(--text-muted);
}

.sidebar-cases-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-case {
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 11px;
}

.sidebar-case a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.sidebar-case a:hover {
    color: var(--accent);
}

.sidebar-case-parties {
    color: var(--text-muted);
    font-size: 10px;
    margin-top: 1px;
}

/* Steps */
.step {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
    transform: translateX(30px);
    z-index: 1;
}

.step.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
    z-index: 10;
}

.step-content {
    width: 100%;
    max-width: 400px;
    padding: 24px 20px;
    padding-top: 70px;
    text-align: center;
}

.step-content-wide {
    max-width: 600px;
    text-align: left;
    max-height: 100vh;
    overflow-y: auto;
    padding-bottom: 140px;
}

.step-icon-line {
    width: 40px;
    height: 3px;
    background: var(--accent);
    margin: 0 auto 24px;
}

/* Back */
.back-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 24px;
    transition: color var(--transition);
}

.back-btn:hover {
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 16px;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-cta {
    background: white;
    color: var(--accent);
    font-weight: 700;
}

.btn-cta:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

/* Fields */
.field {
    margin-bottom: 16px;
}

.field input,
.field textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 16px;
    transition: border-color var(--transition);
    outline: none;
    text-align: center;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-muted);
}

.step-note {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 16px;
    line-height: 1.5;
}

/* Contract */
.contract-panel {
    margin-top: 16px;
}

#contractText {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    margin-bottom: 16px;
    text-align: left;
    transition: border-color var(--transition);
}

#contractText:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.upload-zone:hover {
    border-color: var(--accent);
    background: rgba(196, 30, 30, 0.04);
}

.upload-zone.drag-over {
    border-color: var(--accent);
    background: rgba(196, 30, 30, 0.08);
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: 8px;
}

.upload-zone:hover .upload-icon {
    color: var(--accent);
}

.upload-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.upload-status {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}

.upload-status.error {
    color: var(--risk-critical);
}

.upload-status.success {
    color: var(--status-present);
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Score */
.score-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 16px;
}

.score-ring {
    position: relative;
    width: 90px;
    min-width: 90px;
    height: 90px;
}

.score-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-circle {
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.5s ease;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: 700;
}

.score-info {
    flex: 1;
}

.score-level {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.score-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.score-damage {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(229, 62, 62, 0.1);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--risk-critical);
}

/* Clause cards */
.clauses-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.clause-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 16px 20px;
    border-left: 4px solid var(--border);
}

.clause-card.risk-critical {
    border-left-color: var(--risk-critical);
}

.clause-card.risk-high {
    border-left-color: var(--risk-high);
}

.clause-card.risk-medium {
    border-left-color: var(--risk-medium);
}

.clause-card.risk-low {
    border-left-color: var(--risk-low);
}

.clause-card.risk-ok {
    border-left-color: var(--risk-ok);
}

.clause-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.clause-title {
    font-size: 14px;
    font-weight: 600;
}

.clause-badge {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-missing {
    background: rgba(229, 62, 62, 0.15);
    color: var(--status-missing);
}

.badge-weak {
    background: rgba(237, 137, 54, 0.15);
    color: var(--status-weak);
}

.badge-present {
    background: rgba(72, 187, 120, 0.15);
    color: var(--status-present);
}

.clause-explanation {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.clause-damage {
    font-size: 12px;
    color: var(--accent);
    margin-top: 6px;
    font-weight: 600;
}

.clause-stat {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.clause-quote {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
    font-style: italic;
}

/* Recommendations */
.recs-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 16px;
}

.recs-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recs-card li {
    padding-left: 20px;
    position: relative;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.recs-card li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* Feed */
.feed-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 16px;
}

.feed-card h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: background var(--transition);
}

.feed-item:hover {
    background: var(--border);
}

.feed-item a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
}

.feed-item a:hover {
    color: var(--accent);
}

.feed-item .feed-parties {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

/* News digest */
.news-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 16px;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.news-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.news-date {
    font-size: 11px;
    color: var(--text-muted);
}

.news-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.news-trend {
    padding: 8px 12px;
    background: rgba(56, 178, 172, 0.1);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--risk-ok);
    margin-bottom: 12px;
}

.news-highlights {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.news-highlight {
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}

.news-highlight-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.news-highlight-insight {
    font-size: 12px;
    color: var(--text-muted);
}

.news-highlight-cat {
    font-size: 10px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.news-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.news-item {
    font-size: 12px;
}

.news-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.news-item a:hover {
    color: var(--accent);
}

.news-item-source {
    color: var(--text-muted);
    font-size: 10px;
}

/* Protection Progress & Checklist */
.protection-progress {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 16px;
}

.protection-progress h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.progress-bar-wrap {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--risk-ok), var(--risk-low));
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-label {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.score-path {
    background: rgba(56, 178, 172, 0.08);
    border: 1px solid rgba(56, 178, 172, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--risk-ok);
    line-height: 1.5;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.checklist-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.checklist-icon.ok {
    background: rgba(72, 187, 120, 0.15);
    color: var(--status-present);
}

.checklist-icon.weak {
    background: rgba(237, 137, 54, 0.15);
    color: var(--status-weak);
}

.checklist-icon.missing {
    background: rgba(229, 62, 62, 0.15);
    color: var(--status-missing);
}

.checklist-title {
    flex: 1;
}

.checklist-title.is-ok {
    color: var(--text-muted);
}

/* CTA */
.cta-card {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 40px;
}

.cta-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #FFFFFF;
}

.cta-card p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 0;
    background: rgba(13, 13, 13, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    text-align: center;
    z-index: 50;
}

.footer p {
    font-size: 11px;
    color: var(--text-muted);
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer a:hover {
    color: var(--accent);
}

/* Mobile */
@media (max-width: 768px) {
    .portal-content {
        grid-template-columns: 1fr;
    }

    .portal-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .tool-card-wide {
        grid-column: auto;
    }

    .hero-stats {
        gap: 16px;
    }

    .stat-num {
        font-size: 20px;
    }

    .score-card {
        flex-direction: column;
        text-align: center;
    }

    .step-content {
        padding: 20px 16px;
        padding-top: 70px;
    }

    h1 {
        font-size: 24px;
    }
}

/* Scrollbar */
.step-content-wide::-webkit-scrollbar,
.portal-layout::-webkit-scrollbar,
.portal-sidebar::-webkit-scrollbar {
    width: 4px;
}

.step-content-wide::-webkit-scrollbar-track,
.portal-layout::-webkit-scrollbar-track,
.portal-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.step-content-wide::-webkit-scrollbar-thumb,
.portal-layout::-webkit-scrollbar-thumb,
.portal-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* === Background Glow Circles === */
.portal-step {
    position: relative;
    overflow: hidden;
}

.portal-step::before,
.portal-step::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 30, 30, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.portal-step::before {
    width: 600px;
    height: 600px;
    top: -100px;
    left: -150px;
    animation: glow-drift 20s ease-in-out infinite;
}

.portal-step::after {
    width: 400px;
    height: 400px;
    bottom: 100px;
    right: -100px;
    animation: glow-drift 15s ease-in-out infinite reverse;
}

.portal-layout {
    position: relative;
    z-index: 1;
}

@keyframes glow-drift {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translate(30px, 20px) scale(1.1);
        opacity: 1;
    }
}

/* === Arrow Pulse === */
.tool-arrow {
    animation: pulse-arrow 2.5s ease-in-out infinite;
}

@keyframes pulse-arrow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(196, 30, 30, 0.3);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(196, 30, 30, 0);
    }
}

/* === Card Fade-in === */
.tool-card {
    opacity: 0;
    transform: translateY(16px);
    animation: card-enter 0.5s ease forwards;
}

.tools-grid .tool-card:nth-child(1) {
    animation-delay: 0.1s;
}

.tools-grid .tool-card:nth-child(2) {
    animation-delay: 0.2s;
}

.tools-grid .tool-card:nth-child(3) {
    animation-delay: 0.3s;
}

.tools-grid .tool-card:nth-child(4) {
    animation-delay: 0.4s;
}

.tools-grid .tool-card:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes card-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Hero Text Rotation === */
.hero-rotate-wrap {
    display: inline-block;
    position: relative;
    height: 1.2em;
    overflow: hidden;
    vertical-align: bottom;
}

.hero-rotate-text {
    display: block;
    animation: text-rotate 9s ease-in-out infinite;
}

@keyframes text-rotate {

    0%,
    28% {
        transform: translateY(0);
    }

    33%,
    61% {
        transform: translateY(-100%);
    }

    66%,
    94% {
        transform: translateY(-200%);
    }

    100% {
        transform: translateY(0);
    }
}

/* === Stat Counter Glow === */
.stat-num {
    transition: color 0.3s;
}

.stat-num.counted {
    text-shadow: 0 0 20px rgba(196, 30, 30, 0.3);
}