/* ═══════════════════════════════════════════════
   PCBAssist — Precision Editorial Design System
   ═══════════════════════════════════════════════ */

:root {
    --pcb-bg: #FFFFFF;
    --pcb-surface: #FFFFFF;
    --pcb-surface-alt: #F8F9FA;
    --pcb-primary: #0E7A6D;
    --pcb-primary-light: #13BBA6;
    --pcb-primary-dark: #0D5E58;
    --pcb-primary-subtle: rgba(14, 122, 109, 0.06);
    --pcb-copper: #BE7E3E;
    --pcb-copper-light: #D0A06C;
    --pcb-copper-glow: rgba(190, 126, 62, 0.18);
    --pcb-secondary: #E8590C;
    --pcb-text: #111111;
    --pcb-text-muted: #6B7280;
    --pcb-text-subtle: #9CA3AF;
    --pcb-border: #E5E7EB;
    --pcb-border-subtle: #F3F4F6;
    --pcb-radius: 12px;
    --pcb-radius-lg: 18px;
    --pcb-radius-xl: 24px;
    --pcb-shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
    --pcb-shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.03);
    --pcb-shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --pcb-shadow-glow: 0 0 40px rgba(14, 122, 109, 0.12);
    --font-display: 'Outfit', system-ui, -apple-system, sans-serif;
    --font-body: 'Outfit', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Cascadia Code', monospace;
}

/* Application appearance is independent of the public marketing pages. */
body:has(.pcb-app-shell[data-theme="dark"]) {
    color-scheme: dark;
    --pcb-bg: #0F0F0F;
    --pcb-surface: #1A1A1A;
    --pcb-surface-alt: #222B29;
    --pcb-text: #F5F5F4;
    --pcb-text-muted: #B5C5C1;
    --pcb-text-subtle: #A2B6B1;
    --pcb-border: #43524F;
    --pcb-border-subtle: #33423E;
    --pcb-primary: #74D6C7;
    --pcb-primary-subtle: #173831;
    --spec-text: #E0EEEA;
    --spec-muted: #B5CFC7;
    --spec-accent: #8ADFCF;
    --spec-warning: #F4CA91;
    --spec-danger: #FFBBB3;
    --spec-surface: #213631;
    --spec-field: #142722;
}

body:has(.pcb-app-shell[data-theme="dark"]) .nav-glass {
    background: #1A1A1AF2 !important;
    border-bottom-color: var(--pcb-border) !important;
    color: #F5F5F4;
}

