/* ═══════════════════════════════════════════════════
   kariws.com — Design System
   ═══════════════════════════════════════════════════ */

:root {
    --color-primary: #6c3cff;
    --color-primary-dim: rgba(108, 60, 255, 0.15);
    --color-primary-glow: rgba(108, 60, 255, 0.4);
    --color-secondary: #03dac6;
    --color-bg: #0a0a0f;
    --color-surface: #12121a;
    --color-surface-raised: #1a1a26;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-text: #ffffff;
    --color-text-secondary: rgba(255, 255, 255, 0.55);
    --color-text-tertiary: rgba(255, 255, 255, 0.3);
    --font-body: "aaux-next", "Inter", system-ui, -apple-system, sans-serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --container-max: 1140px;
    --header-height: 80px;
}

/* ── Reset ── */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::selection {
    background: var(--color-primary);
    color: var(--color-text);
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── Utilities ── */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Focus ── */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ── Header ── */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 var(--color-border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
}

.site-logo {
    display: flex;
    align-items: center;
    z-index: 101;
}

.site-logo img {
    height: 38px;
    width: auto;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--color-text);
}

.nav-link--email {
    color: var(--color-text-tertiary);
    font-weight: 400;
    font-size: 0.8rem;
}

.nav-link--email:hover {
    color: var(--color-primary);
}

.nav-link--lang {
    color: var(--color-text-tertiary);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.2em 0.55em;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-link--lang:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 2rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-text);
    box-shadow: 0 0 0 0 var(--color-primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--color-primary-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-ghost:hover {
    color: var(--color-text);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

/* ── Hero ── */

.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

/* Animated gradient orbs */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    will-change: transform;
}

.hero-orb--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
    top: -10%;
    right: -5%;
    animation: orbFloat1 20s ease-in-out infinite;
}

.hero-orb--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(3, 218, 198, 0.4) 0%, transparent 70%);
    bottom: -15%;
    left: -10%;
    animation: orbFloat2 25s ease-in-out infinite;
}

.hero-orb--3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(108, 60, 255, 0.6) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-80px, 60px) scale(1.1); }
    66% { transform: translate(40px, -40px) scale(0.95); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(60px, -80px) scale(1.05); }
    66% { transform: translate(-30px, 50px) scale(0.9); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(-50%, 0) scale(1); }
    50% { transform: translate(-50%, -60px) scale(1.15); }
}

/* Subtle grid overlay */
.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 820px;
    padding: 0 2rem;
    animation: heroFadeIn 1s var(--ease-out) 0.2s both;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: clamp(2.2rem, 6vw, 4.2rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, #fff 60%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 400;
    color: var(--color-text-secondary);
    max-width: 620px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Scroll hint */
.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-hint-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--color-primary), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: scaleY(1); }
    50% { opacity: 0.8; transform: scaleY(1.2); }
}

/* ── About Section ── */

.about {
    padding: 8rem 0 4rem;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.about-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2.5rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.about-card:hover {
    border-color: rgba(108, 60, 255, 0.2);
    box-shadow: 0 0 40px rgba(108, 60, 255, 0.06);
}

.about-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--color-primary-dim);
    margin-bottom: 1.5rem;
    color: var(--color-primary);
}

.about-card-icon svg {
    width: 22px;
    height: 22px;
}

.about-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.about-card p {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

/* ── Section Headers ── */

.section-header {
    margin-bottom: 3.5rem;
    max-width: 600px;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

/* ── Services Section ── */

.services {
    padding: 4rem 0 8rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.service-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s var(--ease-out);
    cursor: default;
}

.service-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.service-card--primary {
    border-color: rgba(108, 60, 255, 0.12);
    background: linear-gradient(135deg, var(--color-surface) 0%, rgba(108, 60, 255, 0.04) 100%);
}

.service-card--primary:hover {
    border-color: rgba(108, 60, 255, 0.3);
    box-shadow: 0 20px 40px rgba(108, 60, 255, 0.1);
}

.service-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--color-primary-dim);
    margin-bottom: 1.25rem;
    color: var(--color-primary);
}

.service-card-icon svg {
    width: 20px;
    height: 20px;
}

.service-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.service-card p {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* ── Contact Section ── */

.contact {
    padding: 8rem 0;
    background:
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(108, 60, 255, 0.08) 0%, transparent 60%),
        var(--color-surface);
}

