/* ==========================================================================
   JOHN SAMWANI - PORTFOLIO DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

/* --- Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Root & Design Tokens --- */
:root {
    /* Color Palette */
    --primary: #8a5a36;         /* Caramel Bronze Brown */
    --primary-hover: #704729;   /* Deep roasted coffee brown */
    --primary-light: #f7f1eb;   /* Linen sand-clay tint */
    --secondary: #a87853;       /* Warm Terracotta Gold */
    --dark: #0f172a;            /* Slate 900 (Rich Dark) */
    --dark-muted: #1e293b;      /* Slate 800 */
    --text-primary: #334155;    /* Slate 700 (High contrast text) */
    --text-muted: #64748b;      /* Slate 500 (Subtle labels) */
    --bg-light: #f8fafc;        /* Slate 50 (Soft section bg) */
    --bg-white: #ffffff;
    --border-color: #e2e8f0;    /* Slate 200 */
    --success: #10b981;         /* Emerald 500 */
    --error: #ef4444;           /* Red 500 */
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Layout & Spacing */
    --max-width: 1200px;
    --header-height: 80px;
    
    /* Transitions & Shadows */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    --shadow-xl: 0 20px 25px -5px rgba(138, 90, 54, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

/* --- Dark Mode Theme Overrides --- */
[data-theme="dark"] {
    --dark: #f8fafc;            /* Slate 50 (Light text for headers) */
    --dark-muted: #e2e8f0;      /* Slate 200 */
    --text-primary: #cbd5e1;    /* Slate 300 (High contrast text) */
    --text-muted: #94a3b8;      /* Slate 400 (Subtle labels) */
    --bg-light: #1e293b;        /* Slate 800 (Soft section bg) */
    --bg-white: #0f172a;        /* Slate 900 (Main card bg) */
    --border-color: #334155;    /* Slate 700 */
    --primary-light: #2d241d;   /* Deep roasted caramel tint */
    
    /* Muted shadow values for dark background */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

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

html {
    scroll-behavior: auto; /* Handled smoothly by JS offset */
    scroll-padding-top: var(--header-height);
}

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

/* --- Common Components & Layout --- */
section {
    padding: 100px 0;
    position: relative;
}

.bg-alt {
    background-color: var(--bg-light);
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

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

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

ul {
    list-style: none;
}

input, textarea, button {
    font-family: inherit;
    font-size: inherit;
}

/* Typography Utilities */
h1, h2, h3, h4 {
    color: var(--dark);
    font-weight: 700;
    line-height: 1.25;
}

.section-tag {
    display: inline-block;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.section-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.section-desc {
    color: var(--text-muted);
    font-size: 18px;
    max-width: 600px;
    margin-bottom: 60px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--bg-white);
    box-shadow: 0 4px 14px rgba(138, 90, 54, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 90, 54, 0.35);
}

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

.btn-outline:hover {
    background-color: var(--bg-light);
    border-color: var(--text-muted);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

/* --- Modal Overlay --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.2s ease;
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 36px 32px 28px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideUp 0.25s ease;
    position: relative;
}
.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 30px;
}
.modal-icon.info {
    background: #dbeafe;
    color: #1e40af;
}
.modal-icon.warning {
    background: #fef3c7;
    color: #d97706;
}
.modal-icon.error {
    background: #fee2e2;
    color: #991b1b;
}
.modal-icon.success {
    background: #d1fae5;
    color: #065f46;
}
.modal-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 10px;
}
.modal-message {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 28px;
}
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.modal-actions .btn {
    min-width: 100px;
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.modal-close:hover {
    color: var(--text-primary);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Header / Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: var(--transition);
    background-color: transparent;
    border-bottom: 1px solid transparent;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    height: 70px;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .navbar.scrolled {
    background-color: var(--bg-white);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 22px;
    color: var(--dark);
    letter-spacing: -0.03em;
}

.logo-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background-color: var(--primary);
    display: inline-block;
}

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

.nav-link {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-muted);
    position: relative;
    padding: 8px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--dark);
}

.nav-link.active::after, .nav-link:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

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

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-btn:hover svg {
    transform: rotate(30deg);
}

/* Toggle Sun/Moon icons based on theme state */
[data-theme="dark"] .moon-icon {
    display: none;
}

html:not([data-theme="dark"]) .sun-icon {
    display: none;
}

/* Hamburger Menu button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background-color: var(--dark);
    transition: var(--transition);
    transform-origin: left;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: calc(var(--header-height) + 40px);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    max-width: 650px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-light);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero-badge span {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: var(--radius-full);
    display: inline-block;
    animation: pulse 2s infinite;
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.typing-container {
    display: inline-block;
    min-height: 1.1em;
    vertical-align: top;
}

@media (max-width: 1024px) {
    .typing-container {
        min-height: 2.2em;
    }
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 36px;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 48px;
    border-top: 1px solid var(--border-color);
    padding-top: 32px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, var(--primary-light) 0%, rgba(255,255,255,0) 70%);
    z-index: -1;
    transform: scale(1.2);
}

.hero-image {
    width: 320px;
    height: 320px;
    border-radius: var(--radius-full);
    object-fit: cover;
    box-shadow: var(--shadow-xl);
    border: 8px solid var(--bg-white);
    background-color: var(--bg-light);
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 32px;
}

.about-feature {
    display: flex;
    gap: 16px;
}

.about-feature-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.about-feature-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.about-feature-desc {
    font-size: 14px;
    color: var(--text-muted);
}

/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.service-card {
    background-color: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.service-icon-box {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.service-icon-box svg {
    width: 28px;
    height: 28px;
}

.service-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.service-desc {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 20px;
}

.service-link {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.service-link svg {
    width: 16px;
    height: 16px;
    transition: var(--transition);
}

.service-card:hover .service-link svg {
    transform: translateX(4px);
}

/* --- Tech Stack Section --- */
.tech-container {
    max-width: 1000px;
    margin: 0 auto;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.tech-item {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition);
}

.tech-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.tech-icon {
    font-size: 32px;
    color: var(--text-primary);
    transition: var(--transition);
    height: 40px;
    display: flex;
    align-items: center;
}

.tech-item:hover .tech-icon {
    color: var(--primary);
    transform: scale(1.1);
}

.tech-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

/* --- Portfolio Section --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.portfolio-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.portfolio-img-box {
    height: 220px;
    position: relative;
    background: linear-gradient(135deg, var(--primary-light), var(--bg-light));
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-img-box img {
    transition: var(--transition);
}

.portfolio-card:hover .portfolio-img-box img {
    transform: scale(1.05);
}

/* Abstract design elements for placeholder project cards */
.portfolio-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(138, 90, 54, 0.15) 0%, rgba(168, 120, 83, 0.15) 100%);
    color: var(--primary);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
    position: relative;
}

.portfolio-img-placeholder::before {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    border: 1px dashed rgba(138, 90, 54, 0.15);
    border-radius: var(--radius-full);
    animation: rotate 60s linear infinite;
}

.portfolio-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.portfolio-content .btn {
    margin-top: auto;
    width: fit-content;
    align-self: flex-start;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.portfolio-tag {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background-color: var(--primary-light);
    padding: 4px 12px;
    border-radius: var(--radius-full);
}

.portfolio-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

.portfolio-text {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* --- Testimonials Section --- */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.testimonial-card {
    background-color: var(--bg-white);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    position: relative;
}

.testimonial-stars {
    color: #f59e0b; /* Amber 500 */
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
}

.testimonial-text {
    font-size: 16px;
    color: var(--text-primary);
    font-style: italic;
    margin-bottom: 28px;
}

.testimonial-client {
    display: flex;
    align-items: center;
    gap: 16px;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--bg-white);
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.testimonial-info h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.testimonial-info p {
    font-size: 13px;
    color: var(--text-muted);
}

/* --- Hire Me (CTA Banner) Section --- */
.cta-banner {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-muted) 100%);
    color: var(--bg-white);
    padding: 80px 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.cta-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(138, 90, 54, 0.15) 0%, rgba(0,0,0,0) 60%);
    pointer-events: none;
}

.cta-container {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.cta-banner h2 {
    color: var(--bg-white);
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.cta-banner p {
    color: #94a3b8; /* Slate 400 */
    font-size: 18px;
    margin-bottom: 36px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-upwork {
    background-color: #14a800; /* Upwork Green */
    color: var(--bg-white);
}

.btn-upwork:hover {
    background-color: #108a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(20, 168, 0, 0.35);
}

.btn-fiverr {
    background-color: #1dbf73; /* Fiverr Green */
    color: var(--bg-white);
}

.btn-fiverr:hover {
    background-color: #19a362;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(29, 191, 115, 0.35);
}

/* --- Blog Section --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.blog-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.blog-header {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, var(--bg-light), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-header span {
    position: absolute;
    top: 16px;
    left: 16px;
    background-color: var(--primary);
    color: var(--bg-white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.blog-body {
    padding: 30px;
}

.blog-meta {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 12px;
}

.blog-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.blog-title a:hover {
    color: var(--primary);
}

.blog-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.blog-readmore {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Contact form fields (shared with admin settings) */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}
.form-group label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    outline: none;
    line-height: 1.5;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-control::placeholder {
    color: #94a3b8;
}
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}
select.form-control {
    cursor: pointer;
    appearance: auto;
}

/* Contact section grid */
.contact-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 60px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.contact-method {
    display: flex;
    gap: 20px;
}

.contact-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-icon-box svg {
    width: 22px;
    height: 22px;
}

.contact-details h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.contact-details p {
    font-size: 14px;
    color: var(--text-muted);
}

.contact-form-card {
    background-color: var(--bg-white);
    padding: 36px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Honeypot field hidden from real users */
.honey-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.form-status {
    font-size: 14px;
    font-weight: 600;
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    display: none;
}

.form-status.success {
    display: block;
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.form-status.error {
    display: block;
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* --- Footer Section --- */
.footer {
    background-color: var(--dark);
    color: #94a3b8;
    padding: 80px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--dark-muted);
    margin-bottom: 30px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
}

.footer-logo {
    font-weight: 800;
    font-size: 22px;
    color: var(--bg-white);
    letter-spacing: -0.03em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.footer-logo:hover {
    color: var(--bg-white);
}

.footer-desc {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 320px;
}

.footer-socials {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--dark-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: #94a3b8;
    transition: var(--transition);
}

.social-link:hover {
    border-color: var(--primary);
    background-color: var(--primary);
    color: var(--bg-white);
}

.footer-column h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--bg-white);
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    font-size: 14px;
    color: #94a3b8;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding-top: 10px;
}

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

/* --- Cookie Consent Banner --- */
.cookie-consent-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 560px;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 24px;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.cookie-consent-banner.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.cookie-banner-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 10px;
}

.cookie-banner-title svg {
    color: var(--primary);
}

.cookie-banner-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 18px;
}

.cookie-banner-desc a {
    color: var(--primary);
    font-weight: 600;
}

.cookie-banner-desc a:hover {
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cookie-banner-buttons {
    display: flex;
    gap: 10px;
}

.cookie-banner-buttons .btn {
    flex: 1;
}

.cookie-banner-customize {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    padding: 4px;
    transition: var(--transition);
}

.cookie-banner-customize:hover {
    color: var(--primary);
}

/* --- Cookie Settings Modal --- */
.cookie-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.2s ease;
}

.cookie-modal-overlay.show {
    display: flex;
}

.cookie-modal-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideUp 0.25s ease;
    overflow: hidden;
}

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 0;
}

