/* ==========================================================================
   CriseStudios – Design System
   Shared tokens, base styles and components for all public pages.
   Page stylesheets build on these tokens instead of hard-coding values.
   ========================================================================== */

/* Self-hosted (DSGVO): no requests to Google Fonts. License: ../fonts/OFL.txt */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-display: swap;
    font-weight: 300 700;
    src: url("../fonts/space-grotesk-latin-wght-normal.b75d397ffd1c.woff2") format('woff2-variations'),
         url("../fonts/space-grotesk-latin-wght-normal.b75d397ffd1c.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens ------------------------------------------------------------ */
:root {
    /* Brand */
    --accent: #06b6d4;
    --accent-strong: #22d3ee;
    --accent-soft: #67e8f9;
    --accent-dark: #0891b2;
    --accent-rgb: 6, 182, 212;
    --accent-2: #a855f7;
    --accent-2-rgb: 168, 85, 247;
    --gradient-brand: linear-gradient(100deg, #18c8f7 0%, #458dff 48%, #9c4df2 100%);
    --gradient-button: linear-gradient(105deg, #0aa5de 0%, #12c6d9 100%);

    /* Surfaces */
    --bg: #050b1a;
    --bg-elevated: #0a1226;
    --surface: rgba(15, 23, 42, 0.72);
    --surface-solid: #0f172a;
    --surface-2: rgba(255, 255, 255, 0.035);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --border-accent: rgba(6, 182, 212, 0.38);

    /* Text */
    --text: #f5f8ff;
    --text-muted: rgba(226, 234, 248, 0.72);
    --text-subtle: rgba(226, 234, 248, 0.54);

    /* Status */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Shape & rhythm */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    --shadow-accent: 0 18px 40px rgba(6, 182, 212, 0.12);
    --container: 1240px;
    --gutter: 2rem;
    --font: 'Space Grotesk', "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;

    /* Legacy aliases (kept for older stylesheets) */
    --footer-height: 60px;
    --primary-color: var(--surface-solid);
    --secondary-color: #ffffff;
    --background-color: var(--bg);
    --text-color: var(--text);
    --box-shadow: var(--shadow);
    --border-radius: var(--radius);
}

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

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    min-width: 100dvw;
    min-height: 100dvh;
    overflow-x: hidden;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#main_wrapper {
    position: relative;
    width: 100dvw;
    min-height: calc(100dvh - var(--navbar-height) - 40px);
    overflow-y: auto;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(6, 182, 212, 0.08), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 100%);
}

a {
    color: var(--accent-strong);
    text-decoration: none !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font);
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

button, input, select, textarea {
    font-family: inherit;
}

::selection {
    background: rgba(var(--accent-rgb), 0.35);
    color: #fff;
}

:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 2px;
}

img {
    max-width: 100%;
}

/* Components set `display`, which would otherwise override the hidden attribute */
[hidden] {
    display: none !important;
}

/* --- Layout ------------------------------------------------------------ */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section {
    padding: clamp(3.5rem, 7vw, 6rem) 0;
}

@media (max-width: 760px) {
    :root {
        --gutter: 1.25rem;
    }
}

/* --- Page hero (shared header for all inner pages) --------------------- */
.page-hero {
    position: relative;
    padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(2.5rem, 5vw, 3.5rem);
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(ellipse 60% 120% at 0% 0%, rgba(var(--accent-rgb), 0.12), transparent 60%),
        radial-gradient(ellipse 50% 100% at 100% 0%, rgba(var(--accent-2-rgb), 0.08), transparent 60%);
}

.page-hero__inner {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
    animation: ds-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.page-hero__inner > * {
    max-width: 760px;
}

.page-hero__breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-subtle);
}

.page-hero__breadcrumb a {
    color: var(--text-muted);
}

.page-hero__breadcrumb a:hover {
    color: var(--text);
}

.page-hero__breadcrumb i {
    font-size: 0.65rem;
}

.page-hero h1 {
    font-size: clamp(2.2rem, 4.6vw, 3.6rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.page-hero h1 .gradient,
.text-gradient {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-hero__lead {
    font-size: clamp(1.02rem, 1.3vw, 1.15rem);
    line-height: 1.75;
    color: var(--text-muted);
}

.page-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-subtle);
}

.page-hero__meta i {
    margin-right: 0.4rem;
    color: var(--accent-strong);
}

.page-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2rem;
}

