:root {
    /* Colors - Brand Palette (Dark Mode Adaptation) */
    --bg-dark: #041C1E;
    /* Primary Brand Background */
    --bg-card: rgba(254, 252, 248, 0.03);
    /* Sand-tinted glass */
    --bg-card-hover: rgba(254, 252, 248, 0.06);

    --text-primary: #FEFCF8;
    /* Sand White */
    --text-secondary: #CBB9A9;
    /* Secondary Sand */
    --text-tertiary: #134338;
    /* Dark Green (used for depth/borders) */

    --accent-primary: #CBB9A9;
    /* Secondary Sand as primary accent in dark mode */
    --accent-glow: rgba(203, 185, 169, 0.3);
    --accent-gradient: linear-gradient(135deg, #FEFCF8, #CBB9A9);

    --border-light: rgba(254, 252, 248, 0.1);
    --border-hover: rgba(254, 252, 248, 0.2);

    /* Typography */
    --font-display: 'Funnel Display', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    /* Spacing */
    --container-width: 1400px;
    --header-height: 80px;

    /* Animations */
    --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
    --ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s var(--ease-out);
}

ul {
    list-style: none;
}

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

/* Typography Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.1;
}

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

.outline-text {
    -webkit-text-stroke: 1px var(--text-secondary);
    -webkit-text-fill-color: transparent;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: all 0.4s var(--ease-out);
}

header.scrolled {
    padding: 1rem 0;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
    font-family: var(--font-display);
    /* Ensure brand font */
}

.logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--text-primary);
    color: var(--bg-dark);
    border-radius: 8px;
    font-family: var(--font-display);
    font-weight: 800;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
    transition: color 0.3s var(--ease-out);
    font-family: var(--font-display);
    /* Use brand font */
    font-weight: 500;
    letter-spacing: 0.02em;
}

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

.nav-links a:not(.nav-cta)::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--text-primary);
    transition: width 0.3s var(--ease-out);
}

.nav-links a:not(.nav-cta):hover::after {
    width: 100%;
}

.nav-cta {
    padding: 0.75rem 1.5rem;
    background: var(--text-primary);
    color: var(--bg-dark) !important;
    border-radius: 100px;
    font-weight: 600;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    z-index: 1001;
}

.mobile-menu-toggle .line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    position: absolute;
    transition: all 0.3s var(--ease-out);
}

.mobile-menu-toggle .line:first-child {
    top: 0;
}

.mobile-menu-toggle .line:last-child {
    bottom: 0;
}

.mobile-menu-toggle.active .line:first-child {
    transform: rotate(45deg);
    top: 9px;
}

.mobile-menu-toggle.active .line:last-child {
    transform: rotate(-45deg);
    bottom: 9px;
}

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

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out alternate;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-primary), transparent 70%);
    top: -10%;
    right: -10%;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #8b5cf6, transparent 70%);
    bottom: -10%;
    left: -10%;
    animation-delay: -5s;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: pulse 2s infinite;
}

.hero h1 {
    font-size: clamp(3.5rem, 8vw, 6rem);
    line-height: 1;
    margin-bottom: 2rem;
    letter-spacing: -0.03em;
}

.hero-description {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
}

.hero-description .highlight {
    display: block;
    margin-top: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 100px;
    font-weight: 600;
    transition: all 0.3s var(--ease-out);
    cursor: pointer;
    border: none;
    font-family: var(--font-body);
    font-size: 1rem;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.15);
}

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

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
}

.btn-submit {
    background: var(--accent-primary);
    color: white;
    width: 100%;
}

.btn-submit:hover {
    background: var(--text-primary);
    color: var(--bg-dark);
    transform: translateY(-2px);
}

/* Manifesto Section */
.manifesto {
    padding: 8rem 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(to bottom, var(--bg-dark), rgba(4, 28, 30, 0.5));
}

.manifesto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 4rem;
}

.manifesto-item {
    padding: 2rem;
    border-left: 1px solid var(--border-light);
    transition: all 0.3s var(--ease-out);
}

.manifesto-item:hover {
    border-left-color: var(--text-primary);
    background: var(--bg-card-hover);
}

.manifesto-number {
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--text-tertiary);
    opacity: 0.5;
    margin-bottom: 1.5rem;
    line-height: 1;
}

.manifesto-item:hover .manifesto-number {
    color: var(--text-secondary);
    opacity: 0.8;
}

.manifesto-item h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.manifesto-item p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Projects Section */
.projects {
    padding: 8rem 0;
}

.section-header {
    margin-bottom: 5rem;
}

.section-label {
    display: block;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

.projects-grid {
    display: grid;
    gap: 6rem;
}

.project-card {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
}

.project-card:nth-child(even) {
    direction: rtl;
}

.project-card:nth-child(even) .project-info {
    direction: ltr;
}

.project-visual {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    aspect-ratio: 16/10;
    transform: translateZ(0);
    /* Fix for Safari flickering */
}

.project-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease-out);
}