.cookie-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
}

.cookie-modal-header h3 svg {
    color: var(--primary);
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.cookie-modal-close:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.cookie-modal-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 16px 24px 0;
}

.cookie-categories-list {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cookie-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    background-color: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.cookie-category-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.cookie-category-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
    white-space: nowrap;
    background-color: #d1fae5;
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.cookie-modal-footer {
    padding: 0 24px 24px;
}

/* --- Cookie Toggle Switch --- */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    border-radius: 24px;
    transition: var(--transition);
}

.cookie-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-white);
    border-radius: 50%;
    transition: var(--transition);
}

.cookie-switch input:checked + .cookie-slider {
    background-color: var(--primary);
}

.cookie-switch input:checked + .cookie-slider::before {
    transform: translateX(20px);
}

/* --- Cookie Recall Floating Widget --- */
.cookie-recall-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.cookie-recall-trigger.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.cookie-recall-trigger:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: scale(1.05);
}

/* --- Scroll Animation --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* ==========================================================================
   RESPONSIVE DESIGN / MEDIA QUERIES
   ========================================================================== */

/* --- Tablet / Crossover Viewport (991px and below) --- */
@media (max-width: 991px) {
    /* Navbar Mobile Layout */
    .navbar .btn-primary {
        display: none; /* Hide Hire Me button on mobile header to avoid clutter */
    }

    .hamburger {
        display: flex;
    }
    
    .nav-container {
        padding: 0 20px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background-color: var(--bg-white);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 100px 40px 40px;
        gap: 24px;
        box-shadow: var(--shadow-xl);
        z-index: 1050;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-link {
        font-size: 17px;
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
        color: var(--text-primary);
    }
    
    .nav-link::after {
        display: none; /* Disable hover underline bar on mobile */
    }

    /* Hamburger Menu Active (X-State) */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .hamburger.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(-15px);
    }
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    /* Hero Section Stacking */
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-badge {
        margin-bottom: 20px;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
        gap: 24px 48px;
    }
    
    .hero-image-wrapper {
        order: -1; /* Place image at the top of content on mobile */
    }
    
    .hero-image {
        width: 260px;
        height: 260px;
    }

    /* About Section Stacking */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .about-features {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* --- Mobile Viewport (768px and below) --- */
@media (max-width: 768px) {
    /* Spacing & Container Padding */
    .container {
        padding: 0 16px;
    }
    
    section {
        padding: 60px 0;
    }
    
    .hero {
        padding-top: calc(var(--header-height) + 20px);
    }

    /* Typography Scale Down */
    .hero-title {
        font-size: 38px;
    }
    
    .hero-subtitle {
        font-size: 16px;
        margin-bottom: 28px;
    }
    
    .section-title {
        font-size: 28px;
        margin-bottom: 12px;
    }
    
    .section-desc {
        font-size: 15px;
        margin-bottom: 40px;
    }

    /* Tech Stack Grid */
    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    /* Call To Action (CTA) Banner */
    .cta-banner {
        padding: 50px 24px;
        margin: 0 16px;
    }
    
    .cta-banner h2 {
        font-size: 28px;
    }
    
    .cta-banner p {
        font-size: 15px;
        margin-bottom: 24px;
    }

    /* Contact Form Layout */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .contact-info {
        gap: 28px;
    }
    
    .contact-form-card {
        padding: 24px;
    }

    /* Grids Auto-Fit Refinements (prevents overflow on 320px screens) */
    .services-grid, .portfolio-grid, .testimonials-grid, .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }

    /* Blog Post / Article Card Detail Page Fix */
    .article-card {
        padding: 24px 20px;
        border-radius: var(--radius-md);
    }
    
    .article-title {
        font-size: 28px;
    }
    
    .article-summary {
        font-size: 16px;
        padding-left: 14px;
        margin-bottom: 24px;
    }

    /* Policy Pages Container Responsiveness (Higher Specificity) */
    body .policy-container {
        padding: 100px 16px 40px;
    }
    body .policy-header h1 {
        font-size: 28px;
    }

    /* Footer Responsive Grid */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-desc {
        max-width: 100%;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .footer-bottom-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    /* Cookie Banner & Dialogs */
    .cookie-consent-banner {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: 100%;
        padding: 20px;
    }
    
    .cookie-banner-buttons {
        flex-direction: column;
    }
    
    .cookie-category-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* --- Tiny Mobile Viewport (480px and below) --- */
@media (max-width: 480px) {
    .hero-title {
        font-size: 30px;
    }
    
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    .services-grid, .portfolio-grid, .testimonials-grid, .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   PORTAL RESPONSIVENESS OVERRIDES (ADMIN & CLIENT PORTALS)
   ========================================================================== */

/* Hidden elements on desktop */
.admin-mobile-header,
.admin-hamburger,
.client-hamburger {
    display: none !important;
}

/* Hamburger Buttons */
.admin-hamburger, .client-hamburger {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 24px;
    height: 18px;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 !important;
    z-index: 1200;
}
.admin-hamburger span, .client-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--dark);
    transition: var(--transition);
    transform-origin: left center;
}
/* White bars for admin hamburger on dark background */
.admin-hamburger span {
    background-color: #94a3b8;
}
.admin-hamburger:hover span {
    background-color: #ffffff;
}

/* Active X State */
.admin-hamburger.active span:nth-child(1),
.client-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(1px, 0px);
}
.admin-hamburger.active span:nth-child(2),
.client-hamburger.active span:nth-child(2) {
    width: 0% !important;
    opacity: 0;
}
.admin-hamburger.active span:nth-child(3),
.client-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(1px, -1px);
}

