/* =========================================
   SubraLabs — Style
   Zero dependencies. Pure CSS.
   ========================================= */

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

:root {
    --font-serif: 'Times New Roman', Times, Georgia, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Helvetica, Arial, sans-serif;

    --bg: #faf9f6;
    --bg-alt: #f3f1ec;
    --text: #1a1a1a;
    --text-mid: #555;
    --text-light: #888;
    --accent: #8b6f47;
    --accent-light: #c9a96e;
    --border: #e0dcd4;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    --space-2xl: 10rem;

    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::selection {
    background: var(--accent);
    color: #fff;
}

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

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

ul {
    list-style: none;
}


/* --- Layout --- */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-2xl) 0;
}

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


/* --- Typography --- */
.section-label {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: var(--space-lg);
    color: var(--text);
}

.lead {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: var(--space-md);
}


/* --- Header / Nav --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s var(--ease);
    border-bottom: 1px solid transparent;
}

.header.scrolled {
    background-color: rgba(250, 249, 246, 0.85);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom-color: var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--space-sm) var(--space-md);
    height: 64px;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: opacity 0.3s var(--ease);
}

.logo:hover {
    opacity: 0.6;
}

.nav-list {
    display: flex;
    gap: var(--space-md);
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--text-mid);
    transition: color 0.3s var(--ease);
    position: relative;
}

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

.nav-link:hover {
    color: var(--text);
}

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

/* Hamburger */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 1.5px;
    background-color: var(--text);
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
    transform-origin: center;
}

.menu-toggle.active span:first-child {
    transform: translateY(3.75px) rotate(45deg);
}

.menu-toggle.active span:last-child {
    transform: translateY(-3.75px) rotate(-45deg);
}


/* --- Hero --- */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-lg) var(--space-md);
    position: relative;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(3.5rem, 10vw, 8rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text);
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px);
    animation: charReveal 0.7s var(--ease-out) forwards;
}

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

.hero-subtitle {
    font-family: var(--font-sans);
    font-size: clamp(0.875rem, 2vw, 1.1rem);
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-light);
    opacity: 0;
    animation: fadeUp 0.8s var(--ease-out) 0.8s forwards;
}

.hero-line {
    width: 60px;
    height: 1px;
    background-color: var(--border);
    transform: scaleX(0);
    animation: lineGrow 0.6s var(--ease-out) 0.5s forwards;
}

@keyframes lineGrow {
    to { transform: scaleX(1); }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    opacity: 0;
    animation: fadeUp 0.6s var(--ease-out) 1.2s forwards;
}

.scroll-indicator span {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-light);
}

.scroll-arrow {
    width: 1px;
    height: 24px;
    position: relative;
    overflow: hidden;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--text-light);
    animation: scrollDown 1.8s var(--ease) infinite;
}

@keyframes scrollDown {
    0% { top: -100%; }
    50% { top: 0; }
    100% { top: 100%; }
}


/* --- About --- */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.about-text p {
    color: var(--text-mid);
    margin-bottom: var(--space-sm);
}

.about-text p.lead {
    color: var(--text);
}

.about-details {
    border-top: 1px solid var(--border);
    padding-top: var(--space-md);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border);
}

.detail-label {
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-light);
}

.detail-value {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--text);
}


/* --- Projects --- */
.project-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 2px;
}

.project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--bg);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 30px rgba(0,0,0,0.06);
    transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 16px 48px rgba(0,0,0,0.1);
}

.project-visual {
    position: relative;
    min-height: 380px;
    background: linear-gradient(135deg, #c9a96e 0%, #8b6f47 40%, #5c4531 100%);
    overflow: hidden;
}

.project-visual-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: var(--space-md);
}

/* Geometric pattern overlay */
.project-visual-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.08;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 30px, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 31px),
        repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 31px);
}

.project-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.15);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    padding: 0.4rem 0.8rem;
    border-radius: 2px;
    position: relative;
    z-index: 1;
}

.project-info {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-name {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: var(--space-xs);
}

.project-tagline {
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-md);
}

.project-description {
    color: var(--text-mid);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.project-tech span {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-light);
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 2px;
    transition: border-color 0.3s var(--ease), color 0.3s var(--ease);
}

.project-tech span:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.project-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-top: var(--space-sm);
    transition: gap 0.3s var(--ease-out);
}

.project-card-link:hover .project-cta {
    gap: 0.8rem;
}

.cta-arrow {
    transition: transform 0.3s var(--ease-out);
}

.project-card-link:hover .cta-arrow {
    transform: translateX(4px);
}


/* --- Contact --- */
.contact {
    text-align: center;
}

.contact-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.contact-text {
    font-size: 1.1rem;
    color: var(--text-mid);
    max-width: 480px;
    margin-bottom: var(--space-lg);
}

.contact-email {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--accent);
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s var(--ease);
}

.contact-email::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease-out);
}

.contact-email:hover {
    color: var(--text);
}

.contact-email:hover::after {
    transform: scaleX(1);
    transform-origin: left;
    background-color: var(--text);
}


/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border);
    padding: var(--space-md) 0;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-light);
}


/* --- Scroll Reveal --- */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

[data-reveal].visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Responsive --- */

/* Tablet */
@media (max-width: 900px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }

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

    .project-visual {
        min-height: 260px;
    }
}

/* Mobile */
@media (max-width: 640px) {
    :root {
        --space-2xl: 6rem;
    }

    .nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100dvh;
        background-color: rgba(250, 249, 246, 0.97);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
        z-index: 90;
    }

    .nav.open {
        opacity: 1;
        visibility: visible;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: var(--space-lg);
    }

    .nav-link {
        font-family: var(--font-serif);
        font-size: 1.5rem;
        color: var(--text);
    }

    .menu-toggle {
        display: flex;
        position: relative;
        z-index: 95;
    }

    .hero-title {
        letter-spacing: -0.01em;
    }

    .project-info {
        padding: var(--space-md);
    }

    .footer-inner {
        flex-direction: column;
        gap: var(--space-xs);
        text-align: center;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }

    .hero-title .char {
        opacity: 1;
        transform: none;
    }

    .hero-subtitle {
        opacity: 1;
    }

    .hero-line {
        transform: scaleX(1);
    }

    .scroll-indicator {
        opacity: 1;
    }
}
