* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f2f5fb;
    --text: #16213c;
    --muted: #5f6b86;
    --border: #d8dfef;
    --primary: #1f4fff;
    --primary-hover: #173ec9;
    --secondary-bg: #e9eeff;
    --secondary-text: #24355f;
    --success-bg: #d8f3e1;
    --success-text: #17653a;
    --error-bg: #ffe2e2;
    --error-text: #7f1f1f;
    --primary-contrast: #ffffff;
}

body[data-template="deepTech"] {
    --bg: #090c15;
    --surface: #121827;
    --surface-soft: #0f1523;
    --text: #d6e4ff;
    --muted: #8ea1cb;
    --border: #243050;
    --primary: #2dd4bf;
    --primary-hover: #14b8a6;
    --secondary-bg: #172036;
    --secondary-text: #b1c6f5;
    --success-bg: #12432d;
    --success-text: #9bffce;
    --error-bg: #4f2121;
    --error-text: #ffc9c9;
    --primary-contrast: #001310;
}

body[data-template="enterprise"] {
    --bg: #f2f5f9;
    --surface: #ffffff;
    --surface-soft: #eef3fb;
    --text: #0f1f3a;
    --muted: #5b6b84;
    --border: #d3dce9;
    --primary: #003366;
    --primary-hover: #002244;
    --secondary-bg: #e7eef8;
    --secondary-text: #1f3d67;
    --success-bg: #dff5e6;
    --success-text: #14693a;
    --error-bg: #ffe7e7;
    --error-text: #7a2525;
    --primary-contrast: #ffffff;
}

body[data-template="swiss"] {
    --bg: #f4f4f0;
    --surface: #ffffff;
    --surface-soft: #f7f7f3;
    --text: #0f0f0f;
    --muted: #555555;
    --border: #1a1a1a;
    --primary: #0f0f0f;
    --primary-hover: #333333;
    --secondary-bg: #ffffff;
    --secondary-text: #0f0f0f;
    --success-bg: #e7f7ea;
    --success-text: #165b30;
    --error-bg: #ffe9e9;
    --error-text: #7f2020;
    --primary-contrast: #ffffff;
}

body[data-template="glass"] {
    --bg: #0f172a;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-soft: rgba(15, 23, 42, 0.78);
    --text: #e6f0ff;
    --muted: #b7c7ee;
    --border: rgba(255, 255, 255, 0.16);
    --primary: #e8efff;
    --primary-hover: #ffffff;
    --secondary-bg: rgba(255, 255, 255, 0.12);
    --secondary-text: #e6f0ff;
    --success-bg: rgba(34, 197, 94, 0.2);
    --success-text: #b3f6cb;
    --error-bg: rgba(239, 68, 68, 0.2);
    --error-text: #ffd2d2;
    --primary-contrast: #0f172a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 30;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 72px;
    gap: 1rem;
}

