/* CSS VARIABLES */
:root {
    /* Base units */
    --font-size-base: 1.171875rem; /* 18.75px - our fundamental unit */
    --space-unit: var(--font-size-base); /* Use font size as spacing unit */
    
    /* Typography scale (relative to base) */
    --font-size-name: calc(var(--font-size-base) * 1.5);
    --line-height-base: 1.2;
    --line-height-spaced: 1.4;
    
    /* Spacing scale (relative to space unit) */
    --space-hairline: calc(var(--space-unit) / 18.75); /* ~1px equivalent */
    --space-fine: calc(var(--space-unit) / 9.375); /* ~2px equivalent */
    --space-small: calc(var(--space-unit) / 4.6875); /* ~4px equivalent */
    --space-medium: calc(var(--space-unit) / 1.875); /* ~10px equivalent */
    --space-large: calc(var(--space-unit) * 1.067); /* ~20px equivalent */
    --space-xl: calc(var(--space-unit) * 1.6); /* ~30px equivalent */
    
    /* Proportional dimensions */
    --width-content: calc(var(--font-size-base) * 36); /* Content width scales with font */
    --width-image: calc(var(--font-size-name) * 7.1); /* Image scales with name font */
    --gap-container: var(--space-large);
    
    /* Baseline alignment */
    --baseline-ratio: 0.65; /* Typical baseline position for serif fonts like Garamond */
    --header-baseline-offset: calc(var(--font-size-name) * var(--baseline-ratio));
    --regular-baseline-offset: calc(var(--font-size-base) * var(--baseline-ratio));
    
    /* Content positioning */
    --content-section-spacing: calc(var(--space-large) * 2); /* Fixed spacing for main content sections */
    
    /* Colors */
    --color-bg: #faf9f0;
    --color-text: #000;
    --color-link: #004225;
    --color-bg-dark: #1c1f20;
    --color-text-dark: #faf9f0;
    
    /* Effects */
    --text-shadow: 0 0 var(--space-hairline) rgba(255, 255, 255, 0.8), 
                   0 0 var(--space-fine) rgba(255, 255, 255, 0.4), 
                   0 0 calc(var(--space-hairline) * 3) rgba(255, 255, 255, 0.2);
}

/* REM DICTIONARY (base: 16px = 1rem)
 * 
 * SPACING:
 * 0.0625rem = 1px   | hairline, borders
 * 0.125rem  = 2px   | fine adjustments
 * 0.1875rem = 3px   | text-shadow blur
 * 0.25rem   = 4px   | small spacing
 * 0.3125rem = 5px   | list margins
 * 0.5rem    = 8px   | element margins
 * 0.625rem  = 10px  | media margins
 * 0.9375rem = 15px  | content gaps
 * 1.25rem   = 20px  | section spacing, body padding
 * 1.875rem  = 30px  | large gaps (name-contacts)
 * 
 * DIMENSIONS:
 * 12.5rem   = 200px | profile image max-width
 * 15.625rem = 250px | painting images
 * 18.75rem  = 300px | painting section max-width
 * 25rem     = 400px | instacart section min-width
 * 40 rem   = 640px | content wrapper, video max-width
 * 
 * TYPOGRAPHY:
 * 1.171875rem  = 18.75px | base font size
 * 1.7578125rem = 28.125px | main name (18.75px * 1.5)
 * 
 * NEGATIVE VALUES:
 * -0.25rem   = -4px  | name-location baseline align
 * -3.125rem  = -50px | profile image vertical offset
 */

/* Simple styling with FeatureFlat fonts and white blur background */
body {
    font-family: 'FeatureFlatText-Regular', 'Garamond', 'Times New Roman', serif;
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    margin: 0;
    padding: var(--space-large);
    min-height: 100vh;
    position: relative;
    background: var(--color-bg);
    text-shadow: var(--text-shadow);
}


/* Universal content wrapper */
.content-wrapper {
    max-width: var(--width-content);
}

/* Header section styling */
.header-section {
    margin-bottom: var(--content-section-spacing); /* Fixed spacing independent of baseline */
}

.header-section-layout {
    display: flex;
    gap: var(--space-xl);
    align-items: flex-start;
}

