/* =========================================================
   Systems page (/systems)
   Builds on the v3 theme tokens in style.css (navy + gold).
   ========================================================= */

/* ---------------- Hero ---------------- */
.sys-hero { padding: 5.5rem 0 4.5rem; text-align: center; }
.sys-hero .container { position: relative; }
.sys-hero h1 { max-width: 820px; margin-left: auto; margin-right: auto; }
.sys-hero p.lead { margin-left: auto; margin-right: auto; max-width: 640px; }
.sys-hero .hero-actions { justify-content: center; margin-bottom: 3.25rem; }
.sys-launch a { text-align: left; }

.sys-launch {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: .8rem;
    border-top: 1px solid rgba(255,255,255,.15); padding-top: 2rem;
}
.sys-launch a {
    display: flex; flex-direction: column; gap: .3rem; height: 100%;
    padding: 1rem 1.1rem; border-radius: 12px;
    border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05);
    transition: var(--transition);
}
.sys-launch a:hover { background: rgba(255,255,255,.11); border-color: var(--accent); transform: translateY(-2px); }
.sys-launch i { color: var(--accent-light); font-size: 1.15rem; margin-bottom: .35rem; }
.sys-launch strong { color: var(--white); font-family: var(--font-heading); font-size: .92rem; line-height: 1.3; }
.sys-launch span { font-size: .72rem; color: rgba(255,255,255,.6); overflow-wrap: anywhere; }

/* ---------------- Picker ---------------- */
.sys-section { scroll-margin-top: 70px; }
.sys-picker { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.75rem; align-items: start; }

.sys-tabs { display: flex; flex-direction: column; gap: .55rem; position: sticky; top: 96px; }
html:not(.js) .sys-tabs { display: none; }
.sys-tab {
    display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left;
    padding: .9rem 1rem; border-radius: 12px; cursor: pointer;
    background: var(--white); border: 1px solid var(--gray-200); font: inherit; color: inherit;
    transition: var(--transition);
}
.sys-tab .ico {
    width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 1.05rem;
    background: var(--gray-100); color: var(--primary); transition: var(--transition);
}
.sys-tab .txt { display: block; min-width: 0; }
.sys-tab b { display: block; font-family: var(--font-heading); font-size: .93rem; line-height: 1.3; color: var(--dark); }
.sys-tab small { display: block; margin-top: .1rem; font-size: .78rem; color: var(--gray-500); }
.sys-tab:hover { border-color: var(--primary-light); }
.sys-tab[aria-selected="true"] { background: var(--primary); border-color: var(--primary); box-shadow: var(--shadow); }
.sys-tab[aria-selected="true"] .ico { background: var(--accent); color: var(--primary-dark); }
.sys-tab[aria-selected="true"] b { color: var(--white); }
.sys-tab[aria-selected="true"] small { color: rgba(255,255,255,.7); }

/* Stage */
.sys-stage {
    position: relative; overflow: hidden; padding: 1.5rem; border-radius: var(--radius-lg);
    color: var(--white); box-shadow: var(--shadow-lg);
    background:
        radial-gradient(520px 260px at 100% 0%, rgba(201,160,74,.22), transparent 70%),
        linear-gradient(160deg, var(--primary-dark), var(--primary));
}
html.js .sys-panel:not(.is-active) { display: none; }
html:not(.js) .sys-panel + .sys-panel { margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid rgba(255,255,255,.15); }

