/* KADdynamic - classic design (main design: style.css). Brand colours shared with QuantAI */
:root {
    --navy: #0b2a4a;
    --deep: #050f1e;
    --panel: #0a1a2e;
    --panel-2: #0e2340;
    --teal: #14b8c4;
    --teal-bright: #3fd6de;
    --teal-dim: rgba(20, 184, 196, 0.14);
    --text: #e8f0f7;
    --muted: #8ea3b8;
    --line: rgba(142, 163, 184, 0.18);
    --line-strong: rgba(63, 214, 222, 0.35);
    --ok: #4ade80;

    --font-sans: 'Inter', system-ui, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    --container: 1200px;
    --section-y: clamp(4.5rem, 10vw, 8rem);
    --radius: 10px;
    --ease: cubic-bezier(0.2, 0.75, 0.25, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
    font-family: var(--font-sans);
    background: var(--deep);
    background-image:
        radial-gradient(1200px 600px at 85% -10%, rgba(20, 184, 196, 0.16), transparent 60%),
        radial-gradient(900px 500px at -10% 40%, rgba(11, 42, 74, 0.9), transparent 70%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#grid-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

::selection { background: var(--teal); color: var(--deep); }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--deep); }
::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

a { color: inherit; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

.container { width: min(100% - 2.5rem, var(--container)); margin: 0 auto; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; }

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    color: var(--teal-bright);
    font: 500 0.78rem var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.lead { color: var(--muted); font-size: 1.1rem; max-width: 56ch; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1.4rem;
    border: 1px solid var(--teal);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--teal), #0e8e9b);
    color: #031018;
    font: 600 0.88rem var(--font-mono);
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0 0 0 var(--teal-dim), 0 10px 30px -12px rgba(20, 184, 196, 0.7);
    transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 0 4px var(--teal-dim), 0 16px 36px -12px rgba(20, 184, 196, 0.8);
}

.btn i { font-size: 0.8rem; transition: transform 0.25s var(--ease); }
.btn:hover i { transform: translateX(3px); }

.btn-ghost {
    background: rgba(10, 26, 46, 0.6);
    border-color: var(--line-strong);
    color: var(--text);
    box-shadow: none;
}
.btn-ghost:hover { border-color: var(--teal); background: var(--teal-dim); }

.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--teal-bright);
    outline-offset: 3px;
}

/* Header */
#header {
    position: fixed;
    top: 1rem;
    left: 50%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100% - 2rem, var(--container));
    padding: 0.6rem 0.6rem 0.6rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(5, 15, 30, 0.72);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    transform: translateX(-50%);
    transition: top 0.3s var(--ease), border-color 0.3s;
}

#header.scrolled { top: 0.5rem; border-color: var(--line-strong); }

.logo { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }

.logo-chip {
    display: grid;
    place-items: center;
    width: 40px;
    height: 34px;
    border-radius: 7px;
    background: #f4f8fb;
}
.logo-chip img { width: 30px; height: auto; }

.logo-word { font: 600 1.1rem var(--font-display); letter-spacing: -0.01em; color: var(--text); }
.logo-word b { font-weight: 500; color: var(--teal-bright); }

.nav-links { display: flex; align-items: center; gap: 0.3rem; }

.nav-links a {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border-radius: 7px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}
.nav-links a i { color: var(--teal); font: 500 0.68rem var(--font-mono); font-style: normal; }
.nav-links a:hover { color: var(--text); background: rgba(142, 163, 184, 0.08); }

.nav-links .nav-cta {
    margin-left: 0.5rem;
    border: 1px solid var(--line-strong);
    color: var(--teal-bright);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}
.nav-links .nav-cta:hover { background: var(--teal-dim); color: var(--text); }

/* Products dropdown */
.nav-menu { position: relative; }
.nav-menu-btn {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--muted);
    font: 500 0.9rem var(--font-sans);
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}
.nav-menu-btn i { color: var(--teal); font: 500 0.68rem var(--font-mono); font-style: normal; }
.nav-menu-btn:hover, .nav-menu.open .nav-menu-btn { color: var(--text); background: rgba(142, 163, 184, 0.08); }
.chev {
    width: 6px;
    height: 6px;
    margin-left: 0.15rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s;
}
.nav-menu.open .chev { transform: translateY(1px) rotate(225deg); }

