/* =========================================================
   monopoleai.com — Cool-Minimal Bento AI Lab
   Palette: #F4F6FA #FFFFFF #0A1830 #3060C0 #E8F0FF #8090A0 #20A060
   Fonts:   DM Sans (display) · Inter (body) · Space Grotesk (data)
   ========================================================= */

:root {
    --cool-white: #F4F6FA;
    --card: #FFFFFF;
    --navy: #0A1830;
    --blue: #3060C0;
    --blue-soft: #E8F0FF;
    --steel: #8090A0;
    --green: #20A060;

    --shadow-rest: 0 1px 3px rgba(10, 24, 48, 0.06);
    --shadow-hover: 0 4px 16px rgba(10, 24, 48, 0.10);
    --shadow-deep: 0 8px 28px rgba(10, 24, 48, 0.12);

    --radius: 12px;
    --gap: 16px;

    --spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    --f-display: "DM Sans", "Inter", system-ui, sans-serif;
    --f-body: "Inter", system-ui, sans-serif;
    --f-data: "Space Grotesk", "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--cool-white);
    color: var(--navy);
    font-family: var(--f-body);
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* -------- Neural network ambient background -------- */
.neural-bg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

/* -------- Page wrap -------- */
.page {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px clamp(20px, 4vw, 56px) 56px;
}

/* -------- Header -------- */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0 32px;
    gap: 24px;
}

.logotype {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--f-display);
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.01em;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--blue-soft);
    border-radius: 8px;
}

.logo-text {
    font-size: clamp(18px, 1.4vw, 22px);
    line-height: 1;
}

.logo-text.small { font-size: 15px; }

.logo-tld {
    color: var(--blue);
    font-weight: 500;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.5vw, 28px);
}

.nav-link {
    font-size: 14px;
    color: var(--steel);
    transition: color 0.2s ease;
}

.nav-link:hover { color: var(--navy); }

.nav-cta {
    font-size: 14px;
    color: var(--card);
    background: var(--navy);
    padding: 9px 16px;
    border-radius: 8px;
    transition: transform 0.4s var(--spring), box-shadow 0.3s ease, background 0.3s ease;
}

.nav-cta:hover {
    transform: scale(1.04);
    background: var(--blue);
    box-shadow: 0 4px 12px rgba(48, 96, 192, 0.25);
}

@media (max-width: 720px) {
    .site-nav .nav-link { display: none; }
}

/* -------- Bento grid base -------- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
    grid-auto-rows: minmax(160px, auto);
}

.bento-cell {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-rest);
    padding: clamp(20px, 1.6vw, 28px);
    position: relative;
    transition: transform 0.4s var(--spring), box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(8px) scale(0.985);
    will-change: transform;
}

.bento-cell.in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bento-cell:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
    z-index: 2;
}

.bento-cell.in:hover {
    transform: scale(1.02);
}

.cell-tag {
    font-family: var(--f-data);
    font-weight: 500;
    font-size: clamp(11px, 0.75vw, 13px);
    color: var(--steel);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

/* -------- Hero grid -------- */
.hero-grid { margin-bottom: 48px; }

.hero-cell {
    grid-column: span 2;
    grid-row: span 2;
    display: flex;
    flex-direction: column;
}

.hero-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(28px, 3.5vw, 48px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--navy);
    margin: 8px 0 16px;
}

.hero-title .version {
    font-family: var(--f-data);
    font-weight: 500;
    font-size: clamp(14px, 1.1vw, 18px);
    color: var(--blue);
    background: var(--blue-soft);
    padding: 4px 10px;
    border-radius: 6px;
    vertical-align: middle;
    margin-left: 6px;
}

.hero-lede {
    color: var(--navy);
    max-width: 60ch;
    margin: 0 0 20px;
}

.hero-chartwrap {
    flex: 1;
    margin: 8px 0 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-chart {
    width: 100%;
    height: clamp(140px, 18vw, 200px);
    overflow: visible;
}

/* -------- Charts -------- */
.chart-grid line {
    stroke: var(--blue-soft);
    stroke-width: 1;
}

.chart-line {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-line.primary { stroke: var(--blue); }
.chart-line.baseline {
    stroke: var(--steel);
    stroke-dasharray: 4 4;
    stroke-width: 1.5;
}

.chart-points circle {
    fill: var(--blue);
    stroke: var(--card);
    stroke-width: 1.5;
}

.draw-on-view .chart-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.draw-on-view.is-drawn .chart-line {
    transition: stroke-dashoffset 1.6s ease;
    stroke-dashoffset: 0;
}

.draw-on-view .chart-points circle {
    opacity: 0;
}

.draw-on-view.is-drawn .chart-points circle {
    transition: opacity 0.6s ease 1.0s;
    opacity: 1;
}

.draw-on-view .spark-line {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
}

.draw-on-view.is-drawn .spark-line {
    transition: stroke-dashoffset 1.2s ease;
    stroke-dashoffset: 0;
}

.spark-line {
    fill: none;
    stroke: var(--blue);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--f-data);
    font-size: 12px;
    color: var(--steel);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 6px;
    display: inline-block;
}

.legend-dot.primary { background: var(--blue); }
.legend-dot.baseline { background: var(--steel); }

/* -------- Hero buttons -------- */
.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    flex-wrap: wrap;
}

