/* ========================================
   Theme Variables
   ======================================== */
:root {
    --bg-page: #1a1714;
    --bg-card: #242018;
    --bg-card-hover: #2c2620;
    --card-border: #332e26;
    --heading-color: #f0e6d2;
    --accent: #c8922a;
    --accent-light: #f4d03f;
    --body-text: #b8b0a4;
    --muted-text: #8f867c;
    --link-text: #f0e6d2;
    --link-bg-hover: #c8922a;
    --link-text-hover: #1a1714;
    --divider-color: #c8922a;
    --footer-color: #a99e90;
    --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --logo-filter: drop-shadow(0 0 20px rgba(200, 146, 42, 0.2));
    --bg-image: url('slides/bg3.jpg');
    --bg-overlay: rgba(26, 23, 20, 0.88);
    --highlight-bg: linear-gradient(135deg, rgba(200, 146, 42, 0.08) 0%, rgba(200, 146, 42, 0.03) 100%);
}

@media (prefers-color-scheme: light) {
    :root {
        --bg-page: #f5f2ed;
        --bg-card: #ffffff;
        --bg-card-hover: #faf8f5;
        --card-border: #e8e2d8;
        --heading-color: #0a0805;
        --accent: #b8860b;
        --accent-light: #c8922a;
        --body-text: #4a4540;
        --muted-text: #8f867c;
        --link-text: #1a1714;
        --link-bg-hover: #1a1714;
        --link-text-hover: #ffffff;
        --divider-color: #b8860b;
        --footer-color: #8a8278;
        --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
        --logo-filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08))
            brightness(0.55) contrast(1.3);
        --bg-image: url('slides/bg3.jpg');
        --bg-overlay: rgba(245, 242, 237, 0.92);
        --highlight-bg: linear-gradient(135deg, rgba(184, 134, 11, 0.06) 0%, rgba(184, 134, 11, 0.02) 100%);
    }
}

/* ========================================
   Base
   ======================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page) var(--bg-image) no-repeat center center fixed;
    background-size: cover;
    color: var(--body-text);
    line-height: 1.7;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 0;
    pointer-events: none;
}

/* Disable fixed bg on mobile for scroll performance */
@media screen and (max-width: 768px) {
    body {
        background-attachment: scroll;
    }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .animate { animation: none !important; }
    * { transition-duration: 0.01ms !important; }
}

/* ========================================
   Layout
   ======================================== */
.page {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 0 2rem;
    padding-top: max(0px, env(safe-area-inset-top));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
}

section {
    padding: 4rem 0;
    border-bottom: 1px solid var(--card-border);
}

section:last-of-type {
    border-bottom: none;
}

/* ========================================
   Shared Card Component
   ======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    padding: 1.3rem;
    padding-left: 1.35rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px) translateZ(0);
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate { animation: fadeInUp 0.8s ease-out both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ========================================
   Hero
   ======================================== */
.hero {
    text-align: center;
    padding: 5rem 0 2rem;
    border-bottom: none;
}

.logo {
    width: 140px;
    height: 130px;
    margin-bottom: 1.5rem;
    filter: var(--logo-filter);
    transition: filter 0.4s ease;
    image-rendering: crisp-edges;
}

/* Experience summary */
.experience-summary {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--muted-text);
    letter-spacing: 0.5px;
    margin-bottom: 1.2rem;
}

/* Focus visible states */
.card:focus-visible,
.social-links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

h1 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 3rem;
    font-weight: 400;
    color: var(--heading-color);
    margin-bottom: 0.3rem;
    letter-spacing: -0.5px;
    transition: color 0.4s ease;
}

.tagline {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    transition: color 0.4s ease;
}

.hero-bio {
    max-width: 520px;
    margin: 0 auto 2rem;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--body-text);
}

.social-links {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
}

.social-links a {
    color: var(--link-text);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0.65rem 1.4rem;
    border: 1px solid var(--card-border);
    border-radius: 50px;
    background: var(--bg-card);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    min-height: 48px;
}

.social-links a:hover {
    color: var(--link-text-hover);
    background: var(--link-bg-hover);
    border-color: var(--link-bg-hover);
    box-shadow: var(--card-shadow);
}

.social-links svg {
    width: 15px; height: 15px;
    vertical-align: -1px;
    margin-right: 6px;
    fill: currentColor;
}

/* ========================================
   Section Headings
   ======================================== */
.section-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--heading-color);
    margin-bottom: 1.2rem;
    transition: color 0.4s ease;
}

/* ========================================
   Focus Areas
   ======================================== */
.focus-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.focus-card {
    padding: 1.4rem;
    padding-left: 1.3rem;
}

.focus-card:hover {
    transform: translateY(-2px) translateZ(0);
}

.focus-card h3 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--heading-color);
    margin-bottom: 0.5rem;
    transition: color 0.4s ease;
}

.focus-card p {
    font-size: 0.85rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--muted-text);
}

/* ========================================
   Experience
   ======================================== */
.exp-item {
    margin-bottom: 0.8rem;
}

.exp-item:last-child { margin-bottom: 0; }

.exp-role {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--heading-color);
    transition: color 0.4s ease;
}

.exp-company {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--muted-text);
    margin-bottom: 0.4rem;
}

.exp-desc {
    font-size: 0.88rem;
    font-weight: 300;
    line-height: 1.7;
}

/* ========================================
   Education & Certs
   ======================================== */