.nav-dropdown {
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 50%;
    display: grid;
    gap: 0.25rem;
    width: 290px;
    padding: 0.45rem;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(5, 15, 30, 0.97);
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(20, 184, 196, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -6px);
    transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0.2s;
}
/* bridge the gap so the menu stays open while the pointer moves down to it */
.nav-dropdown::before { content: ''; position: absolute; left: 0; right: 0; top: -0.7rem; height: 0.7rem; }
.nav-menu.open .nav-dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
@media (hover: hover) and (min-width: 861px) {
    .nav-menu:hover .nav-dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
    .nav-menu:hover .chev { transform: translateY(1px) rotate(225deg); }
}
.nav-links .nav-dropdown a { align-items: center; gap: 0.8rem; padding: 0.65rem 0.7rem; }
.nav-links .nav-dropdown a:hover { background: var(--teal-dim); }
.dd-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--teal-dim);
    color: var(--teal-bright);
}
.nav-links .nav-dropdown a .dd-icon i { color: inherit; font: var(--fa-font-solid); font-size: 0.9rem; }
.nav-dropdown b { display: block; color: var(--text); font-weight: 600; }
.nav-dropdown small { display: block; color: var(--muted); font-size: 0.76rem; }

.menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 11px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}
.menu-toggle span { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: var(--text); }

/* Hero */
.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: min(100svh, 920px);
    padding: 8rem 0 4rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, var(--deep) 0%, rgba(5, 15, 30, 0.88) 45%, rgba(5, 15, 30, 0.55) 100%),
        linear-gradient(0deg, var(--deep) 0%, transparent 35%),
        url('images/hero-tech.jpg') center / cover no-repeat;
    filter: saturate(0.7) hue-rotate(-10deg);
    opacity: 0.85;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: center;
    gap: 3.5rem;
}

.hero h1 {
    margin-bottom: 1.5rem;
    font-size: clamp(2.4rem, 5vw, 3.7rem);
    font-weight: 700;
}

/* the rotating word keeps its line height so the page below doesn't jump */
.typed-line { display: block; min-height: 1.08em; }

