/* =========================================================
   RESET
========================================================= */

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

/* =========================================================
   ROOT TYPOGRAPHY SYSTEM
========================================================= */

:root {
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;

    --fs-body: clamp(1rem, 0.92rem + 0.35vw, 1.18rem);
    --fs-lead: clamp(1.15rem, 1rem + 0.65vw, 1.55rem);

    --fs-h1: clamp(3rem, 1.65rem + 6vw, 6.4rem);
    --fs-h2: clamp(2rem, 1.35rem + 3vw, 3.8rem);
    --fs-h3: clamp(1.25rem, 1rem + 1vw, 1.8rem);

    --lh-tight: 0.92;
    --lh-heading: 1.02;
    --lh-body: 1.62;

    --space-xs: clamp(0.75rem, 0.6rem + 0.6vw, 1rem);
    --space-sm: clamp(1rem, 0.8rem + 1vw, 1.6rem);
    --space-md: clamp(1.8rem, 1.2rem + 2vw, 3rem);
    --space-lg: clamp(3rem, 2rem + 4vw, 6rem);

    --color-bg: #000000;
    --color-text: #ffffff;
    --color-text-soft: rgba(255,255,255,0.82);
    --color-border: #222222;
}

/* =========================================================
   BASE
========================================================= */

html {
    scroll-behavior: smooth;
    background-color: var(--color-bg);
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    letter-spacing: -0.01em;
    overflow-x: hidden;

    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: #ffffff;
    text-decoration: underline;
}

/* =========================================================
   LLM / CRAWLER CONTENT
========================================================= */

.llm-crawler-content {
    position: absolute;
    left: -99999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* =========================================================
   SPOTLIGHT OVERLAY
========================================================= */

.spotlight-overlay {
    position: fixed;
    top: -50px;
    bottom: -50px;
    left: 0;
    right: 0;
    width: 100%;

    background:
        radial-gradient(
            circle 450px at center,
            rgba(0,0,0,0) 0%,
            rgba(0,0,0,0) 55%,
            rgba(0,0,0,1) 100%
        );

    pointer-events: none;
    z-index: 5;
}

/* =========================================================
   HEADER / LOGO / MENU
========================================================= */

.site-header {
    position: fixed;
    top: 40px;
    left: 40px;
    right: 40px;
    z-index: 110;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    pointer-events: none;
    overflow: visible;

    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.logo-container,
.menu-toggle {
    pointer-events: auto;
}

.logo-container {
    display: block;
    width: 100px;
    height: 100px;
    overflow: visible;
}

.logo-container img {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    filter:
        invert(1)
        drop-shadow(0 0 10px rgba(255,255,255,0.95))
        drop-shadow(0 0 24px rgba(255,255,255,0.55));
}

.menu-toggle {
    width: 30px;
    height: 20px;
    margin-top: 10px;

    background: none;
    border: none;
    cursor: pointer;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #ffffff;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

body.menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

body.menu-open .menu-toggle span:nth-child(2) {
    transform: translateY(-9px) rotate(-45deg);
}

/* =========================================================
   SIDEBAR
========================================================= */

.sidebar {
    position: fixed;
    top: 0;
    left: -400px;

    width: 350px;
    height: 100vh;
    height: 100dvh;

    padding: 150px 40px 40px;

    background: #000000;
    border-right: 1px solid #111111;

    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);

    overflow-y: auto;
    overscroll-behavior: contain;
}

body.menu-open .sidebar {
    transform: translateX(400px);
}

.sidebar-inner {
    padding-bottom: 80px;
}

.sidebar ul {
    list-style: none;
}

.sidebar li {
    margin-bottom: 1.1rem;
}

.sidebar a,
.menu-folder-toggle {
    width: 100%;

    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;

    background: transparent;
    border: 0;
    border-radius: 0;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;

    cursor: pointer;
    text-align: left;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

.sidebar a:hover,
.menu-folder-toggle:hover {
    opacity: 0.7;
    transform: translateX(3px);
}

.menu-folder {
    margin-top: 0.4rem;
}

.menu-folder-toggle span:last-child {
    flex: 0 0 auto;
    opacity: 0.5;
}

.submenu {
    display: none;
    margin-top: 1rem;
    margin-left: 0.85rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255,255,255,0.16);
}

.menu-folder.is-open > .submenu {
    display: block;
}

.submenu li {
    margin-bottom: 0.85rem;
}

.submenu a,
.submenu .menu-folder-toggle {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255,255,255,0.76);
}

/* =========================================================
   CONTENT CONTAINER
========================================================= */

.content-container {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 820px;
    margin: 0 auto;

    padding: clamp(24px, 5vw, 56px) 20px;
}

.page-section {
    margin-bottom: var(--space-lg);
}

/* =========================================================
   PAGE REVEAL / SOFT LOADING
========================================================= */

.reveal-section,
.site-footer {
    opacity: 0;
    transform: translateY(80px);
    filter: blur(16px);
    transition:
        opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1.4s cubic-bezier(0.16, 1, 0.3, 1),
        filter 1.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform, filter;
}

.reveal-section.is-visible,
.site-footer.is-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* =========================================================
   FOLDER GROUPS / BLOG SECTION
========================================================= */

.page-folder-group {
    margin: var(--space-lg) 0;
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
}

.folder-group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: var(--space-md);
}

