/* ================================================================
   MED PIPERS — Preview site (castle.medpipers.com)
   Design v3: Clinical clean. IBM Plex Sans + deep teal.
   Grid-forward, structured, modernist.
   ================================================================ */

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

:root {
    /* Palette — clinical white + deep teal */
    --bg:          #FFFFFF;
    --bg-alt:      #F6F8FA;  /* soft cool gray for section alt */
    --bg-sunken:   #EDF1F5;  /* code snippets / highlight blocks */
    --bg-ink:      #0B1218;  /* ink-dark surfaces (buttons, footer) */

    --text:        #0A1420;  /* near-black with cool undertone */
    --text-2:      #1F2A37;  /* strong secondary */
    --text-muted:  #475569;  /* body copy */
    --text-subtle: #8595A8;  /* labels, timestamps */
    --text-on-ink: #F3F6F9;
    --text-on-ink-muted: rgba(243,246,249,0.70);
    --text-on-ink-subtle: rgba(243,246,249,0.42);

    --accent:         #0F766E;  /* deep teal — healthcare, trust, data */
    --accent-dark:    #0C5D56;  /* hover */
    --accent-soft:    #E9F5F3;  /* tint */
    --accent-contrast:#F3F6F9;  /* text on accent */

    --border:        #E2E8F0;
    --border-strong: #CBD5E1;
    --border-soft:   #EEF2F6;
    --border-on-ink: rgba(243,246,249,0.14);

    /* Shape */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 14px;

    /* Layout */
    --max: 1200px;
    --gutter: 32px;

    /* Type — IBM Plex family */
    --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, system-ui, 'Helvetica Neue', Arial, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--sans);
    font-size: 16.5px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }
address { font-style: normal; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ========== Typography ========== */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}
.eyebrow::before {
    content: '';
    width: 20px;
    height: 1px;
    background: currentColor;
}
.eyebrow-muted { color: var(--text-subtle); }

.display {
    font-family: var(--sans);
    font-weight: 500;
    font-size: clamp(2.75rem, 6vw, 5.5rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: var(--text);
}

.h1 {
    font-weight: 500;
    font-size: clamp(2rem, 3.5vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: var(--text);
}
.h2 {
    font-weight: 500;
    font-size: 1.5rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}
.h3 {
    font-weight: 500;
    font-size: 1.125rem;
    line-height: 1.4;
    letter-spacing: -0.015em;
}

.lead {
    font-size: clamp(1.0625rem, 1.4vw, 1.25rem);
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 62ch;
    font-weight: 400;
}

.mono { font-family: var(--mono); }
.text-accent { color: var(--accent); }

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius);
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
    white-space: nowrap;
    cursor: pointer;
}
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); }

.btn-secondary {
    background: var(--bg);
    border-color: var(--border-strong);
    color: var(--text);
}
.btn-secondary:hover { border-color: var(--text); }

.btn-accent { background: var(--accent); color: var(--accent-contrast); }
.btn-accent:hover { background: var(--accent-dark); }

.btn-ghost-dark {
    background: transparent;
    border-color: var(--border-on-ink);
    color: var(--text-on-ink);
}
.btn-ghost-dark:hover { background: var(--text-on-ink); color: var(--text); border-color: var(--text-on-ink); }

.btn-lg { padding: 13px 24px; font-size: 15.5px; }

/* ========== NAV ========== */
#nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: rgba(255,255,255, 0.82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}
#nav.scrolled {
    border-bottom-color: var(--border);
    background: rgba(255,255,255, 0.94);
}
.nav-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 14px var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: -0.01em;
    color: var(--text);
}
.brand-mark {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: var(--text);
    color: var(--accent);
    display: grid;
    place-items: center;
}
.brand-mark svg { width: 16px; height: 16px; }

.nav-links { display: flex; gap: 2px; }
.nav-links a {
    padding: 8px 14px;
    font-size: 14.5px;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-alt); }
.nav-links a.current { color: var(--accent); }