@media (hover: hover) {
    .project-card:hover .project-visual img {
        transform: scale(1.05);
    }

    .project-card:hover .project-overlay {
        opacity: 1;
    }

    .project-card:hover .btn-icon {
        transform: scale(1);
    }
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
    backdrop-filter: blur(4px);
}

/* Mobile: Show overlay elements by default or on tap without sticky hover */
@media (hover: none) {
    .project-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.1);
        /* Lighter overlay on mobile */
        backdrop-filter: none;
    }

    .btn-icon {
        transform: scale(1);
        background: rgba(254, 252, 248, 0.9);
    }
}

.btn-icon {
    width: 64px;
    height: 64px;
    padding: 0;
    /* Override .btn padding */
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    transition: transform 0.3s var(--ease-bounce);
    flex-shrink: 0;
    /* Prevent squishing */
}

.project-card:hover .btn-icon {
    transform: scale(1);
}

.project-info h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.badge-beta {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.badge-live {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.project-info p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.project-tags {
    display: flex;
    gap: 1rem;
}

.project-tags span {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: 100px;
    border: 1px solid var(--border-light);
}

/* Values Section */
.values {
    padding: 8rem 0;
    background: linear-gradient(to bottom, var(--bg-dark), #0f0f0f);
}

.values-wrapper {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 4rem;
}

.values-intro {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-top: 2rem;
    max-width: 400px;
}

.values-list {
    display: grid;
    gap: 2rem;
}

.value-item {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    padding: 2.5rem;
    border-radius: 24px;
    display: flex;
    gap: 2rem;
    transition: all 0.3s var(--ease-out);
}

.value-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateX(10px);
}

.value-number {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--border-light);
    line-height: 1;
}

.value-item:hover .value-number {
    color: var(--accent-primary);
}

.value-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.value-content p {
    color: var(--text-secondary);
}

/* Contact Section */
.contact {
    padding: 8rem 0;
    position: relative;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: start;
}

.contact-info h2 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.contact-info p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 4rem;
}

.contact-meta {
    display: grid;
    gap: 2rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meta-item .label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
}

.meta-item .value {
    font-size: 1.25rem;
    font-weight: 500;
}

.contact-form-wrapper {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 32px;
    border: 1px solid var(--border-light);
}

.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s var(--ease-out);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-group label {
    position: absolute;
    left: 1rem;
    top: 1.25rem;
    color: var(--text-tertiary);
    pointer-events: none;
    transition: all 0.3s var(--ease-out);
    background: transparent;
    padding: 0 0.25rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group input:not(:placeholder-shown),
.form-group textarea:not(:placeholder-shown) {
    border-color: var(--accent-primary);
    outline: none;
    background: rgba(255, 255, 255, 0.05);
}

.form-group input:focus~label,
.form-group textarea:focus~label,
.form-group input:not(:placeholder-shown)~label,
.form-group textarea:not(:placeholder-shown)~label {
    top: -0.6rem;
    left: 0.75rem;
    font-size: 0.75rem;
    color: var(--accent-primary);
    background: var(--bg-dark);
}

/* Footer */
footer {
    padding: 6rem 0 2rem;
    border-top: 1px solid var(--border-light);
}

footer {
    padding: 6rem 0 3rem;
    border-top: 1px solid var(--border-light);
    background: var(--bg-dark);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3rem;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-brand {
    align-items: center;
}

.footer-tagline {
    color: var(--text-tertiary);
    font-size: 1.125rem;
}

.footer-status {
    align-items: center;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    opacity: 0.6;
}

/* Desktop Footer Grid */
@media (min-width: 1024px) {
    .footer-content {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        text-align: left;
        gap: 2rem;
    }

    .footer-brand {
        align-items: flex-start;
    }

    .footer-status {
        justify-self: center;
    }

    .footer-meta {
        align-items: flex-end;
        text-align: right;
        justify-self: end;
    }
}

/* Animations */
@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(20px, -20px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s var(--ease-out) forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-out);
}

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

/* Responsive */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 4rem;
    }

    .projects-grid {
        gap: 4rem;
    }

    .project-card {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-card:nth-child(even) {
        direction: ltr;
    }

    .project-card:nth-child(even) .project-info {
        direction: ltr;
    }

    .values-wrapper {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 4rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100%;
        background: var(--bg-dark);
        flex-direction: column;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.4s var(--ease-out);
        z-index: 1000;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        display: block;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }

    .contact-info h2 {
        font-size: 2.5rem;
    }
}

/* Status Indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 2rem;
    font-family: var(--font-body);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
    animation: pulse 2s infinite;
}

.status-indicator.sleeping .status-dot {
    background-color: #f59e0b;
    /* Amber for sleep */
    box-shadow: none;
    animation: none;
    opacity: 0.8;
}

.status-text {
    font-weight: 500;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-out);
}

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

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Form Validation */
.form-group.error input,
.form-group.error textarea {
    border-color: #ef4444;
    /* Red-500 */
    box-shadow: 0 0 0 1px #ef4444;
}

.form-error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: block;
    font-weight: 500;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}