/* ==========================================================================
   Runestone Technologies — global styles
   ========================================================================== */

:root,
:root[data-theme="dark"] {
    --bg: #07091a;
    --bg-elev: #0d1024;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #ffffff;
    --text-soft: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --nav-bg: rgba(7, 9, 26, 0.7);
    --btn-primary-bg: #ffffff;
    --btn-primary-text: #0a0e27;
    --grid-line: rgba(255, 255, 255, 0.025);
    --glow-opacity: 0.35;
    --glow-opacity-2: 0.25;
    --indigo: #6366f1;
    --violet: #8b5cf6;
    --pink: #ec4899;
    --gradient: linear-gradient(120deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --max-w: 1200px;
}

:root[data-theme="light"] {
    --bg: #fafafa;
    --bg-elev: #ffffff;
    --surface: rgba(0, 0, 0, 0.03);
    --surface-strong: rgba(0, 0, 0, 0.05);
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.14);
    --text: #0a0a0a;
    --text-soft: #404040;
    --text-muted: #525252;
    --text-dim: #737373;
    --nav-bg: rgba(250, 250, 250, 0.75);
    --btn-primary-bg: #0a0a0a;
    --btn-primary-text: #ffffff;
    --grid-line: rgba(0, 0, 0, 0.04);
    --glow-opacity: 0.18;
    --glow-opacity-2: 0.14;
}

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

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

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-feature-settings: 'cv11', 'ss01', 'ss03';
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

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

button {
    font-family: inherit;
    cursor: pointer;
    border: 0;
    background: transparent;
    color: inherit;
}

::selection {
    background: rgba(139, 92, 246, 0.4);
    color: #fff;
}

/* ==========================================================================
   Background decoration
   ========================================================================== */

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    transition: opacity 0.4s ease;
}

.bg-glow--1 {
    background: radial-gradient(circle, var(--indigo) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    opacity: var(--glow-opacity);
}

.bg-glow--2 {
    background: radial-gradient(circle, var(--pink) 0%, transparent 70%);
    bottom: -200px;
    right: -200px;
    opacity: var(--glow-opacity-2);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
    z-index: 1;
}

main,
.nav,
.footer {
    position: relative;
    z-index: 2;
}

.section {
    padding: 100px 0;
}

.section--contact {
    padding: 120px 0;
}

.section__header {
    margin-bottom: 64px;
    max-width: 720px;
}

.eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 16px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--surface);
}

.section__title {
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin: 0;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

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

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    cursor: pointer;
}

.btn--primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .btn--primary:hover {
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.15);
}

.btn--ghost {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn--ghost:hover {
    background: var(--surface-strong);
}

.btn--sm {
    padding: 10px 18px;
    font-size: 14px;
}

.btn--lg {
    padding: 18px 32px;
    font-size: 17px;
    font-weight: 600;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    background: var(--nav-bg);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.nav--scrolled {
    border-bottom-color: var(--border);
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 72px;
}

.nav__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.02em;
    margin-right: auto;
}

.nav__links {
    display: flex;
    gap: 32px;
}

.nav__links a {
    font-size: 14px;
    color: var(--text-muted);
    transition: color 0.2s ease;
    font-weight: 500;
}

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

.nav__tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0;
}

.icon-btn:hover {
    background: var(--surface-strong);
    color: var(--text);
    border-color: var(--border-strong);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn .icon-btn__moon { display: none; }
[data-theme="dark"] .icon-btn .icon-btn__sun { display: none; }
[data-theme="dark"] .icon-btn .icon-btn__moon { display: block; }

.lang-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 100px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
    font-family: 'JetBrains Mono', monospace;
}

.lang-btn:hover {
    background: var(--surface-strong);
    border-color: var(--border-strong);
}

@media (max-width: 720px) {
    .nav__links {
        display: none;
    }
    .nav__inner {
        gap: 6px;
    }
    .icon-btn {
        width: 36px;
        height: 36px;
    }
}

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

