/* ==========================================================================
   MDS Inc. - site styles
   ========================================================================== */

:root {
    --brand-950: #1c1d24;
    --brand-900: #252630;
    --brand-800: #33333f;
    --brand-700: #48415a;
    --brand-600: #51426b;
    --brand-500: #63527f;
    --brand-400: #8e7ca8;
    --brand-300: #c3b8d3;
    --brand-100: #eeecf2;
    --brand-50: #f6f6f8;
    --accent: #8fac9f;
    --accent-soft: #c1d3ca;

    --ink: #252630;
    --ink-muted: #5d606b;
    --line: #dedee4;
    --surface: #ffffff;
    --bg: #ffffff;

    --radius: 3px;
    --radius-lg: 3px;
    --shadow-md: 0 4px 16px rgba(28, 29, 36, .1);

    --container: 1160px;
    --header-h: 72px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */

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

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: var(--brand-600);
}

ul,
ol {
    list-style: none;
}

h1,
h2,
h3 {
    line-height: 1.15;
    letter-spacing: -.02em;
    font-weight: 700;
    color: inherit;
}

h1:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--brand-400);
    outline-offset: 3px;
    border-radius: var(--radius);
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -100px;
    z-index: 100;
    background: #fff;
    color: var(--brand-900);
    padding: 10px 16px;
    border-radius: var(--radius);
    font-weight: 600;
}

.skip-link:focus {
    top: 12px;
}

/* ---------- Typography helpers ---------- */

.eyebrow {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brand-500);
    margin-bottom: 14px;
}

.lead {
    font-size: clamp(1.05rem, .6vw + .95rem, 1.25rem);
    line-height: 1.6;
}

.hero-emphasis {
    color: var(--brand-300);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    font-size: .98rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease;
}

.btn .icon {
    width: 18px;
    height: 18px;
}

.btn-light {
    background: #fff;
    color: var(--brand-900);
}

.btn-light:hover {
    background: var(--brand-50);
}

.btn-ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, .28);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .5);
}

.btn-brand {
    background: var(--brand-500);
    color: #fff;
}

.btn-brand:hover {
    background: var(--brand-600);
}

/* ---------- Header & navigation ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--brand-950);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}

.brand img {
    height: 48px;
    width: auto;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav a {
    color: rgba(255, 255, 255, .75);
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
    padding: 8px 14px;
    border-radius: var(--radius);
    border-bottom: 2px solid transparent;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.nav a.active {
    color: #fff;
    border-bottom-color: var(--brand-300);
}

.nav a.nav-cta {
    margin-left: 10px;
    color: #fff;
    background: var(--brand-500);
}

.nav a.nav-cta:hover,
.nav a.nav-cta.active {
    background: var(--brand-600);
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: var(--radius);
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.nav-toggle .icon {
    width: 22px;
    height: 22px;
}

@media (max-width: 880px) {
    .nav-toggle {
        display: inline-flex;
    }

    .nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px 16px 20px;
        background: var(--brand-950);
        border-bottom: 1px solid rgba(255, 255, 255, .08);
        box-shadow: var(--shadow-md);
    }

    .nav.open {
        display: flex;
    }

    .nav a {
        padding: 12px 14px;
        border-radius: var(--radius);
        font-size: 1rem;
    }

    .nav a.nav-cta {
        margin: 8px 0 0;
        text-align: center;
    }
}

/* ---------- Hero (home) ---------- */

.hero,
.page-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: var(--brand-900);
}

.hero > .container,
.page-hero > .container {
    position: relative;
}

.hero {
    padding: clamp(56px, 7vw, 96px) 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 56px;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.2rem, 3.6vw + .5rem, 3.5rem);
    font-weight: 600;
    letter-spacing: -.025em;
    line-height: 1.12;
    margin-bottom: 22px;
}

.hero .eyebrow,
.page-hero .eyebrow {
    color: var(--brand-300);
}

.hero .lead {
    color: rgba(255, 255, 255, .78);
    max-width: 560px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}

/* Decorative status board */
.status-board {
    background: var(--brand-950);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.status-board-header {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: .85rem;
    color: rgba(255, 255, 255, .6);
    padding: 2px 4px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    margin-bottom: 8px;
}

.status-board li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 4px;
    border-radius: var(--radius);
    font-size: .95rem;
    color: rgba(255, 255, 255, .9);
}

.status-board li + li {
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.status-board li .icon {
    width: 22px;
    height: 22px;
    color: var(--brand-300);
}

.status-board li span {
    flex: 1;
}

.status-board em {
    font-style: normal;
    font-size: .8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-soft);
}

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
    padding: clamp(56px, 7vw, 96px) 0 clamp(56px, 7vw, 88px);
}

.page-hero h1 {
    font-size: clamp(2rem, 3vw + 1rem, 3.25rem);
    font-weight: 600;
    letter-spacing: -.03em;
    max-width: 820px;
    margin-bottom: 18px;
}

.page-hero .lead {
    color: rgba(255, 255, 255, .78);
    max-width: 720px;
}

/* ---------- Sections ---------- */

.section {
    padding: clamp(56px, 7vw, 88px) 0;
}

.section-tight {
    padding-top: 0;
}

