/* Main stylesheet for onprem.ai */

:root {
    --primary: #ffffff;
    --secondary: #a0a0a0;
    --light: #1a1a1a;
    --dark: #0a0a0a;
    --gray: #6c757d;

    --brand-color: #47FFD7;
    --light-body-color: rgba(255, 255, 255, 0.9);

    --bg-primary: #0a0a0a;
    --bg-card: #0a0a0a;
    --bg-elevated: #0a0a0a;
    --bg-surface: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.4);
    --accent: #47FFD7;
    --border-color: rgba(255, 255, 255, 0.1);

    --body-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --heading-font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    --max-width: 1440px;
    --transition-speed: 0.2s;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);

    /* Global horizontal padding - responsive from mobile to desktop */
    --page-padding-x: clamp(4rem, 7vw, 8rem);

    /* Global text padding-top for consistent spacing of first text elements */
    --text-padding-top: clamp(1rem, 2vw, 1.5rem);

    /* H2 title sizing for large variant (centralized for TitlesAndBody & TitlesOnly) */
    --h2-title1-large: 16px;
    --h2-title2-large: 45px;
    --h2-title1-large-mobile: 14px;
    --h2-title2-large-mobile: clamp(24px, 5vw, 36px);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    background-color: var(--bg-primary);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--body-font);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font);
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

h2 {
    font-size: 1.6rem;
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

img {
    max-width: 100%;
    height: auto;
}

ul {
    list-style-position: inside;
    margin-bottom: 1rem;
}

/* Layout */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col {
    flex: 1;
    padding: 0 15px;
}

/* Section styling */
section {
    padding: 2rem 0;
    margin: 2rem 0 2rem 0;
}

section h2 {
    text-align: left;
    margin-bottom: 1.5rem;
}

.section-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem auto;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.pt-1 { padding-top: 0.5rem; }
.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 1.5rem; }
.pt-4 { padding-top: 2rem; }
.pt-5 { padding-top: 3rem; }

.pb-1 { padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 1.5rem; }
.pb-4 { padding-bottom: 2rem; }
.pb-5 { padding-bottom: 3rem; }

/* Header and Navigation */
header.scrolled .nav-links a {
    color: var(--text-primary);
}

header.scrolled .logo {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 900;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    text-decoration: none;
}
.logo:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: opacity var(--transition-speed);
    position: relative;
}

.nav-links a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--brand-color);
    transition: width var(--transition-speed);
}

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

.nav-links a:hover:after {
    width: 100%;
}

/* Hamburger / mobile menu button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-speed);
}

.mobile-menu-btn:hover {
    color: var(--accent);
}

header.scrolled .mobile-menu-btn {
    color: var(--text-primary);
    opacity: 1;
}

/* Hero section */
.hero {
    position: relative;
    min-height: 600px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    color: white;
    margin: 0;
    padding: 0;
}


.hero-content {
    position: relative; 
    z-index: 2;
    max-width: 1400px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Hero description links (platform page) */
.hero__description a {
    color: inherit;
    text-decoration: underline;
}


/* Stats label links */
.stats__label a {
    color: inherit;
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: transparent;
    color: white;
    padding: 3rem 0 1.5rem;
    position: relative;
    z-index: 200;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    color: white;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #aaa;
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    color: #aaa;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 992px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .hero {
        min-height: 60vh;
    }
}

@media (max-width: 768px) {
    section {
        padding: 3rem 0;
    }

    .hero {
        text-align: left;
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 1rem 0;
        background: rgba(10, 10, 10, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }

    .nav-links.active {
        display: flex;
    }

    header.scrolled .nav-links,
    header.scrolled .nav-links.active {
        background: rgba(10, 10, 10, 0.95);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    }

    .mobile-menu-btn {
        display: block;
    }

    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--bg-primary);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateX(-100%);
        transition: transform var(--transition-speed);
        z-index: 1001;
    }

    .mobile-menu.active {
        transform: translateX(0);
    }

    .mobile-menu a {
        color: white;
        font-size: 1.5rem;
    }

    .close-menu {
        position: absolute;
        top: 2rem;
        right: 2rem;
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
    }
}

@media (max-width: 576px) {
    .container {
        width: 95%;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Mobile adjustments: two-line left-aligned typewriter headline */
    .typewriter-headline {
        /* Allow wrapping so the fixed and dynamic parts can split across lines */
        white-space: normal;
        /* Align text to the left on very small screens */
        /* text-align: left; */
        /* Reduce oversized font for better fit */
        font-size: 5rem !important;
        padding-bottom: 3rem !important;
    }

    /* Force the dynamic part onto its own line */
    .typewriter-headline #typewriter-target::before {
        content: "\A";   /* newline */
        white-space: pre; /* preserve the newline */
    }

    /* Higher specificity so it wins over the global !important */
    .hero .typewriter-headline {
        font-size: 5rem !important;
    }
}

#regional-map {
    width: 100vw !important;
    max-width: 100vw !important;
    overflow-x: hidden;
}

/* Regional map labels are injected as maplibre DOM markers */
.regional-map-label {
    font-family: 'DM Mono', monospace;
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.55);
    text-shadow: 0 0 6px rgba(10, 10, 10, 0.9);
    white-space: nowrap;
    pointer-events: none;
}

.regional-map-label--home {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #47FFD7;
}

.regional-map-label--home::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #47FFD7;
}

