:root {
    --oxblood: #4A0E1B;
    --wine: #6B1D2A;
    --rosewood: #8C3044;
    --cream: #F5EDE0;
    --bone: #E8DCC8;
    --charcoal: #2A2118;
    --brass: #B8943E;
    --plum: #3A1428;
    --sidebar-width: 260px;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Libre Baskerville', 'Georgia', serif;
    --font-mono: 'DM Mono', 'Courier New', monospace;
}

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

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

body {
    font-family: var(--font-body);
    background-color: var(--cream);
    color: var(--charcoal);
    line-height: 1.75;
    overflow-x: hidden;
}

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--oxblood);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 2.5rem 1.5rem;
    overflow: hidden;
}

.sidebar-brand-vertical {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: center center;
    white-space: nowrap;
}

.sidebar-brand-vertical span {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--cream);
    opacity: 0.5;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 4rem;
    margin-left: 1.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--cream);
    text-decoration: none;
    padding: 0.55rem 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.55;
    position: relative;
    border-left: 3px solid transparent;
    transition: opacity 320ms cubic-bezier(0.34, 1.56, 0.64, 1),
                border-left-color 320ms ease,
                transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-rule {
    display: block;
    width: 0;
    height: 1px;
    background-color: var(--brass);
    transition: width 280ms ease;
}

.nav-text {
    transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-link:hover,
.nav-link.active {
    opacity: 1;
    border-left-color: var(--brass);
}

.nav-link:hover .nav-rule,
.nav-link.active .nav-rule {
    width: 20px;
}

.nav-link:hover .nav-text,
.nav-link.active .nav-text {
    transform: translateY(-2px);
}

.sidebar-tessellation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.sidebar-rosette {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    pointer-events: none;
}

.rosette-svg {
    width: 100%;
    height: 100%;
    animation: rosetteRotate 120s linear infinite;
}

@keyframes rosetteRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.sidebar-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 160px;
    background: linear-gradient(to top, var(--oxblood), var(--wine), rgba(245, 237, 224, 0));
    pointer-events: none;
    z-index: 1;
}

/* Mobile toggle */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 300;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--cream);
    margin: 4px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ===========================
   MAIN CONTENT
   =========================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ===========================
   FOLIO SECTIONS
   =========================== */
.folio {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 6rem);
    position: relative;
}

.folio-inner {
    max-width: 960px;
    width: 100%;
}

/* Section markers */
.section-marker {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.marker-num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--brass);
    letter-spacing: 0.1em;
}

.marker-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--brass), transparent);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3vw + 0.5rem, 3.2rem);
    font-weight: 900;
    color: var(--charcoal);
    letter-spacing: 0.03em;
    margin-bottom: 2.5rem;
}

/* ===========================
   FOLIO DIVIDERS
   =========================== */
.folio-divider {
    height: 12px;
    overflow: hidden;
    opacity: 0.6;
}

.folio-divider svg {
    width: 100%;
    height: 100%;
}

/* ===========================
   HERO FOLIO
   =========================== */
.folio-hero {
    min-height: 100vh;
    background-color: var(--cream);
    position: relative;
    overflow: hidden;
    align-items: flex-end;
    justify-content: flex-start;
    padding-bottom: clamp(4rem, 8vh, 8rem);
    padding-left: clamp(3rem, 6vw, 7rem);
}

.hero-tessellation {
    position: absolute;
    top: 0;
    right: -5%;
    width: 70%;
    height: 100%;
    pointer-events: none;
    opacity: 0.3;
}

.hex-grid {
    width: 100%;
    height: 100%;
    animation: heroRotate 720s linear infinite;
}

@keyframes heroRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hex-group polygon {
    fill: none;
    stroke: var(--brass);
    stroke-width: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw + 1rem, 5.5rem);
    font-weight: 900;
    color: var(--oxblood);
    letter-spacing: 0.03em;
    line-height: 1.05;
    margin-bottom: 1.25rem;
}

.hero-descriptor {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--charcoal);
}

/* ===========================
   CONCEPT FOLIO
   =========================== */
.folio-concept {
    min-height: 120vh;
    background-color: var(--cream);
}

.concept-layout {
    display: grid;
    grid-template-columns: 5fr 7fr;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: center;
}

.concept-text .section-title {
    color: var(--oxblood);
}

.concept-body {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    font-weight: 400;
    color: var(--charcoal);
    line-height: 1.75;
    letter-spacing: 0.01em;
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.concept-morph-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.morph-svg {
    width: 100%;
    max-width: 500px;
    height: auto;
    aspect-ratio: 1;
}

/* ===========================
   ARCHITECTURE FOLIO
   =========================== */
.folio-architecture {
    min-height: 100vh;
    background-color: var(--bone);
}

.folio-architecture .section-title {
    color: var(--oxblood);
}

.arch-panels {
    position: relative;
    height: 520px;
    max-width: 700px;
    margin: 0 auto;
}

.arch-panel {
    position: absolute;
    width: 85%;
    height: 55%;
    border: 1px solid var(--rosewood);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.arch-panel.revealed {
    opacity: 1;
    transform: translateY(0);
}

.arch-panel-1 {
    background-color: var(--cream);
    bottom: 0;
    left: 0;
    z-index: 1;
}

.arch-panel-2 {
    background-color: rgba(107, 29, 42, 0.06);
    bottom: 60px;
    left: 20px;
    z-index: 2;
}

.arch-panel-2.revealed {
    transform: translateY(0) rotate(0deg);
}

.arch-panel-3 {
    background-color: rgba(74, 14, 27, 0.08);
    bottom: 120px;
    left: 40px;
    z-index: 3;
}

.panel-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.5;
}

.panel-pattern svg {
    width: 100%;
    height: 100%;
}

.panel-content {
    position: relative;
    z-index: 2;
}

.panel-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--rosewood);
    display: block;
    margin-bottom: 0.5rem;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--oxblood);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.panel-desc {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--charcoal);
    opacity: 0.7;
    line-height: 1.7;
    max-width: 460px;
}