/* ========== HERO ========== */
.hero {
    padding: 150px 0 100px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: relative;
}
.hero .eyebrow { margin-bottom: 32px; }
.hero .display { max-width: 18ch; margin-bottom: 32px; }
.hero .display .accent { color: var(--accent); font-weight: 500; }
.hero .lead { max-width: 58ch; }
.hero-actions {
    margin-top: 40px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-standards {
    margin-top: 72px;
    padding-top: 24px;
    border-top: 1px dashed var(--border);
}
.hero-standards .label {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-subtle);
    margin-bottom: 14px;
}
.std-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.std {
    font-family: var(--mono);
    font-size: 12.5px;
    padding: 4px 10px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    letter-spacing: 0.02em;
}
.std-dot { color: var(--text-subtle); font-family: var(--mono); font-size: 12px; }

/* ========== Sections ========== */
.section {
    padding: 100px 0;
    border-bottom: 1px solid var(--border);
}
.section-alt { background: var(--bg-alt); }
.section-ink {
    background: var(--bg-ink);
    color: var(--text-on-ink);
    border-color: var(--border-on-ink);
}
.section-ink .h1 { color: var(--text-on-ink); }
.section-ink .lead { color: var(--text-on-ink-muted); }
.section-ink .eyebrow { color: var(--accent); }
.section-ink .eyebrow::before { background: var(--accent); opacity: 0.6; }

.section-head { margin-bottom: 56px; max-width: 720px; }
.section-head .eyebrow { margin-bottom: 20px; }
.section-head .h1 { margin-bottom: 18px; }
.section-head .lead { max-width: 56ch; }

/* ========== PRODUCTS ========== */
.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}
.product {
    padding: 32px 28px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg);
    transition: background 0.18s;
    position: relative;
}
.product:hover { background: var(--bg-alt); }
.product-tag {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
}
.product-name {
    font-size: 1.375rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.product-name svg {
    width: 16px; height: 16px;
    color: var(--text-subtle);
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: all 0.18s;
}
.product:hover .product-name svg { opacity: 1; transform: translate(0,0); color: var(--accent); }
.product-desc {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.55;
    flex: 1;
    margin-top: 2px;
}
.product-url {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-subtle);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

/* ========== SYSTEMS (connection list) ========== */
.systems {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 48px 64px;
}
.system-group h3 {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    font-family: var(--mono);
}
.system-list { display: flex; flex-wrap: wrap; gap: 8px; }
.system {
    font-size: 14px;
    padding: 6px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    transition: border-color 0.15s, color 0.15s;
}
.system:hover { border-color: var(--accent); color: var(--accent); }
.system .code {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--text-subtle);
    margin-left: 6px;
}

/* ========== PIPELINE ========== */
.pipeline-stages {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    position: relative;
    border-top: 1px solid var(--border-on-ink);
}
.stage {
    padding: 28px 20px 24px 0;
    border-right: 1px solid var(--border-on-ink);
    position: relative;
}
.stage:last-child { border-right: none; padding-right: 0; }
.stage-num {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 14px;
}
.stage-name {
    font-size: 1.0625rem;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--text-on-ink);
    margin-bottom: 10px;
}
.stage-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-on-ink-muted);
}

/* ========== PROCESS steps ========== */
.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid var(--border);
}
.step {
    padding: 32px 24px 24px 0;
    border-right: 1px solid var(--border);
}
.step:last-child { border-right: none; }
.step-num {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 20px;
}
.step h3 {
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--text);
    margin-bottom: 10px;
}
.step p {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ========== STANDARDS table ========== */
.std-table {
    width: 100%;
    border-collapse: collapse;
}
.std-table th,
.std-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14.5px;
}
.std-table th {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-subtle);
    background: var(--bg-alt);
    padding: 12px 20px;
}
.std-table tr:last-child td { border-bottom: none; }
.std-table td:first-child {
    font-family: var(--mono);
    font-weight: 500;
    color: var(--text);
    width: 28%;
    font-size: 13.5px;
}
.std-table td:last-child { color: var(--text-muted); }
.std-table tr:hover td { background: var(--bg-alt); }

