/* =============================================
   MichaelBagalman.com — Main Stylesheet
   ============================================= */

:root {
    --bg:           #ffffff;
    --text:         #1a1a1a;
    --muted:        #555555;
    --subtle:       #888888;
    --rule:         #e8e8e8;
    --accent-bg:    #f5f5f3;
    --navy:         #2C3E50;
    --navy-light:   #3d5166;
    --font-head:    'Playfair Display', serif;
    --font-body:    'Lato', sans-serif;
    --max-w:        780px;
    --pad:          24px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }

/* ── Base ── */
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.85;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad);
}

/* ── Typography ── */
h1, h2, h3, h4 {
    font-family: var(--font-head);
    line-height: 1.2;
    color: #111;
}
h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 1rem; letter-spacing: -0.5px; }
h2 { font-size: 1.75rem; margin-top: 3.5rem; padding-bottom: 10px; border-bottom: 2px solid #111; margin-bottom: 1.5rem; }
h3 { font-size: 1.3rem; margin-top: 2rem; margin-bottom: 0.75rem; }
h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 0.5rem; color: var(--muted); }

p { margin-bottom: 1.4rem; }
p:last-child { margin-bottom: 0; }

a {
    color: var(--navy);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 700;
}
a:hover { color: var(--navy-light); text-decoration: none; }

strong { font-weight: 700; }
em { font-style: italic; }

ul, ol { padding-left: 1.4em; margin-bottom: 1.4rem; }
li { margin-bottom: 0.4rem; }

blockquote {
    border-left: 4px solid var(--navy);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--accent-bg);
    font-family: var(--font-head);
    font-style: italic;
    font-size: 1.15rem;
}
blockquote cite {
    display: block;
    font-style: normal;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    color: var(--muted);
    font-family: var(--font-body);
}

section { padding: 3rem 0; border-bottom: 1px solid var(--rule); }
section:last-of-type { border-bottom: none; }

/* ── Navigation ── */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 0 30px;
    border-bottom: 1px solid var(--rule);
    position: relative;
}

.nav-logo {
    font-family: var(--font-head);
    font-weight: 900;
    font-size: 1.15rem;
    text-decoration: none;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    flex-shrink: 0;
}
.nav-logo:hover { color: var(--navy); text-decoration: none; }

.nav-links {
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    gap: 0 14px;
    justify-content: flex-end;
    align-items: center;
}
.nav-links a {
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #444;
    text-decoration: none;
    font-weight: 400;
    white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: #000; text-decoration: underline; }

/* Hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-direction: column;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #222;
    transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero ── */
.hero {
    padding: 72px 0 56px;
}
.hero-layout {
    display: flex;
    align-items: center;
    gap: 44px;
    margin-bottom: 2rem;
}
.hero-text { flex: 1; }

/* Tagline leads visually before the name */
.hero-tagline {
    font-family: var(--font-head);
    font-style: italic;
    font-size: 1.45rem;
    color: #222;
    margin-bottom: 0.5rem;
    line-height: 1.35;
}
/* Name h1 follows, slightly subdued relative to tagline */
.hero .hero-text h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: #444;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 0;
}
.hero-subhead {
    font-family: var(--font-head);
    font-style: italic;
    font-size: 1.3rem;
    color: #444;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}
.hero-intro { font-size: 1rem; color: var(--muted); margin-bottom: 0; }

/* Headshot */
.headshot {
    width: 190px;
    height: 190px;
    border-radius: 10px;
    object-fit: cover;
    filter: grayscale(100%);
    border: 1px solid #ddd;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Credibility bar */
.cred-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 1.5rem 0 2rem;
}
.cred-item {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--navy);
    border-left: 3px solid #bbb;
    padding-left: 12px;
    line-height: 1.4;
}

