/* ===== Sticky Symbol ===== */
.sticky-symbol {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    height: auto;
    pointer-events: none;
    transition: transform 0.3s ease;
}

nav.is-sticky .sticky-symbol {
    transform: translate(-50%, calc(-50% + 5px));
}

/* ===== CSS Variables ===== */
:root {
    --color-bg: #fafaf8;
    --color-text: #1a1a1a;
    --color-text-muted: #5c5c5c;
    --color-accent: #2d5a45;
    --color-accent-light: #e8f0eb;
    --color-border: #e0e0dc;
    --color-card-bg: #ffffff;
    --font-display: 'Miriam Libre', Georgia, serif;
    --font-body: 'IBM Plex Sans', Helvetica, sans-serif;
    --max-width: 1100px;
    --spacing-section: clamp(1.4rem, 1vw, 0.8rem);

    /* Location-based design variables */
    --location-hue-shift: 0deg;
    --location-warmth: 0;
    --location-brightness: 1;
    --location-saturation: 1;
    --time-of-day-opacity: 1;
    --animation-speed-multiplier: 1;
}

/* Dark mode */
[data-theme="dark"] {
    --color-bg: #0f0f0f;
    --color-text: #e8e8e6;
    --color-text-muted: #a0a0a0;
    --color-accent: #5fa882;
    --color-accent-light: #1a2f24;
    --color-border: #2a2a2a;
    --color-card-bg: #1a1a1a;
}

/* Smooth transitions for theme changes */
:root {
    transition:
        --location-hue-shift 2s ease,
        --location-warmth 2s ease,
        --location-brightness 2s ease,
        --location-saturation 2s ease;
}

body, nav, .work-card, .article-card, .case-study-card {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ===== Hero Animation Container ===== */
.hero-animation-wrapper {
    width: 100%;
    height: 35vh;
    min-height: 250px;
    max-height: 400px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
    overflow: hidden;
    background: var(--color-bg);
    clip-path: inset(0 0 calc(100% - 50px) 0);
    transition: clip-path 0.15s ease;
}

.hero-animation-wrapper.at-top {
    clip-path: inset(0);
}

/* Spacer to push content down */
.hero-spacer {
    height: 35vh;
    min-height: 250px;
    max-height: 400px;
}

.hero-animation-wrapper #hero-animation {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.hero-animation-wrapper canvas {
    display: block;
    position: relative;
    z-index: 1;
}


/* Optional: overlay content on top of animation */
.hero-animation-wrapper .hero-overlay {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
}

.hero-animation-wrapper .scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    animation: bounce 2s infinite;
}

.hero-animation-wrapper .scroll-indicator svg {
    width: 24px;
    height: 24px;
    margin-top: 0.5rem;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--color-accent);
    color: white;
}

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

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

/* ===== Layout ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: var(--spacing-section) 0;
}

/* ===== Navigation ===== */
nav {
    position: sticky;
    top: 50px;
    z-index: 100;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0.8rem 0;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
    margin: 0;
    text-decoration: none;
}

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

.nav-links a {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    letter-spacing: 0.02em;
}

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

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }

[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

/* Mobile menu */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    margin: 5px 0;
    transition: 0.3s;
}

/* ===== Particle Background Canvas ===== */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--color-bg);
}

[data-theme="dark"] #particle-canvas {
    background: var(--color-bg);
}

/* ===== Hero / About ===== */
#about {
    padding-top: clamp(3rem, 8vw, 6rem);
    position: relative;
    z-index: 1;
}

.hero-statement {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3.2vw, 2.2rem);
    line-height: 1.2;
    letter-spacing: -1px;
    max-width: 900px;
    margin-bottom: 1rem;
}

.hero-statement span {
    color: var(--color-accent);
}

/* Typewriter cursor */
.typewriter-cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background-color: var(--color-accent);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    50% { opacity: 0; }
}

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 700px;
}

