/* ============================================================================
   NEXUS TECH HUB — REFINED DESIGN LAYER
   Camada complementar: carregar depois das folhas de estilo existentes.
   Direção visual: grafite quente, marfim suave, bronze discreto e verde mineral.
   ============================================================================ */

:root {
    color-scheme: dark;
    --bg-primary: #10141a;
    --bg-secondary: #151b22;
    --surface-primary: #1a222b;
    --surface-raised: #202a34;
    --text-primary: #f0eee9;
    --text-secondary: #a5adb5;
    --accent-primary: #c4a57a;
    --accent-secondary: #829d93;
    --accent-soft: rgba(196, 165, 122, 0.12);
    --border-color: rgba(225, 229, 232, 0.11);
    --border-subtle: rgba(225, 229, 232, 0.07);
    --status-warning: #c6a16f;
    --status-success: #8ca99b;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
    --nexus-shadow-soft: 0 16px 42px rgba(0, 0, 0, 0.18);
    --nexus-shadow-lift: 0 22px 55px rgba(0, 0, 0, 0.28);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 92px;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 3px;
}

::selection {
    color: #13171c;
    background: #c4a57a;
}

.app-shell {
    min-height: 100vh;
    background: var(--bg-primary);
}

.app-sidebar {
    background: #edf2f7;
    border-right: 1px solid var(--border-subtle);
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.08);
}

.sidebar-brand {
    border-bottom: 1px solid var(--border-subtle);
}

.brand-logo-box {
    color: #334e68;
    background: rgba(196, 165, 122, 0.13);
    border: 1px solid rgba(196, 165, 122, 0.22);
    border-radius: 12px;
}

.brand-title {
    color: var(--text-primary);
    letter-spacing: 0.08em;
}

.brand-subtitle {
    color: #334e68;
    letter-spacing: 0.12em;
}

.sidebar-nav-scroll a,
.sidebar-nav-scroll button {
    border-radius: 10px;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.sidebar-nav-scroll a:hover,
.sidebar-nav-scroll button:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.045);
}

.app-topbar {
    background: #edf2f7;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(18px);
}

.global-search-trigger {
    min-height: 42px;
    color: #334e68;
    background: #edf2f7;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.global-search-trigger:hover {
    color: var(--text-primary);
    background: #e1e9f2;
    border-color: rgba(196, 165, 122, 0.38);
}

.app-content {
    width: 100%;
    max-width: 1640px;
    margin-inline: auto;
    padding: clamp(24px, 3vw, 46px) clamp(18px, 3.4vw, 54px) clamp(56px, 6vw, 88px);
}

.app-footer {
    background: #edf2f7;
    border-top: 1px solid var(--border-subtle);
}

.footer-inner {
    gap: clamp(28px, 4vw, 62px);
    padding-block: 46px;
}

.footer-col h4 {
    color: #334e68;
    margin-bottom: 14px;
}

.footer-links a {
    color: #334e68;
    transition: color 160ms ease;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    color: #334e68;
    border-top: 1px solid var(--border-subtle);
}

/* Buttons */
.btn {
    min-height: 40px;
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.005em;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #17191b;
    background: #c4a57a;
    border: 1px solid #c4a57a;
    box-shadow: 0 7px 20px rgba(145, 112, 69, 0.16);
}

.btn-primary:hover {
    color: #111519;
    background: #d0b58f;
    border-color: #d0b58f;
    box-shadow: 0 10px 25px rgba(145, 112, 69, 0.22);
}

.btn-secondary {
    color: #334e68;
    background: #e1e9f2;
    border: 1px solid rgba(225, 229, 232, 0.12);
}

.btn-secondary:hover {
    color: #334e68;
    background: #e1e9f2;
    border-color: rgba(196, 165, 122, 0.32);
}