.edu-item {
    margin-bottom: 0.8rem;
}

.edu-item:last-child { margin-bottom: 0; }

.edu-degree {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--heading-color);
    transition: color 0.4s ease;
}

.edu-school {
    font-size: 0.85rem;
    color: var(--muted-text);
}

.cert-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
}

.cert-list {
    list-style: none;
    padding: 1.3rem;
    padding-left: 1.35rem;
    background: var(--bg-card);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.cert-list li {
    font-size: 0.88rem;
    font-weight: 300;
    padding: 0.3rem 0;
}

/* ========================================
   Project Links
   ======================================== */
.project-link {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.project-link:hover {
    color: var(--accent-light);
    opacity: 0.9;
}

.project-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.project-link {
    display: inline-block;
    padding: 0.3rem 0;
    min-height: 44px;
    line-height: 44px;
}

/* ========================================
   Quote / Highlight
   ======================================== */
.highlight-section {
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--highlight-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    margin: 2rem 0;
}

.highlight-quote {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.3px;
    color: var(--heading-color);
    max-width: 560px;
    margin: 0 auto 1rem;
    transition: color 0.4s ease;
}

.highlight-sub {
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.7;
    color: var(--body-text);
    max-width: 480px;
    margin: 0 auto;
}

/* ========================================
   Footer
   ======================================== */
footer {
    text-align: center;
    padding: 2rem 0 3rem;
    font-size: 0.75rem;
    color: var(--footer-color);
    letter-spacing: 0.5px;
    transition: color 0.4s ease;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

/* ========================================
   Responsive - Tablet (768px)
   ======================================== */
@media screen and (max-width: 768px) {
    .page { padding: 0 1.5rem; }
    .hero { padding: 4rem 0 2rem; }
    .logo { width: 120px; height: 110px; }
    h1 { font-size: 2.5rem; }
    .tagline { font-size: 0.8rem; letter-spacing: 2.5px; }
    .hero-bio { font-size: 0.92rem; }
    .section-title { font-size: 1.4rem; }
    .social-links { flex-wrap: wrap; justify-content: center; }
    .social-links a { justify-content: center; }
    .focus-card { padding: 1.1rem; }
    .focus-card h3 { font-size: 0.95rem; }
    .focus-card p { font-size: 0.82rem; }
    .card { padding: 1.1rem; }
    .exp-role { font-size: 1rem; }
    .highlight-quote { font-size: 1.3rem; }
    .highlight-section { padding: 3rem 1rem; }
    section { padding: 3rem 0; }
}

/* ========================================
   Responsive - Large Mobile (600px)
   ======================================== */
@media screen and (max-width: 600px) {
    .page { padding: 0 1.2rem; }
    .hero { padding: 3.5rem 0 1.5rem; }
    .logo { width: 100px; height: 92px; margin-bottom: 1rem; }
    h1 { font-size: 2.1rem; }
    .tagline { font-size: 0.75rem; letter-spacing: 2px; margin-bottom: 1rem; }
    .hero-bio { font-size: 0.88rem; margin-bottom: 1.5rem; }
    .social-links { gap: 0.6rem; justify-content: center; }
    .social-links a { justify-content: center; padding: 0.7rem 2rem; }
    .section-title { font-size: 1.25rem; }
    .focus-grid { grid-template-columns: 1fr; gap: 0.7rem; }
    .focus-card { padding: 1rem; }
    .focus-card h3 { font-size: 0.9rem; }
    .focus-card p { font-size: 0.8rem; }
    .card { padding: 1rem; margin-bottom: 0.7rem; }
    .exp-role { font-size: 0.95rem; }
    .exp-company { font-size: 0.78rem; }
    .exp-desc { font-size: 0.82rem; }
    .edu-degree { font-size: 0.92rem; }
    .highlight-quote { font-size: 1.15rem; }
    .highlight-sub { font-size: 0.82rem; }
    .highlight-section { padding: 2.5rem 1rem; margin: 1rem 0; }
    section { padding: 2.5rem 0; }
}

/* ========================================
   Responsive - Small Mobile (400px)
   ======================================== */
@media screen and (max-width: 400px) {
    .page { padding: 0 1rem; }
    .hero { padding: 2.5rem 0 1.2rem; }
    .logo { width: 85px; height: 78px; }
    h1 { font-size: 1.75rem; }
    .tagline { font-size: 0.7rem; letter-spacing: 1.5px; }
    .hero-bio { font-size: 0.82rem; line-height: 1.6; }
    .social-links a { font-size: 0.72rem; padding: 0.65rem 0.8rem; }
    .social-links svg { width: 14px; height: 14px; }
    .section-title { font-size: 1.1rem; }
    .card { padding: 0.9rem; border-radius: 6px; }
    .focus-card h3 { font-size: 0.85rem; }
    .focus-card p { font-size: 0.75rem; }
    .exp-role { font-size: 0.88rem; }
    .exp-company, .exp-desc { font-size: 0.75rem; }
    .edu-degree { font-size: 0.85rem; }
    .edu-school { font-size: 0.75rem; }
    .cert-list li { font-size: 0.75rem; }
    .highlight-quote { font-size: 1rem; }
    .highlight-sub { font-size: 0.78rem; }
    .highlight-section { padding: 2rem 0.8rem; border-radius: 10px; }
    section { padding: 2rem 0; }
    footer { font-size: 0.62rem; }
}
