/* ------------------------------------------------------------
   Theme colors sampled from /images/aaron.jpg
   Dominant palette: sky blue #60c0ff, cornflower #4060c0,
   royal #2020e0, indigo #6060c0, warm tan #c08060,
   near-black #202020 / #000020. Avg #575a83.
   ------------------------------------------------------------ */
:root {
    --bg: #0b0f24;             /* deep navy-indigo (from #000020 / #202020) */
    --bg-alt: #121737;         /* slightly lifted indigo */
    --surface: #1a2049;        /* indigo card surface (#6060c0 darkened) */
    --border: #2b3470;         /* indigo border */
    --text: #d3d9f5;           /* soft blue-white */
    --text-dim: #9098c4;       /* muted indigo (near avg #575a83) */
    --heading: #eaf1ff;        /* bright */
    --accent: #60c0ff;         /* sky blue pop from the image */
    --accent-2: #4a6fd4;       /* cornflower */
    --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);  /* translucent accent for hover swatches */
    --warm: #c08060;           /* warm tan accent from the image */
    --shadow: rgba(32, 32, 224, 0.35);  /* royal-blue glow */
    --nav-bg: rgba(11, 15, 36, 0.85);

    /* ---- Sizing tokens (theme-independent) ---- */
    --radius-sm: 8px;    /* buttons, toggles, small icon hit-boxes, skip-link */
    --radius-lg: 14px;   /* cards, panels, photos */
    --radius-pill: 999px;/* fully rounded tags/pills */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.75rem;
    --icon-sm: 16px;
    --icon-md: 20px;
    --icon-lg: 24px;
    /* icon hit-box sizes for tappable social links */
    --hit-sm: 40px;
    --hit-md: 48px;
}

[data-theme="light"] {
    --bg: #eef2fc;             /* pale cornflower wash */
    --bg-alt: #e0e7f8;
    --surface: #ffffff;
    --border: #c9d5f0;
    --text: #2a3157;           /* deep indigo text */
    --text-dim: #575a83;       /* the image's average color */
    --heading: #0b0f24;
    --accent: #2a66c9;         /* cornflower, darkened for contrast on light */
    --accent-2: #4a6fd4;
    --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
    --warm: #b06a45;
    --shadow: rgba(64, 96, 192, 0.22);
    --nav-bg: rgba(238, 242, 252, 0.9);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
    color: var(--heading);
    line-height: 1.15;
    margin: 0 0 0.5rem;
}

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

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

/* ---------- Skip link ---------- */
.skip-link {
    position: absolute;
    top: -60px;
    left: 6px;
    background: var(--accent);
    color: var(--bg);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    z-index: 2000;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 6px;
}

/* ---------- Nav ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--heading);
}
.nav-links {
    display: flex;
    gap: 1.75rem;
}
.nav-links a {
    color: var(--text);
    font-size: 0.95rem;
    position: relative;
    transition: color 0.2s ease;
}
.nav-links a:hover {
    color: var(--accent);
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.theme-toggle, .menu-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.theme-toggle:hover, .menu-toggle:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}
.menu-toggle {
    display: none;
}
.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 0.5rem 1.5rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--nav-bg);
}
.mobile-menu a {
    color: var(--text);
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.mobile-menu.open {
    display: flex;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    cursor: pointer;
    border: 1px solid transparent;
}
.btn-primary {
    background: var(--accent);
    color: var(--bg);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -8px var(--accent);
}
.btn-ghost {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}
.btn-ghost:hover {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    transform: translateY(-3px);
}

/* ---------- Hero ---------- */
.hero {
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1.5rem;
    position: relative;
    overflow: hidden;
    /* Hero background image. Replace /images/aaron-hero.png with your own.
       Recommended: 1536x1024 (3:2 landscape). cover keeps it filling the area. */
    background-image: url("/images/aaron-hero.png");
    background-size: cover;
    background-position: 72% center;
    background-repeat: no-repeat;
}
/* Gradient overlay keeps text readable over any hero image.
   Darker on the left (where the text sits) fading toward the right. */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        var(--bg) 0%,
        color-mix(in srgb, var(--bg) 82%, transparent) 45%,
        color-mix(in srgb, var(--bg) 40%, transparent) 100%
    );
    z-index: 0;
}
.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}
.hero .scroll-down {
    z-index: 1;
}
.hero-intro {
    color: var(--accent);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 1rem;
    margin: 0 0 1rem;
}
.hero-name {
    font-size: clamp(2.5rem, 8vw, 5rem);
    margin: 0;
}
.hero-typed {
    font-size: clamp(1.75rem, 6vw, 3.5rem);
    color: var(--text-dim);
    min-height: 1.2em;
    margin: 0.25rem 0 1.5rem;
}
.cursor {
    color: var(--accent);
    animation: blink 1s step-end infinite;
}
@keyframes blink {
    50% { opacity: 0; }
}
.hero-tagline {
    max-width: 600px;
    font-size: 1.15rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
}
.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.hero-socials {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-6);
}
.hero-socials a {
    width: var(--hit-sm);
    height: var(--hit-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    transition: color 0.2s ease, background 0.2s ease;
}
.hero-socials .ic {
    width: var(--icon-sm);
    height: var(--icon-sm);
    color: inherit;
}
.hero-socials a:hover {
    color: var(--accent);
    background: var(--accent-soft);
}
.scroll-down {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: var(--accent);
    animation: bob 2s ease-in-out infinite;
}
@keyframes bob {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 8px); }
}

