/* ============================================================
   AINCHIL CALAHORRA — styles.css v2.0
   Architecture: reset → tokens → base → layout →
                 components → pages → animations → responsive
   ============================================================ */


/* ── TYPEFACES ─────────────────────────────────────────────── */

@font-face {
    font-family: 'Knockout';
    src: url('assets/fonts/Knockout HTF52-Cruiserweight Regular.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'BillingLottre';
    src: url('assets/fonts/Billing Lottre-Regular.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'Bethany';
    src: url('assets/fonts/Bethany Elingston.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'BDSans';
    src: url('assets/fonts/BDSans-Regular.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'GeistMono';
    src: url('assets/fonts/GeistMono-Regular.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'PixelCircle';
    src: url('assets/fonts/GeistFamily/GeistPixelOTF/GeistPixel-Circle.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'PixelGrid';
    src: url('assets/fonts/GeistFamily/GeistPixelOTF/GeistPixel-Grid.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'PixelLine';
    src: url('assets/fonts/GeistFamily/GeistPixelOTF/GeistPiexl-Line.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'PixelSquare';
    src: url('assets/fonts/GeistFamily/GeistPixelOTF/GeistPixel-Square.otf') format('opentype');
    font-display: swap;
}

@font-face {
    font-family: 'PixelTriangle';
    src: url('assets/fonts/GeistFamily/GeistPixelOTF/GeistPixel-Triangle.otf') format('opentype');
    font-display: swap;
}


/* ── DESIGN TOKENS ──────────────────────────────────────────── */

:root {
    /* Color */
    --color-ink:         #000000;
    --color-paper:       #ffffff;
    --color-surface:     #f4f4f4;
    --color-border:      #e0e0e0;
    --color-muted:       #888888;

    /* Per-department accents */
    --color-artimex:     #fcf9e2;
    --color-engineering: #e8e8e8;

    /* Typography roles */
    --font-display:      'Knockout', sans-serif;
    --font-sub:          'BDSans', sans-serif;
    --font-editorial:    'Bethany', cursive;
    --font-billing:      'BillingLottre', serif;
    --font-mono:         'GeistMono', monospace;
    --font-body:         Arial, Helvetica, sans-serif;

    /* Type scale */
    --text-hero:    clamp(4rem, 10vw, 9.5rem);
    --text-hero-sm: clamp(2.5rem, 6vw, 4rem);
    --text-h1:      clamp(2rem, 4vw, 3.5rem);
    --text-h2:      clamp(1.6rem, 3vw, 2.8rem);
    --text-h3:      clamp(1.4rem, 2.5vw, 2.2rem);
    --text-body-lg: 1.2rem;
    --text-body:    1rem;
    --text-sm:      0.875rem;

    /* Spacing (8px base) */
    --sp-1:  4px;
    --sp-2:  8px;
    --sp-3:  16px;
    --sp-4:  24px;
    --sp-5:  32px;
    --sp-6:  40px;
    --sp-7:  48px;
    --sp-8:  64px;
    --sp-9:  80px;

    /* Layout */
    --max-content: 900px;
    --max-wide:    1400px;
    --page-pad:    clamp(1.5rem, 5vw, 80px);

    /* Motion */
    --ease-out-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-fast: 200ms ease;
    --transition-base: 300ms ease;
}


/* ── RESET ──────────────────────────────────────────────────── */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}


/* ── BASE ───────────────────────────────────────────────────── */

body {
    background-color: var(--color-paper);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: 1.6;
}

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

ul, ol {
    list-style: none;
}

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


/* ── SHARED COMPONENTS ──────────────────────────────────────── */

/* Surname — used on all three pages */
.surname {
    font-family: var(--font-display);
    font-size: var(--text-hero);
    color: var(--color-ink);
    text-transform: uppercase;
    line-height: 0.9;
    letter-spacing: -0.01em;
}

/* Back / return navigation — fixed to bottom */
.back-nav {
    position: fixed;
    bottom: var(--sp-6);
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    animation: fadeIn 0.8s ease-in forwards;
    animation-delay: 2.2s;
    opacity: 0;
}

.back-link {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-muted);
    letter-spacing: 0.05em;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--color-ink);
}


/* ── PAGE: INDEX ────────────────────────────────────────────── */

body.page-index {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.landing-wrapper {
    text-align: center;
}

.landing-wrapper .surname {
    display: block;
}

.sub-nav {
    margin-top: var(--sp-2);
    display: flex;
    justify-content: center;
    gap: var(--sp-2);
    animation: blurIn 1.2s ease-out forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

.nav-item {
    font-family: var(--font-body);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--color-ink);
    transition: opacity var(--transition-fast);
}

.nav-item:hover {
    opacity: 0.5;
}


/* ── PAGE: BUSINESS ─────────────────────────────────────────── */

body.page-business {
    overflow-y: auto;
    height: 100vh;
    scroll-behavior: smooth;
}

/* Hero */
.business-hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.surname-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.surname-container .surname {
    position: relative;
    z-index: 2;
    background-color: var(--color-paper);
}

.business-title {
    position: relative;
    z-index: 1;
    font-family: var(--font-sub);
    font-size: clamp(1.4rem, 2.5vw, 2.8rem);
    text-transform: uppercase;
    letter-spacing: 0.85em;
    margin-right: -0.85em;
    animation: dropFromBehind 1.2s var(--ease-out-smooth) forwards;
    animation-delay: 0.8s;
    opacity: 0;
}

/* About section */
.business-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--sp-9) var(--page-pad);
    max-width: var(--max-wide);
    margin: 0 auto;
    text-align: center;
}

.content-title {
    font-family: var(--font-body);
    font-size: var(--text-h1);
    font-weight: 400;
    color: var(--color-ink);
    margin-bottom: var(--sp-4);
}

.content-subtitle {
    font-family: var(--font-sub);
    font-size: var(--text-h2);
    color: var(--color-ink);
    margin-bottom: var(--sp-5);
    max-width: var(--max-content);
}

.content-body {
    font-family: var(--font-body);
    font-size: var(--text-body-lg);
    line-height: 1.8;
    color: var(--color-ink);
    max-width: 800px;
}

/* Departments section */
.departments-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--sp-9) var(--page-pad);
    max-width: var(--max-wide);
    margin: 0 auto;
    width: 100%;
}

.departments-title {
    font-family: var(--font-body);
    font-size: var(--text-h1);
    font-weight: 400;
    color: var(--color-ink);
    margin-bottom: var(--sp-8);
    text-align: center;
}

.departments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: 100%;
    border: 1px solid var(--color-border);
}

/* Shared card styles */
.department-card {
    padding: clamp(2rem, 5vw, 60px) clamp(1.5rem, 4vw, 50px);
    display: flex;
    flex-direction: column;
}

.department-description {
    font-family: var(--font-body);
    font-size: var(--text-body-lg);
    line-height: 1.8;
    color: var(--color-ink);
}

/* Maison Artimex card */
.artimex-card {
    background-color: var(--color-artimex);
}

.artimex-card .department-name {
    font-family: var(--font-editorial);
    font-size: clamp(2.5rem, 4vw, 4rem);
    color: var(--color-ink);
    margin-bottom: var(--sp-3);
    font-weight: 400;
}

.artimex-card .department-established {
    font-family: var(--font-billing);
    font-size: 1.5rem;
    color: var(--color-ink);
    margin-bottom: var(--sp-4);
}

/* AC Engineering card */
.engineering-card {
    background-color: var(--color-engineering);
    border-left: 1px solid var(--color-border);
}

.engineering-name {
    margin-bottom: var(--sp-3);
}

.engineering-text {
    font-family: var(--font-sub);
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    color: var(--color-ink);
    text-transform: uppercase;
    display: block;
}

.engineering-card .department-subtitle {
    font-family: var(--font-body);
    font-size: var(--text-body-lg);
    color: var(--color-ink);
    margin-bottom: var(--sp-4);
    font-style: italic;
}


/* ── PAGE: FAMILY ───────────────────────────────────────────── */

body.page-family {
    overflow-y: auto;
    height: 100vh;
    scroll-behavior: smooth;
}

/* Hero */
.family-hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.first-last-name {
    font-family: var(--font-mono);
    font-size: clamp(1.5rem, 4vw, 4rem);
    text-transform: uppercase;
    color: var(--color-ink);
    text-align: center;
    margin-bottom: var(--sp-2);
    animation: dropFromAbove 1.2s var(--ease-out-smooth) forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

/* Projects section */
.projects-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--sp-9) var(--page-pad);
    background-color: var(--color-paper);
}

