/* Plansight shared design tokens and base components.
   Linked by every hub/section page. Per-release pages keep their inline CSS. */

:root {
    --ps-dark: #1D3A44;
    --ps-dark-deep: #162E36;
    --ps-green-light: #B4E0D8;
    --ps-green-lighter: #DAF0EB;
    --ps-green-pale: #EDF7F5;
    --ps-accent: #D63E28;
    --ps-white: #FFFFFF;
    --ps-offwhite: #F4F7F6;
    --ps-text: #1D3A44;
    --ps-text-light: #4A6670;
    --ps-muted: #9AAAB0;
    --ps-border: #E1EAE8;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ps-text);
    background: var(--ps-offwhite);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Barlow', sans-serif; }

a { color: var(--ps-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.ps-header {
    background: linear-gradient(135deg, var(--ps-dark) 0%, var(--ps-dark-deep) 100%);
    color: white;
    padding: 60px 40px 52px;
    text-align: center;
}

.ps-header-logo { height: 36px; margin-bottom: 28px; }

.ps-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.ps-header .ps-subtitle {
    font-size: 1.1rem;
    opacity: 0.7;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

/* Crumb / back link for subpages */
.ps-crumb {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 24px 0;
    font-size: 0.9rem;
    color: var(--ps-text-light);
}
.ps-crumb a {
    color: var(--ps-text-light);
    text-decoration: none;
}
.ps-crumb a:hover { color: var(--ps-accent); }

/* Sticky top-bar — always-visible breadcrumb trail on subpages */
.ps-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(29, 58, 68, 0.96);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    padding: 10px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(180, 224, 216, 0.15);
}

.ps-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ps-breadcrumb a {
    color: var(--ps-green-light);
    text-decoration: none;
}
.ps-breadcrumb a:hover {
    color: #fff;
    text-decoration: none;
}
.ps-breadcrumb span[aria-hidden] {
    color: rgba(180, 224, 216, 0.4);
    user-select: none;
}
.ps-breadcrumb span[aria-current] {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 500;
}

/* Container */
.ps-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px;
}

.ps-section-label {
    font-family: 'Barlow', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--ps-text-light);
    margin-bottom: 20px;
}

/* Card pattern: active + disabled variants */
.ps-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.ps-card {
    background: white;
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: 0 2px 8px rgba(29, 58, 68, 0.06);
    text-decoration: none;
    color: var(--ps-text);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 20px;
    border-left: 4px solid var(--ps-green-light);
}

.ps-card:hover {
    box-shadow: 0 8px 24px rgba(29, 58, 68, 0.12);
    transform: translateY(-2px);
    border-left-color: var(--ps-accent);
    text-decoration: none;
}

.ps-card.ps-card-disabled {
    background: #F8FAFA;
    border-left-color: var(--ps-border);
    cursor: default;
    opacity: 0.75;
}
.ps-card.ps-card-disabled:hover {
    box-shadow: 0 2px 8px rgba(29, 58, 68, 0.06);
    transform: none;
    border-left-color: var(--ps-border);
}

.ps-card-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: var(--ps-dark);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ps-card-disabled .ps-card-icon {
    background: var(--ps-muted);
}
.ps-card-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: var(--ps-green-light);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ps-card-info { flex-grow: 1; min-width: 0; }

.ps-card-info h3 {
    font-size: 1.2rem;
    color: var(--ps-dark);
    margin-bottom: 4px;
}

.ps-card-info p {
    font-size: 0.9rem;
    color: var(--ps-text-light);
    margin-bottom: 8px;
}

.ps-card-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ps-tag {
    font-size: 0.7rem;
    font-family: 'Barlow', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 4px;
}

.ps-tag-accent {
    background: rgba(251, 81, 59, 0.1);
    color: var(--ps-accent);
}
.ps-tag-muted {
    background: rgba(29, 58, 68, 0.08);
    color: var(--ps-text-light);
}
.ps-tag-soon {
    background: rgba(154, 170, 176, 0.18);
    color: var(--ps-text-light);
}

.ps-card-arrow {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--ps-green-light);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ps-card-disabled .ps-card-arrow { display: none; }

/* Footer */
.ps-footer {
    text-align: center;
    padding: 24px;
    font-size: 0.85rem;
    color: var(--ps-text-light);
}

@media (max-width: 700px) {
    .ps-header h1 { font-size: 2rem; }
    .ps-card-grid { grid-template-columns: 1fr; }
    .ps-card { flex-direction: column; text-align: center; }
    .ps-card-meta { justify-content: center; }
}

/* =====================================================================
   Integrations site additions — primary nav, diagram, integration cards
   ===================================================================== */

/* Primary nav — sticky tab bar across the top of every page.
   Contains all 5 integrations so users can lateral-navigate without
   going back to index. Active page is highlighted. */
.ps-mainnav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(29, 58, 68, 0.96);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid rgba(180, 224, 216, 0.15);
    font-family: 'Inter', sans-serif;
}
.ps-mainnav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    height: 56px;
}
.ps-mainnav-brand {
    color: #fff;
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.ps-mainnav-brand:hover { color: var(--ps-green-light); text-decoration: none; }
.ps-mainnav-links {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}
.ps-mainnav-links a {
    color: rgba(180, 224, 216, 0.75);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}
.ps-mainnav-links a:hover {
    color: #fff;
    background: rgba(180, 224, 216, 0.1);
    text-decoration: none;
}
.ps-mainnav-links a.is-active {
    color: var(--ps-green-light);
    background: rgba(180, 224, 216, 0.15);
    font-weight: 600;
}

/* Hub-and-spoke diagram on the index — Plansight at center,
   5 integrations around it, color-coded by data direction. */
.ps-diagram-wrap {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(29, 58, 68, 0.06);
    padding: 40px 24px 32px;
    margin: 32px 0 40px;
}
.ps-diagram-svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 760px;
    margin: 0 auto;
}
.ps-diagram-svg .hub-circle {
    fill: var(--ps-dark);
    stroke: var(--ps-green-light);
    stroke-width: 2;
}