.btn-ghost {
    color: #334e68;
    background: transparent;
    border: 1px solid transparent;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-donate {
    color: #334e68;
    background: rgba(129, 157, 146, 0.13);
    border: 1px solid rgba(129, 157, 146, 0.3);
}

.btn-donate:hover {
    color: #334e68;
    background: rgba(129, 157, 146, 0.2);
    border-color: rgba(129, 157, 146, 0.52);
}

/* Global page rhythm */
.page-header {
    gap: 28px;
    padding: clamp(24px, 3.2vw, 40px);
    margin-bottom: clamp(28px, 3vw, 42px);
    background: linear-gradient(135deg, #e1e9f2 0%, #edf2f7 72%, #e1e9f2 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--nexus-shadow-soft);
}

.page-header-info {
    max-width: 820px;
}

.page-kicker {
    color: #334e68;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.5;
}

.page-title {
    max-width: 18ch;
    color: var(--text-primary);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.13;
}

.page-description {
    max-width: 72ch;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.8;
}

.section-header {
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 22px;
}

.section-title {
    color: var(--text-primary);
    font-size: clamp(1.15rem, 1.5vw, 1.42rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.3;
}

.form-hint {
    color: #334e68;
}

/* Cards and catalog grids */
.surface-card,
.tool-panel,
.home-resume-card {
    color: var(--text-primary);
    background: #e1e9f2;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.1);
}

.surface-card {
    padding: 22px;
}

.surface-card.interactive {
    transition: transform 200ms ease, border-color 200ms ease, background-color 200ms ease, box-shadow 200ms ease;
}

.surface-card.interactive:hover {
    transform: translateY(-4px);
    background: #e1e9f2;
    border-color: rgba(196, 165, 122, 0.32);
    box-shadow: var(--nexus-shadow-soft);
}

.card-top {
    gap: 12px;
    margin-bottom: 18px;
}

.card-icon-box {
    width: 42px;
    height: 42px;
    color: #334e68;
    background: rgba(196, 165, 122, 0.11);
    border: 1px solid rgba(196, 165, 122, 0.16);
    border-radius: 12px;
}

.card-title {
    color: #334e68;
    font-size: 1.03rem;
    font-weight: 700;
    line-height: 1.38;
    letter-spacing: -0.018em;
}

.card-desc {
    display: -webkit-box;
    overflow: hidden;
    color: #334e68;
    font-size: 0.86rem;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.card-meta-footer {
    gap: 12px;
    padding-top: 16px;
    margin-top: 20px;
    border-top: 1px solid var(--border-subtle);
    color: #334e68;
}

.badge {
    color: #334e68;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.015em;
}

.badge-accent {
    color: #334e68;
    background: rgba(196, 165, 122, 0.11);
    border-color: rgba(196, 165, 122, 0.19);
}

.badge-info {
    color: #334e68;
    background: rgba(130, 157, 147, 0.11);
    border-color: rgba(130, 157, 147, 0.2);
}

.fav-btn {
    color: #334e68;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 9px;
}

.fav-btn:hover,
.fav-btn.is-fav {
    color: #334e68;
    background: rgba(196, 165, 122, 0.1);
    border-color: rgba(196, 165, 122, 0.22);
}

.tools-grid,
.catalog-grid,
.grid-2,
.grid-3,
.grid-4 {
    gap: 20px;
}

.tools-grid,
.catalog-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.progress-track {
    overflow: hidden;
    background: rgba(255, 255, 255, 0.075);
    border-radius: 999px;
}

.progress-fill {
    background: linear-gradient(90deg, #829d93, #c4a57a);
    border-radius: inherit;
}

/* Search, filters and form controls */
.filter-toolbar,
.filter-search-box {
    background: #edf2f7;
    border-color: var(--border-color);
    border-radius: 13px;
}

.filter-toolbar {
    padding: 18px;
    margin-bottom: 20px;
}

.filter-input,
.form-control,
.form-select,
.form-textarea {
    color: var(--text-primary);
    background: #edf2f7;
    border: 1px solid rgba(225, 229, 232, 0.13);
    border-radius: 10px;
}

.filter-input::placeholder,
.form-control::placeholder,
.form-textarea::placeholder {
    color: #334e68;
}

.filter-input:focus,
.form-control:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: rgba(196, 165, 122, 0.58);
    box-shadow: 0 0 0 3px rgba(196, 165, 122, 0.1);
    outline: none;
}

.filter-pill {
    color: #334e68;
    background: #e1e9f2;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.filter-pill:hover,
.filter-pill.active {
    color: #334e68;
    background: rgba(196, 165, 122, 0.12);
    border-color: rgba(196, 165, 122, 0.28);
}

.form-label {
    color: #334e68;
    font-weight: 650;
}

.form-hint {
    font-size: 0.78rem;
}

/* Technical workspaces */
.tool-workspace {
    overflow: hidden;
    background: #edf2f7;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--nexus-shadow-soft);
}

.tool-workspace-header,
.tool-panel-title,
.code-block-header {
    border-color: var(--border-subtle);
}

.tool-workspace-body {
    gap: 22px;
    padding: 22px;
}

.tool-panel {
    padding: 22px;
    background: #e1e9f2;
}

.tool-result-box,
.code-block-pre {
    color: #334e68;
    background: #edf2f7;
    border: 1px solid rgba(225, 229, 232, 0.1);
    border-radius: 12px;
    line-height: 1.7;
}

.tool-explanation-footer {
    color: #334e68;
    background: rgba(255, 255, 255, 0.025);
    border-top: 1px solid var(--border-subtle);
}

.alert-box {
    border-radius: 12px;
}

.empty-state {
    color: #334e68;
    background: #edf2f7;
    border: 1px dashed rgba(225, 229, 232, 0.16);
    border-radius: var(--radius-md);
}

.modal-backdrop {
    background: #edf2f7;
    backdrop-filter: blur(8px);
}

.modal-window {
    background: #e1e9f2;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.modal-header {
    border-bottom: 1px solid var(--border-subtle);
}

/* Refined home page */
.home-page {
    width: 100%;
}

.home-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    align-items: center;
    gap: clamp(28px, 5vw, 76px);
    overflow: hidden;
    min-height: 390px;
    padding: clamp(30px, 5vw, 68px);
    margin-bottom: clamp(58px, 7vw, 100px);
    background: radial-gradient(ellipse at 88% 12%, rgba(130, 157, 147, 0.12), transparent 32%),
        radial-gradient(ellipse at 8% 100%, rgba(196, 165, 122, 0.09), transparent 38%),
        linear-gradient(125deg, #1b252e 0%, #171f27 56%, #1b252b 100%);
    border: 1px solid rgba(225, 229, 232, 0.12);
    border-radius: 26px;
    box-shadow: var(--nexus-shadow-soft);
}

.home-hero::after {
    position: absolute;
    top: -95px;
    right: 28%;
    width: 260px;
    height: 260px;
    border: 1px solid rgba(196, 165, 122, 0.08);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.home-hero-copy,
.home-overview-card {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.home-eyebrow,
.home-section-kicker,
.home-overview-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #334e68;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.14em;
    line-height: 1.5;
}

.home-eyebrow {
    margin-bottom: 20px;
}

.home-eyebrow-mark,
.home-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    background: #91a99b;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(145, 169, 155, 0.1);
}

.home-hero-title {
    max-width: 13ch;
    margin: 0 0 20px;
    color: #334e68;
    font-size: clamp(2.35rem, 4.1vw, 4.2rem);
    font-weight: 760;
    letter-spacing: -0.06em;
    line-height: 1.04;
}

.home-hero-title span {
    color: #334e68;
}

.home-hero-description {
    max-width: 57ch;
    margin: 0 0 28px;
    color: #334e68;
    font-size: clamp(0.96rem, 1.2vw, 1.08rem);
    line-height: 1.85;
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 26px;
}

.home-trust-line {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    color: #334e68;
    font-size: 0.76rem;
}

.home-trust-line span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.home-trust-line i {
    color: #334e68;
    font-size: 0.95rem;
}

.home-overview-card {
    padding: clamp(22px, 2.5vw, 32px);
    background: rgba(85,111,140,.10);
    border: 1px solid rgba(225, 229, 232, 0.12);
    border-radius: 20px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.13);
    backdrop-filter: blur(10px);
}

.home-overview-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-subtle);
}

.home-overview-heading h2 {
    max-width: 15ch;
    margin: 8px 0 0;
    color: #334e68;
    font-size: 1.28rem;
    font-weight: 680;
    letter-spacing: -0.035em;
    line-height: 1.28;
}

.home-overview-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    color: #334e68;
    background: rgba(196, 165, 122, 0.12);
    border: 1px solid rgba(196, 165, 122, 0.18);
    border-radius: 13px;
    font-size: 1.25rem;
}

.home-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding-block: 12px;
}