.section-alt {
    background: var(--brand-50);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-head {
    max-width: 680px;
    margin-bottom: 44px;
}

.section-head.center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.section-head h2,
.prose h2,
.cta h2 {
    font-size: clamp(1.7rem, 1.6vw + 1.1rem, 2.4rem);
    margin-bottom: 14px;
}

.section-head p {
    color: var(--ink-muted);
    font-size: 1.08rem;
}

/* ---------- Cards ---------- */

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.card {
    position: relative;
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    color: inherit;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease;
}

.card h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.card p {
    color: var(--ink-muted);
}

.card-link:hover {
    background: var(--brand-50);
    border-color: var(--brand-400);
}

.card-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    color: var(--brand-600);
    background: var(--brand-100);
}

.card-icon .icon {
    width: 24px;
    height: 24px;
}

.card .more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
    font-weight: 600;
    color: var(--brand-600);
}

.card .more .icon {
    width: 18px;
    height: 18px;
}

/* ---------- Steps ---------- */

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    counter-reset: step;
}

.steps li {
    counter-increment: step;
    position: relative;
    padding-top: 24px;
    border-top: 2px solid var(--line);
}

.steps li::before {
    content: "0" counter(step);
    position: absolute;
    top: -2px;
    left: 0;
    width: 48px;
    border-top: 2px solid var(--brand-500);
    padding-top: 22px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--brand-500);
}

.steps h3 {
    font-size: 1.2rem;
    margin: 24px 0 8px;
}

.steps p {
    color: var(--ink-muted);
}

/* ---------- Split content + panel ---------- */

.split {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 64px;
    align-items: start;
}

.prose p {
    color: var(--ink-muted);
    font-size: 1.06rem;
    margin-bottom: 18px;
}

.prose p:last-child {
    margin-bottom: 0;
}

.prose strong {
    color: var(--ink);
}

.panel {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    padding: 32px;
    border-radius: var(--radius-lg);
    color: #fff;
    background: var(--brand-900);
}

.panel h3 {
    font-size: 1.15rem;
    margin-bottom: 18px;
}

.checklist li {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    color: rgba(255, 255, 255, .88);
}

.checklist li + li {
    border-top: 1px solid rgba(255, 255, 255, .1);
}

.checklist .icon {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    color: var(--accent-soft);
}

/* ---------- Technology chips ---------- */

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    padding: 9px 16px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: .93rem;
    font-weight: 500;
}

/* ---------- Customers ---------- */

.customer-wall {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.customer-wall li {
    display: grid;
    place-items: center;
    min-height: 88px;
    padding: 16px;
    text-align: center;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.35;
    color: var(--brand-800);
    background: var(--brand-50);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

/* ---------- Testimonials ---------- */

.testimonial {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
}

.testimonial-mark {
    width: 32px;
    height: 32px;
    color: var(--brand-300);
    margin-bottom: 16px;
}

.testimonial blockquote {
    flex: 1;
    color: var(--ink);
    margin-bottom: 24px;
}

.testimonial figcaption {
    display: flex;
    flex-direction: column;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: .95rem;
}

.testimonial figcaption span {
    color: var(--ink-muted);
}

/* ---------- Contact ---------- */

.contact-value {
    font-style: normal;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--ink);
}

.contact-card p.contact-value {
    color: var(--brand-600);
}

/* ---------- Call to action ---------- */

.cta-section {
    padding-top: 0;
}

.cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: clamp(32px, 5vw, 56px);
    border-radius: var(--radius-lg);
    color: #fff;
    background: var(--brand-900);
    border-left: 3px solid var(--brand-400);
}

.cta h2 {
    margin-bottom: 8px;
}

.cta p {
    color: rgba(255, 255, 255, .8);
    max-width: 560px;
}

.cta .btn {
    flex-shrink: 0;
}

/* ---------- Footer ---------- */

.site-footer {
    background: var(--brand-950);
    color: rgba(255, 255, 255, .65);
    font-size: .95rem;
    padding-top: 64px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
    gap: 40px;
}

.site-footer img {
    height: 56px;
    width: auto;
}

.footer-tagline {
    margin-top: 16px;
    max-width: 300px;
}

.footer-heading {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 16px;
}

.footer-links li + li {
    margin-top: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, .65);
    text-decoration: none;
    transition: color .2s ease;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    margin-top: 48px;
    padding-top: 24px;
    padding-bottom: 32px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .85rem;
    color: rgba(255, 255, 255, .45);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .customer-wall {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 960px) {
    .hero-grid,
    .split {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .status-board {
        max-width: 520px;
    }

    .panel {
        position: static;
    }

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

    .steps {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 40px;
    }

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

@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    .grid-3,
    .steps,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

    .customer-wall li {
        font-size: .88rem;
        min-height: 76px;
    }

    .card,
    .testimonial,
    .panel {
        padding: 24px;
    }
}

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

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Initial loading screen & error banner (index.html) ---------- */

.app-loading {
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 28px;
    background: var(--brand-950);
}

.app-loading img {
    height: 72px;
    width: auto;
}

.app-loading-bar {
    position: relative;
    width: 160px;
    height: 3px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, .12);
}

.app-loading-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 40%;
    border-radius: 3px;
    background: var(--brand-300);
    animation: loading 1.1s ease-in-out infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 1000;
    max-width: 560px;
    margin: 0 auto;
    padding: 14px 48px 14px 18px;
    border-radius: var(--radius);
    background: #fff4f4;
    border: 1px solid #f3c2c2;
    color: #7a1c1c;
    box-shadow: var(--shadow-md);
}

#blazor-error-ui .reload {
    color: inherit;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 8px;
    right: 12px;
    border: 0;
    background: none;
    font-size: 1.4rem;
    line-height: 1;
    color: inherit;
    cursor: pointer;
}
