/* ==========================================================================
   myehud.com — Ehud Gavron's Personal Site Design System
   Shared visual DNA & theme key with /heli/, fast, static, Light + Dark
   ========================================================================== */

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --text: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --navy: #0c1b33;
    --accent: #c81e2b;
    --accent-hover: #a61722;
    --accent-soft: #fef2f2;
    --accent-border: #fecaca;

    --sky: #1d4ed8;
    --sky-soft: #eff6ff;
    --sky-border: #bfdbfe;

    --amber: #b45309;
    --amber-soft: #fffbeb;
    --amber-border: #fde68a;

    --emerald: #047857;
    --emerald-soft: #ecfdf5;
    --emerald-border: #a7f3d0;

    --nav-bg: rgba(255, 255, 255, 0.88);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.06);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-theme="dark"] {
    --bg: #080f1a;
    --surface: #0f1b2d;
    --surface-subtle: #14233a;
    --border: #1e3250;
    --border-strong: #2d476e;

    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --navy: #f8fafc;
    --accent: #f43f5e;
    --accent-hover: #fb7185;
    --accent-soft: rgba(244, 63, 94, 0.12);
    --accent-border: rgba(244, 63, 94, 0.34);

    --sky: #60a5fa;
    --sky-soft: rgba(59, 130, 246, 0.14);
    --sky-border: rgba(96, 165, 250, 0.32);

    --amber: #fbbf24;
    --amber-soft: rgba(245, 158, 11, 0.12);
    --amber-border: rgba(251, 191, 36, 0.32);

    --emerald: #34d399;
    --emerald-soft: rgba(16, 185, 129, 0.14);
    --emerald-border: rgba(52, 211, 153, 0.34);

    --nav-bg: rgba(8, 15, 26, 0.86);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.42);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 76px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.2s ease, color 0.2s ease;
}

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

a {
    color: var(--sky);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    text-decoration: underline;
}