/* ─── Base ──────────────────────────────────── */
html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background-color: var(--pcb-bg);
    color: var(--pcb-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::selection {
    background: rgba(14, 122, 109, 0.15);
    color: var(--pcb-text);
}

/* ─── Entrance Animations ───────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes drawTrace {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.animate-fade-up {
    animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }
.animate-delay-6 { animation-delay: 0.6s; }

/* ─── Marketing Sections ────────────────────── */
.marketing-section {
    padding: 6rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.marketing-section-tight {
    padding: 4rem 1.5rem;
}

@media (min-width: 960px) {
    .marketing-section {
        padding: 8rem 2rem;
    }
    .marketing-section-tight {
        padding: 5rem 2rem;
    }
}

/* ─── Page Hero Backgrounds ────────────────── */
.page-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.page-hero-features .page-hero-bg {
    background:
        url('/images/neural-routing-network.svg') right -80px top 20%/400px auto no-repeat,
        url('/images/neural-routing-network.svg') left -80px bottom 20%/350px auto no-repeat;
    opacity: 0.12;
    filter: hue-rotate(-10deg);
}

.page-hero-pricing .page-hero-bg {
    background:
        url('/images/hdi-pcb-isometric.svg') right -60px center/320px auto no-repeat,
        url('/images/hdi-pcb-isometric.svg') left -60px center/280px auto no-repeat;
    opacity: 0.06;
}

/* ─── Hero ──────────────────────────────────── */
.hero-section {
    position: relative;
    padding: 10rem 1.5rem 7rem;
    overflow: hidden;
    background:
        linear-gradient(165deg, #FFFFFF 0%, #FAFBFC 35%, #F5FAF9 65%, #F7FBFA 100%);
}

.hero-bg-image {
    position: absolute;
    inset: 0;
    background:
        url('/images/pcb_trace_background_283925000.jpg') center/cover no-repeat;
    opacity: 0.1;
    pointer-events: none;
    filter: saturate(0.4) contrast(1.2) brightness(0.92);
    mix-blend-mode: multiply;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 70%;
    height: 160%;
    background: radial-gradient(ellipse at center, rgba(15, 118, 110, 0.08) 0%, transparent 55%);
    pointer-events: none;
    z-index: 1;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -5%;
    width: 50%;
    height: 100%;
    background:
        radial-gradient(ellipse at center, rgba(190, 126, 62, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.hero-traces {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.25;
}

.hero-traces svg {
    position: absolute;
    width: 100%;
    height: 100%;
}

.hero-traces path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawTrace 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.hero-traces .trace-1 { animation-delay: 0.2s; }
.hero-traces .trace-2 { animation-delay: 0.5s; }
.hero-traces .trace-3 { animation-delay: 0.8s; }
.hero-traces .trace-4 { animation-delay: 1.1s; }
.hero-traces .trace-5 { animation-delay: 1.4s; }

.hero-traces circle {
    animation: pulseGlow 2s ease-in-out infinite;
}
.hero-traces circle:nth-child(2) { animation-delay: 0.3s; }
.hero-traces circle:nth-child(3) { animation-delay: 0.7s; }

/* ─── Hero Split Layout ────────────────────── */
.hero-split {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
    text-align: center;
}

.hero-content {
    flex: 1;
    min-width: 0;
}

.hero-logo-inline {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(14, 122, 109, 0.25));
}

.hero-visual {
    flex: 1;
    min-width: 0;
    max-width: 560px;
    width: 100%;
}

.hero-image-frame {
    position: relative;
    border-radius: var(--pcb-radius-xl);
    overflow: hidden;
    box-shadow:
        var(--pcb-shadow-lg),
        0 0 80px rgba(14, 122, 109, 0.12),
        0 0 0 1px rgba(14, 122, 109, 0.08);
    border: 2px solid rgba(14, 122, 109, 0.12);
    aspect-ratio: 4 / 3;
}

.hero-image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 8s ease;
}

.hero-image-frame:hover img {
    transform: scale(1.05);
}

.hero-image-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(14, 122, 109, 0.1) 0%, transparent 50%),
        linear-gradient(to bottom, transparent 60%, rgba(15, 15, 15, 0.15) 100%);
    pointer-events: none;
}

@media (min-width: 960px) {
    .hero-section {
        padding: 11rem 2rem 8rem;
    }
    .hero-split {
        flex-direction: row;
        gap: 5rem;
        text-align: left;
        align-items: center;
    }
    .hero-content {
        flex: 1.15;
    }
    .hero-visual {
        flex: 0.95;
    }
    .hero-content .animate-fade-up:first-child {
        justify-content: flex-start;
    }
}

/* ─── Metrics Strip ────────────────────────── */
.metrics-strip {
    background: var(--pcb-surface);
    border-top: 1px solid var(--pcb-border);
    border-bottom: 1px solid var(--pcb-border);
    padding: 2rem 1.5rem;
}

.metrics-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
}

.metric-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pcb-primary);
    letter-spacing: -0.02em;
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--pcb-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.metric-divider {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, transparent, var(--pcb-border), transparent);
}

@media (max-width: 600px) {
    .metric-divider { display: none; }
    .metrics-row { gap: 1rem; }
    .metric-item { min-width: 40%; }
}

/* ─── Bento Grid ───────────────────────────── */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .bento-featured {
        grid-column: 1 / -1;
    }
}

.bento-card {
    background: var(--pcb-surface);
    border: 1px solid var(--pcb-border);
    border-radius: var(--pcb-radius-xl);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.bento-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pcb-primary), var(--pcb-copper));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bento-card:hover {
    border-color: rgba(14, 122, 109, 0.2);
    box-shadow: var(--pcb-shadow-lg), var(--pcb-shadow-glow);
    transform: translateY(-3px);
}

