/* ==========================================================================
   o2form — design system (sobre, pro, light/dark)
   ========================================================================== */

:root {
    --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Inter", var(--font-sans);

    --radius: 10px;
    --radius-lg: 18px;
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 20px rgba(15, 23, 42, 0.06);

    --max-width: 1120px;
    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;
    --space-10: 4rem;
    --space-12: 5rem;
}

/* Light theme (default) */
:root,
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #475569;
    --accent: #0ea5e9;
    --accent-ink: #ffffff;
    --accent-hover: #0284c7;
    --focus: #2563eb;
    --success: #15803d;
    --error: #b91c1c;
}

/* Dark theme */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1220;
    --bg-alt: #0f172a;
    --surface: #111a2e;
    --border: #1e293b;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --accent-ink: #0b1220;
    --accent-hover: #7dd3fc;
    --focus: #60a5fa;
    --success: #4ade80;
    --error: #fca5a5;
}

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

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

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

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

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

.skip-link {
    position: absolute;
    top: -40px;
    left: var(--space-3);
    background: var(--accent);
    color: var(--accent-ink);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    text-decoration: none;
    z-index: 100;
}
.skip-link:focus { top: var(--space-3); }

/* ==========================================================================
   Header / Nav
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
}
.nav-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 14px;
    font-weight: 700;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: var(--space-2) 0;
    border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-left: var(--space-3);
}

.lang-switch {
    font-weight: 600;
    color: var(--text-muted) !important;
    text-decoration: none;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
}
.lang-switch:hover { color: var(--text) !important; border-color: var(--text-muted); }

.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    position: relative;
    padding: 0;
}
.theme-toggle:hover { border-color: var(--text-muted); }

.theme-toggle-icon { position: absolute; transition: opacity .15s; }
:root[data-theme="dark"] .theme-toggle-icon-sun { opacity: 1; }
:root[data-theme="dark"] .theme-toggle-icon-moon { opacity: 0; }
:root[data-theme="light"] .theme-toggle-icon-sun { opacity: 0; }
:root[data-theme="light"] .theme-toggle-icon-moon { opacity: 1; }

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    justify-content: space-between;
}
.nav-toggle-bar {
    display: block;
    height: 2px;
    background: currentColor;
}

@media (max-width: 720px) {
    .nav-toggle { display: inline-flex; }
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
        padding: var(--space-4) var(--space-5);
        display: none;
    }
    .nav-links[data-open="true"] { display: flex; }
    .nav-actions { margin-left: 0; }
}

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

.hero {
    padding: var(--space-12) 0 var(--space-10);
    background:
        radial-gradient(ellipse at 20% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
        var(--bg-alt);
    border-bottom: 1px solid var(--border);
}
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4vw + 1rem, 3.6rem);
    line-height: 1.1;
    margin: 0 0 var(--space-4);
    letter-spacing: -0.02em;
}
.hero-lead {
    font-size: clamp(1.05rem, 0.6vw + 0.95rem, 1.25rem);
    color: var(--text-muted);
    max-width: 60ch;
    margin: 0 0 var(--space-6);
}
.hero-ctas { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

/* ==========================================================================
   Sections
   ========================================================================== */

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 1.5vw + 1rem, 2.2rem);
    margin: 0 0 var(--space-3);
    letter-spacing: -0.015em;
}
.section-intro {
    color: var(--text-muted);
    max-width: 70ch;
    margin: 0 0 var(--space-8);
}

.services { padding: var(--space-10) 0; }

.cards {
    display: grid;
    gap: var(--space-5);
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-card);
}
.card h3 {
    margin: 0 0 var(--space-2);
    font-size: 1.15rem;
}
.card p { margin: 0; color: var(--text-muted); }

/* ==========================================================================
   Contact page
   ========================================================================== */

.contact { padding: var(--space-10) 0; }
.contact-grid {
    display: grid;
    gap: var(--space-8);
    grid-template-columns: minmax(200px, 1fr) 2fr;
}
@media (max-width: 720px) {
    .contact-grid { grid-template-columns: 1fr; }
}
.contact-info dl { margin: 0; }
.contact-info dt {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: var(--space-4);
}
.contact-info dt:first-child { margin-top: 0; }
.contact-info dd { margin: var(--space-1) 0 0; font-size: 1.1rem; }

.form { display: grid; gap: var(--space-4); }
.form-row { display: grid; gap: var(--space-2); }
.form-row label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}
.form-row input,
.form-row textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
}
.form-row input:focus,
.form-row textarea:focus {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
    border-color: var(--focus);
}
.form-row ul { color: var(--error); margin: 0; padding-left: 1rem; font-size: 0.9rem; }

.form-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.flash {
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    margin: var(--space-5) auto 0;
    max-width: var(--max-width);
    width: calc(100% - 2 * var(--space-5));
}
.flash-success { background: color-mix(in srgb, var(--success) 18%, var(--bg-alt)); color: var(--success); }
.flash-error { background: color-mix(in srgb, var(--error) 18%, var(--bg-alt)); color: var(--error); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--border);
    padding: var(--space-6) 0;
    color: var(--text-muted);
    background: var(--bg-alt);
    font-size: 0.95rem;
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; }
.site-footer p { margin: 0; }
.footer-contact a { color: var(--text-muted); text-decoration: none; }
.footer-contact a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