/* Hub breath — very subtle expand/contract, like the system is alive */
.ps-diagram-svg .hub-pulse {
    transform-box: fill-box;
    transform-origin: 450px 320px;
    animation: ps-hub-breath 4s ease-in-out infinite;
}
@keyframes ps-hub-breath {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.022); }
}

/* Soft ring breathes in sync — barely visible, just a faint glow swell */
.ps-diagram-svg .hub-pulse-ring {
    transform-box: fill-box;
    transform-origin: 450px 320px;
    animation: ps-hub-ring-breath 4s ease-in-out infinite;
}
@keyframes ps-hub-ring-breath {
    0%, 100% { transform: scale(1);     opacity: 0.5; }
    50%      { transform: scale(1.04);  opacity: 0.25; }
}
.ps-diagram-svg .hub-text {
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 18px;
    fill: var(--ps-green-light);
    text-anchor: middle;
    dominant-baseline: middle;
}
.ps-diagram-svg .spoke-line {
    stroke: var(--ps-border);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 6 6;
    animation: ps-spoke-flow 1.2s linear infinite;
}
@keyframes ps-spoke-flow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -12; }
}
.ps-diagram-svg .arrow-in { stroke: var(--ps-accent); }
.ps-diagram-svg .arrow-out { stroke: #2A8A6F; }
.ps-diagram-svg .node a { cursor: pointer; }
.ps-diagram-svg .node a:hover .node-rect {
    stroke: var(--ps-accent);
    stroke-width: 3;
}
.ps-diagram-svg .node-rect {
    fill: #fff;
    stroke: var(--ps-dark);
    stroke-width: 2;
    transition: stroke 0.15s, stroke-width 0.15s;
}
.ps-diagram-svg .node-text {
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    font-size: 16px;
    fill: var(--ps-dark);
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}
.ps-diagram-svg .spoke-secondary {
    stroke-dasharray: 4 8;
    stroke-width: 1.5;
    animation-duration: 2s;
}

/* Logo box used inside integration cards */
.ps-card-logo-box {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: #fff;
    border: 1px solid var(--ps-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}
.ps-card-logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.ps-card-logo-box.ps-logo-dark {
    background: var(--ps-dark);
    border-color: var(--ps-dark);
}
.ps-diagram-legend {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 24px;
    font-size: 0.82rem;
    color: var(--ps-text-light);
}
.ps-diagram-legend .item { display: flex; align-items: center; gap: 8px; }
.ps-diagram-legend .swatch {
    width: 18px;
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}
.ps-diagram-legend .swatch.in { background: var(--ps-accent); }
.ps-diagram-legend .swatch.out { background: #2A8A6F; }
.ps-diagram-legend .swatch.both {
    background: linear-gradient(to right, var(--ps-accent) 50%, #2A8A6F 50%);
}

/* Integration card grid — single column, more meta than ps-card default */
.ps-integration-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ps-integration-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 2px 8px rgba(29, 58, 68, 0.06);
    text-decoration: none;
    color: var(--ps-text);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 20px;
    border-left: 4px solid var(--ps-green-light);
}
.ps-integration-card:hover {
    box-shadow: 0 8px 24px rgba(29, 58, 68, 0.12);
    transform: translateY(-2px);
    border-left-color: var(--ps-accent);
    text-decoration: none;
}
.ps-integration-card .ps-card-icon { margin: 0; flex-shrink: 0; }
.ps-integration-card .ps-card-logo-box { flex-shrink: 0; }
.ps-integration-card-info { flex: 1 1 0; min-width: 0; }
.ps-integration-card-info h3 {
    font-family: 'Barlow', sans-serif;
    font-size: 1.25rem;
    color: var(--ps-dark);
    margin: 0 0 4px;
    font-weight: 700;
}
.ps-integration-card-info h3 .renamed-from {
    margin-left: 10px;
    font-size: 0.7rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ps-muted);
    vertical-align: middle;
}
.ps-integration-card-meta {
    font-family: ui-monospace, 'Menlo', monospace;
    font-size: 0.75rem;
    color: var(--ps-muted);
    margin: 0 0 10px;
}
.ps-integration-card-summary {
    font-size: 0.9rem;
    color: var(--ps-text-light);
    line-height: 1.55;
    margin: 0;
    max-width: 720px;
}
.ps-integration-card-summary strong { color: var(--ps-dark); font-weight: 600; }
.ps-integration-card-summary a { color: var(--ps-accent); font-weight: 600; }
.ps-integration-card-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}
.ps-status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-family: 'Barlow', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.ps-status-pill.audited {
    background: rgba(180, 224, 216, 0.4);
    color: var(--ps-dark);
}
.ps-status-pill.items {
    background: rgba(214, 62, 40, 0.12);
    color: var(--ps-accent);
}
.ps-status-pill.pending {
    background: rgba(154, 170, 176, 0.18);
    color: var(--ps-text-light);
}
.ps-status-detail {
    font-size: 0.72rem;
    color: var(--ps-muted);
    text-align: right;
}

/* Wider container for integration site content */
.ps-container.ps-container-wide { max-width: 1100px; }

/* Accessibility — respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ps-card,
    .ps-integration-card,
    .ps-diagram-svg .node-rect,
    .ps-mainnav-links a {
        transition: none !important;
    }
    .ps-card:hover,
    .ps-integration-card:hover {
        transform: none !important;
    }
    .ps-diagram-svg .hub-pulse,
    .ps-diagram-svg .hub-pulse-ring {
        animation: none !important;
    }
    .ps-diagram-svg .spoke-line {
        animation: none !important;
        stroke-dasharray: 4 4;
    }
}

/* Visible focus rings for keyboard nav */
.ps-mainnav-links a:focus-visible,
.ps-card:focus-visible,
.ps-integration-card:focus-visible,
.ps-diagram-svg a:focus-visible .node-rect {
    outline: 3px solid var(--ps-green-light);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .ps-mainnav-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
    .ps-mainnav-links { width: 100%; gap: 2px; }
    .ps-mainnav-links a { padding: 6px 10px; font-size: 0.8rem; }
    .ps-integration-card { flex-direction: column; align-items: flex-start; text-align: left; }
    .ps-integration-card .ps-card-icon { margin-bottom: 4px; }
    .ps-integration-card-status { align-items: flex-start; }
    .ps-diagram-wrap { padding: 24px 12px; }
}