/* App window mock */
.win { background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: 0 24px 48px -24px rgba(0,0,0,.55); color: var(--gray-700); }
.win-bar { display: flex; align-items: center; gap: .4rem; padding: .65rem .9rem; background: var(--gray-100); border-bottom: 1px solid var(--gray-200); }
.win-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-300); }
.win-url { margin-left: .7rem; flex: 1; min-width: 0; padding: .22rem .85rem; border-radius: 999px; background: var(--white); border: 1px solid var(--gray-200); font-size: .74rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-url i { color: var(--success); margin-right: .3rem; font-size: .68rem; }
.win-body { padding: 1.1rem; display: grid; gap: 1rem; }
.win-note { margin: .65rem 0 1.6rem; font-size: .74rem; color: rgba(255,255,255,.72); text-align: right; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.kpi { border: 1px solid var(--gray-200); border-top: 3px solid var(--sys); border-radius: 10px; padding: .65rem .8rem; min-width: 0; }
.kpi span { display: block; font-size: .7rem; color: var(--gray-500); }
.kpi strong { font-family: var(--font-heading); font-size: 1.2rem; color: var(--dark); line-height: 1.25; display: block; }
.kpi em { font-style: normal; font-size: .68rem; font-weight: 600; color: var(--success); }

.viz-title { font-size: .74rem; font-weight: 600; color: var(--gray-500); margin-bottom: .6rem; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; align-items: end; height: 118px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .3rem; }
.bar span { display: block; width: 100%; height: var(--h); border-radius: 5px 5px 0 0; background: var(--sys); opacity: .88; transform-origin: bottom; }
.bar small { font-size: .66rem; color: var(--gray-500); }

.meter { height: 14px; border-radius: 999px; background: var(--gray-100); overflow: hidden; }
.meter span { display: block; height: 100%; width: var(--w); border-radius: 999px; background: var(--sys); transform-origin: left; }
.meter-cap { margin-top: .5rem; font-size: .78rem; color: var(--gray-700); }

.rooms { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; }
.room { display: inline-block; aspect-ratio: 1; border-radius: 4px; background: var(--gray-100); border: 1px solid var(--gray-300); }
.rooms .room { width: 100%; }
.room.r-i { background: var(--primary); border-color: var(--primary); }
.room.r-a { background: var(--accent); border-color: var(--accent); }
.room.r-c { background: repeating-linear-gradient(45deg, var(--gray-200), var(--gray-200) 3px, var(--white) 3px, var(--white) 6px); }
.room-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin-top: .7rem; font-size: .7rem; color: var(--gray-500); }
.room-legend .room { width: 11px; height: 11px; margin-left: .5rem; }
.room-legend .room:first-child { margin-left: 0; }

.feed { display: grid; gap: .45rem; }
.feed li { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: 10px; background: var(--light); border: 1px solid var(--gray-100); }
.feed-ico { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; font-size: .8rem; color: var(--white); background: var(--sys); }
.feed-txt { min-width: 0; }
.feed-txt b { display: block; font-family: var(--font-heading); font-size: .82rem; color: var(--dark); line-height: 1.3; }
.feed-txt small { display: block; font-size: .72rem; color: var(--gray-500); }

/* Panel info */
.sys-info { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.sys-copy h3 { color: var(--white); font-size: 1.45rem; line-height: 1.25; margin-bottom: .8rem; }
.sys-copy p { color: rgba(255,255,255,.82); font-size: .96rem; }
.sys-copy .sys-for { margin-top: .8rem; font-size: .88rem; color: rgba(255,255,255,.7); }
.sys-copy .sys-for strong { color: var(--accent-light); font-weight: 600; }
.sys-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.2rem; }
.sys-chips li { padding: .32rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 500; color: var(--white); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); }

.sys-buy { display: grid; gap: .65rem; }
.sys-meta { display: grid; gap: .1rem; margin-bottom: .6rem; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); }
.sys-meta > div { padding: .75rem 1rem; }
.sys-meta > div + div { border-top: 1px solid rgba(255,255,255,.12); }
.sys-meta dt { font-size: .72rem; color: rgba(255,255,255,.6); }
.sys-meta dd { font-family: var(--font-heading); font-weight: 700; font-size: 1rem; color: var(--white); }
.sys-meta dd small { font-weight: 500; font-size: .78rem; color: rgba(255,255,255,.65); }
.sys-meta dd.sub { font-family: var(--font-body); font-weight: 500; font-size: .76rem; color: var(--accent-light); }
.sys-buy .btn-outline { background: transparent; }
.sys-login { text-align: center; font-size: .84rem; color: rgba(255,255,255,.75); padding: .35rem; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.35); }
.sys-login:hover { color: var(--accent-light); }
.sys-stage :focus-visible { outline-color: var(--accent-light); }