.projects-container {
    display: flex;
    width: 100%;
    max-width: var(--max-wide);
    margin: 0 auto;
    min-height: 600px;
    border: 1px solid var(--color-border);
}

/* Sidebar */
.project-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--color-border);
}

.sidebar-header {
    padding: var(--sp-3) var(--sp-3);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-muted);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.project-nav {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.project-item {
    padding: var(--sp-3) var(--sp-3);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--color-ink);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: opacity var(--transition-fast);
    line-height: 1.4;
}

.project-item:hover {
    opacity: 0.7;
}

.project-item.active {
    border-left: 3px solid var(--color-ink);
    padding-left: calc(var(--sp-3) - 3px);
}

.project-item.light-text {
    color: rgba(255, 255, 255, 0.9);
}

.project-item.light-text.active {
    border-left-color: rgba(255, 255, 255, 0.9);
}

/* Project content pane */
.project-content {
    flex-grow: 1;
    padding: var(--sp-6) clamp(1.5rem, 4vw, 60px);
    font-family: var(--font-mono);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow-y: auto;
    transition: background-color var(--transition-base), color var(--transition-base);
}

.project-content h2 {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 400;
    margin-bottom: var(--sp-2);
    line-height: 1.2;
}

.project-subtitle {
    font-size: var(--text-sm);
    font-style: italic;
    color: var(--color-muted);
    margin-bottom: var(--sp-5);
    font-weight: 400;
}

