/* ==========================================================================
   KURIA — shared styles
   Used by default.php, privacy-policy.html and terms-of-service.html
   ========================================================================== */

:root {
    --bg: #070707;
    --fg: #f4f4f2;
    --fg-muted: #a6a6a3;
    --fg-dim: #6f6f6c;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);

    --accent: #93F9B9;
    --accent-dark: #65C987;
    --accent-ink: #062114;
    --accent-soft: rgba(147, 249, 185, 0.10);
    --accent-glow: rgba(147, 249, 185, 0.25);

    --font-display: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --radius: 20px;
    --radius-sm: 14px;
    --gutter: clamp(1.25rem, 5vw, 4rem);
    --max: 1160px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
    color-scheme: dark;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--fg);
    background-color: var(--bg);
    background-image:
        radial-gradient(70rem 42rem at 50% -12rem, rgba(147, 249, 185, 0.11), transparent 60%),
        radial-gradient(34rem 34rem at 88% 18%, rgba(147, 249, 185, 0.05), transparent 70%);
    background-repeat: no-repeat;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fine grain overlay. Rasterised once as a tile, so cheap on mobile. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.035;
    pointer-events: none;
    z-index: 50;
}

h1, h2, h3, p, ul {
    margin: 0;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

.container {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
}

.eyebrow {
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent-dark);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem var(--gutter);
    padding-top: max(0.75rem, env(safe-area-inset-top));
    background: rgba(7, 7, 7, 0.72);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 44px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.2em;
    color: var(--accent);
    text-decoration: none;
}

.brand svg {
    width: 22px;
    height: 22px;
    flex: none;
}

.site-nav {
    display: flex;
    gap: 0.15rem;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--fg-muted);
    text-decoration: none;
    transition: color 0.25s ease, background-color 0.25s ease;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: clamp(4.5rem, 14vh, 9rem) var(--gutter) clamp(3.5rem, 9vh, 6rem);
    text-align: center;
}

.wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3.6rem, 16vw, 10rem);
    line-height: 1;
    letter-spacing: 0.14em;
    text-indent: 0.14em; /* optically centre: compensates trailing letter-spacing */
    background: linear-gradient(100deg, var(--accent) 0%, #cbffe1 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.tagline {
    max-width: 34ch;
    font-size: clamp(1.2rem, 1rem + 1.6vw, 1.9rem);
    font-weight: 300;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: transform 0.4s var(--ease), background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn-ghost {
    color: var(--fg);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.03);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
    padding: clamp(3rem, 8vh, 6rem) var(--gutter);
    scroll-margin-top: 4rem; /* keep anchored headings clear of the sticky header */
}

.section-head {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.section-head h2 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   Projects
   -------------------------------------------------------------------------- */

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

@media (min-width: 640px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    height: 100%;
    padding: clamp(1.4rem, 3vw, 2.25rem);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
    color: inherit;
    text-decoration: none;
    transition: transform 0.5s var(--ease), border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-dim);
}

.project-card h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.project-card h3 svg {
    flex: none;
    width: 1.1em;
    height: 1.1em;
    color: var(--accent);
    transition: transform 0.4s var(--ease);
}

.project-card p {
    flex: 1;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--fg-muted);
}

.project-url {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.contact-list li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.contact-list .label {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--fg-dim);
}

.contact-list a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--fg);
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color 0.25s ease;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding: 1.25rem var(--gutter);
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--fg-dim);
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
}

.site-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--fg-muted);
    text-decoration: none;
    transition: color 0.25s ease;
}

/* --------------------------------------------------------------------------
   Legal pages
   -------------------------------------------------------------------------- */

.legal {
    padding: clamp(2.5rem, 7vh, 5rem) var(--gutter);
}

.legal .container {
    max-width: 760px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    margin-bottom: 1.5rem;
    font-family: var(--font-display);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--fg-muted);
    text-decoration: none;
    transition: color 0.25s ease;
}

.back-link svg {
    width: 1em;
    height: 1em;
}

.legal h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0.5rem 0 0.75rem;
}

.legal .updated {
    margin-bottom: 2.5rem;
    font-size: 0.9rem;
    color: var(--fg-dim);
}

.legal h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent);
    margin: 2.25rem 0 0.75rem;
}

.legal p,
.legal li {
    color: var(--fg-muted);
}

.legal p {
    margin-bottom: 1rem;
}

.legal ul {
    padding-left: 1.4rem;
    margin-bottom: 1rem;
}

.legal li {
    margin-bottom: 0.4rem;
}

.legal strong {
    font-weight: 500;
    color: var(--fg);
}

.legal a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(147, 249, 185, 0.4);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.25s ease;
}

/* --------------------------------------------------------------------------
   Hover — only on devices that actually hover
   -------------------------------------------------------------------------- */

@media (hover: hover) {
    .site-nav a:hover {
        color: var(--fg);
        background-color: rgba(255, 255, 255, 0.05);
    }

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

    .btn-ghost:hover {
        border-color: rgba(255, 255, 255, 0.32);
        background: rgba(255, 255, 255, 0.06);
        transform: translateY(-2px);
    }

    .project-card:hover {
        transform: translateY(-4px);
        border-color: rgba(147, 249, 185, 0.35);
        background: linear-gradient(180deg, rgba(147, 249, 185, 0.07), rgba(255, 255, 255, 0.02));
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    }

    .project-card:hover h3 svg {
        transform: translate(3px, -3px);
    }

    .contact-list a:hover,
    .site-footer a:hover,
    .back-link:hover {
        color: var(--accent);
    }

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

/* --------------------------------------------------------------------------
   Entrance animation
   -------------------------------------------------------------------------- */

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

.rise {
    animation: rise 1s var(--ease) both;
}

.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.15s; }
.rise-3 { animation-delay: 0.3s; }
.rise-4 { animation-delay: 0.45s; }

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

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* --------------------------------------------------------------------------
   Small screens
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
    .brand {
        font-size: 0.92rem;
    }

    .site-nav a {
        padding-inline: 0.7rem;
        font-size: 0.84rem;
    }

    .hero-actions .btn {
        flex: 1 1 100%;
    }

    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
