/* ══════════════════════════════════════════════════════
   layout.css
   Header, hero, portfolio grid, footer, and page layout
   ══════════════════════════════════════════════════════ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === HEADER & NAV === */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(245, 245, 245, 0.9);
    backdrop-filter: blur(15px);
    z-index: 4000;
    border-bottom: 1px solid rgba(26, 26, 26, 0.1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transform: translateZ(0);
    will-change: transform;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-colour);
    transition: width 0.3s ease;
}

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

/* Language switcher */
.language-switcher {
    display: flex;
    gap: 0.5rem;
    margin-left: 2rem;
}

.lang-btn {
    background: rgba(26, 26, 26, 0.1);
    border: 1px solid rgba(26, 26, 26, 0.2);
    color: #1a1a1a;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.lang-btn:hover {
    background: rgba(26, 26, 26, 0.2);
    border-color: #4a4a4a;
    color: #1a1a1a;
}

.lang-btn.active {
    background: var(--accent-colour);
    border-color: #1a1a1a;
    color: #1a1a1a;
}

/* Main content */
.main {
    margin-top: 80px;
}

/* === HERO === */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
    margin-bottom: 0;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    bottom: 0;
    background: transparent;
    opacity: 1;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background-color: #1a1a1a;
    background-image: 
        linear-gradient(rgba(212,212,212,0.08) 2px, transparent 2px), 
        linear-gradient(90deg, rgba(212,212,212,0.08) 2px, transparent 2px), 
        linear-gradient(rgba(212,212,212,0.04) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(212,212,212,0.04) 1px, #1a1a1a 1px);
    background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px;
    background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px;
    /* Stronger, earlier fade: mostly gone by ~40% width */
    -webkit-mask-image: linear-gradient(to right, black 0%, black 15%, transparent 40%);
    mask-image: linear-gradient(to right, black 0%, black 15%, transparent 40%);
}
.hero-content {
    position: relative;
    z-index: 3;
    max-width: 1000px;
    width: 100%;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transition: none; /* Remove any CSS transitions that might conflict */
}

.hero-brand {
    text-align: left;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #f5f5f5;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.hero-tagline {
    font-family: 'Work Sans', sans-serif;
    font-size: 0.9rem;
    color: #d4d4d4;
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
}

.hero-tagline-merged {
    line-height: 1.45;
}

.hero-tagline-merged .hero-tagline-meta {
    color: #b8b8b8;
    font-weight: 400;
}

.hero-description {
    text-align: left;
}

.hero-subtitle {
    font-size: 0.75rem;
    color: #d4d4d4;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero-text {
    font-size: 0.825rem;
    color: #e0e0e0;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.hero-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 0;
    border-left: 2px solid rgba(212, 212, 212, 0.2);
    padding-left: 1rem;
    transition: all 0.3s ease;
}

.feature-item:hover {
    border-left-color: var(--accent-colour);
    padding-left: 1.5rem;
}

.feature-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

.feature-text {
    font-size: 1rem;
    color: #d4d4d4;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-btn {
    padding: 0.8rem 2rem;
    border: 1px solid rgba(212, 212, 212, 0.3);
    background: transparent;
    color: #d4d4d4;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.hero-btn.primary {
    background: rgba(212, 212, 212, 0.1);
    border-color: #d4d4d4;
}

.hero-btn.primary:hover {
    background: var(--accent-colour);
    color: #1a1a1a;
}

.hero-btn.secondary:hover {
    background: rgba(212, 212, 212, 0.1);
    border-color: #d4d4d4;
}

/* === PORTFOLIO GRID === */
.portfolio-grid {
    padding: 2rem 0;
    background: #1a1a1a;
    margin-top: 0;
    position: relative;
}

.portfolio-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 212, 212, 0.1), transparent);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 2px;
    padding: 2px;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #2a2a2a;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}

.portfolio-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-item.revealed:hover {
    transform: translateY(0) scale(1.03);
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Interlocking brick pattern - different sizes for each item */
.portfolio-item:nth-child(1) {
    grid-column: span 4;
    grid-row: span 2;
}

.portfolio-item:nth-child(2) {
    grid-column: span 4;
    grid-row: span 2;
}

.portfolio-item:nth-child(3) {
    grid-column: span 4;
    grid-row: span 2;
}

.portfolio-item:nth-child(4) {
    grid-column: span 6;
    grid-row: span 1;
}

.portfolio-item:nth-child(5) {
    grid-column: span 3;
    grid-row: span 1;
}

.portfolio-item:nth-child(6) {
    grid-column: span 3;
    grid-row: span 1;
}

/* Items 7+ tile like 4–6: same row height, 3 per row (span 4 each) */
.portfolio-item:nth-child(n+7) {
    grid-column: span 4;
    grid-row: span 1;
}

.portfolio-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    min-height: 100%;
}

.portfolio-item:hover .portfolio-image {
    transform: scale(1.1);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.8);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay-text {
    color: #f5f5f5;
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 0.3rem;
    text-align: right;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.portfolio-category {
    color: #d4d4d4;
    font-size: 0.7rem;
    font-weight: 300;
    text-align: right;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}


/* === GUIDE section=== */
.guides-section {
    padding: 4rem 0;
    background: var(--bg-main);
    position: relative;
}

.guides-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 212, 212, 0.1), transparent);
}

.guides-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.guides-header {
    margin-bottom: 2.5rem;
}

.guides-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.guides-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 520px;
}

.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5px;
}

.guide-card {
    display: block;
    background: var(--bg-card);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
}

.guide-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid var(--border);
    pointer-events: none;
    transition: border-color 0.2s ease;
}

.guide-card:hover {
    background: #323232;
}

.guide-card:hover::after {
    border-color: rgba(200, 216, 228, 0.25);
}

.guide-card:hover .guide-read-more {
    color: var(--accent-colour);
}

.guide-card-inner {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
}

.guide-tag {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-colour);
    opacity: 0.7;
}

.guide-card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
}

.guide-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}

.guide-read-more {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.2s ease;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .guides-section {
        padding: 3rem 0;
    }
    .guides-grid {
        grid-template-columns: 1fr;
    }
}


/* Site footer (admin link) */
.site-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: 2rem;
}
.site-footer .footer-add-project {
    font-size: 0.85rem;
    color: rgba(212, 212, 212, 0.5);
    text-decoration: none;
    transition: color 0.2s ease;
}
.site-footer .footer-add-project:hover {
    color: rgba(212, 212, 212, 0.85);
}

/* === SCROLL TO TOP === */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(245, 245, 245, 0.9);
    backdrop-filter: blur(15px);
    border: none;
    border-radius: 50%;
    color: #1a1a1a;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    display: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.scroll-to-top:hover {
    background: rgba(245, 245, 245, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.scroll-to-top:active {
    transform: translateY(0);
}

/* Mobile Navigation Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #1a1a1a;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: 1px;
}

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

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

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

/* Header Right Container */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Responsive Typography (base values only; media overrides in responsive.css) */
:root {
    --base-font-size: 16px;
    --scale-factor: 1.2;
}

/* Responsive Container (base values only; media overrides in responsive.css) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
}