.home-stat-item {
    display: flex;
    min-height: 92px;
    flex-direction: column;
    justify-content: center;
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 160ms ease;
}

.home-stat-item:nth-child(odd) {
    border-right: 1px solid var(--border-subtle);
}

.home-stat-item:nth-child(n + 3) {
    border-bottom: 0;
}

.home-stat-item:hover {
    background: rgba(255, 255, 255, 0.025);
}

.home-stat-item strong {
    color: #334e68;
    font-family: var(--font-mono);
    font-size: 1.9rem;
    font-weight: 650;
    letter-spacing: -0.06em;
    line-height: 1.2;
}

.home-stat-item span {
    color: #334e68;
    font-size: 0.78rem;
}

.home-overview-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 17px;
    color: #334e68;
    font-size: 0.75rem;
}

.home-overview-footer .home-status-dot {
    width: 6px;
    height: 6px;
    flex-basis: 6px;
    background: #8ca99b;
}

.home-section {
    margin-top: clamp(58px, 7vw, 96px);
}

.home-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 25px;
}

.home-section-heading > div:first-child {
    max-width: 760px;
}

.home-section-kicker {
    margin-bottom: 8px;
    color: #334e68;
    font-size: 0.65rem;
}

.home-section-title {
    margin: 0;
    color: #334e68;
    font-size: clamp(1.45rem, 2vw, 1.95rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.2;
}

.home-section-description {
    max-width: 66ch;
    margin: 10px 0 0;
    color: #334e68;
    font-size: 0.91rem;
    line-height: 1.75;
}

.home-section-heading-inline {
    align-items: flex-end;
}

.home-text-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding-bottom: 4px;
    color: #334e68;
    font-size: 0.82rem;
    font-weight: 650;
    transition: color 160ms ease, gap 160ms ease;
}

