/* ==========================================================================
   THEME.CSS — "The Geometric Engineer" Bauhaus Design System
   ==========================================================================
   Montserrat typography · Primary color accents · Geometric markers
   Deep navy dark mode · CSS-only decorative geometry
   ========================================================================== */

/* ==========================================================================
   1. Design Tokens
   ========================================================================== */

:root {
    /* Typography */
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;

    /* Bauhaus Primary Accents */
    --red: #E63946;
    --blue: #457B9D;
    --amber: #F4A261;

    /* Accent rotation (sections get their own color) */
    --accent-0: var(--red);
    --accent-1: var(--blue);
    --accent-2: var(--amber);
    --accent-3: var(--red);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;

    /* Layout */
    --max-width: 1140px;
    --nav-height: 56px;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.3s;

    /* Radius */
    --radius: 4px;
    --radius-lg: 8px;
}

/* ---------- LIGHT MODE ---------- */
[data-theme="light"] {
    --bg: #FAFAF8;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F5F4F0;
    --text: #1A1A2E;
    --text-secondary: #4A4A5A;
    --text-muted: #8A8A9A;
    --border: #E8E6E1;
    --border-hover: #D0CFC8;
    --accent: #1A1A2E;
    --accent-hover: #2A2A3E;
    --accent-subtle: rgba(26, 26, 46, 0.04);
    --tag-bg: #F0EFE8;
    --tag-text: #4A4A5A;
    --tag-border: #E0DFD8;
    --marker-text: #FFFFFF;
    --nav-bg: rgba(250, 250, 248, 0.88);
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.08);
    --geo-opacity: 0.06;
}

/* ---------- DARK MODE (Deep Navy) ---------- */
[data-theme="dark"] {
    --bg: #0F1A2E;
    --bg-surface: #162240;
    --bg-surface-hover: #1C2A4A;
    --text: #E8E6E1;
    --text-secondary: #A0A0B0;
    --text-muted: #606070;
    --border: #253352;
    --border-hover: #354362;
    --accent: #E8E6E1;
    --accent-hover: #D0CFC8;
    --accent-subtle: rgba(232, 230, 225, 0.06);
    --tag-bg: #1C2A4A;
    --tag-text: #B0B0C0;
    --tag-border: #2A3A5A;
    --marker-text: #FFFFFF;
    --nav-bg: rgba(15, 26, 46, 0.88);
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.3);
    --geo-opacity: 0.08;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + var(--space-lg));
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    transition: background var(--duration) var(--ease),
        color var(--duration) var(--ease);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--text);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}

a:hover {
    color: var(--blue);
}

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

/* ==========================================================================
   3. Typography
   ========================================================================== */

h1,
h2,
h3,
h4 {
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.2rem);
}

h2 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
}

h3 {
    font-size: clamp(1.05rem, 2vw, 1.25rem);
}

p {
    color: var(--text-secondary);
    max-width: 62ch;
}

/* ==========================================================================
   4. Navigation
   ========================================================================== */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    transition: background var(--duration) var(--ease);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text);
}

/* Bauhaus geometric logo mark — red circle */
.nav-brand::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--red);
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-brand span {
    font-weight: 400;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-left: var(--space-xs);
}

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

.nav-links a {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    position: relative;
    transition: color var(--duration) var(--ease);
}

.nav-links a::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--blue);
    transition: width var(--duration) var(--ease);
}

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

.nav-links a:hover::after {
    width: 100%;
}

.theme-toggle {
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: 0.3rem 0.9rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    font-family: var(--font-body);
    text-transform: uppercase;
}

.theme-toggle:hover {
    border-color: var(--blue);
    color: var(--blue);
}

/* ==========================================================================
   5. Layout
   ========================================================================== */

.site-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    padding-top: var(--nav-height);
}

.section {
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.section:last-of-type {
    border-bottom: none;
}

/* ==========================================================================
   6. Bauhaus Section Markers — ● Circle + Subscript Number
   ========================================================================== */

.section-header {
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
}

.section-marker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* The geometric filled circle — color rotates per section */
.section-marker .marker-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--section-accent, var(--red));
    flex-shrink: 0;
}

/* Subscript-style number */
.section-marker .marker-num {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.section-title {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 800;
    color: var(--text);
}

/* ==========================================================================
   7. Hero
   ========================================================================== */

.hero {
    padding: var(--space-2xl) 0 var(--space-xl);
    min-height: 75vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Decorative background geometry — CSS only */
.hero::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -60px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: var(--red);
    opacity: var(--geo-opacity);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    bottom: -40px;
    left: 20%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--blue);
    opacity: var(--geo-opacity);
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: var(--space-xl);
    align-items: center;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hero-marker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--space-md);
}

