/* ---------------------------------------------------------------
   Portfolio site styles
   Built on top of Bootstrap 5 (loaded in App.razor) for grid/utility
   classes and component structure, with a "modern research lab"
   theme layered on top: Inter for body/headings, IBM Plex Mono for
   labels/dates/tags, a monochrome palette with a single restrained
   deep-navy accent, generous whitespace, and sharp thin-bordered
   edges rather than rounded/pill shapes or drop shadows.
   --------------------------------------------------------------- */

:root {
    --color-bg: #ffffff;
    --color-bg-subtle: #f6f7f8;
    --color-border: #e3e5e8;
    --color-border-strong: #cdd2d8;
    --color-text: #14171a;
    --color-text-muted: #5b6470;
    --color-accent: #14284a;
    --color-accent-hover: #0c1a30;

    --radius: 3px;
    --max-width: 1120px;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Blazor's <FocusOnNavigate Selector="h1" /> (in Routes.razor) puts
   programmatic focus on the page's <h1> after every navigation, purely
   for screen readers — the browser then draws its default focus ring
   around it even though no one clicked it. Suppress the visible ring
   but leave the element focusable. */
h1:focus {
    outline: none;
}

h1, h2, h3, h4 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--color-text);
}

h2 {
    font-size: 1.65rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

p {
    color: var(--color-text-muted);
    line-height: 1.7;
}

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

a:hover {
    text-decoration: underline;
}

.container {
    max-width: var(--max-width);
}

.container.narrow {
    max-width: 720px;
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-content {
    flex: 1;
}

/* ---------- Buttons ---------- */
/* Sharp corners, no gradients/shadows — a single restrained accent
   colour rather than Bootstrap's default blue. */

.btn {
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
    padding: 0.65rem 1.4rem;
    box-shadow: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

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

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

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--color-border-strong);
    color: var(--color-text);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: transparent;
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ---------- Header / nav ---------- */
/* A plain top bar, thin bottom border, small tracked nav labels with
   an underline on the active link — precise rather than decorative. */

.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    padding: 1.25rem 0;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-text) !important;
    font-size: 1.02rem;
}

.navbar-toggler {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.35rem 0.6rem;
    cursor: pointer;
}

/* The toggle is a checkbox + label (no JS, no server round-trip) — the
   checkbox itself is visually hidden but stays focusable, and the
   collapse's visibility is driven purely by CSS sibling selectors. */
.nav-toggle-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nav-toggle-checkbox:focus-visible ~ .navbar-toggler {
    outline: none;
    box-shadow: 0 0 0 2px rgba(20, 40, 74, 0.35);
}

@media (max-width: 767.98px) {
    .nav-collapse {
        display: none;
    }

    .nav-toggle-checkbox:checked ~ .nav-collapse {
        display: block;
    }
}

.nav-bar {
    gap: 2rem;
}

.nav-bar .nav-link,
.nav-bar a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-bar a:hover {
    color: var(--color-text);
    text-decoration: none;
}

.nav-bar a.active {
    color: var(--color-text);
    font-weight: 600;
    border-bottom-color: var(--color-accent);
}

/* ---------- Hero ---------- */

.hero {
    padding: 5.5rem 0 4rem;
    background: var(--color-bg-subtle);
    border-bottom: 1px solid var(--color-border);
}

.eyebrow {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    align-items: center;
    gap: 3rem;
}

.hero h1 {
    font-size: 2.85rem;
    max-width: 26ch;
    margin-bottom: 0.35rem;
}

.name-suffix {
    display: inline-block;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: normal;
    color: var(--color-text-muted);
    margin-left: 0.65rem;
    vertical-align: baseline;
}

.hero-lede {
    font-size: 1.05rem;
    max-width: 58ch;
    margin-top: 0.65rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.75rem;
    flex-wrap: wrap;
}

/* ---------- Hero graphic ---------- */
/* A generated attention-grid diagram (not a photo/screenshot) — one
   patch attending to its neighbours plus two distant ones, in the
   site's navy accent, standing in for a decorative hero image. */

.hero-graphic {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-graphic svg {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.hero-graphic-caption {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    margin-top: 1rem;
    margin-bottom: 0;
    text-align: center;
}

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

    .hero-graphic {
        order: -1;
    }

    .hero-graphic svg {
        max-width: 200px;
    }
}

/* ---------- Sections ---------- */

.section {
    padding: 4.5rem 0;
}

.page-header {
    padding-bottom: 1.5rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.25rem;
    color: var(--color-text-muted);
    font-size: 0.88rem;
    text-decoration: none;
}

.back-link:hover {
    color: var(--color-accent);
}

.timeframe {
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
}

.see-all {
    margin-top: 2.5rem;
    text-align: center;
}

.see-all a {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

/* ---------- About page ---------- */

.about-intro {
    display: flex;
    gap: 2.25rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.about-photo {
    width: 152px;
    height: 152px;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    flex-shrink: 0;
}

@media (max-width: 560px) {
    .about-intro {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* ---------- Experience / Education timeline ---------- */

.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem;
}

.timeline-list li {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--color-border);
}

.timeline-list li:last-child {
    border-bottom: none;
}

.timeline-role {
    font-weight: 600;
    color: var(--color-text);
}

.timeline-dates {
    font-family: var(--font-mono);
    font-weight: 400;
    color: var(--color-text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

.timeline-org {
    color: var(--color-text-muted);
    font-size: 0.88rem;
    margin: 0.2rem 0 0.6rem;
}

.timeline-list li p {
    margin: 0;
}

/* ---------- Project grid / cards ---------- */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.75rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    color: var(--color-text);
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.project-card:hover {
    border-color: var(--color-border-strong);
    box-shadow: 0 6px 20px rgba(20, 23, 26, 0.06);
    color: var(--color-text);
}

/* Project images (logos/banners as well as screenshots) are shown
   whole rather than cropped — object-fit: contain on a neutral panel
   avoids a wide/odd-aspect image being zoomed into an unrecognisable
   sliver. */
.project-card-image {
    height: 150px;
    background-color: var(--color-bg-subtle);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.project-card-image.placeholder {
    background: var(--color-bg-subtle);
}

.project-card-body {
    padding: 1.5rem;
}

.project-card-body h3 {
    margin-bottom: 0.5rem;
}

.project-card-body p {
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.project-detail-image {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    background: var(--color-bg-subtle);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.gallery-image {
    width: 100%;
    max-height: 320px;
    object-fit: contain;
    background: var(--color-bg-subtle);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
}

/* ---------- Tags ---------- */
/* Rectangular, thin-bordered, mono/uppercase — reads as a data label
   rather than a decorative pill. */

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tag {
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    padding: 0.28rem 0.55rem;
}

/* ---------- Contact page ---------- */

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--color-border);
}

.contact-label {
    width: 90px;
    flex-shrink: 0;
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

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

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.footer-links a:hover {
    color: var(--color-accent);
}

/* ---------- Not found ---------- */

.not-found {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 5rem 1.5rem;
    text-align: center;
}

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

@media (max-width: 720px) {
    .hero h1 { font-size: 2.15rem; }

    .section { padding: 3rem 0; }

    .site-footer .container {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}
