/* Homepage-only layer. Loaded after styles.css; subpages are unaffected. */

:root {
    /* ---- surfaces: neutral charcoal, no warm tint ---- */
    --bg: #0e0f10;
    --surface-1: #17181a;      /* panels */
    --surface-2: #1c1d20;      /* cards */
    --surface-3: #24262a;      /* pills / inset chips */
    --surface-hover: #282b30;  /* interactive hover fill */
    --border: #2c2e33;
    --border-strong: #3b3e44;

    /* ---- text tiers ---- */
    --text-strong: #f3f5f6;    /* headline info: role, org, project, name */
    --text: #cbcfd3;           /* body copy */
    --text-dim: #91959a;       /* supporting detail: dates, subtitles */
    --text-faint: #6b6f74;     /* micro-labels, locations */

    /* ---- accent: forest green, the only chromatic element ---- */
    --accent: #57a86e;         /* structural: ticks, borders, list markers */
    --accent-strong: #8fd0a1;  /* accent text: dates, placements, link hover */
    --accent-soft: rgba(87, 168, 110, 0.14);

    /* remap the shared styles.css tokens onto this palette so any
       base rule that isn't overridden below still renders in-theme */
    --bg-color: var(--bg);
    --text-color: var(--text);
    --heading-color: var(--text-strong);
    --subtitle-color: var(--text-dim);
    --border-color: var(--border);
    --link-color: var(--accent-strong);
    --link-hover: var(--accent-strong);
}

body {
    background-color: var(--bg);
    color: var(--text);
}

/* faint fixed backdrop that shows through the gaps between panels */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("images/homepage_bckgd.jpg");
    background-position: center 35%;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.08;
    pointer-events: none;
}

a {
    color: var(--accent-strong);
}

a:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}

/* ---------- Top nav (reflavored to match the panel system) ---------- */

.navbar {
    top: 0;
    background: rgba(15, 16, 17, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0.7rem 1.5rem;
    gap: 1.75rem;
    font-size: 0.76rem;
}

.navbar a {
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}

.navbar a:hover {
    color: var(--accent-strong);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

.container {
    max-width: 1200px;
    padding: 1.5rem 1.5rem 3rem;
}

h2 {
    border: none;
}

/* ---------- Two-column layout ---------- */

.layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 58px;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    max-height: calc(100vh - 74px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* ---------- Sidebar panels ---------- */

.panel-id,
.panel-side {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.35rem;
}

.side-photo {
    margin: 0 0 1rem;
}

.side-photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center 25%;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.panel-id h1 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-strong);
    margin-bottom: 0.3rem;
}

.panel-id .tagline {
    color: var(--text-dim);
    font-size: 0.88rem;
    margin: 0 0 0.85rem;
}

.interest-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0;
    margin: 0 0 1rem;
}

.interest-tags li {
    font-size: 0.75rem;
    color: var(--text-dim);
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
}

.links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font-weight: 500;
    font-size: 0.88rem;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.link-bubble:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
    color: var(--text-strong);
    text-decoration: none;
}

.link-bubble svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

/* sidebar sections */

.panel-side section + section {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border);
}

.panel-side h2 {
    margin: 0 0 0.8rem;
    padding: 0 0 0 0.55rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-strong);
    border-left: 3px solid var(--accent);
}

#skills,
#education-summary {
    scroll-margin-top: 46px;
}

.micro-label {
    margin: 0 0 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.skill-block + .skill-block {
    margin-top: 0.8rem;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.pill {
    font-size: 0.78rem;
    color: var(--text-dim);
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.18rem 0.5rem;
}

.edu-item + .edu-item {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
}

.edu-item h3 {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.2rem;
}

.edu-degree {
    margin: 0 0 0.2rem;
    font-size: 0.85rem;
    color: var(--text);
}

.edu-meta {
    margin: 0 0 0.55rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.edu-sub {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--text-faint);
    line-height: 1.5;
}

.edu-sub .k {
    display: block;
    margin-bottom: 0.1rem;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ---------- Main feed ---------- */

.feed {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* each section is one squared-off panel: title bar on top, entries below
   separated by hairline dividers. No overflow clipping here — it would
   break the sticky title bar. */
.feed-section {
    scroll-margin-top: 46px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.anchor-alias {
    display: block;
    height: 0;
    scroll-margin-top: 46px;
}

.feed-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    padding: 0.7rem 1.25rem;
    position: sticky;
    top: 43px;
    background: var(--surface-3);
    z-index: 5;
    border-bottom: 1px solid var(--border-strong);
    border-radius: 3px 3px 0 0;
}

.feed-head h2 {
    margin: 0;
    padding: 0 0 0 0.65rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-strong);
    border-left: 3px solid var(--accent);
}

.count {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border: 1px solid var(--accent-soft);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
}

.feed li::marker {
    color: var(--accent-strong);
}

/* Personal / Academic groups inside the Projects panel */
.subgroup + .subgroup {
    border-top: 1px solid var(--border-strong);
}

.subgroup-label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-strong);
    background: var(--surface-1);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1.25rem;
    margin: 0;
}

.stack {
    display: flex;
    flex-direction: column;
}

.stack > .card + .card {
    border-top: 1px solid var(--border);
}

/* experience entries: logo spanning a two-line header
   (role · dates / company · location), bullets below */

.exp-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

/* sized to the combined height of the two header lines */
.org-logo {
    flex-shrink: 0;
    width: 2.7rem;
    height: 2.7rem;
    object-fit: contain;
    border-radius: 4px;
}

.org-logo.round {
    border-radius: 50%;
}

.exp-lines {
    flex: 1;
    min-width: 0;
}

.exp-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 1rem;
    line-height: 1.4;
}

