/* =========================================
   1. GLOBAL RESET & VARIABLES
   ========================================= */
:root {
    --transition-speed: 0.4s;
    
    /* TECH PALETTE (CTO) */
    --tech-bg: #0f172a;       /* Slate 900 */
    --tech-surface: #1e293b;  /* Slate 800 */
    --tech-accent: #38bdf8;   /* Sky 400 */
    --tech-text: #f1f5f9;     /* Slate 100 */
    --tech-muted: #94a3b8;    /* Slate 400 */
    --font-tech: 'Inter', sans-serif;

    /* PSY PALETTE (Human) */
    --psy-bg: #fdfbf7;        /* Warm Paper */
    --psy-surface: #ffffff;   /* Pure White */
    --psy-accent: #a4ac86;    /* Sage Green */
    --psy-text: #4a403a;      /* Dark Coffee */
    --psy-muted: #8d8178;     /* Warm Grey */
    --font-psy: 'Lora', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-tech);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; transition: opacity 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* =========================================
   2. UTILITIES & LAYOUT
   ========================================= */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Grids */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr; /* Stack on mobile */
    }
}

/* =========================================
   3. HEADER & NAVIGATION
   ========================================= */
.site-header {
    z-index: 100;
    position: relative;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Language Switcher */
.lang-switch {
    display: flex;
    gap: 10px;
    margin-left: 20px;
    font-size: 0.85rem;
    font-family: var(--font-tech);
    font-weight: 600;
}

.lang-switch a {
    color: inherit;
    opacity: 0.5;
    text-decoration: none;
}
.lang-switch a:hover { opacity: 1; }
.lang-switch a.active { opacity: 1; text-decoration: underline; }

@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; }
    .lang-switch { margin-left: auto; order: 2; margin-right: 15px; }
    .main-nav { order: 3; width: 100%; margin-left: 0 !important; margin-top: 10px; display: flex; justify-content: space-between; font-size: 0.9rem;}
}

/* =========================================
   4. SPLIT SCREEN (INDEX.HTML)
   ========================================= */
.split-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

.split-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    transition: flex var(--transition-speed) ease-in-out;
    overflow: hidden;
    text-align: center;
}

