/* 
 * Whitefir Studio - "Apple Flavor" Design System
 * Focuses on extreme minimalism, crisp typography, and refined tension.
 */

:root {
    /* Apple-inspired Dark Theme Colors */
    --bg-color: #000000;
    --bg-surface: #1d1d1f;
    /* Card/Section backgrounds */
    --bg-surface-elevated: #2c2c2e;
    /* Hover states */

    --text-primary: #f5f5f7;
    /* Classic Apple light grey */
    --text-secondary: #86868b;
    --text-tertiary: #515154;

    --accent-color: #ffffff;
    /* Pure white high contrast */

    /* Deep blur specific to Apple navigation */
    --nav-bg: rgba(0, 0, 0, 0.72);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(255, 255, 255, 0.25);

    /* Animation Physics - Apple Spring */
    --spring-timing: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-timing: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    scroll-behavior: smooth;
    font-size: 16px;
    line-height: 1.5;
}

body {
    overflow-x: hidden;
    background-color: var(--bg-color);
    /* Adding View Transitions API Support for cross-page animations if supported */
    view-transition-name: root;
}

/* Custom Minimalist Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    border: 3px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Typography Constraints */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    letter-spacing: -0.04em;
    /* Very tight spacing for tension */
    color: var(--text-primary);
    line-height: 1.1;
}

h1 {
    font-size: clamp(3rem, 8vw, 6rem);
}

h2 {
    font-size: clamp(2rem, 5vw, 4rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    color: var(--text-secondary);
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: 0.015em;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.3s var(--ease-timing);
}

a:hover {
    opacity: 0.7;
}

/* Layout Utilities */
.container {
    max-width: 1440px;
    /* Expanded for Atmospheric Layout */
    margin: 0 auto;
    padding: 0 4rem;
    /* Increased padding for ultra wide */
}

@media (max-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

.section {
    padding: 8rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ==========================================================================
   Components
   ========================================================================== */

/* Navigation */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 9999;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.nav-links a:hover {
    color: var(--text-primary);
    opacity: 1;
}

.lang-toggle {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    transition: color 0.3s var(--ease-timing), opacity 0.3s var(--ease-timing);
}

.lang-toggle:hover {
    color: var(--text-primary);
    opacity: 1;
}

/* Glass Card / Bento Box */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
    margin-top: 4rem;
}

.glass-card {
    background: var(--bg-surface);
    border-radius: 20px;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s var(--spring-timing), background 0.4s var(--ease-timing);
    border: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Text at bottom */
}

/* The Apple 'Pill' Style Hover */
.glass-card:hover {
    transform: scale(1.02);
    background: var(--bg-surface-elevated);
    border-color: var(--border-focus);
}

/* Project Specifics */
.project-large {
    grid-column: span 12;
    min-height: 500px;
}

.project-medium {
    grid-column: span 6;
    min-height: 450px;
}

@media (max-width: 768px) {
    .project-medium {
        grid-column: span 12;
    }
}

/* Beautiful Image Placeholder */
.project-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0));
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1.05);
    /* initial scale */
    transition: transform 0.6s var(--ease-timing);
}

.glass-card:hover .project-image-placeholder {
    transform: scale(1);
}

.card-content {
    position: relative;
    z-index: 10;
}

.card-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Pill Button */
.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    color: var(--bg-color);
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.4s var(--spring-timing);
    border: none;
    cursor: pointer;
    margin-top: 2rem;
}

.btn-pill:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s var(--ease-timing);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* i18n Anti-Flicker */
.i18n-loading [data-i18n] {
    opacity: 0 !important;
}