/* ===================================================
   sbom.study — Avant-garde SBOM Research Lab
   Colors: #0A0A0A, #141414, #C8A040, #E8E4DC, #A0A8B0
   Fonts: Syne, Inter, JetBrains Mono
   =================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0A0A0A;
    color: #E8E4DC;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.5vw, 18px);
    line-height: 1.75;
    overflow-x: hidden;
}

/* --- Kinetic Typography --- */
@keyframes kinetic {
    0%, 100% { letter-spacing: -0.02em; }
    50% { letter-spacing: 0em; }
}

@keyframes kineticWeight {
    0%, 100% { font-weight: 700; }
    50% { font-weight: 800; }
}

.kinetic-wordmark .letter {
    display: inline-block;
    animation: kinetic 4s ease-in-out infinite;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
}

.kinetic-wordmark .letter:nth-child(2) { animation-delay: 0.15s; }
.kinetic-wordmark .letter:nth-child(3) { animation-delay: 0.3s; }
.kinetic-wordmark .letter:nth-child(4) { animation-delay: 0.45s; }
.kinetic-wordmark .letter:nth-child(5) { animation-delay: 0.6s; }
.kinetic-wordmark .letter:nth-child(6) { animation-delay: 0.75s; }
.kinetic-wordmark .letter:nth-child(7) { animation-delay: 0.9s; }
.kinetic-wordmark .letter:nth-child(8) { animation-delay: 1.05s; }
.kinetic-wordmark .letter:nth-child(9) { animation-delay: 1.2s; }
.kinetic-wordmark .letter:nth-child(10) { animation-delay: 1.35s; }

.kinetic-wordmark .letter.dot {
    color: #C8A040;
}

.kinetic-text {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    animation: kinetic 4s ease-in-out infinite;
}

/* --- Bokeh Circles --- */
.bokeh-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200,160,64,0.12) 0%, rgba(200,160,64,0.03) 60%, transparent 100%);
    opacity: 0;
    animation: bokehFadeIn 1.5s ease-out forwards;
}

.bokeh-circle:nth-child(1) { width: 150px; height: 150px; top: 10%; left: 8%; animation-delay: 0.2s; }
.bokeh-circle:nth-child(2) { width: 100px; height: 100px; top: 60%; left: 75%; animation-delay: 0.4s; }
.bokeh-circle:nth-child(3) { width: 80px; height: 80px; top: 30%; left: 55%; animation-delay: 0.6s; }
.bokeh-circle:nth-child(4) { width: 120px; height: 120px; top: 70%; left: 20%; animation-delay: 0.8s; }
.bokeh-circle:nth-child(5) { width: 60px; height: 60px; top: 15%; left: 85%; animation-delay: 1.0s; }
.bokeh-circle:nth-child(6) { width: 90px; height: 90px; top: 80%; left: 50%; animation-delay: 1.2s; }
.bokeh-circle:nth-child(7) { width: 70px; height: 70px; top: 45%; left: 30%; animation-delay: 1.4s; }
.bokeh-circle:nth-child(8) { width: 110px; height: 110px; top: 25%; left: 90%; animation-delay: 1.6s; }

.bokeh-circle[data-depth="1"] { transform: scale(1.3); filter: blur(8px); }
.bokeh-circle[data-depth="2"] { transform: scale(1.0); filter: blur(5px); }
.bokeh-circle[data-depth="3"] { transform: scale(0.7); filter: blur(3px); }

.bokeh-circle.small {
    width: 40px;
    height: 40px;
    animation-delay: 0s;
    opacity: 0.6;
    animation: none;
    filter: blur(4px);
}

.bokeh-circle.small:nth-child(1) { top: 15%; left: 80%; }
.bokeh-circle.small:nth-child(2) { top: 70%; left: 10%; }

.bokeh-circle.tiny {
    width: 20px;
    height: 20px;
    animation-delay: 0s;
    opacity: 0.5;
    animation: none;
    filter: blur(2px);
}

.bokeh-circle.tiny:nth-child(1) { top: 30%; left: 5%; }
.bokeh-circle.tiny:nth-child(2) { top: 20%; left: 25%; }
.bokeh-circle.tiny:nth-child(3) { top: 60%; left: 45%; }
.bokeh-circle.tiny:nth-child(4) { top: 40%; left: 70%; }
.bokeh-circle.tiny:nth-child(5) { top: 80%; left: 85%; }
.bokeh-circle.tiny:nth-child(6) { top: 50%; left: 15%; }

@keyframes bokehFadeIn {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

.bokeh-circle[data-depth="1"] {
    animation: bokehFadeIn 1.5s ease-out forwards, bokehFloat1 8s ease-in-out infinite;
}
.bokeh-circle[data-depth="2"] {
    animation: bokehFadeIn 1.5s ease-out forwards, bokehFloat2 10s ease-in-out infinite;
}
.bokeh-circle[data-depth="3"] {
    animation: bokehFadeIn 1.5s ease-out forwards, bokehFloat3 12s ease-in-out infinite;
}

@keyframes bokehFloat1 {
    0%, 100% { transform: scale(1.3) translate(0, 0); }
    50% { transform: scale(1.3) translate(10px, -8px); }
}

@keyframes bokehFloat2 {
    0%, 100% { transform: scale(1.0) translate(0, 0); }
    50% { transform: scale(1.0) translate(-8px, 6px); }
}

@keyframes bokehFloat3 {
    0%, 100% { transform: scale(0.7) translate(0, 0); }
    50% { transform: scale(0.7) translate(5px, -5px); }
}

/* --- Research Portal (Hero) --- */
#research-portal {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0A0A0A;
    overflow: hidden;
}