.home-text-link:hover {
    gap: 12px;
    color: #334e68;
}

.home-domain-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.home-domain-card {
    display: flex;
    min-height: 218px;
    flex-direction: column;
    padding: 22px;
    background: #e1e9f2;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: transform 190ms ease, background-color 190ms ease, border-color 190ms ease, box-shadow 190ms ease;
}

.home-domain-card:hover {
    transform: translateY(-3px);
    background: #e1e9f2;
    border-color: rgba(196, 165, 122, 0.3);
    box-shadow: var(--nexus-shadow-soft);
}

.home-domain-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    margin-bottom: 18px;
    color: #334e68;
    background: rgba(196, 165, 122, 0.1);
    border: 1px solid rgba(196, 165, 122, 0.15);
    border-radius: 12px;
    font-size: 1.15rem;
}

.home-domain-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 7px;
}

.home-domain-content strong {
    color: #334e68;
    font-size: 0.94rem;
    font-weight: 680;
    line-height: 1.38;
}

.home-domain-content > span {
    color: #334e68;
    font-size: 0.79rem;
    line-height: 1.65;
}

.home-domain-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 14px;
    margin-top: 18px;
    color: #334e68;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.7rem;
}

.home-domain-footer i {
    color: #334e68;
    font-size: 1rem;
}

