/* =============================================
   simulai.xyz - Styles
   Design: Retro elegant bento-box with handwritten
   triadic colors and lens-flare warmth
   ============================================= */

/* --- CSS Variables --- */
:root {
    --deep-base: #1a1a2e;
    --primary-blue: #4a90d9;
    --warm-white: #f5f0e8;
    --accent-gold: #e8b84b;
    --muted-gray: #6c757d;
    --plum: #1a1a2e;
    --font-display: 'Caveat', cursive;
    --font-body: 'Inter', sans-serif;
    --font-serif: 'Playfair Display', serif;
}

/* --- Reset & Base --- */
*, *::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(--deep-base);
    color: var(--warm-white);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

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

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

/* --- Grid Background --- */
#grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(106, 117, 125, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(106, 117, 125, 0.06) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* --- Lens Flare --- */
#lens-flare {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.8s ease;
    background: radial-gradient(
        ellipse 600px 400px at var(--flare-x, 50%) var(--flare-y, 30%),
        rgba(232, 184, 75, 0.12) 0%,
        rgba(232, 184, 75, 0.04) 40%,
        transparent 70%
    );
}

#lens-flare.active {
    opacity: 1;
}

/* --- Header --- */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1.25rem 2rem;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
}

#site-header.scrolled {
    background-color: rgba(26, 26, 46, 0.92);
    backdrop-filter: blur(12px);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 1.25rem;
}

.logo-mark {
    color: var(--accent-gold);
    font-size: 1.5rem;
    margin-right: 0.25rem;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--warm-white);
}

.logo-ext {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--muted-gray);
    font-size: 1rem;
}

#main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--muted-gray);
    transition: color 0.3s ease;
    letter-spacing: 0.03em;
}

.nav-link:hover {
    color: var(--warm-white);
}

#nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

#nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--warm-white);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

#nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

#nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Hero --- */
#hero {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 4rem;
    text-align: center;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 700px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    color: var(--warm-white);
    line-height: 1.1;
    margin-bottom: 1.25rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease 0.3s forwards;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: var(--muted-gray);
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease 0.6s forwards;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s ease 0.9s forwards;
}

.hero-decoration {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    z-index: 1;
    opacity: 0.5;
}

.hero-orbital {
    width: 100%;
    height: 100%;
    animation: orbitalSpin 40s linear infinite;
}

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

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--accent-gold);
    color: var(--deep-base);
}

.btn-primary:hover {
    background-color: #d4a63e;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(232, 184, 75, 0.3);
}

.btn-outline {
    border: 1px solid var(--muted-gray);
    color: var(--warm-white);
    background: transparent;
}

.btn-outline:hover {
    border-color: var(--warm-white);
    transform: translateY(-2px);
}

/* --- Sections --- */
.section {
    position: relative;
    z-index: 2;
    padding: 6rem 2rem;
}

.section-dark {
    background-color: rgba(26, 26, 46, 0.6);
}

.section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 3rem;
    text-align: center;
}

/* --- About --- */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-lead {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    line-height: 1.7;
    color: var(--warm-white);
    margin-bottom: 1.5rem;
}

.about-text p:last-child {
    color: var(--muted-gray);
    font-size: 1rem;
    line-height: 1.8;
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-top: 0.5rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    border: 1px solid rgba(106, 117, 125, 0.2);
    border-radius: 8px;
    background: rgba(74, 144, 217, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-blue);
}

.stat-unit {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary-blue);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted-gray);
    margin-top: 0.25rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- Bento Grid --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.bento-cell {
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(106, 117, 125, 0.15);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}

.bento-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    opacity: 0.7;
}

.bento-cell:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.bento-large {
    grid-column: span 2;
}

/* Triadic color zones */
.bento-blue {
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.08) 0%, rgba(26, 26, 46, 0.4) 100%);
}

.bento-blue::before {
    background: var(--primary-blue);
}

.bento-gold {
    background: linear-gradient(135deg, rgba(232, 184, 75, 0.08) 0%, rgba(26, 26, 46, 0.4) 100%);
}

.bento-gold::before {
    background: var(--accent-gold);
}

.bento-plum {
    background: linear-gradient(135deg, rgba(106, 117, 125, 0.12) 0%, rgba(26, 26, 46, 0.4) 100%);
}

