/* ==========================================================
   Florencia Martinez Addiego: homepage + Background page
   Edit the values in :root to change fonts and colors site-wide.
   ========================================================== */

:root {
    --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --blue: #3475c0;          /* your blue: fills, buttons, large text */
    --blue-deep: #275a9e;     /* darker blue: small text and hover states */
    --blue-tint: #eaf2fb;     /* pale blue: chips and the contact band */
    --blue-wash: #f6f9fd;     /* barely-there blue: the Explore band */

    --ink: #16202b;           /* headings and nav */
    --text: #44505c;          /* body text */
    --muted: #66727e;         /* secondary text */
    --line: #dde5ee;          /* hairlines and card borders */

    --wrap: 1040px;
    --gutter: clamp(20px, 5vw, 48px);
    --header-h: 64px;
}

/* ---------- Reset and base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    font-family: var(--font);
    color: var(--text);
    background: #fff;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

[hidden] { display: none !important; }

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
    border-radius: 4px;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding-inline: var(--gutter);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    background: #fff;
    color: var(--ink);
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.skip-link:focus { top: 12px; }

.section-title {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--blue-deep);
    margin-bottom: 20px;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--line);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
}

.logo {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
}

.nav-links a {
    display: inline-block;
    font-size: 0.95rem;
    color: var(--ink);
    text-decoration: none;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current] {
    border-bottom-color: var(--blue);
}

.menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--blue);
    cursor: pointer;
}

.menu-btn svg { width: 22px; height: 22px; }

@media (max-width: 720px) {
    .menu-btn { display: inline-flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(var(--header-h) - 4px);
        right: var(--gutter);
        flex-direction: column;
        gap: 0;
        min-width: 180px;
        padding: 8px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 12px;
    }

    .nav-links.open { display: flex; }

    .nav-links a {
        display: block;
        padding: 10px 14px;
        border-bottom: none;
        border-radius: 8px;
    }

    .nav-links a:hover,
    .nav-links a[aria-current] {
        background: var(--blue-tint);
    }
}

/* ---------- Hero ---------- */
.hero {
    padding-block: clamp(40px, 8vw, 96px);
}

.hero .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(28px, 6vw, 80px);
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.1rem, 5.2vw, 3.6rem);
    line-height: 1.1;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.02em;
}

.tagline {
    margin-top: 16px;
    min-height: 1.6em;
    font-size: clamp(1.1rem, 2.4vw, 1.5rem);
    font-weight: 500;
    color: var(--blue);
}

.hero-sub {
    margin-top: 12px;
    max-width: 46ch;
    font-size: 1.05rem;
    color: var(--text);
}

.social {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--blue);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.icon-link:hover {
    border-color: var(--blue);
    color: var(--blue-deep);
}

.icon-link svg { width: 20px; height: 20px; }

.portrait {
    display: block;
    width: clamp(220px, 30vw, 340px);
    height: auto;                  /* lets aspect-ratio keep it square at every width */
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center top;   /* keeps the top of your head in frame */
    border-radius: 32%;
    background: var(--blue-tint);
}

@media (max-width: 820px) {
    .hero .wrap {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .portrait { order: -1; width: min(240px, 62vw); }
    .social { justify-content: center; }
}

/* ---------- About ---------- */
.about {
    padding-block: clamp(40px, 6vw, 72px);
    border-top: 1px solid var(--line);
}

.about p {
    max-width: 68ch;
    margin-bottom: 1rem;
    font-size: 1.02rem;
}

.about a {
    font-weight: 500;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}

.about a:hover { text-decoration-color: var(--blue); }

/* ---------- Explore cards ---------- */
.explore {
    padding-block: clamp(40px, 6vw, 72px);
    background: var(--blue-wash);
    border-top: 1px solid var(--line);
}

/* To add a card later (for example Research), copy one <a class="card">
   block in index.html. The row wraps and centers by itself. */
.cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.card {
    flex: 1 1 210px;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.card:hover { border-color: var(--blue); }
.card:hover h3 { color: var(--blue-deep); }

.card svg {
    width: 26px;
    height: 26px;
    margin-bottom: 6px;
    color: var(--blue);
}

.card h3 {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink);
}

.card p {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--muted);
}

@media (max-width: 520px) {
    .card { max-width: none; }
}

/* ---------- Contact ---------- */
.contact {
    padding-block: clamp(48px, 7vw, 88px);
    text-align: center;
    background: var(--blue-tint);
    border-top: 1px solid var(--line);
}

