:root {
    /* Fonts */
    --font-content: 'Georgia', serif;
    --font-chrome: 'Inter', sans-serif;

    /* Metrics */
    --reading-width: 61ch;
    --vertical-rhythm: 4rem;
    --base-size: 1.125rem;
    --line-height: 1.8;

    /* Colors - Light Mode (Default) */
    --color-bg: #ffffff;
    --color-text: hsl(0, 5%, 10%);
    --color-chrome: #555555;
    --color-chrome-border: rgba(0, 0, 0, 0.1);
    --color-accent: #00234D;
    --color-accent-hover: rgba(0, 80, 220, 0.12);
    --color-overlay-shadow: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Colors - Dark Mode */
        --color-bg: hsl(0, 0%, 16%);
        --color-text: hsl(0, 0%, 86%);
        --color-chrome: #aaaaaa;
        --color-chrome-border: rgba(255, 255, 255, 0.1);
        --color-accent: #4dabf7;
        --color-accent-hover: rgba(77, 171, 247, 0.15);
        --color-overlay-shadow: rgba(0, 0, 0, 0.5);
    }
}

/* -------------------------------------------------------------------------- */
/* Reset & Foundation
/* -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Inter';
    src: url('../assets/fonts/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

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

html {
    font-size: 100%;
    /* Browser default, typically 16px */
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-content);
    font-size: var(--base-size);
    line-height: var(--line-height);

    /* Rendering Standards */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    hyphens: auto;

    /* Layout */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 0 1.5rem;
    /* Mobile padding */
}

/* -------------------------------------------------------------------------- */
/* Typography
/* -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 400;
}

a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

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

strong {
    font-weight: bold;
}

em {
    font-style: italic;
}

/* -------------------------------------------------------------------------- */
/* Chrome (Header & Footer)
/* -------------------------------------------------------------------------- */
.site-header,
.site-footer {
    width: 100%;
    max-width: var(--reading-width);
    font-family: var(--font-chrome);
    color: var(--color-chrome);
    text-align: center;
}

.site-header {
    padding-top: 2rem;
    padding-bottom: 2rem;
    margin-bottom: var(--vertical-rhythm);
    border-bottom: 1px solid var(--color-chrome-border);
}

.brand {
    font-size: 1rem;
    text-decoration: none;
    letter-spacing: 0.05em;
    /* lowercase is brand identity */
}

.site-footer {
    padding-top: 2rem;
    padding-bottom: 3rem;
    margin-top: var(--vertical-rhythm);
    border-top: 1px solid var(--color-chrome-border);
    font-size: 1.125rem;
    /* Matches body text as per spec 4.108 */
}

.footer-text {
    margin-bottom: 2rem;
    font-family: var(--font-content);
    /* Narrative text */
    color: var(--color-text);
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.875rem;
    /* Chrome size for nav */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}



.footer-nav a:hover {
    text-decoration: underline;
}

/* -------------------------------------------------------------------------- */
/* Main Content
/* -------------------------------------------------------------------------- */
main {
    width: 100%;
    max-width: var(--reading-width);
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: var(--vertical-rhythm);
}

.headline {
    font-family: var(--font-chrome);
    font-size: 2.22rem;
    line-height: 1.3;
    margin-bottom: 2rem;
    hyphens: none;
    text-transform: none;
    /* Spec 3.313 */
    color: var(--color-text);
}

.subheadline {
    font-size: 1.25rem;
    color: var(--color-text);
    hyphens: none;
    font-style: italic;
}



.block {
    margin-bottom: var(--vertical-rhythm);
    text-align: justify;
}

.block:last-child {
    margin-bottom: 0;
}

.block p {
    margin-bottom: 0.9em;
}

.block p+p {
    text-indent: 1.5em;
    /* Literary indentation */
}

.block ul {
    margin: 1.5rem 0;
    padding-left: 2rem;
    list-style-type: disc;
    /* Standard bullets */
}

.block li {
    margin-bottom: 0.5em;
    padding-left: 0.5em;
}

/* Authority Block Special Styling */
.authority a {
    font-family: var(--font-chrome);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 400;
}



/* -------------------------------------------------------------------------- */
/* Overlays
/* -------------------------------------------------------------------------- */
.overlay-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    /* Hidden by default */
    overflow-y: auto;
    /* Scrollable wrapper */
    -webkit-overflow-scrolling: touch;
    padding: 3rem 1.5rem;
    /* Padding to ensure card doesn't hit edges */
}

.overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-bg);
    opacity: 0.9;
    z-index: -1;
    cursor: default;
}

/* Active State (Managed via JS) */
.overlay-wrapper.is-visible {
    display: block;
}

.overlay-card {
    position: relative;
    max-width: 600px;
    /* Spec 3.336 */
    width: 100%;
    margin: 3rem auto;
    /* Vertical margin for scroll */
    background: var(--color-bg);
    border: 1px solid var(--color-chrome-border);
    box-shadow: 0 10px 40px var(--color-overlay-shadow);
    padding: 3rem;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--color-chrome-border);
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    color: var(--color-chrome);
    font-family: var(--font-chrome);
}

.overlay-title {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.close-button {
    font-size: 1.5rem;
    line-height: 1;
    text-decoration: none;
    color: var(--color-chrome);
    padding: 0.5rem;
    margin-right: -0.5rem;
    /* Optical alignment */
}

.close-button:hover {
    color: var(--color-accent);
}

.overlay-body {
    /* Ragged right text for overlays per conversation history and spec implied (left aligned) */
    text-align: left;
}

.overlay-body p {
    margin-bottom: 1em;
}

.overlay-body h3 {
    font-family: var(--font-chrome);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--color-chrome);
}

/* LinkedIn Link */
.linkedin-link {
    margin-top: 2rem;
}

.linkedin-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-accent);
    font-family: var(--font-chrome);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 400;
}

.linkedin-link a .link-text {
    text-decoration: underline;
    text-decoration-color: var(--color-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

.linkedin-link a:hover {
    text-decoration: none;
    background-color: var(--color-accent-hover);
}

.linkedin-link a:hover .link-text {
    /* Ensure underline persists on hover */
    text-decoration: underline;
}

.linkedin-icon {
    flex-shrink: 0;
    fill: currentColor;
}