.project-content.dark-content .project-subtitle {
    color: rgba(255, 255, 255, 0.6);
}

.section-heading {
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: var(--sp-5);
    margin-bottom: var(--sp-2);
    width: 100%;
}

.section-content {
    font-size: var(--text-sm);
    line-height: 1.8;
    width: 100%;
    margin-bottom: var(--sp-3);
    max-width: 680px;
}

.section-bullets {
    width: 100%;
    max-width: 680px;
    margin-bottom: var(--sp-3);
    padding-left: var(--sp-3);
    list-style: disc;
}

.section-bullets li {
    font-size: var(--text-sm);
    line-height: 1.8;
    margin-bottom: var(--sp-2);
}

.github-footer {
    margin-top: auto;
    padding-top: var(--sp-6);
    font-size: var(--text-sm);
    font-style: italic;
    color: var(--color-muted);
    width: 100%;
}

.project-content.dark-content .github-footer {
    color: rgba(255, 255, 255, 0.5);
}

/* Family header (legacy — kept for compatibility, not used in v2) */
.github-link {
    font-family: var(--font-mono);
    color: #2ea44f;
    font-size: var(--text-body);
    margin-bottom: var(--sp-1);
}


/* ── ANIMATIONS ─────────────────────────────────────────────── */

@keyframes blurIn {
    from {
        filter: blur(10px);
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        filter: blur(0);
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes dropFromBehind {
    from {
        transform: translateY(-48px);
        filter: blur(5px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        filter: blur(0);
        opacity: 1;
    }
}

@keyframes dropFromAbove {
    from {
        transform: translateY(40px);
        filter: blur(5px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        filter: blur(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    to { opacity: 1; }
}


/* ── RESPONSIVE ─────────────────────────────────────────────── */

/* md — tablets */
@media (max-width: 1024px) {
    .departments-grid {
        grid-template-columns: 1fr;
    }

    .engineering-card {
        border-left: none;
        border-top: 1px solid var(--color-border);
    }

    .projects-container {
        flex-direction: column;
        min-height: auto;
    }

    .project-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .project-nav {
        flex-direction: row;
        flex-wrap: wrap;
        overflow-x: auto;
        overflow-y: visible;
    }

    .project-item {
        border-bottom: none;
        border-right: 1px solid rgba(0, 0, 0, 0.08);
        white-space: nowrap;
        flex-shrink: 0;
    }

    .project-item.active {
        border-left: none;
        border-bottom: 3px solid var(--color-ink);
        padding-left: var(--sp-3);
        padding-bottom: calc(var(--sp-3) - 3px);
    }

    .project-item.light-text.active {
        border-bottom-color: rgba(255, 255, 255, 0.9);
    }
}

/* sm — large phones */
@media (max-width: 768px) {
    body.page-index {
        overflow: hidden;
    }

    .sub-nav {
        flex-direction: column;
        gap: var(--sp-1);
        align-items: center;
    }

    .business-content,
    .departments-section,
    .projects-section {
        padding-top: clamp(3rem, 8vw, var(--sp-9));
        padding-bottom: clamp(3rem, 8vw, var(--sp-9));
    }

    .departments-title,
    .content-title {
        text-align: center;
    }

    .project-content {
        padding: var(--sp-4) var(--sp-4);
    }

    .back-nav {
        bottom: var(--sp-4);
    }
}

/* xs — phones */
@media (max-width: 480px) {
    .surname {
        font-size: clamp(3rem, 15vw, 5rem);
        letter-spacing: -0.02em;
    }

    .business-title {
        font-size: clamp(0.8rem, 3.5vw, 1.4rem);
        letter-spacing: 0.4em;
        margin-right: -0.4em;
    }

    .department-card {
        padding: var(--sp-5) var(--sp-4);
    }
}