.logo a {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.25rem;
    align-items: center;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.94rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.is-active {
    color: var(--text);
}

.template-picker-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.template-label {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
}

.template-picker {
    border: 1px solid var(--border);
    background-color: var(--surface-soft);
    color: var(--text);
    border-radius: 8px;
    font-size: 0.84rem;
    padding: 0.4rem 0.6rem;
}

body[data-template="swiss"] {
    font-family: "Segoe UI", Arial, sans-serif;
}

body[data-template="swiss"] .btn,
body[data-template="swiss"] .badge {
    border-radius: 0;
}

body[data-template="swiss"] .btn {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

body[data-template="swiss"] .feature-item,
body[data-template="swiss"] .form-card,
body[data-template="swiss"] .portal-card,
body[data-template="swiss"] .contact-form,
body[data-template="swiss"] .contact-info,
body[data-template="swiss"] .domain-card,
body[data-template="swiss"] .offering-card,
body[data-template="swiss"] .tech-card,
body[data-template="swiss"] .nexus-sidebar,
body[data-template="swiss"] .nexus-content {
    border-radius: 0;
    box-shadow: none;
}

body[data-template="glass"] header,
body[data-template="glass"] footer,
body[data-template="glass"] .feature-item,
body[data-template="glass"] .form-card,
body[data-template="glass"] .portal-card,
body[data-template="glass"] .contact-form,
body[data-template="glass"] .contact-info,
body[data-template="glass"] .domain-card,
body[data-template="glass"] .offering-card,
body[data-template="glass"] .tech-card,
body[data-template="glass"] .nexus-sidebar,
body[data-template="glass"] .nexus-content,
body[data-template="glass"] .pathway-card,
body[data-template="glass"] .asset-link-card,
body[data-template="glass"] .tech-dependency {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body[data-template="glass"] .hero {
    background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 40%, #7c3aed 100%);
}

body[data-template="deepTech"] {
    font-family: "Consolas", "Courier New", monospace;
}

body[data-template="deepTech"] header {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    border-right: 1px solid var(--border);
    border-bottom: 0;
    background: #0a0a0a;
}

body[data-template="deepTech"] nav,
body[data-template="deepTech"] nav .container {
    height: 100%;
}

body[data-template="deepTech"] nav .container {
    align-items: stretch;
    justify-content: flex-start;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

body[data-template="deepTech"] .logo {
    width: 100%;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.1rem;
}

body[data-template="deepTech"] .logo a {
    color: #e2e8f0;
}

body[data-template="deepTech"] .nav-links {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.8rem;
}

body[data-template="deepTech"] .nav-links li {
    list-style: none;
}

body[data-template="deepTech"] .nav-links a {
    display: block;
    padding: 0.65rem 0.7rem;
    border-radius: 8px;
    color: #93a4c6;
}

body[data-template="deepTech"] .nav-links a:hover,
body[data-template="deepTech"] .nav-links a.is-active {
    color: #2dd4bf;
    background: rgba(45, 212, 191, 0.12);
}

body[data-template="deepTech"] .template-picker-wrap {
    width: calc(100% - 1.6rem);
    margin: auto 0.8rem 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
    display: grid;
    gap: 0.35rem;
}

body[data-template="deepTech"] .template-picker {
    width: 100%;
    background: #0f1523;
    color: #d6e4ff;
}

body[data-template="deepTech"] main,
body[data-template="deepTech"] footer {
    margin-left: 260px;
}

body[data-template="deepTech"] .hero {
    background: linear-gradient(140deg, #03110f 0%, #0a2232 55%, #10243d 100%);
}

body[data-template="deepTech"] .btn-primary {
    color: var(--primary-contrast);
}

body[data-template="deepTech"] footer {
    border-top-color: var(--border);
    background: #0a0a0a;
}

main {
    min-height: calc(100vh - 165px);
}

.hero {
    color: #ffffff;
    padding: 5rem 0;
    text-align: center;
    background: linear-gradient(135deg, #2f4cff 0%, #6b27c6 52%, #d31e73 100%);
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3.6rem);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero .subtitle {
    max-width: 760px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
    margin-top: 1.8rem;
    display: flex;
    gap: 0.9rem;
    justify-content: center;
    flex-wrap: wrap;
}

.features,
.contact-section,
.form-page,
.portal-page,
.capabilities-section,
.nexus-app-wrap {
    padding: 3.4rem 0;
}

.features {
    background-color: var(--surface);
}

.features h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.feature-item,
.form-card,
.portal-card,
.contact-form,
.contact-info,
.domain-card,
.offering-card,
.tech-card,
.nexus-sidebar {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.feature-item {
    padding: 1.35rem;
}

.feature-item h3 {
    margin-bottom: 0.55rem;
}

.page-intro h1 {
    font-size: clamp(1.8rem, 5vw, 3rem);
    margin-bottom: 0.5rem;
}

.page-intro p {
    color: var(--muted);
}

.btn {
    display: inline-block;
    padding: 0.72rem 1.35rem;
    border-radius: 10px;
    font-weight: 700;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-contrast);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-bg);
    color: var(--secondary-text);
}

.btn-block {
    width: 100%;
}

.form-card,
.portal-card {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.8rem;
}

.portal-card {
    max-width: 520px;
}

.subtitle {
    color: var(--muted);
    margin-bottom: 1.2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.form-group {
    margin-bottom: 0.95rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 0.84rem;
    margin-bottom: 0.33rem;
    color: var(--muted);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.72rem;
    background-color: var(--surface-soft);
    color: var(--text);
}

.template-picker option,
.form-group select option {
    background-color: var(--surface-soft);
    color: var(--text);
}

body[data-template="glass"] .template-picker,
body[data-template="glass"] .form-group select {
    background-color: var(--surface-soft);
    color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
    border-color: var(--primary);
}

.app-form {
    margin-top: 1rem;
}

.divider {
    position: relative;
    margin: 1rem 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border);
    z-index: 1;
}

.divider span {
    position: relative;
    z-index: 2;
    background-color: var(--surface);
    padding: 0 0.75rem;
}

.contact-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.2rem;
}

.contact-form,
.contact-info {
    padding: 1.25rem;
}

.contact-item {
    margin-top: 1rem;
}

.alert {
    padding: 0.8rem 1rem;
    margin: 0.85rem 0;
    border-radius: 10px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.alert-error {
    background-color: var(--error-bg);
    color: var(--error-text);
}

.nexus-app {
    min-height: 420px;
}

.pathway-grid,
.domain-grid,
.linked-assets-grid {
    display: grid;
    gap: 1rem;
}

.pathway-grid,
.domain-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.linked-assets-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.pathway-card,
.domain-card,
.offering-card,
.asset-link-card,
.tech-dependency {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 14px;
    padding: 1rem;
}

.pathway-card,
.domain-card,
.asset-link-card,
.tech-dependency,
.breadcrumb-item,
.back-link,
.nexus-sidebar button {
    cursor: pointer;
}

.pathway-card:hover,
.domain-card:hover,
.asset-link-card:hover,
.tech-dependency:hover {
    border-color: var(--primary);
}

.pathway-card h3,
.domain-card h3,
.offering-card h3,
.offering-card h4,
.asset-link-card h4,
.tech-card h3 {
    margin-bottom: 0.45rem;
}

.pathway-card p,
.domain-card p,
.asset-link-card p,
.tech-card p,
.nexus-muted,
.nexus-subtitle {
    color: var(--muted);
}

.nexus-emphasis {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.nexus-meta {
    margin-top: 0.6rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.nexus-meta-copy {
    margin-top: 0.45rem;
    color: var(--muted);
}

.nexus-subtitle-extended {
    margin-top: 0.55rem;
    max-width: 1040px;
}

.nexus-intro-card {
    margin-top: 0.8rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.nexus-intro-card h4 {
    margin-bottom: 0.35rem;
}

.nexus-intro-card h5 {
    margin-top: 0.65rem;
    margin-bottom: 0.3rem;
    font-size: 0.92rem;
}

.nexus-intro-note {
    margin-top: 0.55rem;
    color: var(--muted);
}

.nexus-list {
    margin: 0.35rem 0 0 1.05rem;
    color: var(--muted);
}

.nexus-list li {
    margin-bottom: 0.32rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.76rem;
    border-radius: 999px;
    padding: 0.28rem 0.75rem;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.nexus-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1rem;
}

.nexus-sidebar {
    padding: 1rem;
    position: sticky;
    top: 88px;
    height: fit-content;
}

.nexus-sidebar h3 {
    margin-bottom: 0.3rem;
}

.nexus-sidebar .offering-menu {
    margin-top: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.offering-menu button {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--text);
    text-align: left;
    font-weight: 600;
    padding: 0.65rem 0.75rem;
}

.offering-menu button.is-selected {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.back-link,
.breadcrumb-item {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-weight: 700;
    padding: 0;
}

.back-link:hover,
.breadcrumb-item:hover {
    color: var(--text);
}

.breadcrumbs {
    margin-bottom: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.nexus-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.1rem;
}

.tech-card {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    margin-top: 0.8rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.tech-field h5 {
    margin-bottom: 0.35rem;
}

.dependency-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.tech-dependency {
    width: 100%;
    text-align: left;
    color: var(--text);
    font: inherit;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 14px;
    padding: 0.9rem;
}

.tech-dependency strong {
    color: var(--text);
    display: block;
    font-size: 1.08rem;
    line-height: 1.35;
}

.tech-dependency .badge {
    margin-top: 0.3rem;
}

.tech-dependency-head {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 0.45rem;
}

.tech-dependency-desc {
    color: var(--muted);
    margin-bottom: 0.45rem;
}

.tech-dependency-stack {
    color: var(--text);
    font-weight: 600;
    font-size: 0.94rem;
}

.tech-dependency:hover,
.tech-dependency:focus {
    border-color: var(--primary);
    outline: none;
}

.tech-section {
    margin-top: 1.1rem;
}

.tech-section h5 {
    margin-bottom: 0.55rem;
    font-size: 1rem;
}

.stack-detail-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.stack-item {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.stack-item-name {
    display: block;
    font-size: 0.96rem;
    margin-bottom: 0.3rem;
    color: var(--text);
}

.stack-item-purpose {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0;
}

.empty-msg {
    color: var(--muted);
    padding: 0.6rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
}

footer {
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 1.4rem 0;
    color: var(--muted);
}

@media (max-width: 980px) {
    nav .container {
        flex-wrap: wrap;
        padding: 0.75rem 20px;
    }

    .nexus-layout {
        grid-template-columns: 1fr;
    }

    .nexus-sidebar {
        position: static;
    }

    .contact-content,
    .form-grid,
    .tech-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    body[data-template="deepTech"] header {
        position: sticky;
        width: 100%;
        height: auto;
    }

    body[data-template="deepTech"] nav .container {
        min-height: 72px;
        padding: 0.65rem 20px;
    }

    body[data-template="deepTech"] .logo {
        border-bottom: 0;
        padding: 0;
    }

    body[data-template="deepTech"] .nav-links {
        flex-direction: row;
        width: 100%;
        overflow-x: auto;
        padding: 0.2rem 0 0;
    }

    body[data-template="deepTech"] .template-picker-wrap {
        width: 100%;
        margin: 0;
        border-top: 0;
        padding-top: 0;
    }

    body[data-template="deepTech"] main,
    body[data-template="deepTech"] footer {
        margin-left: 0;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
        gap: 0.65rem;
        overflow-x: auto;
        padding-bottom: 0.35rem;
    }

    .template-picker-wrap {
        width: 100%;
        justify-content: flex-end;
    }
}