/* =========================================
   CSS Variables & Theming (Neutral Palette)
   ========================================= */
:root {
    /* Light Theme (Default, if data-theme="light") */
    --bg-primary: #fcfcfc;
    --bg-secondary: #f3f4f6;
    --bg-accent: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --border-hover: #d1d5db;
    
    --brand-dark: #000000;
    --brand-light: #ffffff;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: 'Newsreader', Georgia, Cambria, "Times New Roman", Times, serif;
    
    /* Effects */
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] {
    /* Dark Theme */
    --bg-primary: #0a0a0b;
    --bg-secondary: #141415;
    --bg-accent: #1c1c1e;
    --text-primary: #f9fafb;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border-color: #27272a;
    --border-hover: #3f3f46;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

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

ul {
    list-style: none;
}

img, svg {
    max-width: 100%;
    height: auto;
}

i {
    font-family: var(--font-serif);
    font-weight: 400;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 8rem 0;
}

.bg-alt {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.border-top {
    border-top: 1px solid var(--border-color);
}

/* =========================================
   Typography & Utilities
   ========================================= */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    background: var(--bg-accent);
}

.section-header {
    margin-bottom: 4rem;
    max-width: 600px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-desc {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* =========================================
   Buttons
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

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

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-secondary);
}

/* =========================================
   Header & Navigation
   ========================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: rgba(var(--bg-primary-rgb), 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

/* Creating an rgb var for blur background */
:root { --bg-primary-rgb: 252, 252, 252; }
[data-theme="dark"] { --bg-primary-rgb: 10, 10, 11; }

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo a {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

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

.main-nav ul {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

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

/* =========================================
   Layout Grids
   ========================================= */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.align-center { align-items: center; }

/* =========================================
   Hero Section
   ========================================= */
.hero {
    padding-top: 12rem;
    padding-bottom: 8rem;
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 4.5rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-title i {
    color: var(--text-secondary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 650px;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

/* =========================================
   Expertise Section
   ========================================= */
.card {
    padding: 2.5rem;
    background-color: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition);
}

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

.card-icon {
    width: 48px;
    height: 48px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* =========================================
   Work Section
   ========================================= */
.case-study {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 2rem;
    background-color: var(--bg-accent);
    overflow: hidden;
    transition: var(--transition);
    padding: 3rem;
}

.case-study:hover {
    border-color: var(--border-hover);
}

.case-study-content {
    max-width: 700px;
}

.eyebrow {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.case-study-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.case-study-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.tag-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-list li {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
}

/* =========================================
   Philosophy Section
   ========================================= */
.prose p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.prose strong {
    color: var(--text-primary);
    font-weight: 500;
}

.quote-box {
    padding: 3rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    position: relative;
}

.quote-box::before {
    content: '"';
    font-family: var(--font-serif);
    font-size: 6rem;
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--bg-secondary);
    line-height: 1;
    z-index: 0;
}

.quote-box blockquote {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    line-height: 1.4;
    position: relative;
    z-index: 1;
    color: var(--text-primary);
}

/* =========================================
   Writing Section
   ========================================= */
.writing-list {
    display: flex;
    flex-direction: column;
}

.writing-item {
    display: flex;
    align-items: center;
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.writing-item:first-child {
    border-top: 1px solid var(--border-color);
}

.writing-meta {
    width: 250px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.writing-title {
    flex-grow: 1;
    font-size: 1.25rem;
    font-weight: 500;
}

.writing-arrow {
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--transition);
    color: var(--text-primary);
}

.writing-item:hover .writing-title {
    color: var(--text-secondary);
}

.writing-item:hover .writing-arrow {
    opacity: 1;
    transform: translateX(0);
}

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

.contact-card h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-card p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

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

/* =========================================
   Footer
   ========================================= */
.site-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

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

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

/* =========================================
   Animations
   ========================================= */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    
    .writing-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        position: relative;
    }
    
    .writing-arrow {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .hero { padding-top: 8rem; min-height: auto; }
    
    .grid-3 { grid-template-columns: 1fr; }
    
    .main-nav { display: none; } /* Could add a hamburger menu, keeping minimal for now */
    .section { padding: 5rem 0; }
    
    .case-study { padding: 2rem; }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; }
    .contact-links { flex-direction: column; }
}
