/* ═══════════════════════════════════
   malacarne.com — Portfolio
   ═══════════════════════════════════ */

:root {
    --bg: #FAFAF8;
    --bg-card: #FFFFFF;
    --bg-section: #F4F3F0;
    --text: #1A1A1A;
    --text-2: #555;
    --text-3: #999;
    --accent: #2D6A4F;
    --accent-hover: #1B4332;
    --accent-light: #E8F5E9;
    --terracotta: #C7632D;
    --border: #E5E3DE;
    --radius: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
    --glow: none;
}

[data-theme="dark"] {
    --bg: #0C0C0E;
    --bg-card: #16161A;
    --bg-section: #111114;
    --text: #EAEAE8;
    --text-2: #9E9E98;
    --text-3: #5A5A56;
    --accent: #6ECEA0;
    --accent-hover: #8EDBB6;
    --accent-light: #1A2E23;
    --terracotta: #E8854A;
    --border: #26262A;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
    --glow: 0 0 60px rgba(110, 206, 160, 0.04), 0 0 120px rgba(142, 85, 180, 0.03);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── Scroll Animations ─── */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal.stagger-1 { transition-delay: 0.1s; }
.reveal.stagger-2 { transition-delay: 0.2s; }
.reveal.stagger-3 { transition-delay: 0.3s; }

/* ─── Cursor Follower ─── */
.cursor-glow {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(45, 106, 79, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
    opacity: 0;
    will-change: left, top;
}

[data-theme="dark"] .cursor-glow {
    background: radial-gradient(circle, rgba(110, 206, 160, 0.08) 0%, transparent 70%);
}

.hero:hover .cursor-glow {
    opacity: 1;
}

@media (hover: none) or (pointer: coarse) {
    .cursor-glow { display: none; }
}

/* ─── Hero Canvas ─── */
#hero-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background 0.4s, color 0.4s;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    box-shadow: var(--glow);
    transition: box-shadow 0.6s;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ─── Button ─── */
.btn {
    display: inline-block;
    padding: 14px 30px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.25s;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--text);
    transform: translateY(-1px);
}

/* ─── Header ─── */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

nav {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64px;
    position: relative;
}

.logo {
    position: absolute;
    left: 24px;
    font-size: 1.15rem;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.03em;
}

.logo span { color: var(--terracotta); }

.nav-links { display: flex; gap: 36px; }

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    transition: color 0.2s;
}

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

.nav-right {
    position: absolute;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-3);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.lang-toggle:hover {
    border-color: var(--text-2);
    color: var(--text-2);
}

.lang-sep { color: var(--text-3); margin: 0 1px; }

.lang-option.active { color: var(--text); }

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
}

.theme-toggle:hover {
    border-color: var(--text-2);
    transform: rotate(15deg);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: absolute;
    right: 24px;
    z-index: 110;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 105;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mobile-menu.show { display: flex; }

.mobile-menu a {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    padding: 14px 32px;
}

/* ─── Hero ─── */
.hero {
    padding: 120px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-label {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--terracotta);
    margin-bottom: 24px;
}

.hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.2rem, 5.5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero h1 em {
    font-style: italic;
    color: var(--accent);
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-2);
    max-width: 520px;
    margin: 0 auto 36px;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Work ─── */
.work {
    padding: 80px 0;
    background: var(--bg-section);
}

.section-head {
    text-align: center;
    margin-bottom: 48px;
}

.section-head h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.work-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.work-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

[data-theme="dark"] .work-card {
    border-color: var(--border);
}

[data-theme="dark"] .work-card:hover {
    border-color: rgba(110, 206, 160, 0.25);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 40px rgba(110, 206, 160, 0.08);
}

.work-card-img {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.work-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.work-card:hover .work-card-img::after {
    opacity: 0.06;
}

.work-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.work-card:hover .work-card-img img {
    transform: scale(1.08);
}

.work-card-body {
    padding: 28px;
}

.work-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--terracotta);
    background: rgba(199, 99, 45, 0.08);
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.work-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.work-card p {
    font-size: 0.9rem;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 16px;
}

.work-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

/* ─── About ─── */
.about {
    padding: 100px 0;
}

.about-grid {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 56px;
    align-items: start;
}

.about-photo-wrap {
    position: sticky;
    top: 88px;
}

.about-photo {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.about-content h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.about-content p {
    color: var(--text-2);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 16px;
}

.about-text strong { color: var(--text); }

.about-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 28px;
    background: var(--bg-section);
    border-radius: var(--radius);
    margin-top: 24px;
}

.info-block h4 {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 4px;
}

.info-block p {
    font-size: 0.95rem;
    font-weight: 500;
}

.info-block a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.info-block a:hover { border-color: var(--accent); }

.social-links {
    display: flex;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.social-links a {
    color: var(--text-2);
    transition: color 0.2s, transform 0.2s;
    display: flex;
}

.social-links a:hover {
    color: var(--text);
    transform: translateY(-2px);
}

[data-theme="dark"] .about-photo {
    box-shadow: var(--shadow-lg), 0 0 40px rgba(110, 206, 160, 0.06);
}

[data-theme="dark"] .work-tag {
    background: rgba(232, 133, 74, 0.12);
}

[data-theme="dark"] .btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── Contact ─── */
.contact {
    padding: 100px 0;
    text-align: center;
    background: var(--bg-section);
}

.contact h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.contact > .container > p {
    color: var(--text-2);
    font-size: 1.05rem;
    max-width: 420px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

/* ─── Footer ─── */
footer {
    padding: 24px 0;
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p {
    font-size: 0.8rem;
    color: var(--text-3);
}

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

.footer-links a {
    font-size: 0.8rem;
    color: var(--text-3);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--text-2); }

/* ═══════════════════════════════════
   MOBILE
   ═══════════════════════════════════ */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }

    .hero { padding: 80px 0 60px; }

    .work { padding: 56px 0; }
    .work-grid { grid-template-columns: 1fr; }
    .section-head { margin-bottom: 32px; }

    .about { padding: 56px 0; }
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
    .about-photo-wrap { max-width: 280px; margin: 0 auto; position: static; }
    .about-photo { aspect-ratio: 1; }

    .contact { padding: 56px 0; }

    .footer-inner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}
