/* =========================================
   BIGSIAM — stylesheet
   Monochrome. Mobile-first. No frameworks.
   ========================================= */

:root {
    /* Color — single source of truth */
    --bg: #ffffff;
    --bg-alt: #fafafa;
    --fg: #0a0a0a;
    --fg-soft: #404040;
    --muted: #737373;
    --border: #e7e7e7;
    --accent: #0a0a0a;

    /* Type scale */
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Spacing scale (multiples of 8) */
    --s1: 8px;
    --s2: 16px;
    --s3: 24px;
    --s4: 32px;
    --s5: 48px;
    --s6: 64px;
    --s7: 96px;
    --s8: 128px;

    /* Layout */
    --maxw: 1080px;
    --radius: 8px;
}

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

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

body {
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.65;
    color: var(--fg);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

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

/* --- Layout helpers --- */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding-left: var(--s3);
    padding-right: var(--s3);
}

.section {
    padding-top: var(--s7);
    padding-bottom: var(--s7);
}

.section--alt {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.divider {
    height: 1px;
    background: var(--border);
    border: 0;
    margin: 0;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.h-hero {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    max-width: 16ch;
    color: #ffffff;
}

.h-section {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: var(--s3);
}

.h-sub {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: var(--s1);
}

.lead {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    color: var(--fg-soft);
    max-width: 56ch;
}

.muted {
    color: var(--muted);
}

p {
    max-width: 64ch;
}

p + p {
    margin-top: var(--s2);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 13px 26px;
    border-radius: var(--radius);
    border: 1px solid var(--accent);
    transition: opacity 0.18s ease, transform 0.18s ease;
    cursor: pointer;
}

.btn:hover {
    opacity: 0.85;
}

.btn:active {
    transform: translateY(1px);
}

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

.btn--ghost:hover {
    border-color: var(--fg);
    opacity: 1;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 0.98rem;
    border-bottom: 1px solid transparent;
    transition: gap 0.18s ease, border-color 0.18s ease;
}

.link-arrow:hover {
    gap: 10px;
    border-bottom-color: var(--fg);
}

/* =========================================
   Header
   ========================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--s4);
    list-style: none;
}

.nav-links a {
    font-size: 0.95rem;
    color: var(--fg-soft);
    transition: color 0.16s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
    color: var(--fg);
}

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.nav-toggle span {
    position: relative;
    width: 20px;
    height: 1.5px;
    background: var(--fg);
    display: block;
    transition: background 0.2s ease;
}

.nav-toggle span::before,
.nav-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 1.5px;
    background: var(--fg);
    transition: transform 0.2s ease;
}

.nav-toggle span::before {
    top: -6px;
}

.nav-toggle span::after {
    top: 6px;
}

.nav-toggle.is-open span {
    background: transparent;
}

.nav-toggle.is-open span::before {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.is-open span::after {
    transform: translateY(-6px) rotate(-45deg);
}

/* =========================================
    Hero
    ========================================= */

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes hero-glow-drift {
    0% {
        transform: translate(-12%, -8%) scale(1);
        opacity: 0.55;
    }
    50% {
        transform: translate(12%, 10%) scale(1.15);
        opacity: 0.8;
    }
    100% {
        transform: translate(-12%, -8%) scale(1);
        opacity: 0.55;
    }
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
}

.hero {
    padding-top: var(--s8);
    padding-bottom: var(--s8);
    background: linear-gradient(
            135deg,
            #0a0a0a 0%,
            #0f0f0f 25%,
            #050505 50%,
            #0f0f0f 75%,
            #0a0a0a 100%
    );
    background-size: 300% 300%;
    animation: gradient-shift 8s ease infinite;
    position: relative;
    overflow: hidden;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero .lead {
    margin-top: var(--s3);
    color: #ffffff;
}

.hero .btn {
    margin-top: var(--s5);
    background: #ffffff;
    color: #0a0a0a;
    border-color: #ffffff;
}

.hero .btn:hover {
    background: transparent;
    color: #ffffff;
    border-color: #ffffff;
}

/* =========================================
   Generic content blocks
   ========================================= */
.stack > * + * {
    margin-top: var(--s2);
}

.block-cta {
    margin-top: var(--s4);
}

/* Two-column grid for services / info */
.grid {
    display: grid;
    gap: var(--s5);
}

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

.item {
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

@media (hover: hover) {
    .item:hover {
        transform: translateY(-4px);
        box-shadow: 0 14px 32px rgba(0, 0, 0, 0.06);
    }
}

.item .h-sub {
    margin-bottom: var(--s1);
}

.item p {
    color: var(--fg-soft);
}

/* Page intro (for inner pages) */
.page-intro {
    padding-top: var(--s7);
    padding-bottom: var(--s5);
}

.page-intro h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    letter-spacing: -0.03em;
}

.page-intro .lead {
    margin-top: var(--s2);
}

/* Legal / long-form content */
.prose {
    max-width: 110ch;
}

.prose h2 {
    font-size: 1.2rem;
    margin-top: var(--s5);
    margin-bottom: var(--s2);
}

.prose h2:first-of-type {
    margin-top: var(--s3);
}

.prose p {
    color: var(--fg-soft);
}

.prose ul {
    margin: var(--s2) 0;
    padding-left: var(--s3);
    color: var(--fg-soft);
}

.prose li + li {
    margin-top: var(--s1);
}

.prose .updated {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: var(--s4);
}

/* Contact details */
.contact-grid {
    display: grid;
    gap: var(--s5);
}

@media (min-width: 720px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.cf-status {
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.95rem;
    margin-bottom: var(--s3);
}

.cf-status.is-ok {
    border-color: var(--fg);
    background: var(--bg-alt);
    color: var(--fg);
}

.cf-status.is-error {
    border-color: var(--muted);
    color: var(--fg-soft);
}

.contact-block .h-sub {
    margin-bottom: var(--s1);
}

.contact-block address {
    font-style: normal;
    color: var(--fg-soft);
    line-height: 1.8;
}

.contact-block a {
    border-bottom: 1px solid var(--border);
    transition: border-color 0.16s ease;
}

.contact-block a:hover {
    border-bottom-color: var(--fg);
}

/* =========================================
   Footer
   ========================================= */
.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding-top: var(--s6);
    padding-bottom: var(--s5);
    margin-top: var(--s4);
}

.footer-top {
    display: grid;
    gap: var(--s5);
    grid-template-columns: 1fr;
    margin-bottom: var(--s6);
}

@media (min-width: 720px) {
    .footer-top {
        grid-template-columns: 1.5fr 1fr 1fr;
    }
}

.footer-brand .brand {
    display: inline-block;
    margin-bottom: var(--s2);
}

.footer-brand p {
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 34ch;
}

.footer-col h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: var(--s2);
}

.footer-col ul {
    list-style: none;
}

.footer-col li + li {
    margin-top: var(--s1);
}

.footer-col a {
    color: var(--fg-soft);
    font-size: 0.95rem;
    transition: color 0.16s ease;
}

.footer-col a:hover {
    color: var(--fg);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2) var(--s5);
    justify-content: space-between;
    align-items: flex-start;
    padding-top: var(--s4);
    border-top: 1px solid var(--border);
}

.footer-bottom address {
    font-style: normal;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.7;
}

.footer-bottom .copy {
    color: var(--muted);
    font-size: 0.88rem;
}

/* =========================================
   404
   ========================================= */
.notfound {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.notfound .code {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
}

.notfound p {
    color: var(--fg-soft);
    margin: var(--s2) 0 var(--s4);
}

/* =========================================
    Reveal animation (light)
    ========================================= */

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

.reveal {
    opacity: 0;
    transform: translateY(18px);
}

.reveal.is-visible {
    animation: reveal-in 1.2s cubic-bezier(0.45, 0, 0.25, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero,
    .hero::before {
        animation: none;
    }

    .item {
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* =========================================
   Mobile
   ========================================= */
@media (max-width: 719px) {
    body {
        font-size: 16px;
    }

    .container {
        padding-left: var(--s2);
        padding-right: var(--s2);
    }

    .section {
        padding-top: var(--s6);
        padding-bottom: var(--s6);
    }

    .hero {
        padding-top: var(--s6);
        padding-bottom: var(--s6);
    }

    #hero-canvas {
        display: none;
    }

    /* Mobile: replace the hidden particle canvas with a soft drifting glow */
    .hero::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 120%;
        height: 120%;
        transform: translate(-50%, -50%);
        background: radial-gradient(
            circle at 50% 50%,
            rgba(255, 255, 255, 0.14) 0%,
            rgba(255, 255, 255, 0.05) 30%,
            transparent 60%
        );
        animation: hero-glow-drift 9s ease-in-out infinite;
        pointer-events: none;
        z-index: 1;
    }

    .prose {
        max-width: 100%;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        inset: 64px 0 auto 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: var(--s2) var(--s2) var(--s3);
        transform: translateY(-130%);
        transition: transform 0.28s ease;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04);
    }

    .nav-links.is-open {
        transform: translateY(0);
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: var(--s2) 0;
        font-size: 1.05rem;
        border-bottom: 1px solid var(--border);
    }

    .nav-links li:last-child a {
        border-bottom: 0;
    }
}