/* The one moment of motion: the preview draws itself in when you choose a system */
@keyframes sys-grow-y { from { transform: scaleY(0); } }
@keyframes sys-grow-x { from { transform: scaleX(0); } }
@keyframes sys-pop { from { opacity: 0; transform: scale(.6); } }
@keyframes sys-rise { from { opacity: 0; transform: translateY(6px); } }
html.js .sys-panel.is-active .bar span { animation: sys-grow-y .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 55ms); }
html.js .sys-panel.is-active .meter span { animation: sys-grow-x .9s cubic-bezier(.2,.7,.2,1) both; }
html.js .sys-panel.is-active .rooms .room { animation: sys-pop .35s ease both; animation-delay: calc(var(--i) * 18ms); }
html.js .sys-panel.is-active .feed li { animation: sys-rise .45s ease both; }
html.js .sys-panel.is-active .feed li:nth-child(2) { animation-delay: .12s; }
html.js .sys-panel.is-active .feed li:nth-child(3) { animation-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
    html.js .sys-panel.is-active .bar span, html.js .sys-panel.is-active .meter span,
    html.js .sys-panel.is-active .rooms .room, html.js .sys-panel.is-active .feed li { animation: none; }
    .sys-launch a:hover { transform: none; }
}

/* ---------------- Comparison table ---------------- */
.sys-table-wrap { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow-sm); }
.sys-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .92rem; }
.sys-table th, .sys-table td { padding: 1rem 1.2rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--gray-100); }
.sys-table thead th { background: var(--light); font-family: var(--font-heading); font-size: .8rem; color: var(--gray-500); font-weight: 700; border-bottom: 1px solid var(--gray-200); }
.sys-table tbody tr:last-child th, .sys-table tbody tr:last-child td { border-bottom: 0; }
.sys-table tbody th { font-family: var(--font-heading); font-size: .93rem; color: var(--primary); }
.sys-table tbody th a { display: inline-flex; gap: .6rem; align-items: baseline; }
.sys-table tbody th a:hover { color: var(--accent-dark); }
.sys-table tbody th i { color: var(--accent-dark); width: 1.1rem; }
.sys-table td strong { display: block; color: var(--dark); font-family: var(--font-heading); }
.sys-table td small { display: block; font-size: .76rem; color: var(--gray-500); }
.sys-table tbody tr:hover { background: var(--light); }

/* ---------------- Shared strengths ---------------- */
.sys-shared { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.25rem; }
.sys-shared > div { border-top: 2px solid var(--accent); padding-top: 1.4rem; }
.sys-shared i { color: var(--primary); font-size: 1.4rem; margin-bottom: 1rem; display: block; }
.sys-shared h3 { margin-bottom: .55rem; }
.sys-shared p { font-size: .94rem; }

/* ---------------- Responsive ---------------- */
@media (max-width: 1100px) {
    .sys-launch { grid-template-columns: repeat(3, 1fr); }
    .sys-picker { grid-template-columns: 250px minmax(0, 1fr); }
    .sys-info { grid-template-columns: 1fr; }
    .sys-shared { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .sys-picker { grid-template-columns: 1fr; gap: 1.25rem; }
    .sys-tabs { position: static; flex-direction: row; overflow-x: auto; gap: .5rem; padding-bottom: .4rem; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
    .sys-tab { width: auto; flex: 0 0 auto; scroll-snap-align: start; padding: .7rem .9rem; }
    .sys-tab small { display: none; }
    .sys-tab .ico { width: 34px; height: 34px; font-size: .9rem; }
    .sys-tab b { font-size: .85rem; white-space: nowrap; }
}
@media (max-width: 768px) {
    .sys-hero { padding: 3.75rem 0 3rem; }
    .sys-launch { grid-template-columns: repeat(2, 1fr); }
    .sys-launch li:last-child { grid-column: 1 / -1; }
    .sys-stage { padding: 1rem; }
    .win-body { padding: .85rem; }
    .kpi strong { font-size: clamp(.78rem, 3.4vw, .92rem); }
    .kpi { padding: .5rem .55rem; }
    .kpi span { font-size: .66rem; }
    .rooms { grid-template-columns: repeat(8, 1fr); }
    .sys-copy h3 { font-size: 1.25rem; }
    .sys-shared { grid-template-columns: 1fr; gap: 1.75rem; }
}
