/* ============================================
   PRINCEPS DEVELOPMENT LTD - SHARED STYLES
   Design System: Dark mode default + Light toggle
   Colors: Cyan/Teal primary, #0A0F1A dark bg
   Fonts: Inter + Space Grotesk
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    /* Primary Colors */
    --primary-cyan: #00D4FF;
    --primary-teal: #00B8D9;
    --primary-deep: #00A8C5;
    --primary-glow: rgba(0, 212, 255, 0.15);
    --primary-glow-strong: rgba(0, 212, 255, 0.3);

    /* Dark Mode (Default) */
    --bg-primary: #0A0F1A;
    --bg-secondary: #0D1520;
    --bg-card: rgba(13, 21, 32, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(0, 212, 255, 0.1);
    --border-glass-hover: rgba(0, 212, 255, 0.25);
    --text-primary: #F0F4F8;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-inverse: #0A0F1A;

    /* Typography */
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* Shadows */
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15);
    --shadow-glow-strong: 0 0 40px rgba(0, 212, 255, 0.25);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 8px 40px rgba(0, 212, 255, 0.12);
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-primary: #F8FAFC;
    --bg-secondary: #F1F5F9;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --border-glass: rgba(0, 212, 255, 0.15);
    --border-glass-hover: rgba(0, 212, 255, 0.4);
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-inverse: #F8FAFC;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 8px 40px rgba(0, 212, 255, 0.15);
}

/* ---------- Base Reset ---------- */
*, *::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-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

::selection {
    background: rgba(0, 212, 255, 0.3);
    color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--primary-deep); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-cyan); }

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 6rem 0;
    position: relative;
}

.section-alt {
    background: var(--bg-secondary);
}

/* ---------- Typography ---------- */
.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 600px;
    margin-bottom: 3rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-cyan) 0%, var(--primary-teal) 50%, var(--primary-deep) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Glass Cards ---------- */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    transition: all var(--transition-base);
}

.glass-card:hover {
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    outline: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-teal));
    color: var(--text-inverse);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow-strong);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-cyan);
    border: 1px solid var(--border-glass-hover);
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--primary-cyan);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}

.btn-ghost:hover {
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
    background: rgba(0, 212, 255, 0.05);
}

/* ---------- Tags ---------- */
.tag {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-cyan);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--border-glass);
    border-radius: 9999px;
}

/* ---------- Reveal Animations ---------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ---------- Background Effects ---------- */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

[data-theme="light"] .bg-grid {
    opacity: 0.15;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.06) 1px, transparent 1px);
}

.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}

.bg-glow-1 { top: -200px; left: -200px; animation-delay: 0s; }
.bg-glow-2 { bottom: -200px; right: -200px; animation-delay: -10s; }

/* ---------- Header ---------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    transition: all var(--transition-base);
}

.header.scrolled {
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
}

[data-theme="light"] .header.scrolled {
    background: rgba(248, 250, 252, 0.9);
    border-bottom: 1px solid var(--border-glass);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-text span {
    color: var(--primary-cyan);
}

/* Navigation */
.nav-desktop {
    display: none;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-cyan);
    transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-cyan);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-cta {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.theme-toggle:hover {
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
    box-shadow: var(--shadow-glow);
}

/* Mobile Menu */
.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-base);
}

.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-mobile {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-glass);
    padding: 5rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: right var(--transition-base);
    z-index: 999;
}

.nav-mobile.active { right: 0; }

.nav-mobile .nav-link { font-size: 1.125rem; padding: 0.5rem 0; }

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 998;
}

.overlay.active { opacity: 1; visibility: visible; }

/* ---------- Footer ---------- */
.footer {
    border-top: 1px solid var(--border-glass);
    padding: 3rem 0 2rem;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.footer-logo {
    width: 180px;
    height: auto;
    opacity: 0.7;
    transition: opacity var(--transition-base);
}

.footer-logo:hover { opacity: 1; }

/* Footer logo swaps with theme so text stays legible in both modes */
.footer-logo.for-light-theme { display: none; }
[data-theme="light"] .footer-logo.for-dark-theme { display: none; }
[data-theme="light"] .footer-logo.for-light-theme { display: block; }

/* ---------- Credentials Band ---------- */
.credentials-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.credential-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.credential-badge:hover {
    border-color: var(--border-glass-hover);
    color: var(--text-primary);
    box-shadow: var(--shadow-glow);
}

.credential-badge svg {
    color: var(--primary-cyan);
    flex-shrink: 0;
}

/* ---------- Case Study Split Panel ---------- */
.case-study {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
    padding: 2.5rem;
}

.case-study-tag {
    margin-bottom: 1rem;
}

.case-study-quote {
    font-family: var(--font-heading);
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.case-study-body {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.case-study-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.case-study-stat-number {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    color: var(--primary-cyan);
    line-height: 1;
    display: block;
}

.case-study-stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .case-study { grid-template-columns: 1.1fr 0.9fr; padding: 3rem; }
}

/* ---------- Hero Pipeline Graphic ---------- */
.hero-pipeline {
    width: 100%;
    max-width: 380px;
    height: auto;
    animation: float 8s ease-in-out infinite;
}

.hero-pipeline .pipeline-node-bg {
    fill: var(--bg-glass);
    stroke: var(--border-glass-hover);
}

.hero-pipeline .pipeline-icon-bg {
    fill: rgba(0, 212, 255, 0.12);
    stroke: var(--primary-cyan);
}

.hero-pipeline .pipeline-icon {
    stroke: var(--primary-cyan);
}

.hero-pipeline .pipeline-title {
    fill: var(--text-primary);
    font-family: var(--font-heading);
}

.hero-pipeline .pipeline-subtitle {
    fill: var(--text-secondary);
    font-family: var(--font-body);
}

.hero-pipeline .pipeline-line {
    stroke: var(--primary-cyan);
    opacity: 0.4;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-link:hover { color: var(--primary-cyan); }

.footer-legal {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color var(--transition-fast);
}

.footer-legal a:hover { color: var(--primary-cyan); }

.footer-copy {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-copy span {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ---------- Social Links ---------- */
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.social-link:hover {
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

/* ---------- Cookie Consent Banner ---------- */
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: -160px;
    z-index: 2000;
    max-width: 720px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass-hover);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-card-hover);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: bottom var(--transition-slow);
}

.cookie-banner.active {
    bottom: 1rem;
}

.cookie-banner-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-banner-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.cookie-banner-text a {
    color: var(--primary-cyan);
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-shrink: 0;
}

.cookie-banner-actions .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .cookie-banner-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1.5rem;
    }
    .cookie-banner-text {
        flex: 1;
    }
}

/* ---------- Keyframes ---------- */
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.2); }
    50% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.4); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
    .projects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .nav-desktop { display: flex; }
    .menu-toggle { display: none; }
    .hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
    .hero-visual { margin-top: 0; }
    .about-grid { grid-template-columns: 1fr 1fr; }
    .contact-details { flex-direction: row; justify-content: center; }
    .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

@media (min-width: 1024px) {
    .skills-grid { grid-template-columns: repeat(3, 1fr); }
    .section { padding: 8rem 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}