/* ===== TOKENS ===== */
:root {
    --bg: #050810;
    --surface: #0B1019;
    --surface-2: #101620;
    --surface-3: #151E2A;

    --border: #1A2433;
    --border-strong: #22303F;
    --border-accent: rgba(165, 180, 252, 0.22);

    --text-primary: #EDF2FA;
    --text-secondary: #7A8DA3;
    --text-muted: #3C5068;

    --accent: #a5b4fc;
    --accent-hover: #818cf8;
    --accent-glow: rgba(165, 180, 252, 0.18);
    --accent-dim: rgba(165, 180, 252, 0.07);
    --accent-soft: rgba(165, 180, 252, 0.12);

    --green: #4ade80;
    --amber: #fbbf24;
    --purple: #c4b5fd;

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    --nav-h: 68px;
    --cx: 1100px;
    --cp: 32px;
    --r: 6px;

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body.light-theme {
    --bg: #F2F6FC;
    --surface: #FFFFFF;
    --surface-2: #EBF0F8;
    --surface-3: #E2EAF5;
    --border: #D8E2EF;
    --border-strong: #C5D2E4;
    --border-accent: rgba(99, 102, 241, 0.28);
    --text-primary: #0C1A2E;
    --text-secondary: #475F78;
    --text-muted: #5A7A96;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.14);
    --accent-dim: rgba(99, 102, 241, 0.06);
    --accent-soft: rgba(99, 102, 241, 0.1);
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== TYPE ===== */
h1, h2, h3 { color: var(--text-primary); }

h2 {
    font-size: clamp(18px, 2vw, 26px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

h3 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

p {
    font-size: 15px;
    line-height: 1.78;
    color: var(--text-secondary);
}

/* ===== LAYOUT ===== */
.container {
    max-width: var(--cx);
    margin: 0 auto;
    padding: 0 var(--cp);
}

main { padding-top: var(--nav-h); }

.section { padding: 112px 0; }

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

.section-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 19px;
    color: var(--accent);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

/* ===== NAV ===== */
.navbar {
    position: fixed;
    inset: 0 0 auto;
    height: var(--nav-h);
    z-index: 100;
    background: rgba(5, 8, 16, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

body.light-theme .navbar {
    background: rgba(242, 246, 252, 0.92);
    box-shadow: 0 1px 0 var(--border), 0 4px 24px rgba(12, 26, 46, 0.06);
}

.navbar .container,
.nav-content {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-content { justify-content: space-between; width: 100%; }

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: opacity 150ms;
}

.logo img {
    height: 44px;
    width: auto;
    filter: invert(1);
}

body.light-theme .logo img { filter: none; }
.logo:hover { opacity: 1; }
.logo:hover img { animation: logo-wobble 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }

@keyframes logo-wobble {
    0%   { transform: rotate(0deg) scale(1); }
    15%  { transform: rotate(-8deg) scale(1.07); }
    30%  { transform: rotate(6deg) scale(1.05); }
    45%  { transform: rotate(-4deg) scale(1.02); }
    60%  { transform: rotate(3deg); }
    75%  { transform: rotate(-1.5deg); }
    90%  { transform: rotate(1deg); }
    100% { transform: rotate(0deg) scale(1); }
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    font-size: 17px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.2px;
    transition: color 120ms;
}

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

.theme-toggle {
    background: none;
    border: none;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 120ms;
    padding: 0;
    line-height: 1;
}

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

/* ===== BUTTON ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 26px;
    border-radius: var(--r);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-family: var(--font-sans);
    white-space: nowrap;
    transition: all 180ms var(--ease);
}

.btn-primary {
    background: var(--accent);
    color: #06080f;
    letter-spacing: 0.1px;
    box-shadow: 0 0 0 1px rgba(165, 180, 252, 0.25), 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(165, 180, 252, 0.35), 0 8px 32px var(--accent-glow);
}

body.light-theme .btn-primary {
    color: #fff;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.25), 0 4px 20px var(--accent-glow);
}

body.light-theme .btn-primary:hover {
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35), 0 8px 32px var(--accent-glow);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    min-height: calc(100vh - var(--nav-h));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    left: 50%;
    top: -80px;
    width: 960px;
    height: 720px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at 50% 25%, rgba(165, 180, 252, 0.11) 0%, rgba(165, 180, 252, 0.03) 45%, transparent 68%);
    pointer-events: none;
    z-index: 0;
}

body.light-theme .hero::before {
    background: radial-gradient(ellipse at 50% 25%, rgba(99, 102, 241, 0.14) 0%, rgba(99, 102, 241, 0.05) 45%, transparent 68%);
}

.hero .container {
    position: relative;
    z-index: 1;
    padding-top: 72px;
    padding-bottom: 88px;
}

.hero-logo {
    margin-bottom: 36px;
}

.hero-logo img {
    height: clamp(96px, 15vw, 192px);
    width: auto;
    filter: invert(1);
    cursor: pointer;
}

body.light-theme .hero-logo img {
    filter: none;
}

.hero-logo img.wobble-idle {
    animation: logo-wobble-idle 1.1s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.hero-logo img.wobble-hover {
    animation: logo-wobble 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes logo-wobble-idle {
    0%   { transform: rotate(0deg) scale(1); }
    15%  { transform: rotate(-5deg) scale(1.04); }
    32%  { transform: rotate(3.5deg) scale(1.03); }
    50%  { transform: rotate(-2deg) scale(1.01); }
    65%  { transform: rotate(1.5deg); }
    80%  { transform: rotate(-0.8deg); }
    92%  { transform: rotate(0.4deg); }
    100% { transform: rotate(0deg) scale(1); }
}

.hero-tagline {
    font-size: clamp(18px, 2.2vw, 26px);
    font-weight: 500;
    color: var(--accent);
    letter-spacing: -0.025em;
    line-height: 1.3;
    margin-bottom: 20px;
}

.hero-sub {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto 40px;
}

.hero-cta { margin-bottom: 48px; }

/* ===== SCROLL REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }

/* ===== ABOUT ===== */
.about-text {
    max-width: 680px;
}

.about-text p {
    font-size: 15px;
    line-height: 1.85;
    color: var(--text-secondary);
}

.about-text p:first-child {
    font-size: 20px;
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: -0.015em;
    margin-bottom: 28px;
}

.about-text p + p { margin-top: 18px; }

/* ===== BUILD ===== */
.build-wrapper {
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}

.build-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--border);
}

.build-item {
    background: var(--surface);
    padding: 40px 36px;
    position: relative;
    transition: background 200ms var(--ease);
    border-right: 1px solid var(--border);
}

.build-item:last-child { border-right: none; }

.build-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 320ms var(--ease);
}

.build-item:hover { background: var(--surface-2); }
.build-item:hover::before { transform: scaleX(1); }

.build-num {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 20px;
    transition: color 200ms;
}

.build-item:hover .build-num { color: var(--accent); }

.build-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 14px;
    transition: color 200ms;
}

.build-item:hover .build-name { color: var(--accent); }

.build-desc {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.build-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.build-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 3px 9px;
    letter-spacing: 0.3px;
    transition: border-color 200ms, color 200ms;
}

.build-item:hover .build-tag {
    border-color: var(--border-accent);
    color: var(--accent);
}

.build-featured {
    background: var(--surface);
    padding: 32px 36px 32px 48px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: center;
    position: relative;
    transition: background 200ms var(--ease);
}

.build-featured::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
}

.build-featured:hover { background: var(--surface-2); }

.build-featured-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.build-featured-name {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.2;
}

.build-featured-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

.build-featured-arrow {
    font-size: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 200ms, transform 200ms var(--ease);
}

.build-featured:hover .build-featured-arrow {
    color: var(--accent);
    transform: translateX(5px);
}

/* ===== CONTACT ===== */
.contact-heading {
    margin-bottom: 40px;
}

/* ===== FOOTER ===== */
footer {
    border-top: 1px solid var(--border);
    padding: 28px 0;
    background: var(--surface);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: opacity 150ms;
}

.footer-logo img {
    height: 36px;
    width: auto;
    filter: invert(1);
}

body.light-theme .footer-logo img { filter: none; }

/* ===== LIGHT THEME ENHANCEMENTS ===== */
body.light-theme .hero-title {
    background: linear-gradient(160deg, var(--text-primary) 20%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-theme .build-item,
body.light-theme .service-entry,
body.light-theme .contact-row {
    box-shadow: 0 1px 3px rgba(12, 26, 46, 0.07), 0 1px 2px rgba(12, 26, 46, 0.04);
}

body.light-theme .build-item:hover,
body.light-theme .contact-row:hover {
    box-shadow: 0 4px 16px rgba(12, 26, 46, 0.1);
}

body.light-theme .build-wrapper,
body.light-theme .services-detail,
body.light-theme .contact-row {
    box-shadow: 0 1px 4px rgba(12, 26, 46, 0.06);
}

body.light-theme .section-alt {
    background: var(--surface);
    box-shadow: inset 0 1px 0 var(--border), inset 0 -1px 0 var(--border);
}

body.light-theme footer {
    box-shadow: 0 -1px 0 var(--border);
}

.footer-logo:hover { opacity: 1; }
.footer-logo:hover img { animation: logo-wobble 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    font-size: 17px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 120ms;
}

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

.footer-socials {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-social {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: color 150ms;
}

.footer-social:hover { color: var(--accent); }

/* ===== STANDALONE PAGES ===== */
.page-section { padding: 80px 0 96px; }

.page-header {
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 56px;
}

.page-header h1 {
    font-size: clamp(26px, 3.2vw, 40px);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.page-header .lead {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* About page */
.about-page-body {
    max-width: 640px;
}

.about-page-text p {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text-secondary);
}

.about-page-text p + p { margin-top: 20px; }

/* Contact grid */
.contact-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 640px;
    margin-top: 48px;
}

.contact-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 24px 28px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: border-color 200ms, background 200ms;
}

.contact-row::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 300ms var(--ease);
}

.contact-row:hover { border-color: var(--border-accent); background: var(--surface-2); }
.contact-row:hover::before { transform: scaleX(1); }

.contact-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.contact-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: color 200ms;
}

.contact-row:hover .contact-icon { color: var(--accent); }

.contact-platform {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.contact-row-right { display: contents; }

.contact-handle {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    transition: color 200ms;
    word-break: break-all;
}

.contact-row:hover .contact-handle { color: var(--accent); }

.contact-arrow { display: none; }

/* Services page */
.services-detail {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    margin-top: 0;
}

.service-entry {
    display: flex;
    flex-direction: column;
    padding: 40px 36px 44px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: relative;
    transition: background 200ms;
}

.service-entry:last-child { border-right: none; }

.service-entry-meta {
    position: static;
    margin-bottom: 24px;
}

.service-entry-num {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 1.5px;
    margin-bottom: 14px;
}

.service-entry-meta h2 {
    font-size: clamp(20px, 2.2vw, 28px);
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.service-entry-body > p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.service-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-list li {
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 18px;
    position: relative;
    line-height: 1.5;
}

.service-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent);
    top: 2px;
}

.services-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding: 22px 32px;
    border: 1px solid var(--border-accent);
    border-radius: var(--r);
    background: var(--accent-dim);
    text-decoration: none;
    transition: background 160ms, border-color 160ms;
    cursor: pointer;
}