.folder-group-header h2 {
    margin-bottom: 0;
}

.folder-toggle {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 0.8em 1.1em;
    border-radius: 999px;

    background: #ffffff;
    color: #000000;
    border: 0;

    font: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;

    cursor: pointer;

    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

.folder-toggle:hover {
    transform: translateY(-2px);
}

.folder-group-content {
    display: none;
}

.page-folder-group.is-expanded > .folder-group-content {
    display: block;
}

.folder-child-section {
    margin-bottom: var(--space-lg);
}

.folder-child-section:last-child {
    margin-bottom: 0;
}

/* =========================================================
   TYPOGRAPHY
========================================================= */

h1,
h2,
h3 {
    font-weight: 800;
    letter-spacing: -0.055em;
    text-wrap: balance;
}

h1 {
    font-size: var(--fs-h1);
    line-height: var(--lh-tight);
    margin-bottom: var(--space-md);
    max-width: 11ch;
}

h2 {
    font-size: var(--fs-h2);
    line-height: var(--lh-heading);
    margin-bottom: var(--space-sm);
    max-width: 14ch;
}

h3 {
    font-size: var(--fs-h3);
    line-height: 1.15;
    margin-bottom: var(--space-xs);
}

p {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    margin-bottom: var(--space-sm);
    max-width: 62ch;
    color: var(--color-text-soft);
}

h1 + p,
.lead,
.subtitle {
    font-size: var(--fs-lead);
    line-height: 1.42;
    color: rgba(255,255,255,0.92);
    max-width: 48ch;
}

b,
strong {
    color: #ffffff;
}

/* =========================================================
   IMAGES
========================================================= */

.image-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #080808;
    border-radius: 18px;
    margin: var(--space-md) 0;
}

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

.image-wrapper.ai-badge {
    position: relative;
}

.image-wrapper.ai-badge::after {
    content: "AI-generated / enhanced";
    position: absolute;
    left: 16px;
    bottom: 16px;
    z-index: 2;

    padding: 8px 14px;
    border-radius: 999px;

    background: rgba(178,255,196,0.92);
    color: #052e13;

    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border: 1px solid rgba(220,255,228,0.85);
    box-shadow:
        0 8px 24px rgba(0,0,0,0.28),
        0 0 18px rgba(178,255,196,0.45);
}

/* =========================================================
   BUTTONS
========================================================= */

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: var(--space-md) 0;
}

.project-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0.9em 1.45em;
    border-radius: 999px;

    background: #ffffff;
    color: #000000;

    text-decoration: none;
    font-weight: 700;
    font-size: clamp(0.9rem, 0.84rem + 0.25vw, 1rem);
    line-height: 1;

    transition:
        transform 0.25s ease,
        background-color 0.25s ease,
        opacity 0.25s ease;
}

.project-btn:hover {
    transform: translateY(-2px);
}

.project-btn.secondary {
    background: #0e0e0e;
    color: #ffffff;
}

/* =========================================================
   TOGGLE / FAQ
========================================================= */