.content-wrapper {
    z-index: 10;
    max-width: 450px;
    animation: fadeIn 1s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

@media (min-width: 768px) {
    .split-screen { flex-direction: row; }
    .split-side:hover { flex: 1.5; }
    .split-screen:hover .split-side:not(:hover) {
        opacity: 0.8;
        filter: grayscale(30%);
    }
}

/* Tech Side Styles */
.side-tech {
    background: linear-gradient(135deg, #0b1120 0%, #1e293b 100%);
    color: var(--tech-text);
    font-family: var(--font-tech);
    border-right: 1px solid rgba(255,255,255,0.05);
}
.side-tech h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: -webkit-linear-gradient(0deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.btn-tech {
    display: inline-block;
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    background: transparent;
    border: 1px solid var(--tech-accent);
    color: var(--tech-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    transition: all 0.3s;
}
.btn-tech:hover {
    background: var(--tech-accent);
    color: #0f172a;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

/* Human Side Styles */
.side-human {
    background: var(--psy-bg);
    color: var(--psy-text);
    font-family: var(--font-psy);
}
.side-human h1 {
    font-size: 2.5rem;
    font-weight: 400;
    font-style: italic;
    margin-bottom: 1rem;
    color: #2c2420;
}
.btn-human {
    display: inline-block;
    margin-top: 2rem;
    padding: 1rem 2.5rem;
    background: var(--psy-text);
    color: #fff;
    border-radius: 50px;
    font-family: var(--font-tech);
    font-size: 0.9rem;
    transition: all 0.3s;
}
.btn-human:hover {
    background: var(--psy-accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* =========================================
   5. TECH THEME (CTO)
   ========================================= */
body.tech-theme {
    background-color: var(--tech-bg);
    color: var(--tech-text);
    font-family: var(--font-tech);
}

.site-header.tech-theme {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 0;
}
.site-header.tech-theme .logo { color: #fff; font-weight: 700; font-size: 1.2rem; }
.site-header.tech-theme nav a { color: var(--tech-muted); margin-left: 1.5rem; font-size: 0.9rem; }
.site-header.tech-theme nav a:hover { color: #fff; }

.hero-tech {
    padding: 6rem 0;
    text-align: center;
    background: radial-gradient(circle at top, #1e293b 0%, #0f172a 70%);
}
.hero-tech h1 { font-size: 3rem; margin-bottom: 1rem; line-height: 1.1; }
.hero-tech .lead { color: var(--tech-muted); font-size: 1.25rem; max-width: 700px; margin: 0 auto; }

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}
.tech-card {
    background: var(--tech-surface);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 2rem;
    transition: transform 0.3s;
}
.tech-card:hover { transform: translateY(-5px); border-color: var(--tech-accent); }
.tech-card h3 { color: var(--tech-accent); margin-bottom: 1rem; font-size: 1.1rem; text-transform: uppercase; }
.tech-list li { padding-left: 1rem; border-left: 2px solid var(--tech-accent); margin-bottom: 0.8rem; color: var(--tech-muted); }

/* =========================================
   6. HUMAN THEME (PSY)
   ========================================= */
body.human-theme {
    background-color: var(--psy-bg);
    color: var(--psy-text);
    font-family: var(--font-psy);
}

.site-header.human-theme {
    background: rgba(253, 251, 247, 0.95);
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.site-header.human-theme .logo { color: var(--psy-text); font-family: var(--font-psy); font-style: italic; font-size: 1.4rem; }
.site-header.human-theme nav a { color: var(--psy-muted); margin-left: 1.5rem; font-family: var(--font-tech); font-size: 0.9rem; }
.site-header.human-theme nav a:hover { color: var(--psy-accent); }

.hero-human { padding: 6rem 0; text-align: center; }
.hero-human h1 { font-size: 3.5rem; font-weight: 400; color: var(--psy-text); margin-bottom: 0.5rem; }
.hero-human .lead { font-family: var(--font-tech); color: var(--psy-muted); font-size: 1.1rem; letter-spacing: 1px; text-transform: uppercase; }

/* =========================================
   7. BOOK COVER & LAYOUT
   ========================================= */
.grid-2.book-layout {
    margin-top: 5rem;
    align-items: center;
}

.book-cover-3d {
    width: 340px;
    height: 510px;
    background: url('../images/book-kintsugi.webp') no-repeat center center;
    background-size: cover;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    box-shadow: 
        15px 15px 30px rgba(0,0,0,0.2),
        inset 2px 0px 5px rgba(255,255,255,0.2),
        inset -1px 0px 2px rgba(0,0,0,0.1);
    border-radius: 2px 6px 6px 2px;
    transition: transform 0.4s ease;
}

.book-cover-3d:hover {
    transform: translateY(-5px) rotateY(-5deg);
    box-shadow: 15px 15px 30px rgba(0,0,0,0.3);
}

.book-cover-3d::after { display: none; }

.book-cover-title {
    font-family: 'Lora', serif;
    font-weight: 600;
    font-size: 1.6rem;
    line-height: 1.2;
    color: #443730;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 15px rgba(44, 36, 32, 0.5);
}

.book-cover-author {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #5e503f;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
    .grid-2.book-layout { margin-top: 3rem; }
    .book-cover-3d { width: 280px; height: 420px; }
}

/* =========================================
   8. CONTACT PAGE & FOOTER
   ========================================= */
.contact-page {
    background-color: #f8f9fa;
    color: #333;
    font-family: var(--font-tech);
}
.contact-header { background: #fff; border-bottom: 1px solid #eee; padding: 1.5rem 0; }
.contact-header .logo { color: #333; font-weight: 800; }
.contact-header nav a { color: #666; margin-left: 20px; font-weight: 500; }
.contact-header nav a:hover { color: #000; }

.contact-hero { text-align: center; padding: 4rem 0 2rem; }
.contact-hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }

.contact-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}
.contact-card {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}
.contact-card:hover { transform: translateY(-5px); }
.tech-card-style { border-top: 4px solid var(--tech-accent); }
.human-card-style { border-top: 4px solid var(--psy-accent); }

/* Form */
.form-wrapper {
    max-width: 700px;
    margin: 0 auto;
    background: #fff;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.general-form input, .general-form textarea, .general-form select {
    width: 100%; padding: 0.8rem; border: 1px solid #ddd;
    border-radius: 6px; font-size: 1rem; background: #fcfcfc;
    margin-bottom: 1.5rem; font-family: inherit;
}
.btn-neutral {
    width: 100%; padding: 1rem; background: #333; color: #fff;
    border: none; border-radius: 6px; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.btn-neutral:hover { background: #000; }

/* Footer */
.site-footer {
    padding: 2rem 0;
    margin-top: auto;
}
.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.text-right { text-align: right; }

/* Mobile Utils */
@media (max-width: 768px) {
    .hero-tech h1, .hero-human h1 { font-size: 2rem; }
    .form-wrapper { padding: 1.5rem; }
    .footer-grid { flex-direction: column; gap: 1rem; text-align: center; }
    .text-right { text-align: center; }
}