/* Dual CTA */
.dual-cta {
    display: flex;
    gap: 14px;
    margin: 2.5rem 0;
    flex-wrap: wrap;
}
.cta-btn {
    display: inline-block;
    padding: 11px 24px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: 2px;
    transition: background 0.2s, color 0.2s;
}
.cta-primary {
    background: var(--navy);
    color: #fff;
}
.cta-primary:hover { background: var(--navy-light); color: #fff; text-decoration: none; }
.cta-secondary {
    background: transparent;
    color: var(--navy);
    border: 2px solid var(--navy);
}
.cta-secondary:hover { background: var(--navy); color: #fff; text-decoration: none; }

/* ── Card: Featured Item (writing, articles) ── */
.card {
    padding: 24px;
    background: var(--accent-bg);
    border-radius: 2px;
    margin-bottom: 1.5rem;
    transition: transform 0.15s ease;
}
.card:hover { transform: translateY(-2px); }
.card h3 { margin-top: 0; margin-bottom: 0.5rem; }
.card h3 a { color: #111; text-decoration: none; }
.card h3 a:hover { text-decoration: underline; color: var(--navy); }
.card p { margin-bottom: 0.5rem; font-size: 0.95rem; color: var(--muted); }

.card-meta {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #888;
    display: block;
    margin-bottom: 0.6rem;
}
.card-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 2px;
    margin-right: 6px;
    margin-top: 6px;
}
.tag-exec { background: #e8edf2; color: var(--navy); }
.tag-practitioner { background: #f0ece4; color: #7a5c2e; }
.tag-culture { background: #edf2e8; color: #3a6b2a; }

/* ── Impact / Case Study ── */
.vignette {
    border-left: 4px solid var(--navy);
    padding: 28px 32px;
    background: var(--accent-bg);
    margin-bottom: 2.5rem;
    border-radius: 0 4px 4px 0;
}
.vignette-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--navy);
    border: 1.5px solid var(--navy);
    padding: 2px 8px;
    border-radius: 2px;
    margin-bottom: 1rem;
}
.vignette h3 { margin-top: 0.5rem; margin-bottom: 0; font-size: 1.25rem; }
.vignette-context {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--subtle);
    margin-bottom: 1rem;
    margin-top: 0.2rem;
}
.poi { margin-top: 1.2rem; }
.poi-label {
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--subtle);
    display: block;
    margin-bottom: 0.3rem;
}
.poi-text { margin-bottom: 0; font-size: 0.97rem; }

/* ── Principles Grid ── */
.principles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 1.5rem;
}
.principle {
    border-top: 2px solid #ddd;
    padding-top: 1rem;
}
.principle strong {
    display: block;
    font-family: var(--font-head);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #111;
}
.principle p { font-size: 0.92rem; color: var(--muted); line-height: 1.6; }

/* ── Speaking List ── */
.talk-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 18px 0;
    border-bottom: 1px solid var(--rule);
    gap: 20px;
}
.talk-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.05rem;
    flex: 1;
}
.talk-meta {
    text-align: right;
    flex-shrink: 0;
}
.talk-loc {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
}
.talk-role {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--navy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.talk-desc {
    font-size: 0.93rem;
    color: #555;
    margin-top: 6px;
    margin-bottom: 1.2rem;
    padding-left: 0;
}

/* Speaking action photo */
.speaking-photo {
    width: 100%;
    max-width: 340px;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin: 0 0 2rem;
}

/* ── Timeline (About) ── */
.timeline { margin-top: 1.5rem; }
.timeline-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 16px 24px;
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
}
.timeline-year {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--subtle);
    padding-top: 2px;
}
.timeline-content strong {
    display: block;
    margin-bottom: 0.2rem;
}
.timeline-content p {
    font-size: 0.92rem;
    color: var(--muted);
    margin-bottom: 0;
}

/* ── Edu grid ── */
.edu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 1.5rem;
}
.edu-item strong { display: block; font-size: 1.05rem; margin-bottom: 0.2rem; }
.edu-item span { font-size: 0.9rem; color: var(--muted); }

/* ── Pull Quote ── */
.pull-quote {
    font-family: var(--font-head);
    font-style: italic;
    font-size: 1.35rem;
    line-height: 1.5;
    color: #333;
    border-top: 2px solid #111;
    border-bottom: 2px solid #111;
    padding: 1.5rem 0;
    margin: 2.5rem 0;
}