.portal-frame {
    position: relative;
    z-index: 2;
    width: min(80vw, 800px);
    height: min(55vh, 500px);
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.frame-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.frame-path {
    stroke-dasharray: 2600;
    stroke-dashoffset: 2600;
    animation: drawFrame 1.2s ease-out 0.2s forwards;
}

@keyframes drawFrame {
    to { stroke-dashoffset: 0; }
}

.portal-content {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    animation: portalContentIn 0.8s ease-out 0.8s forwards;
}

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

.kinetic-wordmark {
    font-family: 'Syne', sans-serif;
    font-size: clamp(40px, 6vw, 80px);
    font-weight: 800;
    color: #E8E4DC;
    margin-bottom: 16px;
    line-height: 1;
}

.portal-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1.2vw, 18px);
    color: #A0A8B0;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.portal-cut {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: #0A0A0A;
    clip-path: polygon(0 100%, 100% 0, 100% 100%);
    z-index: 3;
}

/* --- Study Portfolio --- */
#study-portfolio {
    position: relative;
    padding: 100px 5vw 80px;
    background: #0A0A0A;
}

.section-title {
    font-size: clamp(32px, 5vw, 72px);
    color: #E8E4DC;
    margin-bottom: 60px;
    text-align: center;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(250px, auto);
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.research-card {
    position: relative;
    background: #141414;
    border: 1px solid rgba(200,160,64,0.2);
    clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%);
    padding: 32px 28px;
    overflow: hidden;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, border-color 0.3s ease;
    cursor: default;
}

.research-card:hover {
    border-color: rgba(200,160,64,0.5);
}

.research-card.featured {
    grid-column: span 2;
}

.research-card.tall {
    grid-row: span 2;
}

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

.card-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    color: #C8A040;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 16px;
}

.research-card h3 {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(20px, 2vw, 28px);
    color: #E8E4DC;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.research-card p {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1.2vw, 16px);
    color: #A0A8B0;
    line-height: 1.65;
    flex: 1;
}

.card-data {
    display: block;
    margin-top: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: rgba(200,160,64,0.7);
    padding: 8px 12px;
    background: rgba(200,160,64,0.06);
    border-left: 2px solid rgba(200,160,64,0.3);
}

/* --- Deep Analysis --- */
#deep-analysis {
    position: relative;
    padding: 120px 5vw;
    background: #0A0A0A;
    overflow: hidden;
}

.sharp-angle-frame {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
    border: 1px solid rgba(200,160,64,0.3);
    clip-path: polygon(0 0, calc(100% - 50px) 0, 100% 50px, 100% 100%, 50px 100%, 0 calc(100% - 50px));
    background: #141414;
    padding: 60px 50px;
}

.deep-content {
    position: relative;
}

.deep-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #C8A040;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 20px;
}

#deep-analysis h2 {
    font-size: clamp(28px, 4vw, 56px);
    color: #E8E4DC;
    margin-bottom: 24px;
}

.deep-body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: #A0A8B0;
    font-size: clamp(16px, 1.4vw, 18px);
    line-height: 1.8;
    max-width: 800px;
    margin-bottom: 40px;
}

.deep-data-block {
    background: #0A0A0A;
    border: 1px solid rgba(200,160,64,0.15);
    border-radius: 2px;
    padding: 24px;
    overflow-x: auto;
}

.deep-data-block pre {
    margin: 0;
}

.deep-data-block code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #A0A8B0;
}

/* --- Lab Footer --- */
#lab-footer {
    position: relative;
    background: #0A0A0A;
    padding: 60px 5vw 40px;
    overflow: hidden;
}

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

.footer-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 30px;
}

.footer-wordmark {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 28px;
    color: #E8E4DC;
    letter-spacing: -0.02em;
}

.footer-tagline {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #A0A8B0;
    letter-spacing: 0.05em;
}

.footer-links {
    display: flex;
    gap: 32px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.footer-link {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #A0A8B0;
    cursor: default;
    transition: color 0.3s ease;
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #C8A040;
    transition: width 0.3s ease;
}

.footer-link:hover {
    color: #C8A040;
}

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

.footer-border {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200,160,64,0.3), transparent);
    margin-bottom: 20px;
    clip-path: polygon(0 0, 95% 0, 100% 100%, 5% 100%);
}

.footer-copy {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: rgba(160,168,176,0.5);
}

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

    .research-card.featured {
        grid-column: span 2;
    }

    .sharp-angle-frame {
        padding: 40px 30px;
    }
}

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

    .research-card.featured {
        grid-column: span 1;
    }

    .research-card.tall {
        grid-row: span 1;
    }

    .portal-frame {
        width: 90vw;
        height: 60vh;
    }

    .sharp-angle-frame {
        padding: 30px 20px;
        clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 30px 100%, 0 calc(100% - 30px));
    }

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