.bento-card:hover::before {
    transform: scaleX(1);
}

.bento-number {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 300;
    color: var(--pcb-border);
    line-height: 1;
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    transition: color 0.3s ease;
}

.bento-card:hover .bento-number {
    color: rgba(14, 122, 109, 0.1);
}

.bento-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pcb-primary), var(--pcb-primary-dark));
    color: white;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
    transition: transform 0.3s ease;
}

.bento-card:hover .bento-icon-wrap {
    transform: scale(1.05) rotate(-2deg);
}

.bento-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--pcb-text);
    margin: 0 0 0.625rem;
}

.bento-desc {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--pcb-text-muted);
    margin: 0 0 1.25rem;
}

.bento-visual {
    background: var(--pcb-surface-alt);
    border-radius: var(--pcb-radius);
    padding: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    margin-top: auto;
}

.bento-visual img {
    width: 90%;
    height: auto;
    max-height: 180px;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.bento-card:hover .bento-visual img {
    opacity: 1;
    transform: scale(1.04);
}

.bento-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.bento-tag {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--pcb-primary);
    background: var(--pcb-primary-subtle);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    border: 1px solid rgba(14, 122, 109, 0.1);
}

/* ─── Bento Featured Card ──────────────────── */
.bento-featured {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2.5rem;
    background:
        linear-gradient(135deg, rgba(14, 122, 109, 0.02) 0%, var(--pcb-surface) 50%, rgba(190, 126, 62, 0.02) 100%);
}

.bento-featured-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.bento-featured-visual {
    flex: 1;
    background: var(--pcb-bg);
    border-radius: var(--pcb-radius-lg);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.bento-featured-visual img {
    width: 90%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
}

@media (min-width: 768px) {
    .bento-featured {
        flex-direction: row;
        padding: 3rem;
    }
    .bento-featured-visual {
        min-height: 220px;
    }
}

/* ─── Typography ────────────────────────────── */
.display-heading {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 6vw, 4.25rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--pcb-text);
    text-wrap: balance;
}

.display-heading em {
    font-style: normal;
    color: var(--pcb-primary);
    font-weight: 800;
}

.section-heading {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--pcb-text);
}

.body-large {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--pcb-text-muted);
    letter-spacing: 0.01em;
}

.hero-content .body-large {
    font-size: 1.125rem;
    color: var(--pcb-text-muted);
    line-height: 1.7;
}

.mono {
    font-family: var(--font-mono);
}

.label-upper {
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--pcb-text-muted);
}

/* ─── Cards ─────────────────────────────────── */
.pcb-card {
    background: var(--pcb-surface);
    border: 1px solid var(--pcb-border);
    border-radius: var(--pcb-radius-lg);
    padding: 2rem;
    transition: box-shadow 0.3s ease;
    position: relative;
}

.pcb-card:hover {
    box-shadow: var(--pcb-shadow-lg);
}

.pcb-card-highlight {
    border-color: var(--pcb-primary);
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.02) 0%, var(--pcb-surface) 100%);
}

/* ─── Feature Cards ─────────────────────────── */
.feature-card {
    background: var(--pcb-surface);
    border: 1px solid var(--pcb-border);
    border-radius: var(--pcb-radius-xl);
    padding: 2.5rem;
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at top right, var(--pcb-primary-subtle), transparent 70%);
    transition: all 0.4s ease;
}

.feature-card:hover {
    border-color: rgba(14, 122, 109, 0.2);
    box-shadow: var(--pcb-shadow-lg), var(--pcb-shadow-glow);
    transform: translateY(-2px);
}

.feature-card:hover::after {
    width: 200px;
    height: 200px;
}

.feature-card .feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pcb-primary), var(--pcb-primary-dark));
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.05) rotate(-2deg);
}

.feature-card .feature-number {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 300;
    color: var(--pcb-border);
    line-height: 1;
    z-index: 0;
    transition: color 0.3s ease;
}

