/* ==========================================================================
   Fintech Portfolio — Main Site Stylesheet
   Approach: Mobile-first, DRY via CSS custom properties, progressive
   enhancement for larger screens via min-width media queries.
   ========================================================================== */


/* ---------- 1. Design Tokens (CSS Custom Properties) ---------- */
:root {
    /* Brand palette — fintech: trust + growth */
    --color-primary: #0a2540;        /* Deep navy — trust, stability */
    --color-primary-light: #1e3a5f;
    --color-accent: #00d4a6;         /* Mint green — growth, money */
    --color-accent-dark: #00a884;
    --color-gold: #d4af37;           /* Subtle premium accent */

    /* Neutrals */
    --color-bg: #f7f9fc;
    --color-surface: #ffffff;
    --color-text: #1a2332;
    --color-text-muted: #5a6a7e;
    --color-border: #e3e8ef;

    /* Status */
    --color-success: #00a884;
    --color-warning: #f5a623;
    --color-info: #4a90e2;

    /* Typography */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, Consolas, "Courier New", monospace;

    /* Spacing scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
    --space-2xl: 4rem;

    /* Layout */
    --container-max: 1200px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(10, 37, 64, 0.08);
    --shadow-md: 0 4px 12px rgba(10, 37, 64, 0.1);
    --shadow-lg: 0 12px 32px rgba(10, 37, 64, 0.15);

    /* Transitions */
    --transition: 0.2s ease;
}


/* ---------- 2. Reset + Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover, a:focus { color: var(--color-accent-dark); }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 var(--space-md); color: var(--color-primary); }

p { margin: 0 0 var(--space-md); }


/* ---------- 3. Layout helpers ---------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--color-border);
}

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

.section-title {
    font-size: 1.75rem;
    margin-bottom: var(--space-lg);
    position: relative;
    padding-bottom: var(--space-sm);
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 60px; height: 3px;
    background: var(--color-accent);
    border-radius: 2px;
}

.subhead {
    font-size: 1.25rem;
    color: var(--color-primary-light);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-md);
}

.lead { font-size: 1.1rem; color: var(--color-text-muted); max-width: 70ch; }


/* ---------- 4. Header ---------- */
.site-header {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
    color: #fff;
    padding: var(--space-lg) 0;
    box-shadow: var(--shadow-md);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }

.brand { display: flex; align-items: center; gap: var(--space-md); }

.brand-logo {
    width: 48px; height: 48px;
    background: var(--color-accent);
    color: var(--color-primary);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.5rem;
    box-shadow: 0 0 0 4px rgba(0, 212, 166, 0.2);
    /* Subtle pulse animation on page load — stops after 3 cycles */
    animation: brandPulse 2s ease-out 3;
}

@keyframes brandPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(0, 212, 166, 0.2); }
    50%      { box-shadow: 0 0 0 10px rgba(0, 212, 166, 0.05); }
}

.brand-name { font-size: 1.35rem; color: #fff; margin: 0; }

.brand-tagline { margin: 0; font-size: 0.9rem; color: var(--color-accent); letter-spacing: 0.5px; text-transform: uppercase; }


/* ---------- 5. Navigation ---------- */
.site-nav {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky; top: 0;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.nav-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.nav-link {
    display: block;
    padding: var(--space-md) var(--space-lg);
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 3px solid transparent;
    transition: all var(--transition);
}

.nav-link:hover, .nav-link:focus {
    color: var(--color-primary);
    background: var(--color-bg);
}

.nav-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-accent);
}


/* ---------- 6. Hero ---------- */
.hero {
    display: grid;
    gap: var(--space-lg);
    padding: var(--space-xl) 0;
    align-items: center;
}

.hero-img-wrapper { width: 100%; }

.hero-img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    /* Slide-in animation on load — stops after 1 run */
    animation: slideInUp 0.8s ease-out 1;
}

.hero-title {
    font-size: 1.75rem;
    color: var(--color-primary);
}

.hero-sub { color: var(--color-text-muted); font-size: 1.05rem; }

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ---------- 7. Card grid (About sections, Skills examples) ---------- */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card-img { width: 100%; height: 180px; object-fit: cover; background: var(--color-bg); }

.card-body { padding: var(--space-lg); flex: 1; display: flex; flex-direction: column; }

.card-title { font-size: 1.2rem; margin-bottom: var(--space-sm); }


/* ---------- 8. Lists ---------- */
.bullet-list, .number-list { padding-left: var(--space-lg); margin: 0 0 var(--space-md); }

.bullet-list li, .number-list li { margin-bottom: var(--space-sm); }

.bullet-list li::marker { color: var(--color-accent); }

.number-list li::marker { color: var(--color-accent-dark); font-weight: 700; }


/* ---------- 9. Tables (responsive) ---------- */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); background: var(--color-surface); }

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.data-table caption {
    padding: var(--space-md);
    font-weight: 600;
    color: var(--color-primary);
    text-align: left;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
}

.data-table th, .data-table td { padding: var(--space-md); text-align: left; border-bottom: 1px solid var(--color-border); }

.data-table thead th { background: var(--color-primary); color: #fff; font-weight: 600; }

.data-table tbody tr { transition: background var(--transition); }

.data-table tbody tr:hover { background: rgba(0, 212, 166, 0.05); }

.data-table tfoot td { background: var(--color-bg); font-style: italic; color: var(--color-text-muted); text-align: center; }

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-done     { background: rgba(0, 168, 132, 0.15); color: var(--color-accent-dark); }
.status-current  { background: rgba(74, 144, 226, 0.15); color: var(--color-info); }
.status-upcoming { background: rgba(245, 166, 35, 0.15); color: var(--color-warning); }


/* ---------- 10. Buttons ---------- */
.button {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    margin-top: auto;
    align-self: flex-start;
    background: var(--color-accent);
    color: var(--color-primary);
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: transform var(--transition), background var(--transition);
}

.button:hover, .button:focus { background: var(--color-accent-dark); color: #fff; transform: translateY(-2px); }


/* ---------- 11. Footer ---------- */
.site-footer {
    background: var(--color-primary);
    color: #cdd5e0;
    padding: var(--space-xl) 0 var(--space-md);
    margin-top: var(--space-2xl);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.footer-title { color: #fff; font-size: 1rem; margin-bottom: var(--space-sm); }

.footer-col a { color: var(--color-accent); }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    text-align: center;
    font-size: 0.9rem;
}


/* ==========================================================================
   12. Responsive breakpoints — mobile-first, enhance upward
   ========================================================================== */

/* Tablet and up: 600px+ */
@media (min-width: 600px) {
    .section-title { font-size: 2rem; }
    .hero-title { font-size: 2.25rem; }
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: repeat(2, 1fr); }
    .container { padding: 0 var(--space-lg); }
}

/* Desktop: 900px+ */
@media (min-width: 900px) {
    .hero { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
    .card-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-inner { grid-template-columns: repeat(3, 1fr); }
    .hero-title { font-size: 2.5rem; }
}

/* Large desktop: 1200px+ */
@media (min-width: 1200px) {
    .section { padding: var(--space-2xl) 0; }
}


/* ---------- 13. Accessibility ---------- */
:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