.bento-plum::before {
    background: var(--muted-gray);
}

.bento-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1.25rem;
    color: var(--accent-gold);
}

.bento-blue .bento-icon {
    color: var(--primary-blue);
}

.bento-plum .bento-icon {
    color: var(--muted-gray);
}

.bento-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--warm-white);
    margin-bottom: 0.75rem;
}

.bento-desc {
    font-size: 0.95rem;
    color: var(--muted-gray);
    line-height: 1.7;
}

/* --- Simulations --- */
.sim-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.sim-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(106, 117, 125, 0.15);
    background: rgba(26, 26, 46, 0.6);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
}

.sim-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.sim-visual {
    width: 100%;
    height: 200px;
    position: relative;
    overflow: hidden;
}

.sim-visual-1 {
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.15), rgba(26, 26, 46, 0.8));
}

.sim-visual-2 {
    background: linear-gradient(135deg, rgba(232, 184, 75, 0.15), rgba(26, 26, 46, 0.8));
}

.sim-visual-3 {
    background: linear-gradient(135deg, rgba(106, 117, 125, 0.15), rgba(26, 26, 46, 0.8));
}

.sim-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.sim-info {
    padding: 1.5rem;
}

.sim-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-gold);
    background: rgba(232, 184, 75, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    margin-bottom: 0.75rem;
}

.sim-name {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--warm-white);
    margin-bottom: 0.5rem;
}

.sim-detail {
    font-size: 0.9rem;
    color: var(--muted-gray);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.sim-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.sim-status {
    font-weight: 500;
}

.sim-status.active {
    color: #5cb85c;
}

.sim-status.paused {
    color: var(--accent-gold);
}

.sim-iter {
    color: var(--muted-gray);
}

/* --- Research --- */
.research-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.research-card {
    padding: 2rem;
    border: 1px solid rgba(106, 117, 125, 0.15);
    border-radius: 12px;
    background: rgba(74, 144, 217, 0.03);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
}

.research-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.research-year {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 0.5rem;
}

.research-heading {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--warm-white);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.research-authors {
    font-size: 0.85rem;
    color: var(--primary-blue);
    margin-bottom: 0.25rem;
}

.research-journal {
    font-size: 0.8rem;
    color: var(--muted-gray);
    font-style: italic;
    margin-bottom: 1rem;
}

.research-link {
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 500;
    transition: color 0.3s ease;
}

.research-link:hover {
    color: #d4a63e;
}

/* --- Contact --- */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-lead {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    line-height: 1.7;
    color: var(--warm-white);
    margin-bottom: 2rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.contact-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
    font-weight: 500;
}

.contact-value {
    font-size: 1rem;
    color: var(--warm-white);
    transition: color 0.3s ease;
}

a.contact-value:hover {
    color: var(--primary-blue);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted-gray);
    font-weight: 500;
}

.form-input {
    background: rgba(245, 240, 232, 0.05);
    border: 1px solid rgba(106, 117, 125, 0.25);
    border-radius: 6px;
    padding: 0.85rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--warm-white);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.btn-submit {
    align-self: flex-start;
    margin-top: 0.5rem;
}

/* --- Footer --- */
#site-footer {
    position: relative;
    z-index: 2;
    padding: 3rem 2rem;
    border-top: 1px solid rgba(106, 117, 125, 0.15);
    text-align: center;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.footer-brand .logo-mark {
    font-size: 1.2rem;
}

.footer-brand .logo-text {
    font-size: 1.3rem;
}

.footer-tagline {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--muted-gray);
    margin-bottom: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.footer-links a {
    font-size: 0.85rem;
    color: var(--muted-gray);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--warm-white);
}

.footer-copy {
    font-size: 0.8rem;
    color: rgba(106, 117, 125, 0.6);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    #main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(26, 26, 46, 0.98);
        flex-direction: column;
        padding: 1.5rem 2rem;
        gap: 1rem;
    }

    #main-nav.open {
        display: flex;
    }

    #nav-toggle {
        display: flex;
    }

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

    .bento-large {
        grid-column: span 1;
    }

    .sim-showcase {
        grid-template-columns: 1fr;
    }

    .about-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

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

    .hero-decoration {
        width: 300px;
        height: 300px;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .section {
        padding: 4rem 1.25rem;
    }

    #site-header {
        padding: 1rem 1.25rem;
    }
}