/* --- Kicker / eyebrow -------------------------------------------------- */
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

/* --- Section head ------------------------------------------------------ */
.section-head {
    max-width: 720px;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-head--center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.section-head h2 {
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.025em;
    margin-bottom: 0.85rem;
}

.section-head p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-muted);
}

/* --- Buttons ----------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.8rem 1.4rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: #fff;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
    color: #fff;
    transform: translateY(-1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--gradient-button);
    border-color: transparent;
    box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.25);
}

.btn-primary:hover {
    background: var(--gradient-button);
    box-shadow: 0 12px 30px rgba(var(--accent-rgb), 0.38);
}

.btn-secondary,
.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-strong);
}

.btn-secondary:hover,
.btn-ghost:hover {
    background: rgba(var(--accent-rgb), 0.08);
    border-color: var(--border-accent);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

.btn-sm {
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 1rem 1.7rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--accent-strong);
}

.link-arrow i {
    transition: transform 0.2s ease;
}

.link-arrow:hover i {
    transform: translateX(4px);
}

/* --- Cards ------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
}

.card--interactive {
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card--interactive:hover {
    transform: translateY(-3px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-accent);
}

.icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    font-size: 1.2rem;
    color: var(--accent-strong);
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-2-rgb), 0.14));
    border: 1px solid rgba(var(--accent-rgb), 0.25);
}

/* --- Tags -------------------------------------------------------------- */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--accent-soft);
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
}

/* --- Forms ------------------------------------------------------------- */
.field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.15rem;
}

.field-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-control::placeholder {
    color: var(--text-subtle);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

/* --- CTA panel --------------------------------------------------------- */
.cta-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2rem;
    align-items: center;
    padding: clamp(2rem, 5vw, 3.25rem);
    border-radius: calc(var(--radius-lg) + 4px);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    background:
        radial-gradient(circle at 0% 0%, rgba(var(--accent-rgb), 0.2), transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(var(--accent-2-rgb), 0.18), transparent 45%),
        rgba(12, 19, 38, 0.9);
}

.cta-panel h2 {
    margin-bottom: 0.6rem;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.cta-panel p {
    max-width: 620px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.cta-panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

@media (max-width: 760px) {
    .cta-panel {
        grid-template-columns: 1fr;
    }

    .cta-panel__actions .btn {
        width: 100%;
    }
}

/* --- Empty state ------------------------------------------------------- */
.empty-block {
    max-width: 520px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-block .icon-badge {
    width: 64px;
    height: 64px;
    margin-bottom: 1.25rem;
    font-size: 1.5rem;
}

.empty-block h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

/* --- Scroll reveal (content stays visible without JS) ------------------ */
.js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0s);
}

.js .reveal.is-visible {
    opacity: 1;
    transform: none;
}

@keyframes ds-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-hero__inner {
        animation: none;
    }

    .js .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* --- Loader ------------------------------------------------------------ */
.lds-ellipsis {
    color: var(--accent);
}

.lds-ellipsis,
.lds-ellipsis div {
    box-sizing: border-box;
}

.lds-ellipsis {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 40px;
}

.lds-ellipsis div {
    position: absolute;
    top: 13.33333px;
    width: 13.33333px;
    height: 13.33333px;
    border-radius: 50%;
    background: currentColor;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.lds-ellipsis div:nth-child(1) {
    left: 8px;
    animation: lds-ellipsis1 0.6s infinite;
}

.lds-ellipsis div:nth-child(2) {
    left: 8px;
    animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(3) {
    left: 32px;
    animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(4) {
    left: 56px;
    animation: lds-ellipsis3 0.6s infinite;
}

@keyframes lds-ellipsis1 {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

@keyframes lds-ellipsis3 {
    0% { transform: scale(1); }
    100% { transform: scale(0); }
}

@keyframes lds-ellipsis2 {
    0% { transform: translate(0, 0); }
    100% { transform: translate(24px, 0); }
}

.lds-ellipsis.small {
    transform: scale(70%);
}