/* ── Philosophy / Manifesto ── */
.manifesto p { font-size: 1rem; }
.manifesto ul, .manifesto ol { font-size: 0.95rem; }
.manifesto h2 { margin-top: 3rem; }
.manifesto h3 { color: #222; }

/* ── At a Glance / LLM summary box ── */
.thesis-box {
    border-left: 4px solid var(--accent);
    background: #f7f8fa;
    padding: 1.4rem 1.6rem;
    margin: 0 0 2.5rem 0;
    border-radius: 0 4px 4px 0;
}
.thesis-box h2 {
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--subtle);
    margin: 0 0 0.9rem 0;
}
.thesis-box p {
    font-size: 0.95rem;
    margin: 0 0 0.6rem 0;
    color: #333;
}
.thesis-box ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.2rem;
    font-size: 0.93rem;
    color: #333;
}
.thesis-box ul li { margin-bottom: 0.3rem; }

/* ── Now page ── */
.now-date {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--subtle);
    margin-bottom: 2rem;
    display: block;
}

/* ── External Links List ── */
.link-list { list-style: none; padding: 0; }
.link-list li {
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.95rem;
}
.link-list li:last-child { border-bottom: none; }
.link-list .link-label {
    display: block;
    font-weight: 700;
    margin-bottom: 2px;
}
.link-list .link-desc {
    font-size: 0.88rem;
    color: var(--muted);
}

/* ── Footer ── */
footer {
    margin-top: 80px;
    padding: 50px 0 40px;
    border-top: 1px solid var(--rule);
    font-size: 0.85rem;
    color: #888;
    text-align: center;
}
footer a { color: #888; font-weight: 400; }
footer a:hover { color: var(--navy); }
.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 20px;
    list-style: none;
    margin-bottom: 1.5rem;
}
.footer-nav a {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    color: #888;
}
.footer-nav a:hover { color: var(--navy); }
.footer-copy { color: #aaa; }

/* ── Machine-readable identity block ── */
.identity-block {
    padding: 1rem 0;
    border-top: 1px solid #e8e8e8;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 0;
}
.identity-block p {
    font-size: 0.9rem;
    color: var(--subtle);
    margin: 0;
    line-height: 1.6;
}

/* ── "As Published By" proof grid ── */
.proof-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
    margin-top: 1.5rem;
}
.proof-item {
    background: var(--bg);
    padding: 18px 20px;
    text-decoration: none;
    display: block;
    transition: background 0.15s;
}
.proof-item:hover { background: var(--accent-bg); text-decoration: none; }
.proof-name {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: #111;
    margin-bottom: 2px;
}
.proof-role {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--subtle);
}

/* ── Skip link (accessibility) ── */
.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--navy);
    color: #fff;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    z-index: 9999;
    border-radius: 0 0 4px 0;
    transition: top 0.15s;
}
.skip-link:focus { top: 0; }

/* ── Focus styles ── */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ── Utility ── */
.text-muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 2rem; }
.mt-lg { margin-top: 3rem; }
.inline-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.inline-list li::after { content: "·"; margin-left: 8px; color: #ccc; }
.inline-list li:last-child::after { content: ""; }

/* ── Responsive ── */
@media (max-width: 640px) {
    :root { --pad: 18px; }
    body { font-size: 17px; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    /* Nav: hamburger */
    .nav-toggle { display: flex; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border: 1px solid var(--rule);
        border-top: none;
        flex-direction: column;
        gap: 0;
        z-index: 100;
        padding: 8px 0;
    }
    .nav-links.open { display: flex; }
    .nav-links li { width: 100%; }
    .nav-links a {
        display: block;
        padding: 10px 20px;
        font-size: 0.85rem;
        border-bottom: 1px solid var(--rule);
    }
    .nav-links li:last-child a { border-bottom: none; }

    .hero-layout { flex-direction: column-reverse; align-items: flex-start; gap: 24px; }
    .headshot { width: 140px; height: 140px; }
    .proof-grid { grid-template-columns: repeat(2, 1fr); }

    .cred-item { border-left: none; border-top: 2px solid #ccc; padding: 6px 0 0; }

    .dual-cta { flex-direction: column; }
    .cta-btn { text-align: center; }

    .principles-grid { grid-template-columns: 1fr; }
    .edu-grid { grid-template-columns: 1fr; }

    .talk-row { flex-direction: column; gap: 4px; }
    .talk-meta { text-align: left; }

    .timeline-item { grid-template-columns: 1fr; gap: 4px; }
    .timeline-year { color: var(--navy); }

    .vignette { padding: 20px 20px; }

    .speaking-photo { max-width: 100%; height: 200px; }
}
