/* ==========================================================
   SELF-HOSTED FONTS
   Variable font — covers weights 300–800 with two files.
   ========================================================== */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
                 U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                 U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,
                 U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
                 U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
                 U+FEFF, U+FFFD;
}

/* ==========================================================
   CSS CUSTOM PROPERTIES
   Edit these to quickly change colors, fonts, and spacing.
   ========================================================== */
:root {
    /* Background tones: deep navy-charcoal, not pure black */
    --bg-primary:    #080b12;
    --bg-secondary:  #0d1117;
    --bg-card:       #111827;
    --bg-card-hover: #161f2e;

    /* Accent: teal-cyan */
    --accent:        #00d4aa;
    --accent-dim:    rgba(0, 212, 170, 0.12);
    --accent-glow:   rgba(0, 212, 170, 0.25);

    /* Text */
    --text-primary:   #f0f2f5;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;

    /* Borders */
    --border:        #1e293b;
    --border-light:  #2d3a4d;

    /* Typography: follows 4pt baseline grid */
    --font-family:   'Outfit', sans-serif;
    --font-base:     1rem;       /* 16px */
    --line-height:   1.6;        /* 25.6px, comfortable for body text */

    /* Spacing scale: 8pt grid system */
    --space-xs:  0.25rem;  /* 4px */
    --space-sm:  0.5rem;   /* 8px */
    --space-md:  1rem;     /* 16px */
    --space-lg:  1.5rem;   /* 24px */
    --space-xl:  2rem;     /* 32px */
    --space-2xl: 3rem;     /* 48px */
    --space-3xl: 4rem;     /* 64px */
    --space-4xl: 6rem;     /* 96px */
    --space-5xl: 8rem;     /* 128px */

    /* Layout */
    --max-width:  1120px;
    --nav-height: 64px;      /* 8pt aligned */


    /* Nav overlay for scrolled state */
    --nav-bg: rgba(8, 11, 18, 0.85);
    --nav-mobile-bg: #080b12;
}

/* ==========================================================
   LIGHT MODE
   ========================================================== */
[data-theme="light"] {
    --bg-primary:    #ffffff;
    --bg-secondary:  #f8f9fb;
    --bg-card:       #f1f3f6;
    --bg-card-hover: #e8ebf0;

    --accent:        #00a884;
    --accent-dim:    rgba(0, 168, 132, 0.1);
    --accent-glow:   rgba(0, 168, 132, 0.2);

    --text-primary:   #0f1419;
    --text-secondary: #536471;
    --text-muted:     #8899a6;

    --border:        #e1e4e8;
    --border-light:  #cfd4da;

    --nav-bg: rgba(255, 255, 255, 0.85);
    --nav-mobile-bg: #ffffff;
}

/* ==========================================================
   RESET & BASE
   ========================================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-base);
    line-height: var(--line-height);
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

/* Prevent scroll when mobile menu is open (iOS-safe) */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    /* top is set dynamically via JS to preserve scroll position */
}

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

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

/* Utility: constrain content width */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ==========================================================
   NAVIGATION
   ========================================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    transition: background 0.3s ease, border-color 0.3s ease;
    border-bottom: 1px solid transparent;
}

.nav.scrolled {
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom-color: var(--border);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.nav-logo img {
    height: 24px;
    width: auto;
}

/* Toggle logo per theme */
.nav-logo .logo-dark  { display: block; }
.nav-logo .logo-light { display: none; }
[data-theme="light"] .nav-logo .logo-dark  { display: none; }
[data-theme="light"] .nav-logo .logo-light { display: block; }

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

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s ease;
    letter-spacing: 0.01em;
}

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

/* Theme toggle button in nav */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Hide the inactive icon */
.theme-toggle .icon-moon  { display: block; }
.theme-toggle .icon-sun   { display: none; }
[data-theme="light"] .theme-toggle .icon-moon  { display: none; }
[data-theme="light"] .theme-toggle .icon-sun   { display: block; }

/* Mobile menu toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.25s 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);
}

/* Desktop: nav-right holds lang toggle + theme toggle + hamburger */
.nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Language toggle */
.lang-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.lang-toggle:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