.home-resume-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 18px;
}

.home-resume-card {
    min-width: 0;
    padding: clamp(20px, 2.4vw, 28px);
}

.home-card-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 20px;
}

.home-card-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    color: #334e68;
    background: rgba(196, 165, 122, 0.1);
    border-radius: 12px;
    font-size: 1.1rem;
}

.home-card-heading h3 {
    margin: 0;
    color: #334e68;
    font-size: 0.98rem;
    font-weight: 680;
}

.home-card-heading p {
    margin: 3px 0 0;
    color: #334e68;
    font-size: 0.76rem;
}

.home-history-list {
    display: flex;
    flex-direction: column;
}

.home-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 9px 6px;
    border-top: 1px solid var(--border-subtle);
    transition: background-color 160ms ease;
}

.home-history-item:hover {
    background: rgba(255, 255, 255, 0.025);
}

.home-history-icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    color: #334e68;
    background: rgba(196, 165, 122, 0.09);
    border-radius: 9px;
}

.home-history-name {
    overflow: hidden;
    flex: 1;
    color: #334e68;
    font-size: 0.82rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-history-count {
    color: #334e68;
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.home-history-item > .mdi-chevron-right {
    color: #334e68;
}

.home-empty-history {
    padding: 16px 0 2px;
    border-top: 1px solid var(--border-subtle);
}

.home-empty-history p,
.home-personal-note {
    margin: 0 0 15px;
    color: #334e68;
    font-size: 0.82rem;
    line-height: 1.7;
}

.home-empty-history a,
.home-subsection-heading a {
    color: #334e68;
    font-size: 0.78rem;
    font-weight: 650;
}

.home-personal-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 3px 0 18px;
}

.home-personal-stats > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 15px 16px;
    background: #edf2f7;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
}

.home-personal-stats strong {
    color: #334e68;
    font-family: var(--font-mono);
    font-size: 1.55rem;
    line-height: 1.2;
}

.home-personal-stats span {
    color: #334e68;
    font-size: 0.74rem;
}

.home-progress-link {
    margin-top: 2px;
}

.home-feature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-learning-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.home-learning-card {
    display: flex;
    min-height: 265px;
    flex-direction: column;
    align-items: flex-start;
    padding: 25px;
    background: #e1e9f2;
    border: 1px solid var(--border-color);
    border-radius: 17px;
    transition: transform 190ms ease, background-color 190ms ease, border-color 190ms ease;
}

.home-learning-card:hover {
    transform: translateY(-3px);
    background: #e1e9f2;
    border-color: rgba(130, 157, 147, 0.34);
}

.home-learning-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    margin-bottom: 17px;
    color: #334e68;
    background: rgba(130, 157, 147, 0.12);
    border: 1px solid rgba(130, 157, 147, 0.18);
    border-radius: 13px;
    font-size: 1.25rem;
}

.home-learning-count {
    margin-bottom: 7px;
    color: #334e68;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.035em;
}

.home-learning-card strong {
    margin-bottom: 8px;
    color: #334e68;
    font-size: 1.04rem;
    font-weight: 700;
}

.home-learning-card > span:not(.home-learning-icon):not(.home-learning-count):not(.home-learning-link) {
    color: #334e68;
    font-size: 0.82rem;
    line-height: 1.7;
}

.home-learning-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 20px;
    color: #334e68;
    font-size: 0.78rem;
    font-weight: 650;
}

.home-course-preview {
    margin-top: 38px;
    padding-top: 30px;
    border-top: 1px solid var(--border-subtle);
}

.home-subsection-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 17px;
}

.home-subsection-heading h3 {
    margin: 0;
    color: #334e68;
    font-size: 1rem;
    font-weight: 680;
}

.home-course-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-lab-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-lab-card {
    min-height: 230px;
}