.btn {
    border: 1px solid transparent;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: transform 0.4s var(--spring), box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn-primary {
    background: var(--blue);
    color: var(--card);
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 14px rgba(48, 96, 192, 0.30);
    background: #2854B0;
}

.btn-ghost {
    background: transparent;
    color: var(--navy);
    border-color: rgba(10, 24, 48, 0.12);
}

.btn-ghost:hover {
    transform: scale(1.03);
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-soft);
}

.btn-block { width: 100%; }

/* -------- Metric cell -------- */
.metric-cell {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-family: var(--f-data);
    font-weight: 600;
    color: var(--blue);
    font-size: clamp(32px, 4vw, 56px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-top: 6px;
}

.metric-suffix {
    font-size: 0.55em;
    color: var(--steel);
    margin-left: 4px;
    font-weight: 500;
}

.metric-label {
    font-size: 13px;
    color: var(--steel);
    margin-top: 4px;
}

.trend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-family: var(--f-data);
    font-size: 12px;
}

.trend-arrow {
    font-size: 10px;
    line-height: 1;
}

.trend-arrow.up { color: var(--green); }
.trend-arrow.down { color: #C0402F; }

.trend-pct {
    color: var(--navy);
    font-weight: 500;
}

.trend-period {
    color: var(--steel);
}

.sparkline {
    width: 100%;
    height: 36px;
    margin-top: auto;
    overflow: visible;
}

/* -------- Status cell -------- */
.status-cell { display: flex; flex-direction: column; }

.status-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: var(--f-data);
    font-size: 13px;
}

.status-row {
    display: grid;
    grid-template-columns: 12px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--blue-soft);
}

.status-row:last-child { border-bottom: 0; }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.ok { background: var(--green); box-shadow: 0 0 0 3px rgba(32, 160, 96, 0.15); }
.status-dot.warn { background: #D8A130; box-shadow: 0 0 0 3px rgba(216, 161, 48, 0.15); }

.status-name { color: var(--navy); }
.status-state { color: var(--steel); font-size: 12px; }

.status-meta {
    margin-top: auto;
    padding-top: 12px;
    font-family: var(--f-data);
    font-size: 11px;
    color: var(--steel);
}

/* -------- Sections -------- */
.section {
    margin-top: 64px;
}

.section-head {
    margin-bottom: 28px;
    max-width: 70ch;
}

.kicker {
    font-family: var(--f-data);
    font-weight: 500;
    font-size: 12px;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}

.section-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(24px, 2.6vw, 36px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--navy);
    margin: 0 0 8px;
}

.section-sub {
    color: var(--steel);
    margin: 0;
    font-size: clamp(14px, 1vw, 16px);
}

/* -------- Products grid -------- */
.products-grid .product-cell.wide { grid-column: span 2; }
.products-grid .product-cell.tall { grid-row: span 2; }

.product-cell {
    display: flex;
    flex-direction: column;
}

.product-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--blue-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    transition: background 0.3s ease, transform 0.4s var(--spring);
}

.bento-cell:hover .product-icon {
    background: #DDE7FB;
    transform: rotate(-4deg) scale(1.05);
}

.product-name {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(18px, 1.5vw, 22px);
    color: var(--navy);
    letter-spacing: -0.01em;
    margin: 0 0 6px;
}

.product-desc {
    color: var(--steel);
    margin: 0 0 12px;
    font-size: clamp(13px, 0.95vw, 15px);
    line-height: 1.6;
}

.product-tags {
    list-style: none;
    margin: auto 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-family: var(--f-data);
    font-size: 11px;
    color: var(--blue);
    background: var(--blue-soft);
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.cell-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--blue-soft);
}

.mini-stat { text-align: left; }

.mini-num {
    font-family: var(--f-data);
    font-weight: 600;
    font-size: clamp(20px, 1.8vw, 26px);
    color: var(--blue);
    line-height: 1;
}

.mini-cap {
    font-size: 11px;
    color: var(--steel);
    margin-top: 4px;
    font-family: var(--f-data);
}

/* -------- Metrics grid -------- */
.metrics-grid .metric-large {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
}

.big-metric {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 6px 0 4px;
    font-family: var(--f-data);
    font-weight: 600;
    color: var(--blue);
}

.big-num {
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1;
    letter-spacing: -0.02em;
}

.big-unit {
    font-size: clamp(20px, 2vw, 28px);
    color: var(--steel);
    font-weight: 500;
}

.bench-chart {
    width: 100%;
    height: clamp(110px, 14vw, 160px);
    margin-top: 14px;
    overflow: visible;
}

.metrics-grid .metric-bars { grid-column: span 2; }