/* ==========================================================
   BUTTONS
   Min height 44px for touch targets (WCAG 2.5.5)
   ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-family);
    font-size: 0.9375rem;
    font-weight: 600;
    min-height: 44px;
    padding: 0.625rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--accent);
    color: #080b12;
}

[data-theme="light"] .btn-primary {
    color: #ffffff;
}

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 24px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Button arrow */
.btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.btn:hover svg {
    transform: translateX(3px);
}

/* ==========================================================
   SECTION DEFAULTS
   ========================================================== */
section {
    padding: var(--space-5xl) 0;
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-md);
}

.section-heading {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-md);
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--nav-height);
    overflow: hidden;
}

/* Subtle radial grid background */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

/* Radial glow at center-top */
.hero-bg::before {
    content: '';
    position: absolute;
    top: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(
        ellipse at center,
        rgba(0, 212, 170, 0.07) 0%,
        rgba(0, 212, 170, 0.02) 40%,
        transparent 70%
    );
    pointer-events: none;
}

[data-theme="light"] .hero-bg::before {
    background: radial-gradient(
        ellipse at center,
        rgba(0, 168, 132, 0.06) 0%,
        rgba(0, 168, 132, 0.02) 40%,
        transparent 70%
    );
}

/* Dot grid overlay */
.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        rgba(148, 163, 184, 0.08) 1px,
        transparent 1px
    );
    background-size: 32px 32px;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, black 20%, transparent 70%);
    pointer-events: none;
}

[data-theme="light"] .hero-bg::after {
    background-image: radial-gradient(
        rgba(15, 20, 25, 0.06) 1px,
        transparent 1px
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    padding: 0 var(--space-lg);
}

.hero h1 {
    font-size: clamp(2.5rem, 6.5vw, 4.25rem);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.035em;
    margin-bottom: var(--space-lg);
}

/* Accent word in headline */
.hero h1 .accent {
    color: var(--accent);
}

.hero p {
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto var(--space-2xl);
    line-height: 1.6;
    font-weight: 300;
}

/* ==========================================================
   WHAT WE DO:3-card grid
   ========================================================== */
.services {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.services-header {
    text-align: center;
    max-width: 560px;
    margin: 0 auto var(--space-3xl);
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-2xl);
    transition: border-color 0.3s ease, background 0.3s ease;
}

.card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.card-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

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

/* ==========================================================
   MISSION / ABOUT
   ========================================================== */
.mission {
    text-align: center;
}

.mission-content {
    max-width: 620px;
    margin: 0 auto;
}

.mission-content p {
    font-size: clamp(1.05rem, 2vw, 1.15rem);
    color: var(--text-secondary);
    line-height: 1.7;
    font-weight: 300;
}

/* Divider line */
.divider {
    width: 48px;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    margin: var(--space-2xl) auto;
    opacity: 0.5;
}

/* ==========================================================
   CONTACT / CTA
   ========================================================== */
.contact {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    text-align: center;
}

.contact-content {
    max-width: 520px;
    margin: 0 auto;
}

.contact-email {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-2xl);
    padding: 0.625rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.contact-email:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--border);
}

.footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-left {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.footer-brand {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

.footer-links a {
    font-size: 0.8125rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

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

/* Social icons:44px min touch target */
.footer-social {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: border-color 0.2s ease, color 0.2s ease;
    color: var(--text-muted);
}

.footer-social a:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.footer-social svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ==========================================================
   SCROLL ANIMATIONS
   ========================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for cards */
.card:nth-child(1) { transition-delay: 0s; }
.card:nth-child(2) { transition-delay: 0.1s; }
.card:nth-child(3) { transition-delay: 0.2s; }

/* ==========================================================
   RESPONSIVE
   ========================================================== */

/* Tablet & mobile */
@media (max-width: 768px) {
    section {
        padding: var(--space-4xl) 0;
    }

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

    .card {
        padding: var(--space-lg);
    }

    /* Mobile menu:fixed overlay */
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 99;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--space-2xl);
        background: var(--nav-mobile-bg);
        /* Hidden by default:use visibility + opacity for smooth transition */
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .nav-links.open {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        font-size: 1.25rem;
        color: var(--text-primary);
    }

    .nav-toggle {
        display: block;
        position: relative;
        z-index: 101;
    }

    .footer .container {
        flex-direction: column;
        text-align: center;
        gap: var(--space-lg);
    }

    .footer-left {
        flex-direction: column;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.25rem;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}