.home-support {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    padding: clamp(24px, 3.5vw, 38px);
    margin-top: clamp(64px, 8vw, 108px);
    background: radial-gradient(ellipse at 0% 100%, rgba(130, 157, 147, 0.11), transparent 42%),
        #18222a;
    border: 1px solid rgba(130, 157, 147, 0.2);
    border-radius: 20px;
}

.home-support-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    color: #334e68;
    background: rgba(130, 157, 147, 0.13);
    border: 1px solid rgba(130, 157, 147, 0.22);
    border-radius: 15px;
    font-size: 1.45rem;
}

.home-support-copy h2 {
    max-width: 28ch;
    margin: 3px 0 7px;
    color: #334e68;
    font-size: clamp(1.15rem, 1.8vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.25;
}

.home-support-copy p {
    max-width: 70ch;
    margin: 0;
    color: #334e68;
    font-size: 0.84rem;
    line-height: 1.7;
}

.home-support-actions {
    display: flex;
    min-width: 180px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.home-support-link {
    color: #334e68;
    font-size: 0.76rem;
    text-align: center;
}

.home-support-link:hover {
    color: #334e68;
}

/* Learning readers, accordions and long-form content */
.editorial-content {
    max-width: 900px;
    color: #334e68;
    font-size: 0.96rem;
    line-height: 1.85;
}

.editorial-content h2,
.editorial-content h3,
.lesson-reader-panel h2,
.lesson-reader-panel h3 {
    color: #334e68;
    letter-spacing: -0.025em;
}

.lesson-reader-panel,
.course-syllabus-panel,
.roadmap-stage-card,
.flashcard-item {
    background: #e1e9f2;
    border: 1px solid var(--border-color);
    border-radius: 15px;
}

.lesson-list-item,
.module-accordion-header,
.skill-check-item {
    border-color: var(--border-subtle);
}

/* Small screens */
@media (max-width: 1220px) {
    .home-domain-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .home-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-overview-card {
        max-width: 580px;
    }

    .home-resume-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-support {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .home-support-actions {
        grid-column: 2;
        min-width: 0;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .home-support-actions .btn {
        min-width: 190px;
    }
}

@media (max-width: 760px) {
    .app-content {
        padding: 22px 16px 54px;
    }

    .page-header {
        padding: 24px 20px;
        border-radius: 17px;
    }

    .home-hero {
        gap: 26px;
        min-height: 0;
        padding: 30px 22px;
        margin-bottom: 58px;
        border-radius: 19px;
    }

    .home-hero-title {
        max-width: 15ch;
        font-size: clamp(2.2rem, 9vw, 3.15rem);
    }

    .home-hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .home-hero-actions .btn {
        justify-content: center;
        width: 100%;
    }

    .home-trust-line {
        gap: 9px 15px;
    }

    .home-section {
        margin-top: 58px;
    }

    .home-section-heading,
    .home-section-heading-inline {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .home-domain-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .home-domain-card {
        min-height: 220px;
        padding: 18px;
    }

    .home-learning-grid,
    .home-course-grid,
    .home-lab-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-learning-card {
        min-height: 225px;
    }

    .home-support {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 24px 20px;
    }

    .home-support-actions {
        grid-column: auto;
        align-items: flex-start;
        flex-direction: column;
    }

    .home-feature-grid,
    .tools-grid,
    .catalog-grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: minmax(0, 1fr);
    }

    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .tool-workspace-body {
        padding: 15px;
    }
}

@media (max-width: 460px) {
    .home-domain-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-domain-card {
        min-height: 0;
    }

    .home-stat-item {
        min-height: 82px;
    }

    .home-personal-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-subsection-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================================
   MELHORIAS DE DINAMISMO & PROFUNDIDADE DE ENGENHARIA (SENIOR DEV LAYER)
   ============================================================================ */

/* 1. Barra de Leitura Dinâmica Fixa no Topo */
.reading-progress-track {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3.5px;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
    display: none;
}
.reading-progress-track.active {
    display: block;
}
.reading-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-primary), #38bdf8, #818cf8);
    transition: width 0.1s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 10px rgba(196, 165, 122, 0.5);
}

/* 2. Sumário Dinâmico e Interativo de Guias (Table of Contents) */
.guide-toc-container {
    background: var(--surface-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: var(--nexus-shadow-soft);
}
.guide-toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.guide-toc-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.guide-toc-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    transition: all 0.18s ease;
    cursor: pointer;
}
.guide-toc-pill:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    background: var(--accent-soft);
    transform: translateY(-1px);
}
.guide-toc-pill.active {
    color: #121920;
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    font-weight: 600;
}

/* 3. Diagramas Mentais & Arquiteturais em ASCII / Box-Drawing */
.architecture-diagram-box {
    background: #edf2f7;
    border: 1px solid rgba(196, 165, 122, 0.28);
    border-radius: var(--radius-sm);
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.architecture-diagram-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(196, 165, 122, 0.08);
    border-bottom: 1px solid rgba(196, 165, 122, 0.18);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent-primary);
}
.architecture-diagram-pre {
    margin: 0;
    padding: 18px 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    color: #334e68;
    overflow-x: auto;
    white-space: pre;
    background: #edf2f7;
}

/* 4. Sistema Interativo de Laboratórios (Stepper, Dicas Progressivas & Análise Profunda) */
.lab-stepper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 18px;
}
.lab-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.16s ease;
}
.lab-step-item:hover {
    border-color: var(--accent-primary);
    background: rgba(196, 165, 122, 0.05);
}
.lab-step-item.completed {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.06);
}
.lab-step-item.completed span {
    text-decoration: line-through;
    color: var(--text-secondary);
}
.lab-step-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    flex-shrink: 0;
    margin-top: 1px;
}
.lab-step-item.completed .lab-step-badge {
    background: var(--status-success);
    color: #0b0f19;
}