.feature-card:hover .feature-number {
    color: rgba(15, 118, 110, 0.08);
}

.feature-card .feature-illustration {
    width: 100%;
    height: 140px;
    margin-bottom: 1.5rem;
    border-radius: var(--pcb-radius);
    background: var(--pcb-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.feature-card .feature-illustration img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

/* ─── Feature Page Illustrations ───────────── */
.feature-detail-illustration {
    height: 300px;
    border-radius: var(--pcb-radius-xl);
    background:
        radial-gradient(ellipse at 50% 50%, var(--pcb-bg) 40%, rgba(255, 255, 255, 0.85) 100%),
        url('/images/pcba_479585223.jpeg') center/cover no-repeat;
    border: 1px solid var(--pcb-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.feature-detail-illustration img {
    width: 85%;
    height: 85%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.feature-detail-illustration:hover img {
    transform: scale(1.03);
}

/* ─── Pricing Cards ─────────────────────────── */
.pricing-card {
    background: var(--pcb-surface);
    border: 1px solid var(--pcb-border);
    border-radius: var(--pcb-radius-xl);
    padding: 2.5rem;
    height: 100%;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pricing-card:hover {
    box-shadow: var(--pcb-shadow-md);
    transform: translateY(-2px);
}

.pricing-card-featured {
    border: 2px solid var(--pcb-primary);
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.03) 0%, var(--pcb-surface) 40%);
    box-shadow: var(--pcb-shadow-md), 0 0 0 1px var(--pcb-primary);
}

.pricing-card-featured:hover {
    box-shadow: var(--pcb-shadow-lg), var(--pcb-shadow-glow);
}

.pricing-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--pcb-primary), var(--pcb-primary-dark));
    color: white;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.35rem 1.25rem;
    border-radius: 100px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.3);
}

.pricing-price {
    font-family: var(--font-display);
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--pcb-text);
}

.pricing-price .period {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--pcb-text-muted);
    letter-spacing: 0;
}

/* ─── Credit Pack Cards ─────────────────────── */
.credit-card {
    background: var(--pcb-surface);
    border: 1px solid var(--pcb-border);
    border-radius: var(--pcb-radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.credit-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pcb-primary), var(--pcb-copper));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.credit-card:hover {
    border-color: var(--pcb-primary);
    box-shadow: var(--pcb-shadow-md);
    transform: translateY(-2px);
}

.credit-card:hover::before {
    transform: scaleX(1);
}

/* ─── Credits Section Background ──────────── */
.credits-section-bg {
    position: absolute;
    inset: 0;
    background: url('/images/pcb_trace_2_296598774.jpg') center/cover no-repeat;
    opacity: 0.035;
    pointer-events: none;
    filter: saturate(0) contrast(1.3);
}

/* ─── Auth Pages ────────────────────────────── */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 3rem 1.5rem;
    position: relative;
    background:
        url('/images/dot-grid.svg') center/200px 200px repeat,
        var(--pcb-bg);
}

.auth-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 30%, var(--pcb-bg) 30%, transparent 70%);
    pointer-events: none;
}

.auth-card {
    background: var(--pcb-surface);
    border: 1px solid var(--pcb-border);
    border-radius: var(--pcb-radius-xl);
    padding: 3rem;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--pcb-shadow-lg);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pcb-primary) 10%, var(--pcb-copper-light) 50%, var(--pcb-primary) 90%);
}

/* ─── Auth Form Fields ─────────────────────── */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-field label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--pcb-text-muted);
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--pcb-text);
    background: var(--pcb-surface);
    border: 1px solid var(--pcb-border);
    border-radius: var(--pcb-radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--pcb-primary);
    box-shadow: 0 0 0 3px rgba(14, 122, 109, 0.1);
}

.form-input::placeholder {
    color: transparent;
}

.form-helper {
    font-size: 0.75rem;
    color: var(--pcb-text-subtle);
    margin-top: 0.125rem;
}