/* ---------- Sections ---------- */
.section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 5rem 1.5rem;
}
.section.alt {
    max-width: none;
    background: var(--bg-alt);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
.section.alt > * {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}
.section-head {
    text-align: center;
    margin-bottom: 3rem;
}
.section-head h2 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    position: relative;
    display: inline-block;
}
.section-head h2::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 0.75rem auto 0;
    border-radius: 2px;
}
.section-head p {
    color: var(--text-dim);
    margin: 0;
}

/* ---------- About ---------- */
.about-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    align-items: start;
}
.about-photo img {
    border-radius: var(--radius-lg);
    border: 3px solid var(--accent);
    width: 100%;
    object-fit: cover;
}
.about-socials {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.25rem;
}
.about-socials a {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem;
    transition: all 0.2s ease;
}
.about-socials a:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}
.about-text p {
    color: var(--text-dim);
    margin-bottom: 1rem;
}
.about-text .disclaimer {
    font-style: italic;
    font-size: 0.9rem;
}

/* ---------- Cards ---------- */
.cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}
.card {
    flex: 1 1 280px;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all 0.25s ease;
}
.card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 18px 30px -20px var(--shadow);
}
.card-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}
.card h3 {
    font-size: 1.2rem;
}
.card p {
    color: var(--text-dim);
    margin: 0;
    font-size: 0.95rem;
}

/* ---------- SVG icons ---------- */
.ic {
    width: 22px;
    height: 22px;
    color: var(--text);
    transition: color 0.2s ease, transform 0.25s ease;
}
.ic-lg {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    color: var(--accent);
}
a:hover .ic {
    color: var(--accent);
}

/* ---------- Speaking / Talks ---------- */
.talks-group {
    max-width: 820px;
    margin: 0 auto;
}
.talks-group + .talks-group {
    margin-top: 2.5rem;
}
.talks-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.talks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 820px;
    margin: 0 auto;
}
.talk {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: all 0.25s ease;
}
.talk:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 18px 30px -20px var(--shadow);
}
/* Completed events are secondary: muted surface, dimmed title, no accent,
   and a gentler hover so they read as an archive/track record rather than a
   call to action. */
.talk--completed {
    background: transparent;
    border-color: color-mix(in srgb, var(--border) 60%, transparent);
    opacity: 0.85;
}
.talk--completed .talk-title {
    color: var(--text-dim);
    font-weight: 600;
}
.talk--completed .talk-link {
    color: var(--text-dim);
}
.talk--completed:hover {
    transform: translateY(-3px);
    border-color: var(--border);
    box-shadow: none;
    opacity: 1;
}
.talk--completed:hover .talk-link {
    color: var(--accent);
}
.talk-body {
    flex: 0 0 auto;
}
.talk-title {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}
.talk-meta {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
}
.talk-loc::before {
    content: "📍 ";
}
.talk-date::before {
    content: "📅 ";
}
.talk-link {
    font-weight: 600;
    font-size: 0.9rem;
    align-self: flex-start;
}
.talk-link:hover {
    text-decoration: underline;
}
/* Empty-state "invite me to speak" card: spans the whole Upcoming grid and
   uses a soft accent tint so it reads as an invitation, not a dead slot. */
.talk-empty {
    grid-column: 1 / -1;
    align-items: flex-start;
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.talk-empty:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--accent) 30%, transparent);
    box-shadow: none;
}
.talk-empty-text {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin: 0 0 1rem;
    max-width: 46ch;
}
.speaking-cta {
    text-align: center;
    margin-top: 2.5rem;
}

/* ---------- Channels ---------- */
.channels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.channel {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.25s ease;
}
.channel:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 18px 30px -20px var(--shadow);
}
.channel img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}
.channel h3 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}
.channel p {
    margin: 0;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* ---------- Social grid ---------- */
.social-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-2);
}
.social {
    width: var(--hit-md);
    height: var(--hit-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    transition: color 0.2s ease, background 0.2s ease;
}
.social .ic {
    width: var(--icon-md);
    height: var(--icon-md);
    color: inherit;
}
.social:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

/* ---------- Gear ---------- */
.gear-store-cta {
    text-align: center;
    margin-bottom: 2.5rem;
}
.gear-affiliate-note {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin: 0.75rem 0 0;
}
.gear-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}
.gear-card {
    flex: 1 1 300px;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
}
.gear-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 18px 30px -20px var(--shadow);
}
.gear-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.gear-media img,
.gear-media iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    display: block;
}
.gear-media-fallback {
    display: none;
    color: var(--text-dim);
    font-size: 0.95rem;
    padding: 1rem;
    text-align: center;
}
/* When an <img> fails to load, JS adds this class to show the fallback */
.gear-media--empty img {
    display: none;
}
.gear-media--empty .gear-media-fallback {
    display: block;
}
.gear-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.gear-card-body h3 {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}
.gear-card-body p {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin: 0 0 1.25rem;
    flex: 1;
}
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    align-self: flex-start;
}

/* ---------- Footer ---------- */
.footer {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.9rem;
}
.footer p {
    margin: 0.25rem 0;
}
.footer-sub {
    font-size: 0.8rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .menu-toggle {
        display: inline-block;
    }
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .about-photo {
        max-width: 280px;
        margin: 0 auto;
    }
    .talks {
        grid-template-columns: 1fr;
    }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