/* Typewriter headline */
.typewriter-headline {
    white-space: nowrap;
    font-size: 8rem !important;
    opacity: 0.6;
}

.cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--brand-color);
    margin-left: 6px;
    transform: translateY(10px);
    animation: blink 0.7s steps(1) infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

#typewriter-target {
    color: var(--brand-color);
    /* text-decoration: underline 1px;
    text-underline-offset: 10px; */
}

/* Language switcher */
.lang-switcher {
    margin-left: 1rem;
}

.lang-switcher select {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    cursor: pointer;
    font-size: 1rem;
    appearance: none; /* hide native arrow */
    padding-right: 1.2rem; /* space for custom caret */
    position: relative;
}

/* caret using pseudo */
.lang-switcher select::-ms-expand {
    display: none;
}

.lang-switcher select:focus {
    outline: none;
}

header.scrolled .lang-switcher select {
    color: var(--text-primary);
}

.lang-switcher option {
    color: #000; /* ensure readability in dropdown list */
}

@media (max-width: 768px) {
    .lang-switcher {
        margin-left: 0.5rem;
    }
    
    :root {
        --page-padding-x: clamp(1.5rem, 5vw, 2.5rem);
    }
}

@media (min-width: 769px) {
    :root {
        --page-padding-x: clamp(4rem, 7vw, 8rem);
    }
}

/* Scroll entrance animation */
section.will-animate {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}
section.will-animate.has-animated {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    section.will-animate {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Pricing page: header CTA (child component content, styled globally per CLAUDE.md) */
.pricing__header-cta {
    justify-self: start;
    margin-top: clamp(0.5rem, 1.5vw, 0.75rem);
}

/* Price request form: validation errors are injected by JS at runtime */
.request-form .form-error {
    color: #ff6b6b;
    font-size: 13px;
    margin-top: 0.5rem;
}

/* Kostenrechner: table rows, tooltip content and demand line are injected
   by JS at runtime, so their styles live here (see CLAUDE.md) */
.calc__table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.calc__table th {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    text-align: right;
    padding: 0 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    white-space: nowrap;
}

.calc__table td {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    text-align: right;
    padding: 11px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
}

.calc__table th:first-child,
.calc__table td:first-child {
    text-align: left;
    padding-left: 4px;
}

.calc__table th:last-child,
.calc__table td:last-child {
    padding-right: 4px;
}

.calc__table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.025);
}

.calc__table tbody tr:last-child td {
    border-bottom: none;
    color: #ffffff;
    font-weight: 500;
}

.calc__table td:first-child {
    color: rgba(255, 255, 255, 0.45);
}

.calc__tooltip .tt-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calc__tooltip .tt-swatch {
    display: inline-block;
    width: 12px;
    border-top: 2px solid;
}

.calc__tooltip .tt-swatch--onprem { border-color: #47FFD7; }
.calc__tooltip .tt-swatch--cloud { border-color: rgba(255, 255, 255, 0.55); border-top-style: dashed; }
.calc__tooltip .tt-swatch--residual { border-color: rgba(255, 255, 255, 0.3); border-top-style: dotted; }

.calc__demand strong {
    color: #ffffff;
    font-weight: 500;
}

/* Software page: placeholder inside the dashboard screen frame loses
   its own dashed frame (slot content, styled here per CLAUDE.md).
   Doubled class beats the scoped component selector. */
.dashboard__screen .img-placeholder.img-placeholder {
    border: none;
    border-radius: 0;
}

/* HexBoard (platform page): hex cells are injected by JS at runtime,
   so their styles live here (see CLAUDE.md) */
.hexframe {
    position: absolute;
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    background: rgba(255, 255, 255, 0.25);
}

.hexframe .hm {
    position: absolute;
    inset: 1.5px;
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    overflow: hidden;
    background: #0e1210;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hexlogo {
    width: 38%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.hexlogo svg {
    width: 100%;
    height: 100%;
}

.hexlogo--mono {
    color: #ffffff;
}

.hexlogo--mono svg {
    fill: currentColor;
}

.hexlbl {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
}

/* Region hex board: real map tiles per cell (runtime-injected).
   Maps render black and white; color appears on hover. The contrast
   boost keeps the pale basemap readable in grayscale. */
.hexframe--map .hm img {
    position: absolute;
    max-width: none;
    display: block;
    filter: grayscale(100%) contrast(1.1) brightness(0.95);
    transition: filter 0.3s ease;
}

.hexframe--map:hover .hm img {
    filter: none;
}

/* Platform vertical-integration stack: icons arrive via set:html, so the
   svg cannot be reached by the component's scoped styles */
.stack__icon svg {
    width: 100%;
    height: 100%;
}

/* Links inside TitlesAndBody body copy (slot content isn't scoped to the component) */
.titles-and-body__body a {
  color: inherit;
  text-decoration: underline;
}

/* Hex board provider hover: mint hex outline on hoverable cells, provider
   name emphasized in the caption line (label is runtime-injected) */
.hexframe--info:hover {
    background: rgba(71, 255, 215, 0.55);
}

.hexlbl strong {
    color: var(--accent, #47FFD7);
    font-weight: 500;
}

/* Security request form: elements created by script or injected via set:html,
   which the component's scoped styles cannot reach */
.sec-form__consent a {
  color: var(--text-primary, #ffffff);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sec-form__error {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--danger, #ff5a5a);
}

.sec-form__success {
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--accent, #47FFD7);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary, #ffffff);
}