.services-cta:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.services-cta span {
    font-size: 15px;
    color: var(--text-primary);
}

.services-cta-arrow {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    transition: transform 200ms var(--ease);
    display: inline-block;
}

.services-cta:hover .services-cta-arrow {
    transform: translateX(6px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    :root { --cp: 24px; }
    .build-grid { grid-template-columns: 1fr; }
    .build-item { border-right: none; border-top: 1px solid var(--border); }
    .build-item:first-child { border-top: none; }
    .build-featured { grid-template-columns: 1fr; }
    .build-featured-arrow { display: none; }
    .contact-list { grid-template-columns: 1fr; }
    .services-detail { grid-template-columns: 1fr; }
    .service-entry { border-right: none; border-bottom: 1px solid var(--border); }
    .service-entry:last-child { border-bottom: none; }
}

@media (max-width: 768px) {
    :root { --cp: 20px; }
    .section { padding: 72px 0; }
    .hero .container { padding-top: 56px; padding-bottom: 72px; }
    .nav-links { gap: 20px; }
    .process-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; gap: 16px; align-items: flex-start; }
    .footer-links { gap: 16px; }
    .page-header { padding-bottom: 40px; margin-bottom: 40px; }
    .contact-inner { padding: 36px 28px; }
}

@media (max-width: 480px) {
    .hero-tagline { font-size: 17px; }
    .hero-sub { font-size: 14px; }
    .nav-links { gap: 16px; }
}