/* ─── CTA Section ───────────────────────────── */
.cta-section {
    position: relative;
    padding: 7rem 1.5rem;
    text-align: center;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        url('/images/cyber-trace-pattern.svg') center/cover no-repeat,
        radial-gradient(ellipse at 30% 50%, rgba(15, 118, 110, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 50%, var(--pcb-copper-glow) 0%, transparent 50%);
    opacity: 0.6;
    pointer-events: none;
}

.cta-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/images/pcb_trace_closeup_617507782.jpeg') center/cover no-repeat;
    opacity: 0.04;
    pointer-events: none;
    filter: saturate(0) contrast(1.2);
}

/* ─── Footer ────────────────────────────────── */
.site-footer {
    background: #0F0F0F;
    color: #A8A29E;
    padding: 5rem 2rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.site-footer .footer-bg-traces {
    position: absolute;
    right: -50px;
    bottom: -30px;
    width: 600px;
    height: 450px;
    background: url('/images/pcb-traces.svg') center/contain no-repeat;
    opacity: 0.5;
    pointer-events: none;
    filter: brightness(2);
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--pcb-copper) 50%, transparent 100%);
}

.footer-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: #F5F5F4;
    letter-spacing: -0.02em;
}

.footer-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: brightness(1.1);
}

.footer-heading {
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #78716C;
    margin-bottom: 1.25rem;
}

.footer-link {
    display: block;
    color: #A8A29E;
    font-size: 0.875rem;
    margin-bottom: 0.625rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #14B8A6;
}

/* ─── Nav ───────────────────────────────────── */
.nav-glass {
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(229, 231, 235, 0.6) !important;
}

.nav-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--pcb-text) !important;
    letter-spacing: -0.02em;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.nav-logo:hover .nav-logo-img {
    transform: scale(1.08) rotate(-3deg);
}

.nav-link {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--pcb-text-muted) !important;
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--pcb-text) !important;
    background: var(--pcb-primary-subtle);
}

/* ─── Buttons ───────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--pcb-primary), var(--pcb-primary-dark)) !important;
    border: none !important;
    border-radius: 10px !important;
    font-family: var(--font-body) !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: 0.75rem 1.75rem !important;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(15, 118, 110, 0.35) !important;
    transform: translateY(-1px);
}

.btn-outline {
    border: 1.5px solid var(--pcb-border) !important;
    border-radius: 10px !important;
    font-family: var(--font-body) !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    padding: 0.75rem 1.75rem !important;
    color: var(--pcb-text) !important;
    transition: all 0.3s ease !important;
}

.btn-outline:hover {
    border-color: var(--pcb-primary) !important;
    background: var(--pcb-primary-subtle) !important;
    color: var(--pcb-primary) !important;
}

/* ─── App Dashboard ─────────────────────────── */
.metric-card {
    background: var(--pcb-surface);
    border: 1px solid var(--pcb-border);
    border-radius: var(--pcb-radius-lg);
    padding: 1.5rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--pcb-primary), var(--pcb-copper));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.metric-card:hover {
    border-color: rgba(15, 118, 110, 0.15);
    box-shadow: var(--pcb-shadow-sm);
}

.metric-card:hover::after {
    opacity: 1;
}

/* ─── PCB Grid Pattern ──────────────────────── */
.pcb-grid-bg {
    background-image:
        linear-gradient(rgba(231, 229, 228, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(231, 229, 228, 0.3) 1px, transparent 1px);
    background-size: 40px 40px;
}

.pcb-dots-bg {
    background-image: radial-gradient(circle, rgba(194, 136, 74, 0.12) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ─── Divider ───────────────────────────────── */
.trace-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pcb-copper), transparent);
    border: none;
    margin: 3rem 0;
    opacity: 0.3;
}

/* ─── Check Feature List ────────────────────── */
.feature-check {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.25rem 0;
}