/* --- Tablet / Mobile Portals (1024px and below) --- */
@media (max-width: 1024px) {
    /* --- Admin Portal Sidebar & Layout --- */
    body {
        display: block !important;
        padding-top: 80px !important;
    }
    
    .admin-mobile-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        background-color: var(--dark);
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        z-index: 1100;
        border-bottom: 1px solid var(--dark-muted);
        box-shadow: var(--shadow-md);
    }
    
    .admin-mobile-brand {
        color: var(--bg-white);
        font-weight: 800;
        font-size: 18px;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .admin-hamburger {
        display: flex !important;
    }
    
    html body .sidebar {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        width: 280px !important;
        height: calc(100vh - 60px) !important;
        min-height: auto !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 30px 20px !important;
        background-color: var(--dark) !important;
        z-index: 1050 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: var(--shadow-lg) !important;
    }
    
    html body .sidebar.open {
        transform: translateX(0) !important;
    }
    
    html body .sidebar-brand {
        display: none !important; /* Hide original brand logo since it's in the mobile header */
    }
    
    html body .sidebar-footer {
        border-top: 1px solid var(--dark-muted) !important;
        padding-top: 20px !important;
        margin-top: auto !important;
        position: static !important;
        display: block !important;
    }
    
    html body .sidebar-menu {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        overflow-x: visible !important;
        white-space: normal !important;
        gap: 8px !important;
        width: 100% !important;
        flex-grow: 1 !important;
        padding-bottom: 0 !important;
    }
    
    html body .sidebar-link {
        padding: 12px 16px !important;
        font-size: 15px !important;
        flex-shrink: 0 !important;
    }
    
    html body .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 20px 16px !important;
    }

    /* Grids & Columns */
    html body .metrics-grid,
    html body .dashboard-row,
    html body .dashboard-grid,
    html body .form-row,
    html body .project-layout,
    html body .ticket-layout,
    html body .settings-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    html body .kanban-board {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

/* --- Mobile view for client portal & small screen grids (768px and below) --- */
@media (max-width: 768px) {
    /* --- Client Portal Navigation --- */
    html body {
        padding-top: 90px !important;
    }
    
    html body .navbar.scrolled,
    html body .navbar {
        height: 70px !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background-color: var(--bg-white) !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding: 8px 16px !important;
        z-index: 1000 !important;
    }
    
    html body .nav-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 !important;
        position: relative !important;
    }
    
    html body .logo {
        font-size: 20px !important;
    }

    .client-hamburger {
        display: flex !important;
    }
    
    html body .nav-actions-p {
        position: fixed !important;
        top: 70px !important;
        right: 0 !important;
        width: 280px !important;
        height: calc(100vh - 70px) !important;
        background-color: var(--bg-white) !important;
        border-left: 1px solid var(--border-color) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 30px 20px !important;
        gap: 16px !important;
        transform: translateX(100%) !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        z-index: 999 !important;
        box-shadow: var(--shadow-xl) !important;
        overflow-y: auto !important;
        white-space: normal !important;
        margin-right: 0 !important;
    }

    html body .nav-actions-p.open {
        transform: translateX(0) !important;
    }
    
    html body .nav-actions-p a,
    html body .nav-actions-p button {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
        padding: 10px 14px !important;
        font-size: 15px !important;
        border-radius: var(--radius-sm) !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    html body .nav-actions-p a:hover,
    html body .nav-actions-p button:hover {
        background-color: var(--bg-light) !important;
    }

    html body .nav-actions-p .theme-toggle-btn {
        width: 44px !important;
        height: 44px !important;
        border-radius: var(--radius-full) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-left: 14px !important;
    }

    html body .nav-actions-p .btn-outline {
        margin-top: 10px !important;
        text-align: center !important;
        background-color: transparent !important;
    }

    /* Hide user badge on mobile to save screen real estate */
    html body .nav-actions-p span.user-badge,
    html body .nav-actions-p span {
        display: none !important;
    }
    
    /* Make all tables scrollable horizontally to prevent breaking containers */
    .admin-table,
    .portal-table,
    table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Adjust page headers */
    .main-header, .portal-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        margin-bottom: 24px !important;
        padding: 20px !important;
    }
    
    .main-header h1, .portal-header h1 {
        font-size: 24px !important;
    }
    
    /* Small screen grids */
    html body .kanban-board {
        grid-template-columns: 1fr !important;
    }
}