.toggle-box {
    margin: 2rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.toggle-question {
    width: 100%;
    padding: 20px 0;

    background: transparent;
    border: 0;
    border-radius: 0;
    color: #ffffff;

    text-align: left;

    display: flex;
    justify-content: space-between;
    gap: 20px;

    font: inherit;
    font-size: clamp(1rem, 0.9rem + 0.45vw, 1.2rem);
    font-weight: 800;
    line-height: 1.3;

    cursor: pointer;
}

.toggle-answer {
    display: none;
    padding-bottom: 20px;
}

.toggle-box.open .toggle-answer {
    display: block;
}

/* =========================================================
   LISTS
========================================================= */

.feature-list {
    margin: var(--space-md) 0;
    padding-left: 1.15em;
}

.feature-list li {
    font-size: var(--fs-body);
    line-height: 1.55;
    margin-bottom: 0.7rem;
    color: rgba(255,255,255,0.84);
}

/* =========================================================
   FOOTER
========================================================= */

.site-footer {
    position: relative;
    z-index: 1;

    width: 100%;
    max-width: 820px;
    margin: 0 auto;

    padding: var(--space-lg) 20px calc(var(--space-lg) + 40px);
    border-top: 1px solid var(--color-border);
}

.site-footer-inner {
    padding-top: var(--space-md);
}

.footer-kicker {
    margin-bottom: 1rem;

    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.22em;
    text-transform: uppercase;

    color: rgba(255,255,255,0.42);
}

.site-footer h2 {
    max-width: 12ch;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;

    margin-top: var(--space-md);
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0.85em 1.3em;
    border-radius: 999px;

    background: #ffffff;
    color: #000000;

    text-decoration: none;
    font-weight: 800;
    line-height: 1;

    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

.footer-links a:hover {
    transform: translateY(-2px);
}

.footer-links a:nth-child(2) {
    background: #0e0e0e;
    color: #ffffff;
}

/* =========================================================
   MOBILE RESPONSIVENESS
========================================================= */

@media (max-width: 640px) {

    .spotlight-overlay {
        z-index: 0;
    }

    .site-header {
        position: fixed;
        top: -30px;
        left: 0;
        right: 0;
        transform: none;

        width: 100%;
        max-width: 100%;

        padding: calc(env(safe-area-inset-top, 0px) + 42px) 20px 24px 20px;
        min-height: auto;

        display: flex;
        align-items: center;
        justify-content: space-between;

        background: linear-gradient(
            to bottom,
            rgba(0,0,0,1) 0%,
            rgba(0,0,0,1) 30px,
            rgba(0,0,0,0.95) 65%,
            rgba(0,0,0,0) 100%
        );

        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);

        z-index: 110;
        pointer-events: none;

        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }

    .logo-container,
    .menu-toggle {
        pointer-events: auto;
    }

    .logo-container {
        width: 64px;
        height: 64px;
        flex: 0 0 64px;
    }

    .menu-toggle {
        margin-top: 0;
        width: 30px;
        height: 20px;
        flex: 0 0 30px;
    }

    .content-container {
        padding-inline: 18px;
        padding-top: calc(env(safe-area-inset-top, 0px) + 115px);
    }

    .sidebar {
        width: 100%;
        left: -100%;
        height: 100vh;
        height: 100dvh;
        padding: calc(env(safe-area-inset-top, 0px) + 110px) 28px 40px 28px;
    }

    body.menu-open .sidebar {
        transform: translateX(100%);
    }

    .sidebar a,
    .menu-folder-toggle {
        font-size: 1.3rem;
    }

    .submenu a,
    .submenu .menu-folder-toggle {
        font-size: 1rem;
    }

    h1 {
        max-width: 9.5ch;
        letter-spacing: -0.06em;
    }

    p {
        max-width: 100%;
    }

    h1 + p,
    .lead,
    .subtitle {
        line-height: 1.46;
    }

    .project-btn {
        width: 100%;
    }

    .image-wrapper {
        margin: var(--space-md) 0;
    }

    .folder-group-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .folder-toggle {
        width: 100%;
        justify-content: space-between;
    }

    .site-footer {
        padding-inline: 18px;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 120px);
    }

    .footer-links a {
        width: 100%;
    }

    .mobile-bottom-fade {
        display: block;
        position: fixed;
        bottom: -30px;
        left: 0;
        right: 0;
        width: 100%;

        height: calc(env(safe-area-inset-bottom, 0px) + 110px);

        background: linear-gradient(
            to top,
            rgba(0,0,0,1) 0%,
            rgba(0,0,0,1) 30px,
            rgba(0,0,0,0.88) 65%,
            rgba(0,0,0,0) 100%
        );

        pointer-events: none;
        z-index: 90;

        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
}