.feature-check .check-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--pcb-primary-subtle);
    color: var(--pcb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ─── User Avatar Menu ─────────────────────── */
.user-avatar-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.user-avatar-trigger:hover {
    background: var(--pcb-primary-subtle);
}

.user-menu-header {
    padding: 0.75rem 1rem 0.5rem;
    border-bottom: 1px solid var(--pcb-border-subtle);
    margin-bottom: 0.25rem;
}

.user-menu-signout {
    all: unset;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 6px 16px;
    font-size: 0.875rem;
    font-family: var(--font-body);
    color: var(--pcb-text);
    box-sizing: border-box;
}

.user-menu-signout:hover {
    background: var(--pcb-primary-subtle);
}

/* ─── Blazor Error UI ───────────────────────── */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuOTQ5IDUxLjQ4MzcgMjY2Ljc1NCA1Mi4yNjU4TDI3Ni4yMzQgNjEuMzY1MkwyNjcuNTA0IDcwLjU1NkMyNjYuNzI5IDcxLjMyOCAyNjUuNTEzIDcxLjgxMDcgMjY0LjI4MiA3MS44MTA3QzI2My4wNTEgNzEuODEwNyAyNjEuODM1IDcxLjMyOCAyNjEuMDYgNzAuNTU2TDI1MS41OCA2MS4zNjUyQzI1MC43NzQgNjAuNTkzMiAyNTAuMjkyIDU5LjM2MzIgMjUwLjI5MiA1OC4xMzE4QzI1MC4yOTIgNTYuOTAwNSAyNTAuNzc0IDU1LjY3MDQgMjUxLjU4IDU0Ljg5ODVMMjYwLjI1NiA0NS43MDk3QzI2MS4wNjEgNDQuOTM3NyAyNjIuMjk1IDQ0LjQ1NSAyNjMuNTA2IDQ0LjQ1NVpNMjYzLjU4NiA1Ny4xNDk5QzI2NC44OTQgNTcuMTQ5OSAyNjYuMTI2IDU3LjYzMzUgMjY2LjkzMSA1OC40MTU1TDI3Ni40MTEgNjcuMTk2MkMyNzcuMjE3IDY3Ljk3ODIgMjc3LjY5OSA2OS4yMDgzIDI3Ny42OTkgNzAuNDM5NkMyNzcuNjk5IDcxLjY3MSAyNzcuMjE3IDcyLjkwMSAyNzYuNDExIDczLjY4M0wyNjcuNzMgODIuODczOEMyNjYuOTI1IDgzLjY1NTggMjY1LjY5MyA4NC4xMzk1IDI2NC40NjIgODQuMTM5NUMyNjMuMjMxIDg0LjEzOTUgMjYyLjAxNSA4My42NTU4IDI2MS4yMSA4Mi44NzM4TDI1MS43MyA3My42ODNDMjUwLjkyNCA3Mi45MDEgMjUwLjQ0MiA3MS42NzEgMjUwLjQ0MiA3MC40Mzk2QzI1MC40NDIgNjkuMjA4MyAyNTAuOTI0IDY3Ljk3ODIgMjUxLjczIDY3LjE5NjJMMjYwLjQxIDU4LjQxNTVDMjYxLjIxNSA1Ny42MzM1IDI2Mi4yNzggNTcuMTQ5OSAyNjMuNTg2IDU3LjE0OTlaIiBmaWxsPSIjRkYwMDAwIi8+PC9nPjwvc3ZnPg==) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ─── Accessibility ────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 10000;
    background: var(--pcb-primary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 var(--pcb-radius) var(--pcb-radius);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--pcb-copper);
    outline-offset: 2px;
}

:focus-visible {
    outline: 3px solid var(--pcb-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--pcb-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: more) {
    :root {
        --pcb-border: #999;
        --pcb-text-muted: #444;
        --pcb-text-subtle: #666;
    }

    .pcb-card, .feature-card, .pricing-card, .metric-card, .auth-card, .credit-card {
        border-width: 2px;
    }
}

/* ─── Cookie Consent Banner ────────────────── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--pcb-surface);
    border-top: 1px solid var(--pcb-border);
    box-shadow: 0 -4px 24px rgba(30, 20, 10, 0.1);
    padding: 1.25rem 2rem;
}

.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-banner-text {
    flex: 1;
    min-width: 280px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--pcb-text-muted);
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-banner-spacer {
    height: 4rem;
}

/* ─── Nav Sign Out Button ───────────────────── */
.nav-signout-btn {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--pcb-text-muted);
    font-family: inherit;
    text-align: left;
    border-radius: 4px;
}