.hero-marker .marker-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--red);
}

.hero-marker .marker-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

.hero-headline {
    font-size: clamp(2.5rem, 6vw, 4.2rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--text);
}

.hero-description {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

/* ==========================================================================
   8. Credential Badges & Tags
   ========================================================================== */

.credentials {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

.credential-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    transition: border-color var(--duration) var(--ease);
}

.credential-badge:hover {
    border-color: var(--blue);
}

.credential-badge strong {
    font-weight: 700;
    color: var(--text);
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.hero-tag {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--duration) var(--ease);
}

.hero-tag:hover {
    border-color: var(--amber);
    color: var(--text);
}

/* ==========================================================================
   9. Service Cards — Left-border accent strip
   ========================================================================== */

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

.service-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--card-accent, var(--red));
    border-radius: var(--radius);
    padding: var(--space-lg) var(--space-lg) var(--space-lg) calc(var(--space-lg) + 4px);
    transition: all var(--duration) var(--ease);
    position: relative;
}

.service-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-hover);
    transform: translateX(4px);
}

/* Accent strip color rotation */
.service-card:nth-child(3n+1) {
    --card-accent: var(--red);
}

.service-card:nth-child(3n+2) {
    --card-accent: var(--blue);
}

.service-card:nth-child(3n+3) {
    --card-accent: var(--amber);
}

.service-card h3 {
    font-weight: 700;
    margin-bottom: var(--space-xs);
    font-size: 1.05rem;
}

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

/* ==========================================================================
   10. Case Studies
   ========================================================================== */

.case-study {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    transition: all var(--duration) var(--ease);
    position: relative;
    overflow: hidden;
}

/* Decorative corner circle */
.case-study::before {
    content: "";
    position: absolute;
    top: -20px;
    right: -20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--case-accent, var(--blue));
    opacity: var(--geo-opacity);
    transition: opacity var(--duration) var(--ease);
}

.case-study:hover::before {
    opacity: calc(var(--geo-opacity) * 2.5);
}

.case-study:nth-child(3n+1) {
    --case-accent: var(--red);
}

.case-study:nth-child(3n+2) {
    --case-accent: var(--blue);
}

.case-study:nth-child(3n+3) {
    --case-accent: var(--amber);
}

.case-study:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-hover);
}

.case-study-header {
    margin-bottom: var(--space-md);
}

.case-study-header h3 {
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: var(--space-xs);
}

.case-study-client {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.case-study-body {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-lg);
    margin: var(--space-md) 0;
}

.case-study-block h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    font-weight: 700;
}

.case-study-block p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.case-study-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.tag {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    background: var(--tag-bg);
    border: 1px solid var(--tag-border);
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--tag-text);
    letter-spacing: 0.02em;
}

/* ==========================================================================
   11. Contact Form
   ========================================================================== */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-xl);
    align-items: start;
}

.contact-intro p {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.contact-form label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.88rem;
    transition: border-color var(--duration) var(--ease);
    margin-bottom: var(--space-md);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--blue);
}

.contact-form textarea {
    resize: vertical;
    min-height: 110px;
}

/* ==========================================================================
   12. Buttons
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 0.65rem 1.6rem;
    background: var(--accent);
    color: var(--bg);
    border: 2px solid var(--accent);
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.btn:hover {
    background: transparent;
    color: var(--accent);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: transparent;
}

/* ==========================================================================
   13. Footer
   ========================================================================== */

.site-footer {
    padding: var(--space-xl) 0 var(--space-lg);
    text-align: center;
    position: relative;
}

/* Decorative divider — amber line */
.site-footer::before {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    background: var(--amber);
    margin: 0 auto var(--space-lg);
    border-radius: 2px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: var(--space-md);
    list-style: none;
}

.footer-links a {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

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

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

/* ==========================================================================
   14. Sticky CTA
   ========================================================================== */

.sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: var(--nav-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    padding: var(--space-sm) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transform: translateY(100%);
    transition: transform 0.4s var(--ease);
}

.sticky-cta.visible {
    transform: translateY(0);
}

.sticky-cta-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   15. Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

    .hero {
        min-height: auto;
        padding: var(--space-xl) 0;
    }

    .case-study-body {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: var(--space-xl) 0;
    }

    .section-header {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

@media (max-width: 480px) {
    .nav-links {
        gap: var(--space-md);
    }

    .nav-links a {
        font-size: 0.65rem;
    }

    .nav-brand span {
        display: none;
    }

    .site-container {
        padding: 0 var(--space-md);
    }
}