/* ========== FOUNDER ========== */
.founder {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 56px;
    align-items: start;
}
.founder-portrait {
    width: 220px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    position: relative;
}
.founder-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}
.founder-copy .eyebrow { margin-bottom: 16px; }
.founder-copy h2 {
    font-size: clamp(1.75rem, 2.5vw, 2.25rem);
    font-weight: 500;
    letter-spacing: -0.025em;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.1;
}
.founder-copy .role {
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-bottom: 20px;
}
.founder-copy p {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text-muted);
    max-width: 62ch;
}
.founder-copy p + p { margin-top: 14px; }
.founder-links {
    margin-top: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.founder-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13.5px;
    color: var(--text);
    transition: border-color 0.15s, color 0.15s;
}
.founder-links a:hover { border-color: var(--accent); color: var(--accent); }
.founder-links svg { width: 13px; height: 13px; }

/* ========== CTA ========== */
.cta {
    padding: 120px 0;
    text-align: center;
}
.cta .h1 { max-width: 20ch; margin: 0 auto 20px; }
.cta .lead { margin: 0 auto 36px; max-width: 52ch; }
.cta-actions {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.cta-meta {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--border-on-ink);
    display: inline-flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 14px;
    color: var(--text-on-ink-muted);
    font-family: var(--mono);
}
.cta-meta a { color: var(--text-on-ink); font-weight: 500; }
.cta-meta a:hover { color: var(--accent); }

/* ========== FOOTER ========== */
footer {
    background: var(--bg-ink);
    color: var(--text-on-ink);
    padding: 72px 0 32px;
    border-top: 1px solid var(--border-on-ink);
}
footer .brand { color: var(--text-on-ink); }
footer .brand-mark { background: var(--bg); color: var(--text); }

.footer-grid {
    display: grid;
    grid-template-columns: 2.4fr 1fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border-on-ink);
}
.footer-brand p {
    margin-top: 16px;
    color: var(--text-on-ink-muted);
    font-size: 14px;
    line-height: 1.6;
    max-width: 34ch;
}
.footer-col h4 {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-on-ink-subtle);
    margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
    font-size: 14px;
    color: var(--text-on-ink-muted);
    transition: color 0.15s;
}
.footer-col a:hover { color: var(--accent); }
.footer-col address {
    font-size: 13.5px;
    color: var(--text-on-ink-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}
.footer-col address strong {
    color: var(--text-on-ink);
    display: block;
    margin-bottom: 2px;
    font-weight: 500;
}
.footer-bottom {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-on-ink-subtle);
    font-family: var(--mono);
    letter-spacing: 0.03em;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
    .products { grid-template-columns: repeat(2, 1fr); }
    .systems { grid-template-columns: 1fr; gap: 32px; }
    .pipeline-stages { grid-template-columns: repeat(3, 1fr); }
    .stage { border-bottom: 1px solid var(--border-on-ink); padding-bottom: 24px; }
    .stage:nth-child(3n) { border-right: none; }
    .steps { grid-template-columns: repeat(2, 1fr); }
    .step { border-bottom: 1px solid var(--border); padding-bottom: 24px; }
    .step:nth-child(2n) { border-right: none; }
    .step:nth-last-child(-n+2) { border-bottom: none; }
    .founder { grid-template-columns: 1fr; gap: 24px; }
    .founder-portrait { width: 140px; }
    .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    :root { --gutter: 20px; }
    body { font-size: 16px; }
    .nav-links { display: none; }
    .hero { padding: 120px 0 72px; }
    .hero-standards { margin-top: 48px; }
    .section { padding: 72px 0; }
    .section-head { margin-bottom: 40px; }
    .products { grid-template-columns: 1fr; border-left: none; }
    .product { border-left: 1px solid var(--border); }
    .pipeline-stages { grid-template-columns: 1fr; }
    .stage { border-right: none; }
    .stage:last-child { border-bottom: none; }
    .steps { grid-template-columns: 1fr; }
    .step { border-right: none; }
    .step:last-child { border-bottom: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}