.about-content p {
    color: var(--color-text-muted);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tag {
    background: var(--color-accent-light);
    color: var(--color-accent);
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ===== Section Headings ===== */
.section-header {
    margin-bottom: 1rem;
    margin-top: 2rem;
    padding-bottom: .2rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3.2vw, 2.2rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -1px;
}

.section-header .view-all {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

/* ===== Career Timeline ===== */
.timeline {
    position: relative;
    max-width: 800px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 2.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 3px solid var(--color-bg);
}

.timeline-item.current::before {
    box-shadow: 0 0 0 4px var(--color-accent-light);
}

.timeline-date {
    font-size: 0.8125rem;
    color: var(--color-accent);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.timeline-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.timeline-company {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.timeline-desc {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* ===== Work / Case Studies Grid ===== */
.work-grid, .case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.work-card, .case-study-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.work-card:hover, .case-study-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    opacity: 1;
}

[data-theme="dark"] .work-card:hover,
[data-theme="dark"] .case-study-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.work-card-image, .case-study-image {
    aspect-ratio: 16 / 10;
    background: var(--color-accent-light);
    overflow: hidden;
}

.work-card-image img, .case-study-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.work-card:hover .work-card-image img,
.case-study-card:hover .case-study-image img {
    transform: scale(1.03);
}

.work-card-content, .case-study-content {
    padding: 1.25rem;
}

.work-card-title, .case-study-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.work-card-desc, .case-study-desc {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.work-card-meta, .case-study-meta {
    font-size: 0.8125rem;
    color: var(--color-accent);
    margin-top: 0.75rem;
}

/* ===== Portfolio Table ===== */
.portfolio-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
    border: 1px solid var(--color-border);
}

.portfolio-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .portfolio-table {
    background: rgba(15, 15, 15, 0.8);
}

.portfolio-table th,
.portfolio-table td {
    text-align: left;
    padding: 0.45rem .5rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.portfolio-table th {
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    text-transform: none;
    letter-spacing: normal;
    background: var(--color-accent-light);
    position: sticky;
    top: 0;
}

.portfolio-table tbody tr {
    border-bottom: 1px solid var(--color-border);
}

.portfolio-table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.5);
}

.portfolio-table tbody tr:nth-child(even) {
    background: rgba(45, 90, 69, 0.1);
}

[data-theme="dark"] .portfolio-table tbody tr:nth-child(odd) {
    background: rgba(15, 15, 15, 0.5);
}

[data-theme="dark"] .portfolio-table tbody tr:nth-child(even) {
    background: rgba(95, 168, 130, 0.12);
}

.portfolio-table td:first-child {
    font-weight: 500;
    color: var(--color-text);
    min-width: 200px;
}

.portfolio-table td:nth-child(2) {
    color: var(--color-text);
    white-space: nowrap;
}

.portfolio-table td:nth-child(3) {
    color: var(--color-text-muted);
    white-space: nowrap;
}

.portfolio-table td:nth-child(4) {
    color: var(--color-text-muted);
    max-width: 300px;
}

.portfolio-table td:last-child {
    color: var(--color-text-muted);
    white-space: nowrap;
    text-align: right;
}

/* ===== Articles Grid ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.article-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    opacity: 1;
}

[data-theme="dark"] .article-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.article-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.article-card-type {
    color: var(--color-accent);
    font-weight: 500;
}

.article-card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.article-card-excerpt {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* ===== Article Page ===== */
.article-header {
    max-width: 700px;
    margin: 0 auto;
    padding-top: clamp(2rem, 5vw, 4rem);
    padding-bottom: 2rem;
}

.article-header .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin-bottom: 2rem;
}

.article-header .back-link:hover {
    color: var(--color-accent);
}

.article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.article-type {
    color: var(--color-accent);
    font-weight: 500;
}

.article-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.article-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

.article-content {
    max-width: 700px;
    margin: 0 auto;
    padding-bottom: var(--spacing-section);
}

.article-content h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
}

.article-content h3 {
    font-family: var(--font-display);
    font-size: 1.375rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 3px solid var(--color-accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--color-text-muted);
}

.article-content code {
    background: var(--color-accent-light);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

.article-content pre {
    background: var(--color-accent-light);
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content img {
    border-radius: 0.5rem;
    margin: 2rem 0;
}

/* ===== Case Study Page ===== */
.case-study-header {
    max-width: 900px;
    margin: 0 auto;
    padding-top: clamp(2rem, 5vw, 4rem);
    padding-bottom: 2rem;
}

.case-study-hero-image {
    aspect-ratio: 16 / 9;
    background: var(--color-accent-light);
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 2rem;
}

.case-study-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.case-study-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    margin-bottom: 3rem;
}

.overview-item label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.overview-item span {
    font-weight: 500;
}

/* ===== Infographics Grid ===== */
.infographics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.infographic-card {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--color-accent-light) 0%, var(--color-card-bg) 100%);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.infographic-card:hover {
    border-color: var(--color-accent);
}

.infographic-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.infographic-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.infographic-card:hover .infographic-overlay {
    opacity: 1;
}

.infographic-title {
    color: white;
    font-family: var(--font-display);
    font-size: 1.125rem;
}

.infographic-cta {
    color: rgba(255,255,255,0.8);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Placeholder state */
.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.placeholder-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.placeholder-text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ===== Contact / CTA Section ===== */
.contact-section {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-section h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-section p {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: 2rem;
    color: var(--color-text);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.contact-link:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    opacity: 1;
}

.contact-link svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

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

/* ===== Divider ===== */
hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: var(--spacing-section) 0;
}

/* ===== Footer ===== */
footer {
    padding: 3rem 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-name {
    font-family: var(--font-display);
    font-size: 1.125rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

/* Location info in footer */
.location-info {
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.location-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.location-info-item strong {
    color: var(--color-text);
}

.location-toggle {
    margin-left: auto;
    cursor: pointer;
    padding: 0.25rem 0.75rem;
    background: var(--color-accent-light);
    color: var(--color-accent);
    border-radius: 1rem;
    font-size: 0.75rem;
    border: none;
    transition: opacity 0.2s ease;
}

.location-toggle:hover {
    opacity: 0.7;
}

.location-info.hidden {
    display: none;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--color-bg);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-toggle {
        display: block;
    }

    .timeline::before {
        left: 6px;
    }

    .timeline-item {
        padding-left: 2.5rem;
    }

    .timeline-item::before {
        left: 0;
    }
}

@media (max-width: 640px) {
    .nav-links {
        gap: 1.25rem;
    }

    .work-grid,
    .case-studies-grid,
    .articles-grid,
    .infographics-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .contact-links {
        flex-direction: column;
    }
}

/* ===== Animations ===== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-load {
    animation: fadeUp 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.2s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.3s; opacity: 0; }

/* Scroll animations disabled - were causing cache issues */
.fade-in {
    /* No animation - always visible */
}