/* ===========================
   DETAILS FOLIO (Card Grid)
   =========================== */
.folio-details {
    min-height: 90vh;
    background-color: var(--cream);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.detail-card {
    background-color: var(--bone);
    border: 1px solid var(--rosewood);
    padding: 24px;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.32s ease;
    cursor: default;
}

.detail-card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.detail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(74, 14, 27, 0.12);
}

.card-shape {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.25rem;
    position: relative;
}

.card-shape svg {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

.card-blob-shadow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70px;
    height: 70px;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse, rgba(107, 29, 42, 0.08) 0%, transparent 70%);
    border-radius: 50% 40% 60% 50%;
    z-index: 1;
}

.card-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--oxblood);
    margin-bottom: 0.75rem;
}

.card-desc {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--charcoal);
    opacity: 0.7;
    line-height: 1.65;
}

/* ===========================
   CLOSING FOLIO
   =========================== */
.folio-closing {
    min-height: 80vh;
    background-color: var(--cream);
    overflow: hidden;
}

.closing-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.closing-geometric {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    pointer-events: none;
}

.closing-composition {
    width: 100%;
    height: 100%;
}

.closing-content {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.closing-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.closing-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 3vw + 0.3rem, 2.8rem);
    font-weight: 700;
    color: var(--oxblood);
    letter-spacing: 0.03em;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.closing-text {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    color: var(--charcoal);
    opacity: 0.65;
    line-height: 1.75;
    max-width: 480px;
    margin: 0 auto 2rem;
}

.closing-rule {
    width: 50px;
    height: 2px;
    background-color: var(--brass);
    margin: 0 auto 1.5rem;
}

.closing-signature {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--oxblood);
    opacity: 0.5;
}

/* ===========================
   FOOTER
   =========================== */
.site-footer {
    background-color: var(--charcoal);
    padding: 2.5rem clamp(2rem, 5vw, 6rem);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 960px;
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-hex {
    width: 24px;
    height: 24px;
}

.footer-brand span {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--bone);
    letter-spacing: 0.03em;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--bone);
    opacity: 0.35;
    letter-spacing: 0.05em;
}

/* ===========================
   REVEAL ANIMATIONS
   =========================== */
[data-reveal] {
    transition: opacity 0.7s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
    .concept-layout {
        grid-template-columns: 1fr;
    }

    .concept-morph-container {
        order: -1;
    }

    .morph-svg {
        max-width: 350px;
    }

    .arch-panels {
        height: 480px;
    }

    .arch-panel {
        width: 90%;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        padding: 0 1rem;
        align-items: center;
        z-index: 200;
    }

    .sidebar-brand-vertical {
        position: static;
        transform: none;
    }

    .sidebar-brand-vertical span {
        font-size: 0.7rem;
        opacity: 0.8;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 0;
        margin-top: 0;
        margin-left: auto;
    }

    .nav-link {
        font-size: 0.6rem;
        padding: 0.4rem 0.4rem;
        border-left: none;
        border-bottom: 2px solid transparent;
        letter-spacing: 0.08em;
    }

    .nav-rule {
        display: none;
    }

    .nav-link:hover,
    .nav-link.active {
        border-left: none;
        border-bottom-color: var(--brass);
    }

    .nav-link:hover .nav-text,
    .nav-link.active .nav-text {
        transform: none;
    }

    .sidebar-tessellation,
    .sidebar-rosette,
    .sidebar-gradient {
        display: none;
    }

    .mobile-toggle {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding-top: 60px;
    }

    .folio {
        padding: 3rem 1.5rem;
        min-height: auto;
    }

    .folio-hero {
        min-height: 100vh;
        padding: 0 1.5rem 4rem;
        align-items: flex-end;
        justify-content: flex-start;
    }

    .hero-tessellation {
        width: 100%;
        right: 0;
        opacity: 0.2;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .concept-layout {
        grid-template-columns: 1fr;
    }

    .details-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .arch-panels {
        height: auto;
        position: static;
    }

    .arch-panel {
        position: static;
        width: 100%;
        height: auto;
        margin-bottom: 1.5rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .site-footer {
        padding: 2rem 1.5rem;
    }
}

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

    .sidebar-nav {
        gap: 0;
    }

    .nav-link {
        font-size: 0.55rem;
        padding: 0.3rem 0.3rem;
    }
}