.contact p {
    margin-bottom: 22px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    background: var(--blue);
    border-radius: 10px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn:hover { background: var(--blue-deep); }

/* ---------- Footer ---------- */
.site-footer {
    padding-block: 28px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}

/* ---------- Background page ---------- */
.page-head {
    max-width: 720px;              /* same column as .page-body, so titles line up with the text */
    padding-block: clamp(36px, 6vw, 64px) 8px;
}

.page-head h1 {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    line-height: 1.15;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.015em;
}

.page-body {
    max-width: 720px;
    padding-bottom: clamp(40px, 6vw, 72px);
}

.tabs {
    display: flex;
    gap: 26px;
    margin-top: 28px;
    border-bottom: 1px solid var(--line);
}

.tabs button {
    margin-bottom: -1px;
    padding: 10px 0;
    font-family: inherit;
    font-size: 1rem;
    color: var(--muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.tabs button:hover { color: var(--ink); }

.tabs button[aria-selected="true"] {
    font-weight: 500;
    color: var(--blue-deep);
    border-bottom-color: var(--blue);
}

.entry {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.entry:last-child { border-bottom: none; }

.chip {
    align-self: start;
    justify-self: start;
    padding: 3px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--blue-deep);
    background: var(--blue-tint);
    border-radius: 6px;
    white-space: nowrap;
}

.entry h3 {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.4;
}

.entry p {
    margin-top: 3px;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--muted);
}

.updates { margin-top: 44px; }

.updates .entry p {
    margin-top: 0;
    font-size: 0.98rem;
    color: var(--text);
}

.updates a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 3px;
}

.updates a:hover { text-decoration-color: var(--blue); }

.earlier summary {
    padding: 14px 0;
    font-size: 0.92rem;
    color: var(--blue-deep);
    cursor: pointer;
}

@media (max-width: 560px) {
    .entry { grid-template-columns: 1fr; gap: 8px; }
    .tabs { gap: 18px; }
}

/* ---------- Prose pages (Philosophies, Writing) ---------- */
.page-body.prose {
    max-width: 720px;
    line-height: 1.75;
}

.prose h2 {
    margin: 2.6rem 0 0.9rem;
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--ink);
}

.prose > h2:first-child { margin-top: 2rem; }

.prose h3 {
    margin: 1.9rem 0 0.7rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--ink);
}

.prose p { margin-bottom: 1rem; }

.prose a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--line);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}

.prose a:hover { text-decoration-color: var(--blue); }

.prose ol {
    margin-bottom: 1rem;
    padding-left: 1.4rem;
}

.prose li { margin-bottom: 0.9rem; }

.prose li b { font-weight: 500; color: var(--ink); }

.prose blockquote {
    margin: 1.6rem 0;
    padding: 0.2rem 0 0.2rem 1.2rem;
    border-left: 3px solid var(--blue);
    font-style: italic;
}

.prose blockquote cite {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.9rem;
    font-style: normal;
    color: var(--muted);
}

.prose .citations {
    font-size: 0.82rem;
    line-height: 1.8;
    color: var(--muted);
}

.prose .citations a { color: var(--muted); }

.prose .note {
    margin-top: 2.6rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
    font-size: 0.92rem;
    color: var(--muted);
}

/* Writing page: list of posts */
.post-list { list-style: none; margin-top: 8px; }

.post-list li { margin: 0; border-bottom: 1px solid var(--line); }
.post-list li:last-child { border-bottom: none; }

.post-list a {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 20px;
    padding: 18px 0;
    text-decoration: none;
}

.post-date {
    font-size: 0.9rem;
    color: var(--muted);
}

.post-title {
    font-weight: 500;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    transition: text-decoration-color 0.2s ease;
}

.post-list a:hover .post-title { text-decoration-color: var(--blue); }

@media (max-width: 560px) {
    .post-list a { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Blog posts ---------- */
.post-head h1 { max-width: 20em; }

.post-head h2 {
    margin-top: 12px;
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--muted);
}

.back-link {
    display: inline-block;
    margin-bottom: 18px;
    font-size: 0.9rem;
    color: var(--blue-deep);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.back-link:hover { border-bottom-color: var(--blue); }

.prose figure {
    margin: 1.8rem 0;
    text-align: center;
}

.prose figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.prose figcaption {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--muted);
}

.prose strong, .prose b { font-weight: 500; color: var(--ink); }

/* Long equations scroll sideways on small screens instead of breaking the page */
.prose mjx-container[display="true"] {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 0;
}
