/* ==========================================================================
   SensAble Platform Stylesheet
   Dezentes, warm-akademisches Erscheinungsbild
   Strukturierte Typografie, WCAG 2.1 AA Konformität
   ========================================================================== */

:root {
    --color-primary: #0b2341;
    --color-primary-light: #16365c;
    --color-accent: #1e5aa0;
    --color-accent-hover: #144277;
    --color-accent-subtle: #f1f5fa;

    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-surface: #f1f5f9;
    --bg-muted: #e2e8f0;

    --border-subtle: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-focus: #1e5aa0;

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --badge-bg-live: #f0fdf4;
    --badge-text-live: #166534;
    --badge-border-live: #bbf7d0;

    --badge-bg-beta: #f8fafc;
    --badge-text-beta: #334155;
    --badge-border-beta: #cbd5e1;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(11, 35, 65, 0.05);
    --shadow-md: 0 4px 12px rgba(11, 35, 65, 0.08);
    --shadow-lg: 0 12px 24px rgba(11, 35, 65, 0.12);

    --max-width: 1180px;
}

body.dark-mode {
    --bg-page: #0a1120;
    --bg-card: #111c2e;
    --bg-surface: #17243b;
    --bg-muted: #1e304d;

    --border-subtle: #1e2f47;
    --border-medium: #2c4263;
    --border-focus: #60a5fa;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --color-primary: #1e3a66;
    --color-primary-light: #2b4f85;
    --color-accent: #60a5fa;
    --color-accent-hover: #93c5fd;
    --color-accent-subtle: #13233c;

    --badge-bg-live: #064e3b;
    --badge-text-live: #bbf7d0;
    --badge-border-live: #059669;

    --badge-bg-beta: #1e293b;
    --badge-text-beta: #cbd5e1;
    --badge-border-beta: #334155;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.6);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Header */
.site-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-combo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.brand-combo:hover {
    text-decoration: none;
}

.brand-logo-img {
    width: 40px;
    height: 40px;
    display: block;
    border-radius: var(--radius-sm);
}

.brand-details h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
    letter-spacing: -0.015em;
}

body.dark-mode .brand-details h1 {
    color: var(--text-primary);
}

.brand-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-item {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.nav-item:hover {
    color: var(--color-accent);
    background-color: var(--color-accent-subtle);
    text-decoration: none;
}

.nav-item.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-accent);
    border-radius: 0;
}

body.dark-mode .nav-item.active {
    color: #ffffff;
}

.theme-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: all 0.15s ease;
}

.theme-btn:hover {
    background-color: var(--border-medium);
    color: var(--text-primary);
}

.theme-btn svg {
    width: 18px;
    height: 18px;
}

/* Landing Page Hero */
.intro-hero {
    max-width: var(--max-width);
    margin: 40px auto 0;
    padding: 0 24px;
}

.intro-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 48px;
    box-shadow: var(--shadow-sm);
}

.institution-note {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-accent);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.intro-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.3;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

body.dark-mode .intro-title {
    color: var(--text-primary);
}

.intro-text {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 860px;
    line-height: 1.7;
    margin-bottom: 28px;
}

.intro-cta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

/* Strands */
.strands-section {
    max-width: var(--max-width);
    margin: 48px auto;
    padding: 0 24px;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

body.dark-mode .section-title {
    color: var(--text-primary);
}

.strands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.strand-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.strand-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 10px;
}

body.dark-mode .strand-card h3 {
    color: var(--text-primary);
}

.strand-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.strand-tools {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px dashed var(--border-subtle);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.strand-tools strong {
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

/* Catalog Page */
.catalog-container {
    max-width: var(--max-width);
    margin: 32px auto 64px;
    padding: 0 24px;
}

.catalog-header {
    margin-bottom: 24px;
}

.catalog-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 6px;
}

body.dark-mode .catalog-header h2 {
    color: var(--text-primary);
}

.catalog-header p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.group-separator {
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-subtle);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.group-separator h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

body.dark-mode .group-separator h3 {
    color: var(--text-primary);
}

.group-separator span {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.filter-bar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.filter-btn {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    transition: all 0.15s ease;
}

.filter-btn:hover {
    color: var(--color-accent);
    border-color: var(--border-medium);
}

.filter-btn.active {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

body.dark-mode .filter-btn.active {
    background-color: var(--color-accent);
    color: #0b1727;
    border-color: var(--color-accent);
}

/* Tool Cards mit echten Screenshots */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 28px;
}

.tool-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.card-screenshot-frame {
    height: 185px;
    background-color: #0b1120;
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-screenshot-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.2s ease;
}

.tool-card:hover .card-screenshot-frame img {
    transform: scale(1.02);
}

.screenshot-tag {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(11, 23, 40, 0.85);
    backdrop-filter: blur(4px);
    color: #e2e8f0;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-content {
    padding: 20px 22px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tool-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.tool-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--badge-border-beta);
    background-color: var(--badge-bg-beta);
    color: var(--badge-text-beta);
}

.tool-badge.live {
    border-color: var(--badge-border-live);
    background-color: var(--badge-bg-live);
    color: var(--badge-text-live);
}

.tool-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.3;
    margin-bottom: 4px;
}

body.dark-mode .tool-title {
    color: var(--text-primary);
}

.tool-subtitle {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 12px;
}

.tool-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.tool-specs {
    font-size: 0.78125rem;
    color: var(--text-muted);
    background-color: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 16px;
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

/* Buttons */
.btn {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
    border: 1px solid var(--color-primary);
}

.btn-primary:hover {
    background-color: var(--color-primary-light);
    color: #ffffff;
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    background-color: var(--bg-muted);
    color: var(--text-primary);
    text-decoration: none;
}

/* Modaler App-Player & Detail-Dialog */
.app-modal {
    width: 94vw;
    max-width: 1200px;
    height: 88vh;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-lg);
    margin: auto;
    padding: 0;
    overflow: hidden;
    flex-direction: column;
}

.app-modal[open] {
    display: flex;
}

.app-modal::backdrop {
    background-color: rgba(11, 35, 65, 0.6);
    backdrop-filter: blur(2px);
}

.modal-bar {
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-bar h3 {
    font-size: 1rem;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-btn {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 0.75rem;
}

.modal-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.modal-body-stage {
    flex: 1;
    background-color: #000000;
}

.modal-body-stage iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.doc-modal {
    width: 90vw;
    max-width: 800px;
    max-height: 82vh;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background-color: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    margin: auto;
    padding: 0;
    overflow: hidden;
    flex-direction: column;
}

.doc-modal[open] {
    display: flex;
}

.doc-modal::backdrop {
    background-color: rgba(11, 35, 65, 0.6);
}

.doc-body {
    padding: 24px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.65;
}

.doc-body h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 18px 0 8px;
}

body.dark-mode .doc-body h4 {
    color: var(--color-accent);
}

.doc-body ul {
    padding-left: 20px;
    margin-bottom: 14px;
}

.doc-body li {
    margin-bottom: 6px;
    color: var(--text-secondary);
}

/* Footer */
.site-footer {
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    padding: 32px 0 24px;
    margin-top: auto;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.footer-links a {
    color: var(--text-secondary);
    margin-left: 16px;
}

.footer-links a:hover {
    color: var(--color-accent);
}

@media (max-width: 768px) {
    .intro-card {
        padding: 28px 20px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .nav-group {
        width: 100%;
        justify-content: space-between;
    }
}