.typed {
    background: linear-gradient(90deg, var(--teal-bright), var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.caret {
    display: inline-block;
    width: 0.08em;
    height: 0.9em;
    margin-left: 0.08em;
    vertical-align: -0.08em;
    background: var(--teal-bright);
    animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero .lead { margin-bottom: 2rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2.4rem; }

.hero-platforms { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hero-platforms li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(10, 26, 46, 0.55);
    color: var(--muted);
    font: 500 0.78rem var(--font-mono);
}
.hero-platforms i { color: var(--teal-bright); }

/* Terminal */
.terminal {
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: rgba(5, 13, 26, 0.9);
    box-shadow: 0 30px 80px -30px rgba(20, 184, 196, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(14, 35, 64, 0.6);
}
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }
.terminal-bar p { margin-left: auto; color: var(--muted); font: 0.72rem var(--font-mono); }

.terminal-body {
    min-height: 260px;
    padding: 1.2rem 1.3rem 1.4rem;
    font: 0.82rem/1.9 var(--font-mono);
    white-space: pre-wrap;
    word-break: break-word;
}
.tl { display: block; color: #c7d5e3; }
.tl b { font-weight: 700; }
.tl.cmd b { color: var(--teal-bright); }
.tl.cmd { color: var(--text); margin-bottom: 0.3rem; }
.tl.ok b { color: var(--ok); }
.tl.done { color: var(--teal-bright); margin-top: 0.3rem; }
.terminal-body code::after {
    content: '';
    display: inline-block;
    width: 0.55em;
    height: 1.05em;
    vertical-align: -0.2em;
    background: var(--teal-bright);
    animation: blink 1s steps(1) infinite;
}

/* Stack strip */
.stack-strip {
    position: relative;
    overflow: hidden;
    border-block: 1px solid var(--line);
    background: rgba(10, 26, 46, 0.55);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.stack-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.stack-track span {
    padding: 1.1rem 1.6rem;
    color: var(--muted);
    font: 500 0.82rem var(--font-mono);
    white-space: nowrap;
}
.stack-track span::before { content: '\25C6'; margin-right: 1.6rem; color: var(--teal); font-size: 0.6rem; vertical-align: 0.15em; }
.stack-strip:hover .stack-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Sections */
.section { padding: var(--section-y) 0; }
.section-title { max-width: 720px; margin-bottom: 3rem; }
.section-title h2, .about-text h2, .quantai-copy h2, .contact-intro h2 {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 4vw, 2.9rem);
}
.section-title > p:last-child { color: var(--muted); font-size: 1.05rem; }

/* Expertise */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.service-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(14, 35, 64, 0.65), rgba(10, 26, 46, 0.65));
    overflow: hidden;
    transition: transform 0.3s var(--ease), border-color 0.3s;
}

/* glow that follows the pointer (set by --mx / --my) */
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(300px circle at var(--mx, 50%) var(--my, -20%), rgba(20, 184, 196, 0.16), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.service-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.service-card:hover::before { opacity: 1; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4rem;
}
.card-head i {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--teal-dim);
    color: var(--teal-bright);
    font-size: 1.1rem;
}
.card-head span { color: var(--muted); font: 0.7rem var(--font-mono); opacity: 0.8; }

.service-card h3 { margin-bottom: 0.7rem; font-size: 1.25rem; }
.service-card p { flex: 1; margin-bottom: 1.3rem; color: var(--muted); font-size: 0.95rem; }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li {
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: #b6c6d6;
    font: 0.72rem var(--font-mono);
}

/* QuantAI */
.quantai {
    position: relative;
    border-block: 1px solid var(--line);
    background:
        linear-gradient(rgba(63, 214, 222, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(63, 214, 222, 0.05) 1px, transparent 1px),
        linear-gradient(135deg, var(--navy), #061529 70%);
    background-size: 24px 24px, 24px 24px, auto;
}

.quantai-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: center;
    gap: 3.5rem;
}

.quantai-copy h2 small {
    display: block;
    margin-top: 0.4rem;
    color: var(--teal-bright);
    font: 500 0.85rem var(--font-mono);
    letter-spacing: 0.04em;
}
.quantai-copy .lead { margin-bottom: 1.8rem; }

.feature-list { display: grid; gap: 1rem; margin-bottom: 1.6rem; }
.feature-list li { display: flex; gap: 0.9rem; }
.feature-list i {
    flex: none;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--teal-dim);
    color: var(--teal-bright);
    font-size: 0.85rem;
}
.feature-list b { display: block; font-weight: 600; }
.feature-list span { color: var(--muted); font-size: 0.92rem; }

.formats { margin-bottom: 2rem; }
.formats li { border-color: var(--line-strong); color: var(--teal-bright); }

.blueprint {
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #061426;
    box-shadow: 0 30px 80px -30px rgba(20, 184, 196, 0.5);
    overflow: hidden;
}

.blueprint-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(14, 35, 64, 0.7);
    color: var(--muted);
    font: 0.74rem var(--font-mono);
}
.blueprint-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-bright); animation: blink 1.2s steps(1) infinite; }
.blueprint-count {
    margin-left: auto;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    color: var(--teal-bright);
    font-variant-numeric: tabular-nums;
}