.hero {
    padding: 100px 0 80px;
    text-align: center;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 100px;
    background: var(--surface);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-soft);
    margin-bottom: 32px;
}

.hero__badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero__title {
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin: 0 0 24px;
}

.hero__subtitle {
    font-size: clamp(1.05rem, 1.4vw, 1.25rem);
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto 40px;
    line-height: 1.6;
}

.hero__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 80px;
}

.hero__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 720px;
    margin: 0 auto;
    padding: 32px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stat__value {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat__label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@media (max-width: 640px) {
    .hero__stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ==========================================================================
   Services
   ========================================================================== */

.services {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.service-card {
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(236, 72, 153, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.service-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
}

.service-card:hover::before {
    opacity: 1;
}

.service-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #fff;
}

.service-card__icon svg {
    width: 22px;
    height: 22px;
}

.service-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}

.service-card p {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
}

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

@media (max-width: 600px) {
    .services {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Work
   ========================================================================== */

.work {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.work-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    transition: all 0.3s ease;
    display: block;
}

.work-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
}

.work-card__preview {
    aspect-ratio: 16 / 10;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: #fff;
}

.work-card__preview--optic {
    background:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.4), transparent 60%),
        radial-gradient(circle at 80% 50%, rgba(139, 92, 246, 0.3), transparent 60%),
        linear-gradient(135deg, #1e1b4b, #0a0e27);
}

.work-card__preview--trading {
    background:
        radial-gradient(circle at 30% 50%, rgba(236, 72, 153, 0.35), transparent 60%),
        radial-gradient(circle at 70% 50%, rgba(99, 102, 241, 0.3), transparent 60%),
        linear-gradient(135deg, #2d1b4e, #0a0e27);
}

.work-card__preview--branding {
    background:
        radial-gradient(circle at 50% 30%, rgba(168, 85, 247, 0.45), transparent 60%),
        radial-gradient(circle at 50% 80%, rgba(244, 114, 182, 0.3), transparent 60%),
        linear-gradient(135deg, #1e1042, #0a0e27);
}

.work-card__chrome {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    gap: 6px;
}

.work-card__chrome span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}

.work-card__visual {
    text-align: center;
    padding: 32px;
    z-index: 1;
}

.work-card__pill {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 12px;
    font-weight: 500;
    color: #cbd5e1;
    margin-bottom: 16px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.work-card__visual h4 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: #fff;
}

.work-card__visual p {
    color: #94a3b8;
    font-size: 14px;
    margin: 0;
    max-width: 320px;
    margin: 0 auto;
}

.work-card__meta {
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--border);
}

.work-card__title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 2px;
}

.work-card__tags {
    font-size: 13px;
    color: var(--text-muted);
}

.work-card__link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    transition: transform 0.2s ease;
}

.work-card:hover .work-card__link {
    transform: translateX(4px);
}


/* ==========================================================================
   Approach
   ========================================================================== */

.approach {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.approach-item {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    position: relative;
}

.approach-item__num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.approach-item h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.approach-item p {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

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

@media (max-width: 540px) {
    .approach {
        grid-template-columns: 1fr;
    }
}

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

.contact {
    text-align: center;
    padding: 80px 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(236, 72, 153, 0.04));
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.15), transparent 60%);
    pointer-events: none;
}

.contact > * {
    position: relative;
    z-index: 1;
}

.contact__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin: 16px 0 20px;
}

.contact__lede {
    color: var(--text-muted);
    font-size: 17px;
    max-width: 540px;
    margin: 0 auto 40px;
}

.contact__actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 600px) {
    .contact {
        padding: 56px 24px;
    }
    .btn--lg {
        font-size: 14px;
        padding: 16px 24px;
    }
}

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

.footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 40px;
}

.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}

.footer__copy {
    font-size: 13px;
    color: var(--text-dim);
}

/* ==========================================================================
   Reveal animation
   ========================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
    html {
        scroll-behavior: auto;
    }
}