.contact-inner {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.contact-header {
    margin-bottom: 2.5rem;
}

.contact-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.contact-subtitle {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.contact-form[hidden] {
    display: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    width: 100%;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-tertiary);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    background: rgba(255, 255, 255, 0.07);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form .btn {
    width: 100%;
    margin-top: 0.25rem;
}

/* Toggle group */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toggle-label {
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.toggle-track {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 4px;
}

.toggle-btn {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.5rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--color-text-tertiary);
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.toggle-btn.active {
    color: var(--color-text);
    font-weight: 600;
}

.toggle-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc((100% - 8px) / 3);
    height: calc(100% - 8px);
    background: var(--color-primary);
    border-radius: 6px;
    transition: transform 0.25s var(--ease-out);
    pointer-events: none;
    z-index: 1;
}

/* Consent */
.form-group-consent {
    display: flex;
    align-items: flex-start;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-tertiary);
    cursor: pointer;
    line-height: 1.5;
}

.consent-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    flex-shrink: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.consent-label a {
    color: var(--color-text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.consent-label a:hover {
    color: var(--color-text);
}

/* Form success */
.form-success {
    text-align: center;
    padding: 3rem 0;
}

.form-success-icon {
    color: var(--color-secondary);
    margin-bottom: 1rem;
}

.form-success-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.form-success-text {
    font-size: 1rem;
    color: var(--color-text-secondary);
}

/* ── Footer ── */

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 2.5rem 0;
    background: var(--color-bg);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-logo img {
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.footer-logo:hover img {
    opacity: 0.7;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
}

.footer-links a {
    color: var(--color-text-tertiary);
    transition: color 0.2s ease;
}

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

.footer-copyright {
    font-size: 0.7rem;
    color: var(--color-text-tertiary);
}

.site-footer .footer-address {
    font-style: normal;
    font-size: 0.7rem;
    color: var(--color-text-tertiary);
    line-height: 1.4;
}

/* ── Cookie Banner ── */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--color-border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin: 0;
}

.cookie-banner a {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.btn-cookie {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cookie-accept {
    background: var(--color-primary);
    color: var(--color-text);
}

.btn-cookie-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--color-primary-glow);
}

.btn-cookie-decline {
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.btn-cookie-decline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
}

/* ── Scroll Reveal ── */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.services-grid .reveal:nth-child(1) { transition-delay: 0s; }
.services-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.services-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.services-grid .reveal:nth-child(4) { transition-delay: 0.18s; }
.services-grid .reveal:nth-child(5) { transition-delay: 0.24s; }
.services-grid .reveal:nth-child(6) { transition-delay: 0.30s; }
.services-grid .reveal:nth-child(7) { transition-delay: 0.36s; }

.about-grid .reveal:nth-child(2) { transition-delay: 0.1s; }

/* ── Responsive ── */

/* Mobile nav overlay */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        position: fixed;
        inset: 0;
        background: rgba(10, 10, 15, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .site-nav.open {
        opacity: 1;
        visibility: visible;
    }

    .site-nav .nav-link {
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--color-text);
    }

    .site-nav .nav-link--email {
        font-size: 0.9rem;
        font-weight: 400;
        color: var(--color-text-tertiary);
        margin-top: 1rem;
    }

    .site-nav .nav-link--lang {
        font-size: 0.9rem;
        margin-top: 0.5rem;
    }

    .hero-title {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .hero-title br {
        display: none;
    }

    .hero-subtitle {
        font-size: clamp(0.9rem, 3.5vw, 1.05rem);
    }

    .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-actions .btn {
        width: 100%;
        max-width: 300px;
    }

    .about {
        padding: 5rem 0 2rem;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about-card {
        padding: 2rem;
    }

    .services {
        padding: 2rem 0 5rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    .contact {
        padding: 5rem 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevents iOS auto-zoom */
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .hero-orb--1 {
        width: 350px;
        height: 350px;
    }

    .hero-orb--2 {
        width: 300px;
        height: 300px;
    }

    .hero-orb--3 {
        width: 200px;
        height: 200px;
    }

    .container {
        padding: 0 1.25rem;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(1.6rem, 9vw, 2.4rem);
    }

    .about-card {
        padding: 1.5rem;
    }

    .about-card h3 {
        font-size: 1.1rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .toggle-btn {
        font-size: 0.78rem;
        padding: 0.5rem 0.3rem;
    }

    .contact-title {
        font-size: 1.4rem;
    }
}

/* Large desktop */
@media (min-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