.nav-signout-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--pcb-text);
}

/* ─── Mobile responsive ─────────────────────── */
.main-content-responsive {
    min-height: 100vh;
    padding: 1.5rem 2rem;
}

.flex-wrap { flex-wrap: wrap !important; }

@media (max-width: 959px) {
    .main-content-responsive {
        padding: 1rem;
    }

    .hero-section {
        padding-bottom: 9rem;
    }

    .cookie-banner {
        padding: 0.75rem 1rem;
    }

    .cookie-banner-inner {
        gap: 0.75rem;
    }

    .cookie-banner-spacer {
        height: 5rem;
    }

    .cookie-banner-text {
        min-width: unset;
        font-size: 0.8125rem;
        line-height: 1.4;
    }

    .cookie-banner-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 599px) {
    .main-content-responsive {
        padding: 0.75rem;
    }

    .cookie-banner {
        padding: 0.5rem 0.75rem;
    }

    .cookie-banner-text {
        font-size: 0.75rem;
    }

    .cookie-banner-actions .mud-button {
        padding: 0.25rem 0.75rem !important;
        font-size: 0.75rem;
    }
}

/* ─── Chat Markdown ────────────────────────── */
.chat-markdown p {
    margin: 0 0 0.5em;
}
.chat-markdown p:last-child {
    margin-bottom: 0;
}
.chat-markdown h1, .chat-markdown h2, .chat-markdown h3,
.chat-markdown h4, .chat-markdown h5, .chat-markdown h6 {
    margin: 0.75em 0 0.25em;
    font-weight: 600;
    line-height: 1.3;
}
.chat-markdown h3 { font-size: 1rem; }
.chat-markdown h4 { font-size: 0.9375rem; }
.chat-markdown ul, .chat-markdown ol {
    margin: 0.25em 0 0.5em;
    padding-left: 1.5em;
}
.chat-markdown li {
    margin-bottom: 0.15em;
}
.chat-markdown code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    background: rgba(0, 0, 0, 0.06);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}
.chat-markdown pre {
    margin: 0.5em 0;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.06);
    border-radius: var(--pcb-radius);
    overflow-x: auto;
}
.chat-markdown pre code {
    background: none;
    padding: 0;
}
.chat-markdown table {
    border-collapse: collapse;
    margin: 0.5em 0;
    font-size: 0.8125rem;
    width: 100%;
}
.chat-markdown th, .chat-markdown td {
    border: 1px solid var(--pcb-border);
    padding: 0.35rem 0.6rem;
    text-align: left;
}
.chat-markdown th {
    background: var(--pcb-surface-alt);
    font-weight: 600;
}
.chat-markdown blockquote {
    margin: 0.5em 0;
    padding: 0.25rem 0 0.25rem 0.75rem;
    border-left: 3px solid var(--pcb-primary);
    color: var(--pcb-text-muted);
}
.chat-markdown a {
    color: var(--pcb-primary);
    text-decoration: underline;
}