.bar-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 50px;
    gap: 12px;
    align-items: center;
    font-family: var(--f-data);
    font-size: 12px;
}

.bar-label { color: var(--navy); }
.bar-val { color: var(--steel); text-align: right; }

.bar-track {
    height: 6px;
    background: var(--blue-soft);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--blue), #5A88E0);
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.34, 1.2, 0.4, 1);
}

/* -------- Research grid -------- */
.research-grid {
    grid-template-columns: repeat(2, 1fr);
}

.paper-cell {
    display: flex;
    flex-direction: column;
}

.paper-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    font-family: var(--f-data);
    font-size: 12px;
}

.paper-tag {
    background: var(--blue-soft);
    color: var(--blue);
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 500;
}

.paper-date { color: var(--steel); }

.paper-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(16px, 1.3vw, 20px);
    color: var(--navy);
    margin: 0 0 8px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.paper-authors {
    color: var(--steel);
    font-size: 13px;
    margin: 0 0 14px;
}

.paper-actions {
    display: flex;
    gap: 18px;
    margin-top: auto;
    font-family: var(--f-data);
    font-size: 13px;
}

.paper-link {
    color: var(--blue);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, color 0.3s ease;
}

.paper-link:hover {
    border-color: var(--blue);
    color: #2854B0;
}

@media (max-width: 720px) {
    .research-grid { grid-template-columns: 1fr; }
}

/* -------- Company / CTA -------- */
.company-grid { grid-template-columns: 2fr 1fr; }

.company-cell.wide { grid-column: span 1; }

.company-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--navy);
    margin: 6px 0 12px;
    max-width: 24ch;
}

.company-text {
    color: var(--steel);
    margin: 0 0 18px;
    font-size: clamp(13px, 1vw, 15px);
}

.company-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--blue-soft);
}

.cstat-num {
    font-family: var(--f-data);
    font-weight: 600;
    font-size: clamp(24px, 2.4vw, 36px);
    color: var(--blue);
    line-height: 1;
}

.cstat-cap {
    font-size: 11px;
    color: var(--steel);
    margin-top: 6px;
    font-family: var(--f-data);
}

.cta-cell {
    display: flex;
    flex-direction: column;
    background: var(--navy);
    color: var(--cool-white);
}

.cta-cell .cell-tag {
    color: rgba(255, 255, 255, 0.55);
}

.cta-title {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(20px, 1.8vw, 26px);
    margin: 6px 0 8px;
    color: var(--card);
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.cta-text {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    margin: 0 0 18px;
    line-height: 1.6;
}

.cta-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.field { display: flex; flex-direction: column; gap: 4px; }

.field-label {
    font-family: var(--f-data);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.field-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--card);
    padding: 10px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.field-input::placeholder { color: rgba(255, 255, 255, 0.4); }

.field-input:focus {
    outline: 0;
    border-color: var(--blue);
    background: rgba(255, 255, 255, 0.10);
}

.cta-form .btn-primary {
    background: var(--blue);
    color: var(--card);
}

.cta-form .btn-primary:hover {
    background: #4078E0;
}

.form-state {
    font-family: var(--f-data);
    font-size: 12px;
    min-height: 16px;
    color: var(--green);
}

.form-state.is-error { color: #FFA188; }

@media (max-width: 900px) {
    .company-grid { grid-template-columns: 1fr; }
}

/* -------- Footer -------- */
.site-footer {
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--blue-soft);
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-meta {
    font-family: var(--f-data);
    font-size: 12px;
    color: var(--steel);
}

.footer-links {
    display: flex;
    gap: 18px;
    font-family: var(--f-data);
    font-size: 13px;
    color: var(--steel);
}

.footer-links a {
    transition: color 0.2s ease;
}

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

/* -------- Bento responsive collapse -------- */
@media (max-width: 980px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-cell { grid-column: span 2; grid-row: span 1; }
    .products-grid .product-cell.wide,
    .products-grid .product-cell.tall,
    .metrics-grid .metric-large,
    .metrics-grid .metric-bars {
        grid-column: span 2;
        grid-row: auto;
    }
}

@media (max-width: 600px) {
    .bento-grid { grid-template-columns: 1fr; }
    .hero-cell,
    .products-grid .product-cell.wide,
    .products-grid .product-cell.tall,
    .metrics-grid .metric-large,
    .metrics-grid .metric-bars {
        grid-column: span 1;
    }
    .site-header { flex-wrap: wrap; padding-bottom: 20px; }
    .footer-row { flex-direction: column; align-items: flex-start; }
    .cell-mini-stats { grid-template-columns: 1fr 1fr; }
}

/* -------- Reduced motion -------- */
@media (prefers-reduced-motion: reduce) {
    .bento-cell,
    .btn,
    .nav-cta,
    .product-icon,
    .bar-fill,
    .draw-on-view .chart-line,
    .draw-on-view .spark-line,
    .draw-on-view .chart-points circle {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        stroke-dashoffset: 0 !important;
    }
}
