/* Parametrig — Components */

/* Mission Statement */
.mission {
    font-size: 1.5rem;
    margin-bottom: 15vh;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

/* Sections */
.section {
    margin-bottom: 10vh;
}

.section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.section p {
    color: var(--text);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Product Cards */
.product-card {
    scroll-margin-top: 10vh;
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 1rem;
    margin-bottom: 12vh;
}

.index {
    font-family: var(--font-mono);
    color: var(--brand);
    font-size: 0.85rem;
    padding-top: 0.3rem;
    transition: var(--transition-accent);
}

.product-name {
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.description {
    color: var(--text);
    margin-bottom: 1rem;
}

.caps {
    text-transform: none;
}

.repo-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--fg);
    border-bottom: 1px solid transparent;
    text-decoration: none;
    display: inline-block;
    transition: var(--transition-accent);
}

.repo-link:hover {
    color: var(--brand);
    border-bottom-color: var(--brand);
    text-decoration: none;
}

.neutral-link {
    font-family: var(--font-mono);
    color: var(--fg);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    text-underline-offset: 3px;
    transition: var(--transition-accent);
}

.neutral-link:hover {
    color: var(--brand);
    border-bottom-color: var(--brand);
    text-decoration: none;
}

.future-badge {
    color: var(--muted-foreground);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    margin-left: 8px;
    vertical-align: middle;
}

.stage-badge {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
}

.stage-alpha {
    color: var(--brand);
    border: 1px solid var(--brand);
}

.stage-beta {
    color: #f59e0b;
    border: 1px solid #f59e0b;
}

.stage-preview {
    color: var(--muted-foreground);
    border: 1px solid var(--border);
}

/* ─── Page Transition (shared across corporate + console) ─── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-body {
    animation: fadeIn 0.3s ease both;
}

/* Roadmap Items */
.roadmap-item {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border);
    position: relative;
    transition: border-color 0.3s ease;
}

.roadmap-item:hover {
    border-left-color: var(--brand);
}

.roadmap-item strong {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--fg);
    display: block;
    margin-bottom: 0.4rem;
}

.roadmap-item span {
    color: var(--text);
}

/* Status Tags */
.status-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted-foreground);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    color: var(--brand);
    border-color: var(--brand);
    transition: var(--transition-accent);
}

/* Email Link */
.email-link {
    font-family: var(--font-mono);
    color: var(--fg);
    font-weight: 600;
    border-bottom: 1px solid var(--brand);
    text-decoration: none;
    transition: var(--transition-accent);
}

.email-link:hover {
    color: var(--brand);
    text-decoration: none;
}

/* Stack Diagram (Protocol page) */
.stack-diagram {
    margin: 4rem 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.layer {
    border: 1px solid var(--fg);
    padding: 1.5rem;
    text-align: center;
    width: 100%;
    position: relative;
    transition: border-color 0.3s ease;
}

.layer:hover {
    border-color: var(--brand);
}

.layer-base {
    background: var(--faded);
    color: var(--muted-foreground);
    border-color: var(--border);
}

.layer-label {
    position: absolute;
    left: 10px;
    top: 5px;
    font-size: 0.6rem;
    color: var(--muted-foreground);
}

/* Protocol page lists */
.section ul {
    list-style: none;
    margin-bottom: 1.5rem;
}

.section li {
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1rem;
}

.section li strong {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--fg);
}

.section li span {
    color: var(--text);
}

/* Mobile overrides */
@media (max-width: 850px) {
    .product-card {
        scroll-margin-top: 22vh;
    }

    .section li {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}

/* --- Migrated Console Components --- */
/* ─── Buttons ─── */
.btn {
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--fg);
    cursor: pointer;
    transition: var(--transition-accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn:hover {
    border-color: var(--brand);
    color: var(--brand);
    text-decoration: none;
}

.btn-primary {
    background: var(--brand);
    color: var(--bg);
    border-color: var(--brand);
}

.btn-primary:hover {
    opacity: 0.85;
    background: var(--brand);
    border-color: var(--brand);
    color: var(--bg);
}

.btn-danger {
    color: #ff3b30;
    border-color: rgba(255, 59, 48, 0.4);
}

.btn-danger:hover {
    background: rgba(255, 59, 48, 0.05);
    border-color: #ff3b30;
    color: #ff3b30;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 6px 12px;
}

.btn-ghost {
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--faded);
    border-color: transparent;
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted-foreground);
    display: block;
    margin-bottom: 0.5rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--muted-foreground);
    margin-top: 0.4rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--fg);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--brand);
}

.form-input.error {
    border-color: #ff3b30;
}

.form-error {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: #ff3b30;
    margin-top: 0.4rem;
}

/* ─── Modals ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(var(--bg-rgb), 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(10px);
    transition: transform 0.2s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.modal-title {
    font-family: var(--font-main);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--fg);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-foreground);
    font-size: 1.5rem;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--fg);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* ─── Key Display ─── */
.key-display {
    background: var(--faded);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--fg);
    word-break: break-all;
    line-height: 1.5;
    position: relative;
    margin: 1.5rem 0;
}

.key-display .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.75rem;
}

.key-warning {
    color: #cc9900;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ─── Code Samples ─── */
.code-block {
    background: var(--faded);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--fg);
    overflow-x: auto;
    line-height: 1.6;
    position: relative;
    white-space: pre;
}

.code-tabs {
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.code-tab {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0 0 10px 0;
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-accent);
}

.code-tab:hover {
    color: var(--fg);
}

.code-tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