/* right-hand item stays pinned right, even if it wraps on narrow screens */
.exp-when,
.exp-where {
    margin: 0 0 0 auto;
    white-space: nowrap;
}

.card-exp h3 {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text-strong);
    margin: 0;
}

.exp-when {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent-strong);
}

.exp-org {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text-strong);
}

.exp-where {
    font-size: 0.79rem;
    color: var(--text-faint);
}

.card-exp ul {
    margin-top: 0.7rem;
}

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

.hax-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    border-radius: 0 0 3px 3px;
    overflow: clip;
}

/* right/bottom hairlines on every cell draw the inner grid lines; the ones
   on the outer edge fall outside the grid and are clipped */
.hax-grid > .card {
    box-shadow: 1px 0 0 var(--border), 0 1px 0 var(--border);
}

/* ---------- Cards (entries inside a section panel) ---------- */

.card {
    background: transparent;
    padding: 1.15rem 1.25rem;
}

a.card {
    display: block;
    color: inherit;
    transition: background 0.15s;
}

a.card:hover {
    background: var(--surface-hover);
    text-decoration: none;
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 0.15rem;
}

.card h3 a {
    color: var(--text-strong);
}

.card h3 a:hover {
    color: var(--accent-strong);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.card-head h3 {
    margin: 0;
}

.subtitle {
    color: var(--text-dim);
    font-size: 0.83rem;
    font-style: normal;
    margin: 0;
}

.card-head .subtitle {
    white-space: nowrap;
}

.card ul {
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
}

.card li {
    margin-bottom: 0.35rem;
    color: var(--text);
}

.card li:last-child {
    margin-bottom: 0;
}

/* small logo in a left gutter beside an entry; reusable on any card or
   edu-item: add .with-logo, then an <img class="entry-logo"> followed by a
   <div> holding the entry's text */
.with-logo {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.with-logo > div {
    flex: 1;
    min-width: 0;
}

.entry-logo {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    object-fit: contain;
    margin-top: 0.1rem;
}

/* for logos on a square white background, e.g. Haverford's seal */
.entry-logo.round {
    border-radius: 50%;
}

.edu-item .entry-logo {
    width: 30px;
    height: 30px;
    margin-top: 0;
}

.placement {
    color: var(--accent-strong);
    font-size: 0.86rem;
    font-weight: 500;
    margin: 0.4rem 0 0;
}

/* ---------- Footer ---------- */

footer {
    margin-top: 2.5rem;
}

/* ---------- Responsive ---------- */

/* On laptop-class screens the full-size layout reads as too large. Render the
   page at 90% by default there, the same as manually setting browser zoom to
   90%. External monitors (wider than 1700px) get the full-size layout; below
   900px the single-column layout takes over and no zoom is applied.
   Tune the 1700px ceiling to taste. */
@media (min-width: 901px) and (max-width: 1700px) {
    body {
        --page-zoom: 0.9;
        zoom: var(--page-zoom);
    }

    /* zoom shrinks vh-based heights too, which left the sticky sidebar
       ending ~10% short of the screen bottom; divide the zoom back out
       so it fills the viewport like it does unzoomed */
    .sidebar {
        max-height: calc(100vh / var(--page-zoom) - 74px);
    }
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .panel-id {
        display: grid;
        grid-template-columns: 150px 1fr;
        gap: 0 1.3rem;
        align-items: start;
    }

    .side-photo {
        grid-row: 1 / 5;
        margin: 0;
    }

    .panel-id .links {
        grid-column: 2;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .panel-id .link-bubble {
        flex: 1 1 auto;
    }

    /* the feed carries a full Education section once the sidebar
       stacks on top — drop the sidebar copy to avoid the repeat */
    #education-summary {
        display: none;
    }
}

@media (max-width: 680px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .card-head .subtitle {
        white-space: normal;
    }

    .panel-id {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .side-photo {
        grid-row: auto;
        max-width: 170px;
        margin: 0 auto 1rem;
    }

    .panel-id .links,
    .panel-id .interest-tags {
        grid-column: 1;
        justify-content: center;
    }
}