.hidden-link,
.hidden-link:hover {
    color: inherit;
    text-decoration: none;
    cursor: text;
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

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

/* ==========================================================================
   Sticky Top Navigation
   ========================================================================== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1020px;
    margin: 0 auto;
    padding: 0.65rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 750;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
    color: var(--navy);
    white-space: nowrap;
}

.brand:hover {
    text-decoration: none;
    opacity: 0.85;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #0c1b33;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .brand-mark {
    background: var(--accent);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--sky-soft);
    color: var(--sky);
    text-decoration: none;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.42rem 0.68rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.theme-toggle svg {
    width: 15px;
    height: 15px;
}

/* ==========================================================================
   Editorial Hero
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, #0b182e 0%, #13294b 58%, #1d3557 100%);
    color: #ffffff;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 82% 24%, rgba(200, 30, 43, 0.24) 0%, transparent 45%),
        radial-gradient(circle at 15% 85%, rgba(59, 130, 246, 0.18) 0%, transparent 45%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1020px;
    margin: 0 auto;
    padding: 3.5rem 1.25rem 3rem;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.28rem 0.78rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-family: var(--font-mono);
    font-size: 0.73rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.hero-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f43f5e;
}

.hero h1 {
    margin: 0 0 0.7rem;
    font-size: clamp(2rem, 4.5vw, 2.95rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.12;
    color: #ffffff;
}

.hero-lead {
    margin: 0 0 1.6rem;
    max-width: 660px;
    font-size: clamp(1rem, 1.9vw, 1.12rem);
    color: rgba(241, 245, 249, 0.88);
    line-height: 1.6;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.48rem;
    padding: 0.65rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(200, 30, 43, 0.32);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #ffffff;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* ==========================================================================
   Main Content & Section Cards
   ========================================================================== */
main {
    padding: 2.25rem 0 4rem;
}

.section {
    margin-bottom: 2.25rem;
}

.section-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.85rem;
    box-shadow: var(--shadow-md);
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.section-kicker {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.2rem;
}

.section-header h2 {
    margin: 0;
    font-size: clamp(1.3rem, 2.3vw, 1.55rem);
    font-weight: 750;
    letter-spacing: -0.02em;
    color: var(--navy);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.link-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 1.2rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.16s ease, transform 0.14s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

a.link-card:hover {
    text-decoration: none;
    border-color: var(--sky);
    background: var(--surface);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.link-card.featured {
    border-color: var(--accent-border);
    background: var(--accent-soft);
}

a.link-card.featured:hover {
    border-color: var(--accent);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.card-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--sky);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.link-card.featured .card-icon {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.card-icon svg {
    width: 18px;
    height: 18px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.tag-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.tag-sky {
    background: var(--sky-soft);
    border-color: var(--sky-border);
    color: var(--sky);
}

.tag-emerald {
    background: var(--emerald-soft);
    border-color: var(--emerald-border);
    color: var(--emerald);
}

.tag-amber {
    background: var(--amber-soft);
    border-color: var(--amber-border);
    color: var(--amber);
}

.link-card h3 {
    margin: 0.15rem 0 0.25rem;
    font-size: 1.03rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.35;
}

.link-card p {
    margin: 0;
    font-size: 0.89rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.mini-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text);
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.mini-pill:hover {
    border-color: var(--sky);
    color: var(--sky);
    background: var(--sky-soft);
    text-decoration: none;
}

.mini-pill svg {
    width: 13px;
    height: 13px;
}

/* Mars Ingenuity Callout */
.record-callout {
    margin-top: 1.15rem;
    padding: 1.15rem 1.3rem;
    border-radius: var(--radius-md);
    background: var(--amber-soft);
    border: 1px solid var(--amber-border);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.record-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--amber);
}

.record-callout p {
    margin: 0;
    font-size: 0.96rem;
    color: var(--text);
    line-height: 1.55;
}

/* ==========================================================================
   Dynamic Widget & Olympics Split
   ========================================================================== */
.extras-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: stretch;
}

.extra-panel {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.extra-panel h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
}

.widget-frame {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    overflow-x: auto;
    display: flex;
    justify-content: center;
}

.widget-frame iframe {
    border: 0;
    max-width: 100%;
    display: block;
}

.olympics-mat {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.olympics-mat img {
    max-width: 240px;
    width: 100%;
    height: auto;
}

/* ==========================================================================
   Mission Statement Essay Layout (mission.html)
   ========================================================================== */
.essay-wrap {
    max-width: 760px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.9);
    margin-bottom: 1.1rem;
}

.back-link:hover {
    color: #ffffff;
    text-decoration: none;
}

.back-link svg {
    width: 16px;
    height: 16px;
}

.essay-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
}

.essay-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.essay-body p {
    margin: 0 0 1.25rem;
}

.essay-body strong,
.essay-body b {
    color: var(--text);
}

.essay-signoff {
    margin-top: 2rem;
    padding: 1.35rem 1.5rem;
    border-left: 4px solid var(--accent);
    background: var(--surface-subtle);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.essay-signoff p {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 650;
    color: var(--navy);
}

.essay-signoff .sig {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: #0b1628;
    color: #cbd5e1;
    padding: 2.25rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
}

.footer-inner {
    max-width: 1020px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
}

.footer-motto {
    margin: 0;
    font-style: italic;
    color: #e2e8f0;
    font-size: 0.94rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.2rem;
    margin: 0.25rem 0;
}

.site-footer a:not(.hidden-link) {
    color: #93c5fd;
    font-weight: 500;
}

.site-footer a:not(.hidden-link):hover {
    color: #ffffff;
}

.footer-legal {
    margin: 0;
    color: #94a3b8;
    font-size: 0.82rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 780px) {
    .card-grid,
    .extras-grid {
        grid-template-columns: 1fr;
    }

    .section-card,
    .essay-card {
        padding: 1.4rem;
        border-radius: var(--radius-md);
    }

    .hero-inner {
        padding: 2.5rem 1.25rem 2.25rem;
    }

    .brand-name,
    .theme-label {
        display: none;
    }
}

@media print {
    .topbar,
    .hero-actions,
    .theme-toggle,
    .widget-frame {
        display: none !important;
    }

    body {
        background: #ffffff;
        color: #0f172a;
    }

    .hero {
        background: #ffffff;
        color: #0f172a;
        border-bottom: 2px solid #0f172a;
    }

    .hero h1,
    .hero-lead {
        color: #0f172a;
    }

    .section-card,
    .essay-card {
        box-shadow: none;
    }
}