/* Dicas Progressivas do Laboratório */
.lab-hints-container {
    margin-top: 14px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}
.lab-hint-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--surface-raised);
    border: none;
    color: var(--text-primary);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.lab-hint-trigger:hover {
    background: rgba(196, 165, 122, 0.1);
}
.lab-hint-content {
    padding: 14px 16px;
    background: #edf2f7;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.lab-hint-tier {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.lab-hint-tier:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Análise Profunda Pós-Validação (Deep Technical Analysis) */
.lab-analysis-card {
    margin-top: 16px;
    padding: 16px 20px;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    line-height: 1.65;
}
.lab-analysis-card h4 {
    color: var(--accent-primary);
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lab-gotcha-box {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid var(--status-warning);
    border-radius: var(--radius-xs);
    font-size: 0.82rem;
    color: #334e68;
}

/* 5. Banner de Dica de Engenharia Sênior na Home */
.senior-tip-banner {
    background: linear-gradient(135deg, #e1e9f2, #edf2f7);
    border: 1px solid rgba(196, 165, 122, 0.25);
    border-radius: var(--radius-md);
    padding: 22px 26px;
    margin-bottom: 32px;
    box-shadow: var(--nexus-shadow-soft);
    position: relative;
    overflow: hidden;
}
.senior-tip-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-primary);
}
.senior-tip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.senior-tip-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent-primary);
    text-transform: uppercase;
}
.senior-tip-content h3 {
    font-size: 1.05rem;
    font-weight: 750;
    color: var(--text-primary);
    margin-bottom: 6px;
}
.senior-tip-content p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}
.senior-tip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* 6. Foco Acessível por Teclado na Pesquisa Omnibar */
.omnibar-hit-item.keyboard-focused {
    border-color: var(--accent-primary) !important;
    background: rgba(196, 165, 122, 0.12) !important;
    box-shadow: 0 0 0 2px var(--accent-primary), var(--nexus-shadow-soft) !important;
    transform: translateX(4px);
}
.omnibar-highlight {
    background: rgba(196, 165, 122, 0.28);
    color: #334e68;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 700;
}

/* 7. Atalhos de Teclado Kbd */
.kbd-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: var(--text-secondary);
}