.name-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-image {
    max-width: var(--width-image);
    height: auto;
    margin-top: var(--space-medium);
}

.contact-bio-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-large);
    margin-top: calc(var(--header-baseline-offset) - var(--regular-baseline-offset)); /* Align baselines */
}

.main-name {
    font-family: 'FeatureFlatHeadline', 'Garamond', 'Times New Roman', serif;
    font-size: var(--font-size-name);
    font-weight: bold;
    margin: 0;
    color: var(--color-text);
    text-shadow: var(--text-shadow);
    white-space: nowrap;
}

.contacts-section {
    font-family: 'FeatureFlatText-Regular', 'Garamond', 'Times New Roman', serif;
    font-size: var(--font-size-base);
    color: var(--color-text);
    text-shadow: var(--text-shadow);
    line-height: var(--line-height-spaced);
}

.name-location-line {
    margin-top: calc(var(--space-small) * -1); /* Align with baseline of name */
}

.contacts-section div {
    margin: 0;
}

.bio-section {
    line-height: var(--line-height-spaced);
}

.main-content {
    margin-top: calc(var(--space-large) * -1.5); /* Move content up more */
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    top: var(--space-large);
    right: var(--space-large);
    background: none;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-base);
    color: var(--color-text);
    padding: var(--space-small);
    border-radius: var(--space-small);
    transition: opacity 0.2s ease;
}

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

.theme-toggle i {
    width: 1.2em;
    height: 1.2em;
}

/* Dark mode styles */
.theme-dark {
    background: #1c1f20 !important;
    color: #faf9f0 !important;
}

/* Content styling */
h1 {
    font-family: 'FeatureFlatText-Bold', 'Garamond', 'Times New Roman', serif;
    font-size: var(--font-size-base);
    font-weight: bold;
    margin: 0 0 0.5rem 0;
    color: var(--color-text);
    text-shadow: var(--text-shadow);
}

h2 {
    font-family: 'FeatureFlatText-Bold', 'Garamond', 'Times New Roman', serif;
    font-size: var(--font-size-base);
    font-weight: bold;
    margin: 0.9375rem 0 0.1875rem 0;
    color: var(--color-text);
    text-shadow: var(--text-shadow);
}

p {
    font-family: 'FeatureFlatText-Regular', 'Garamond', 'Times New Roman', serif;
    font-size: var(--font-size-base);
    margin: 0 0 0.1875rem 0;
    color: var(--color-text);
    text-shadow: var(--text-shadow);
}

ul {
    list-style: none;
    padding: 0;
    margin: 0 0 0.3125rem 0;
}

li {
    font-family: 'FeatureFlatText-Regular', 'Garamond', 'Times New Roman', serif;
    font-size: var(--font-size-base);
    margin: 0;
    color: var(--color-text);
    text-shadow: var(--text-shadow);
}

a {
    color: var(--color-link);
    text-decoration: underline;
    text-shadow: var(--text-shadow);
}

a:hover {
    text-decoration: none;
}

/* Media styling */
iframe, img {
    margin: 0.625rem 0;
}

iframe {
    border: none;
}

/* Content container for side-by-side layout with minimal padding */
.content-container {
    display: flex;
    gap: 0.9375rem;
    align-items: flex-start;
    flex-wrap: nowrap;
}

.instacart-section {
    flex: 2;
    min-width: 25rem;
}

.painting-section {
    flex: 1;
    min-width: 15.625rem;
    max-width: 18.75rem;
}

/* Instacart video specific styling */
#instacart-video {
    width: 60%;
    max-width: var(--width-content);
    height: auto;
}

/* Painting image styling - 75% smaller */
.painting-image {
    width: 100%;
    max-width: 15.625rem;
    height: auto;
    display: block;
}

.clear-both {
    clear: both;
}

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

/* Back button styling */
.back-button {
    margin-top: var(--space-large);
    padding-bottom: var(--space-large); /* Same as top padding for headers */
}

.back-button a {
    color: var(--color-link);
    text-decoration: underline;
    font-family: 'FeatureFlatText-Regular', 'Garamond', 'Times New Roman', serif;
    font-size: var(--font-size-base);
    text-shadow: var(--text-shadow);
}

.back-button a:hover {
    text-decoration: none;
}