.blueprint svg { display: block; width: 100%; height: auto; color: #9fb7cf; }
.blueprint .devices { color: #e8f0f7; }

.hit {
    opacity: 0;
    stroke-dasharray: 4 3;
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(1.6);
    transition: opacity 0.25s, transform 0.35s var(--ease);
}
.hit.on { opacity: 1; transform: scale(1); }

.blueprint figcaption {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.4rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font: 0.74rem var(--font-mono);
}
.blueprint figcaption span { display: flex; align-items: center; gap: 0.5rem; }
.legend-sym { display: inline-block; width: 12px; height: 12px; border: 1.5px solid var(--text); }
.legend-sym.cam { border-radius: 50%; }
.legend-sym.tri { border: 0; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid var(--text); }

/* Pharma authentication */
.pharma { border-bottom: 1px solid var(--line); }
.pharma-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.authdemo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    min-height: 400px;
    padding: 2.5rem 1.5rem;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background:
        radial-gradient(400px 260px at 30% 40%, rgba(20, 184, 196, 0.16), transparent 70%),
        #061426;
    box-shadow: 0 30px 80px -30px rgba(20, 184, 196, 0.5);
    overflow: hidden;
}

.pack {
    width: 210px;
    padding: 1rem;
    border-radius: 10px;
    background: linear-gradient(160deg, #f4f8fb, #dbe6ef);
    color: #0b2a4a;
    box-shadow: 14px 18px 0 -4px rgba(11, 42, 74, 0.55), 0 24px 50px -20px rgba(0, 0, 0, 0.8);
    transform: rotate(-4deg);
}
.pack-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--teal);
    font: 700 0.62rem var(--font-mono);
}
.pack-top span:last-child { font-weight: 400; opacity: 0.7; }
.pack-qr { position: relative; width: 130px; margin: 0 auto 0.6rem; padding: 6px; background: #fff; border-radius: 4px; overflow: hidden; }
.pack-qr svg { display: block; width: 100%; height: auto; fill: #071c33; }
.qr-beam {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: var(--teal);
    box-shadow: 0 0 12px 4px rgba(20, 184, 196, 0.6);
    animation: qr-beam 8s var(--ease) infinite;
}
@keyframes qr-beam {
    0% { top: 0; opacity: 1; }
    30% { top: calc(100% - 3px); opacity: 1; }
    34%, 100% { top: calc(100% - 3px); opacity: 0; }
}
.pack-code, .pack-batch { text-align: center; font: 0.62rem var(--font-mono); }
.pack-code b { letter-spacing: 0.04em; }
.pack-batch { margin-top: 0.2rem; opacity: 0.6; }

.phone {
    position: relative;
    width: 170px;
    height: 320px;
    padding: 2.2rem 0.9rem 1rem;
    border: 2px solid #284766;
    border-radius: 26px;
    background: #0a1a2e;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.8);
    transform: rotate(3deg);
}
.phone-notch { position: absolute; top: 10px; left: 50%; width: 54px; height: 8px; border-radius: 8px; background: #050f1e; transform: translateX(-50%); }
.phone-scan, .phone-ok {
    position: absolute;
    inset: 2.2rem 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    text-align: center;
}
.phone-scan { color: var(--muted); font: 0.72rem var(--font-mono); animation: phone-scan 8s infinite; }
.phone-scan i { font-size: 2.4rem; color: var(--teal-bright); }
.phone-ok { opacity: 0; animation: phone-ok 8s infinite; }
.phone-ok > i { font-size: 2.6rem; color: var(--ok); filter: drop-shadow(0 0 12px rgba(74, 222, 128, 0.5)); }
.phone-ok b { font-family: var(--font-display); font-size: 1rem; }
.phone-ok dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.5rem;
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: left;
    font: 0.6rem var(--font-mono);
}
.phone-ok dt { color: var(--muted); }
.phone-ok dd { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes phone-scan { 0%, 40% { opacity: 1; } 46%, 96% { opacity: 0; } 100% { opacity: 1; } }
@keyframes phone-ok {
    0%, 44% { opacity: 0; transform: scale(0.94); }
    50%, 94% { opacity: 1; transform: none; }
    100% { opacity: 0; }
}

/* Process */
.process {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 5rem;
    counter-reset: step;
}
.process li {
    position: relative;
    padding: 1.5rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(10, 26, 46, 0.6);
}
.process li:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 2.15rem;
    right: -1rem;
    width: 1rem;
    height: 1px;
    background: var(--line-strong);
}
.step {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--teal-bright);
    font: 700 0.8rem var(--font-mono);
}
.process h3 { margin-bottom: 0.5rem; font-size: 1.15rem; }
.process p { color: var(--muted); font-size: 0.93rem; }

.about-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 4rem;
}
.about-visual { position: relative; }
.about-visual img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 12px;
    filter: saturate(0.75);
}
.about-stat {
    position: absolute;
    right: -1rem;
    bottom: -1.5rem;
    padding: 1.1rem 1.4rem;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: rgba(5, 15, 30, 0.92);
    backdrop-filter: blur(10px);
}
.about-stat span { display: block; color: var(--teal-bright); font: 700 2.6rem/1 var(--font-display); }
.about-stat p { margin-top: 0.3rem; color: var(--muted); font: 0.72rem/1.4 var(--font-mono); text-transform: uppercase; }
.about-text p:not(.kicker) { margin-bottom: 1rem; color: var(--muted); }

/* Work */
.portfolio-bento {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 300px;
    gap: 1rem;
}
.portfolio-tile {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.portfolio-tile.wide { grid-column: span 2; }
.portfolio-tile.tall { grid-row: span 2; }
.portfolio-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.6) brightness(0.85);
    transition: transform 0.8s var(--ease), filter 0.5s;
}
.portfolio-tile:hover img { transform: scale(1.04); filter: saturate(1) brightness(0.95); }
.portfolio-tile:hover { border-color: var(--line-strong); }

