/* ========================================
   Urban Terrains Lab — Styles
   Minimal, architectural aesthetic
   ======================================== */

:root {
    --bg: #fafafa;
    --bg-dark: #111111;
    --bg-alt: #f0f0f0;
    --text: #1a1a1a;
    --text-light: #666666;
    --text-muted: #999999;
    --text-inverse: #fafafa;
    --accent: #1a1a1a;
    --border: #e0e0e0;
    --border-dark: #333333;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --container: 1280px;
    --gutter: 24px;
    --transition: 0.3s ease;
}

/* 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);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}

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

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

ul {
    list-style: none;
}

/* Container */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ========================================
   Navigation
   ======================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 24px 0;
    transition: all var(--transition);
}

.nav.scrolled {
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    font-family: var(--font-display);
    gap: 0;
}

.logo-office {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.logo-main {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.logo-lab {
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-link {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-light);
    transition: color var(--transition);
    position: relative;
}

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

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

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

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 28px;
}

.nav-toggle span {
    display: block;
    height: 1px;
    background: var(--text);
    transition: all var(--transition);
    width: 100%;
}

.nav-toggle.active span:first-child {
    transform: rotate(45deg) translate(2.5px, 2.5px);
}

.nav-toggle.active span:last-child {
    transform: rotate(-45deg) translate(2.5px, -2.5px);
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.nav-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ========================================
   Hero
   ======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 120px var(--gutter) 80px;
    background: var(--bg);
}

.hero-content {
    max-width: var(--container);
    margin: 0 auto;
    width: 100%;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
}

.hero-accent {
    color: var(--text-muted);
    font-weight: 200;
}

.hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    font-weight: 300;
    color: var(--text-light);
    max-width: 640px;
    line-height: 1.6;
    margin-bottom: 48px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 14px 32px;
    transition: all var(--transition);
}

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

.btn-primary:hover {
    background: #333;
}

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

.btn-secondary:hover {
    border-color: var(--text);
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: var(--gutter);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.hero-scroll span {
    font-family: var(--font-display);
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    writing-mode: vertical-rl;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: var(--border);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--text);
    animation: scrollLine 2s ease-in-out infinite;
}

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

/* ========================================
   Sections
   ======================================== */
.section {
    padding: 120px 0;
}

.section-dark {
    background: var(--bg-dark);
    color: var(--text-inverse);
}

.section-dark .section-label {
    color: #666;
}

.section-dark .section-subtitle {
    color: #999;
}

.section-header {
    margin-bottom: 64px;
}

.section-label {
    display: block;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 300;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.section-subtitle {
    font-size: 15px;
    font-weight: 300;
    color: var(--text-light);
    margin-top: 8px;
}

/* ========================================
   Project Grid
   ======================================== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.project-card {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-alt);
    display: block;
    cursor: pointer;
}

.project-card.project-large {
    grid-column: span 2;
    aspect-ratio: 2 / 1;
}

.project-image {
    position: absolute;
    inset: 0;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease, filter 0.6s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.03);
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    color: white;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s ease;
}

.project-card:hover .project-info {
    transform: translateY(0);
    opacity: 1;
}

.project-location {
    display: block;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
    opacity: 0.7;
}

.project-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 4px;
}

.project-meta {
    font-size: 13px;
    font-weight: 300;
    opacity: 0.7;
    line-height: 1.4;
}

/* ========================================
   Prior Work Grid
   ======================================== */
.prior-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.prior-card {
    display: block;
    transition: opacity var(--transition);
}

.prior-card:hover {
    opacity: 0.8;
}

.prior-image {
    aspect-ratio: 1;
    overflow: hidden;
    margin-bottom: 16px;
    background: #222;
}

.prior-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(30%);
    transition: filter var(--transition);
}

.prior-card:hover .prior-image img {
    filter: grayscale(0%);
}

.prior-info h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* ========================================
   Research Grid
   ======================================== */
.research-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 48px 32px;
}

.research-card {
    display: block;
    transition: opacity var(--transition);
}

.research-card:hover {
    opacity: 0.8;
}

.research-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--bg-alt);
}

.research-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.research-card:hover .research-image img {
    transform: scale(1.02);
}

.research-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 4px;
}

.research-subtitle {
    font-size: 15px;
    color: var(--text-light);
    font-weight: 300;
    margin-bottom: 8px;
}

.research-meta {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ========================================
   About
   ======================================== */
.section-about {
    background: var(--bg-alt);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 80px;
    align-items: start;
}

.about-name {
    font-family: var(--font-display);
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 400;
    margin-bottom: 4px;
}

.about-role {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.about-bio p {
    margin-bottom: 20px;
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.8;
}

.about-bio p:last-child {
    margin-bottom: 0;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.detail-block h4 {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.detail-block li {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-light);
    padding: 4px 0;
}

/* ========================================
   Contact
   ======================================== */
.section-contact {
    text-align: center;
    padding: 160px 0;
}

.contact-content {
    max-width: 560px;
    margin: 0 auto;
}

.contact-text {
    font-size: 18px;
    font-weight: 300;
    color: var(--text-light);
    margin-bottom: 24px;
    line-height: 1.7;
}

.contact-email {
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 400;
    letter-spacing: -0.01em;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
    transition: border-color var(--transition);
}

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

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--bg-dark);
    color: var(--text-inverse);
    padding: 60px 0;
}

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

.footer .logo-office,
.footer .logo-lab {
    color: #666;
}

.footer .logo-main {
    font-size: 14px;
}

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

.footer-links a {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #999;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: white;
}

.footer-copy {
    font-size: 12px;
    color: #666;
}

/* ========================================
   Modal
   ======================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 40px;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 32px;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition);
    z-index: 210;
    line-height: 1;
    font-weight: 300;
}

.modal-close:hover {
    opacity: 1;
}

.modal-content {
    max-width: 1000px;
    width: 100%;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: center;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.modal.open .modal-content {
    transform: translateY(0);
}

.modal-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: #222;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    color: white;
}

.modal-location {
    display: block;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 12px;
}

.modal-title {
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 20px;
}

.modal-description {
    font-size: 15px;
    font-weight: 300;
    line-height: 1.8;
    color: #bbb;
}

@media (max-width: 768px) {
    .modal {
        padding: 20px;
        align-items: flex-start;
        overflow-y: auto;
    }

    .modal-content {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top: 60px;
    }

    .modal-image {
        aspect-ratio: 4 / 3;
    }
}

/* ========================================
   Animations
   ======================================== */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-card.project-large {
        grid-column: span 2;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .about-details {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 32px;
    }

    .detail-block {
        flex: 1;
        min-width: 160px;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: var(--bg);
        flex-direction: column;
        padding: 100px 40px 40px;
        gap: 24px;
        transition: right var(--transition);
        z-index: 95;
        border-left: 1px solid var(--border);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-link {
        font-size: 16px;
    }

    .hero-title {
        font-size: clamp(36px, 10vw, 64px);
    }

    .section {
        padding: 80px 0;
    }

    .section-contact {
        padding: 100px 0;
    }

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

    .project-card.project-large {
        grid-column: span 2;
    }

    .project-info {
        opacity: 1;
        transform: none;
        padding: 16px;
    }

    .project-title {
        font-size: 14px;
    }

    .project-location,
    .project-meta {
        display: none;
    }

    .prior-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .research-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .footer-links {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .project-grid {
        grid-template-columns: 1fr;
    }

    .project-card,
    .project-card.project-large {
        grid-column: span 1;
        aspect-ratio: 4 / 3;
    }

    .prior-grid {
        grid-template-columns: 1fr;
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn {
        text-align: center;
    }
}