/* Drawing workspaces share the same mobile panel and expanded-view behavior. */
.viewer-file-heading { min-width: 0; }
.viewer-file-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.viewer-file-heading > a { flex-shrink: 0; }
.viewer-workspace { position: relative; min-width: 0; background: var(--mud-palette-surface, #fff); border: 1px solid var(--mud-palette-lines-default, #dce3e5); border-radius: 8px; }
.viewer-workspace-toolbar { display: flex; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--mud-palette-lines-default, #dce3e5); }
.viewer-workspace-toolbar button, .viewer-comments-close, .viewer-3d-toggle { min-height: 44px; padding: 8px 12px; border: 1px solid var(--mud-palette-lines-default, #b9c9ce); border-radius: 6px; background: var(--mud-palette-surface, #fff); color: var(--mud-palette-text-primary, #24343b); font: inherit; cursor: pointer; }
.viewer-expand { margin-left: auto; }
.viewer-comments-toggle, .viewer-comments-close { display: none; }
.viewer-workspace-body { display: flex; position: relative; min-width: 0; min-height: 0; }
.viewer-workspace-content { flex: 1; min-width: 0; min-height: 0; }
.viewer-file-frame { display: block; width: 100%; height: calc(100vh - 214px); height: calc(100dvh - 214px); min-height: 320px; border: 0; }
.viewer-comments { width: 320px; flex-shrink: 0; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--mud-palette-lines-default, #dce3e5); }
.viewer-comments-content { flex: 1; min-height: 0; height: 0; overflow: auto; }
.viewer-surface { display: block; width: 100%; height: 75vh; height: 75dvh; min-height: 280px; }
.viewer-workspace.is-expanded { position: fixed; inset: 0; z-index: 1101; border: 0; border-radius: 0; height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.viewer-workspace.is-expanded .viewer-workspace-body { flex: 1; overflow: hidden; }
.viewer-workspace.is-expanded .viewer-workspace-content { overflow: auto; overscroll-behavior: contain; }
.viewer-workspace.is-expanded .viewer-file-frame { height: 100%; min-height: 0; }
.viewer-workspace.is-expanded .viewer-surface { height: calc(100dvh - 144px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 0; }
body:has(.viewer-workspace.is-expanded) { overflow: hidden; }
.viewer-page > .mud-stack, .viewer-properties .mud-stack { flex-wrap: wrap; }
.viewer-page > .mud-stack > *, .viewer-properties .mud-stack > * { min-width: 0; overflow-wrap: anywhere; }
.viewer-properties { max-height: 160px; overflow: auto; }
.viewer-3d-tools { position: absolute; bottom: 12px; left: 12px; right: 12px; }
.viewer-3d-toggle { display: none; }
.viewer-3d-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.viewer-zoom-controls button { min-height: 44px; min-width: 44px; }
@media (max-width: 960px), (max-height: 500px) {
  .viewer-file-heading { flex-wrap: wrap; gap: 2px !important; margin-bottom: 8px !important; }
  .viewer-file-name { flex-basis: 100%; font-size: 14px; }
  .viewer-comments-toggle, .viewer-comments-close { display: block; }
  .viewer-comments { display: none; position: absolute; z-index: 3; bottom: 0; left: 0; right: 0; width: 100%; height: 72%; max-height: 520px; border: 1px solid var(--mud-palette-lines-default); border-radius: 12px 12px 0 0; background: var(--mud-palette-surface, #fff); box-shadow: 0 -6px 24px #0003; }
  .comments-open .viewer-comments { display: flex; }
  .viewer-comments-close { align-self: flex-end; margin: 6px; flex-shrink: 0; }
  .viewer-comments-content { padding-bottom: env(safe-area-inset-bottom); }
  .viewer-file-frame { height: calc(100dvh - 230px); min-height: 300px; }
  .viewer-tab-content { padding: 0 !important; }
  .viewer-tabs .mud-tab { min-width: 88px !important; padding: 12px 8px; font-size: 12px; }
  .viewer-surface { height: 70dvh; border-radius: 0 !important; }
  .viewer-workspace.is-expanded .viewer-surface { height: calc(100dvh - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .viewer-properties { max-height: 100px; }
  .viewer-3d-tools { left: 8px; right: 8px; bottom: 8px; }
  .viewer-3d-toggle { display: block; margin-left: auto; background: #24343b; color: white; }
  .viewer-3d-toolbar { display: none; margin-top: 6px; padding: 8px; max-height: 40dvh; overflow: auto; background: #24343bf5; border-radius: 8px; }
  .viewer-3d-tools.is-open .viewer-3d-toolbar { display: flex; }
  .viewer-3d-toolbar button { min-width: 44px !important; min-height: 44px !important; font-size: 13px !important; }
}

details.library-technical-details {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}

details.library-technical-details > summary {
    cursor: pointer;
    color: var(--pcb-text-muted);
}

details.library-technical-details[open] > summary {
    margin-bottom: 0.5rem;
}

details.library-technical-details .mud-typography {
    display: block;
}