.portfolio-info {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.6rem;
    background: linear-gradient(to top, rgba(5, 15, 30, 0.95), rgba(5, 15, 30, 0.1) 75%);
}
.tile-tag {
    align-self: flex-start;
    margin-bottom: 0.7rem;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: rgba(5, 15, 30, 0.7);
    color: var(--teal-bright);
    font: 0.7rem var(--font-mono);
}
.portfolio-info h3 { margin-bottom: 0.3rem; font-size: 1.3rem; }
.portfolio-info p { color: #c2d0de; font-size: 0.92rem; }

/* Contact */
.contact-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 3rem;
    padding: clamp(1.5rem, 4vw, 3.2rem);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(14, 35, 64, 0.85), rgba(5, 15, 30, 0.9));
    box-shadow: 0 30px 90px -40px rgba(20, 184, 196, 0.45);
}
.contact-intro p:not(.kicker) { margin-bottom: 1.6rem; color: var(--muted); }
.contact-points { display: grid; gap: 0.7rem; }
.contact-points li { display: flex; align-items: center; gap: 0.7rem; color: #c2d0de; font-size: 0.95rem; }
.contact-points i { width: 1.2rem; color: var(--teal-bright); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.input-group { display: block; margin-bottom: 1rem; }
.input-group span {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--teal-bright);
    font: 0.72rem var(--font-mono);
}
.input-group span::before { content: '> '; color: var(--muted); }
.input-group input, .input-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(5, 15, 30, 0.75);
    color: var(--text);
    font: 0.95rem var(--font-sans);
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-group input::placeholder, .input-group textarea::placeholder { color: #5f7690; }
.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-dim);
}
#contactForm .btn { margin-top: 0.5rem; }
.form-status { margin-top: 1rem; color: var(--ok); font: 0.85rem var(--font-mono); }
.form-status.error { color: #f87171; }

/* Footer */
footer { padding: 2.5rem 0; border-top: 1px solid var(--line); background: rgba(3, 9, 18, 0.8); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-row p { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font: 0.78rem var(--font-mono); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.active { opacity: 1; transform: none; }
.services-grid .reveal:nth-child(3n + 2), .process .reveal:nth-child(2) { transition-delay: 0.08s; }
.services-grid .reveal:nth-child(3n), .process .reveal:nth-child(3) { transition-delay: 0.16s; }
.process .reveal:nth-child(4) { transition-delay: 0.24s; }

/* Responsive */
@media (max-width: 1024px) {
    .hero-grid, .quantai-grid, .about-row, .contact-panel { grid-template-columns: 1fr; }
    .pharma-grid .authdemo { order: 1; }
    .hero-grid { gap: 2.5rem; }
    .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .process li::after { display: none; }
    .about-visual { max-width: 560px; }
    .portfolio-bento { grid-template-columns: 1fr 1fr; grid-auto-rows: 260px; }
}

@media (max-width: 860px) {
    .menu-toggle { display: block; }
    .nav-links {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #050f1e;
    }
    .nav-links.is-open { display: flex; }
    .nav-links a, .nav-menu-btn { padding: 0.85rem 1rem; }
    .nav-menu-btn { width: 100%; }
    .nav-dropdown {
        position: static;
        display: none;
        width: auto;
        margin: 0 0 0.3rem 1rem;
        padding: 0 0 0 0.5rem;
        border: 0;
        border-left: 1px solid var(--line-strong);
        border-radius: 0;
        background: none;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    .nav-menu.open .nav-dropdown { display: grid; transform: none; }
    .nav-links .nav-cta { margin: 0.3rem 0 0; justify-content: center; }
}

@media (max-width: 640px) {
    .container { width: calc(100% - 2rem); }
    .hero { padding-top: 6.5rem; }
    .services-grid, .process { grid-template-columns: 1fr; }
    .process { margin-bottom: 4rem; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .portfolio-bento { grid-template-columns: 1fr; grid-auto-rows: 240px; }
    .portfolio-tile.wide { grid-column: auto; }
    .portfolio-tile.tall { grid-row: auto; }
    .about-stat { right: 0.75rem; bottom: -1.25rem; }
    .terminal-body { min-height: 0; font-size: 0.74rem; }
    .logo-word { font-size: 1rem; }
    .authdemo { gap: 0.75rem; min-height: 340px; padding: 2rem 0.75rem; }
    .pack { width: 150px; padding: 0.7rem; }
    .pack-qr { width: 96px; }
    .phone { width: 140px; height: 280px; }
    .typed-line { min-height: 2.16em; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
    .phone-ok { opacity: 1; }
    .phone-scan, .qr-beam { display: none; }
}

.switch-link { color: var(--teal-bright); font: 0.78rem var(--font-mono); text-decoration: underline; text-underline-offset: 3px; }
.switch-link:hover { color: var(--text); }