/* ─── Empty State ─── */
.empty-state {
    text-align: left;
    padding: 2rem 0;
    color: var(--muted-foreground);
}

.empty-state h3 {
    font-family: var(--font-main);
    font-size: 1.25rem;
    color: var(--fg);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.empty-state p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.empty-state svg {
    width: 32px;
    height: 32px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* ─── Toast Notifications ─── */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 0.9rem;
    color: var(--fg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 9500;
    transform: translateY(50px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    color: #34c759;
}

.toast-error {
    color: #ff3b30;
}

/* ─── Scope Tags ─── */
.scope-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted-foreground);
    padding: 0;
    margin-right: 8px;
    display: inline-block;
}

/* ─── Audit Log ─── */
.audit-entry {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1.5rem;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.audit-entry:last-child {
    border-bottom: none;
}

.audit-time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.audit-action {
    font-weight: 500;
    color: var(--fg);
}

/* ─── Health Status ─── */
.health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.health-dot.ok {
    background: #34c759;
}

.health-dot.error {
    background: #ff3b30;
}

/* ─── TOTP Setup ─── */
.totp-qr {
    text-align: center;
    padding: 2rem 0;
}

.totp-qr canvas,
.totp-qr img {
    max-width: 200px;
    margin: 0 auto 1.5rem;
    display: block;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.totp-secret {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--muted-foreground);
    text-align: center;
    word-break: break-all;
    letter-spacing: 0.05em;
    margin: 1rem 0;
}

.totp-input {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    max-width: 200px;
    margin: 0 auto;
}

/* ─── Tabs ─── */
.tab-nav {
    display: flex;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.tab-btn {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0 0 10px 0;
    background: none;
    border: none;
    color: var(--muted-foreground);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-accent);
}

.tab-btn:hover {
    color: var(--fg);
}

.tab-btn.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* --- Global Utilities --- */

/* Hide default Number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* --- Global Toggle Element --- */
.p-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    vertical-align: middle;
}

.p-toggle input {
    display: none;
}

.p-toggle .toggle-slider {
    width: 28px;
    height: 16px;
    background: var(--border);
    border-radius: 10px;
    position: relative;
    transition: 0.3s;
}

.p-toggle .toggle-slider::before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

.p-toggle input:checked+.toggle-slider {
    background: var(--brand);
}

.p-toggle input:checked+.toggle-slider::before {
    transform: translateX(12px);
}

/* Environment Toggle Specific colors */
.env-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    vertical-align: middle;
}

.env-toggle input {
    display: none;
}

.env-toggle .env-slider {
    width: 28px;
    height: 16px;
    background: #f59e0b;
    /* Sandbox Orange */
    border-radius: 10px;
    position: relative;
    transition: 0.3s;
}

.env-toggle .env-slider::before {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

.env-toggle input:checked+.env-slider {
    background: var(--brand);
    /* Live Green */
}

.env-toggle input:checked+.env-slider::before {
    transform: translateX(12px);
}

.env-label {
    margin-left: 8px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--fg);
}

/* ─── Dropdowns & Filters ─── */
.p-dropdown {
    position: relative;
    display: inline-block;
}

.p-dropdown summary {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--fg);
    cursor: pointer;
    list-style: none;
    outline: none;
    display: flex;
    align-items: center;
}

/* Safari specific fix for details marker */
.p-dropdown summary::-webkit-details-marker {
    display: none;
}

.p-dropdown .time-marker {
    color: var(--muted-foreground);
    margin-left: 6px;
    font-family: var(--font-mono);
}

/* Standalone [+] marker (e.g. team row action buttons) */
.time-marker::after {
    content: "[+]";
    font-family: var(--font-mono);
}

/* Inside .p-dropdown, inherit context */
.p-dropdown .time-marker::after {
    content: "[+]";
}

.p-dropdown[open] .time-marker::after {
    content: "[-]";
}

.p-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    z-index: 50;
    min-width: 250px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* ─── Mobile Responsive ─── */

@media (max-width: 850px) {
    .modal {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* ─── Phase D: Animated Visual Elements ─── */

/* ASCII Rain */
.ascii-rain {
    position: fixed;
    top: 0;
    left: 32vw;
    width: 12vw;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.6;
    white-space: pre;
    color: var(--fg);
    opacity: 0.08;
}

.dark .ascii-rain {
    opacity: 0.15;
}

.ascii-rain-block {
    animation: ascii-scroll 25s linear infinite;
}

@keyframes ascii-scroll {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
    }
}

/* Adjust animated elements on mobile */
@media (max-width: 850px) {
    .ascii-rain {
        left: 2vw;
        width: 8vw;
        font-size: 0.75rem;
    }
}

/* ─── Corporate Footer ─── */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 5vw 10rem;
    margin-top: 8vh;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    gap: 4rem;
}

.footer-link-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-link-group a {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}

.footer-link-group a:hover {
    color: var(--brand);
}

.footer-legal {
    text-align: left;
    max-width: 320px;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text);
    opacity: 0.7;
}

.footer-notice {
    font-size: 0.72rem;
    color: var(--muted-foreground);
    line-height: 1.5;
    margin-top: 0.6rem;
}

/* ─── Mobile Responsive — Footer ─── */

@media (max-width: 850px) {
    .footer-inner {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1.5rem;
    }

    .footer-link-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem 1.5rem;
    }

    .footer-legal {
        text-align: left;
        max-width: 100%;
    }

    .site-footer {
        padding: 2rem 1.5rem 1.5rem;
    }
}