* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ink: #ececec;
    --paper: #131313;
    --accent: #1f1f1f;
    --accent-dark: #5583c8;
    --line: #2a2a2a;
    --text-muted: #9a9a9a;
    --border: 3px solid var(--line);
    --surface: #1a1a1a;
    --button: #171717;
    --button-background: #585858;
    --mention: #0af;
    --star: #e3b341;
}

html {
    background-color: var(--paper)
}

body {
    font-family: "Bricolage Grotesque", system-ui, sans-serif;
    color: var(--ink);
    background-color: var(--paper);
    line-height: 1.6;
}

h1, .brand {
    font-family: "Space Grotesk", -apple-system, sans-serif;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Floating header: a translucent pill that stays a little below the top edge while the page scrolls under it */
html {
    scroll-padding-top: 5.5rem;   /* in-page jumps land below the bar */
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;                   /* under modals (10) and toasts (30) */
    padding: 0.75rem 1rem 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    width: fit-content;           /* the pill hugs its links instead of spanning the page */
    max-width: 100%;
    margin-inline: auto;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgb(26 26 26 / 0.72);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.35);
}

.brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: none;

}

/* Page links, then a hairline, then Login/Register (or the user and Logout) */
.site-header nav {
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.site-header .nav-pages,
.site-header .nav-auth {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.site-header .nav-auth {
    margin-left: 0.4rem;
    padding-left: 0.65rem;
    border-left: 1px solid var(--line);
}

.site-header .nav-user {
    padding: 0 0.6rem;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.site-header nav a {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.site-header nav a:hover,
.site-header nav a.is-active {
    color: var(--ink);
}

.site-header nav a.is-active {
    background: rgb(255 255 255 / 0.08);
}

.nav-role {
    margin-left: 0.35rem;
    padding: 0.05rem 0.5rem;
    border: 1px solid var(--accent-dark);
    border-radius: 999px;
    color: var(--accent-dark);
    font-size: 0.62rem;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ui-abbr {
    display: none;
}

/* Hero Section with CSS Gridfkicker */
.hero {
    padding: 2rem 0 5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    grid-template-areas:
        "identity photo"
        "details  photo";
    gap: 0.5rem 3rem;
}

.hero-identity {
    grid-area: identity;
}

.hero-details {
    grid-area: details;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hero-kicker {
    font-size: 0.75rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent-dark);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.hero-identity h1 {
    font-size: clamp(3rem, 9vw, 5.5rem);
    line-height: 0.88;
    letter-spacing: -0.04em;
    text-transform:lowercase;
}

.bio {
    color: var(--text-muted);
    max-width: 480px;
    margin-bottom: 0.5rem;
}

.meta-list {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.photo-meta {
    margin-top: 1.5rem;
    margin-bottom: 0;
    gap: 2rem;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.photo-meta .meta-row  {
    text-align:  center;
}
.meta-row dt {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.meta-row dd {
    font-weight: 700;
}

.social-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
 

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--ink);
    background-color: var(--button);
    padding: 0.80rem 1.75rem;
    transition: background-color 0.2s ease, color 0.15s ease;
    border-radius: 6px;
    border: 0.1px solid var(--button-background);
    
}

.social-link:hover {
    color: var(--paper);
    background-color: var(--ink);
    box-shadow: 0 0 0 var(--accent-dark);  
    
}

.white-social {
    color: var(--paper);
    background-color: #f2f2f2;
    border-color: #f2f2f2;
}

.white-social:hover {
    color: var(--paper);
    background-color: var(--text-muted);
    border-color: var(--text-muted);
}

.social-icon {
    width: 1.125em;
    height: 1.125em;
    flex-shrink: 0;
}



.hero-photo {
    grid-area: photo;
    align-self: center;
    position: relative;
}

.photo-frame {
    position: relative;
}


.avatar {
    position: relative;
    z-index: 1;
    display: block;
    width: 86.7%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 36px;
}

.mention {
    color: var(--mention);
    white-space: nowrap;
}

/* Flicker Effect */
@keyframes goat-flicker {
    0%   { opacity: 0; }
    4%   { opacity: 1; }
    8%   { opacity: 0; }
    12%  { opacity: 1; }
    16%  { opacity: 0; }
    100% { opacity: 0; }
}

.avatar-flicker {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    opacity: 0;
    animation: goat-flicker 2s steps(4, end) infinite;
}

@media (prefers-reduced-motion: reduce) {
    .avatar-flicker {
        animation: none;
    }
}

.experience {
    padding: 7rem 0 2rem;
    --date-col: 8rem;
    --rule-col: 5rem;
    --row-gap: 1rem;
    --row-scale: 1rem;
}

/* Experience's Role Styling */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 2rem;
}

.role {
    border-bottom: 1px solid var(--line);
}

.role-header {
    display: grid;
    grid-template-columns:
        var(--date-col)
        var(--rule-col)
        minmax(0, 1fr)
        auto;
    align-items: center;
    gap: 0 var(--row-gap);
    padding: 1.1rem 0;
    cursor: pointer;
    list-style: none;
    font-size: var(--row-scale);
}

.role-header::-webkit-details-marker {
    display: none;
}

.role-rule {
    border-bottom: 1px dashed var(--line);
}

.role-chevron {
    flex-shrink: 0;
    width: 0.45em;
    height: 0.45em;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.role[open] .role-chevron {
    transform: rotate(-135deg);
}

.role-body {
    padding-bottom: 1.4rem;
}

.role-title {
    font-size: 1.15em;
    font-weight: 700;
    line-height: 1.3;
}

.role-org {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.role-dates {
    font-size: 0.7em;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.role-points {
    list-style: none;
    max-width: 720px;
}

.role-points li {
    position: relative;
    padding-left: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}

.role-points li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 0.5rem;
    height: 3px;
    background-color: var(--ink);
}

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

/* Experience retry link and star row (the list itself is drawn by fetch) */
.exp-retry {
    margin-left: 0.5rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.role-actions {
    margin-top: 1.1rem;
}

/* Footer */
/* Projects */
.section-kicker {
    color: var(--accent-dark);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.empty-state {
    color: var(--text-muted);
}

.projects {
    padding: 2rem 0 2rem;
}

.projects-head {
    text-align: center;
}

.projects-title {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.projects-to-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f2f2f2;
    color: var(--paper);
    border-radius: 5%;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.5rem;      /* size of the + — bump to 1.75rem if you want it bigger */
    line-height: 1;
    border: 0;
    padding: 0;
    font-family: inherit;
    cursor: pointer;

}



.projects-head h1 {
    font-size: 2.25rem;
    letter-spacing: -0.02em;
}

.projects-sub {
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.hide {
    display: none !important;
}

/* Project search: sits under the subtitle, results load in place (AJAX) */
.project-search {
    display: flex;
    gap: 0.5rem;
    max-width: 420px;
    margin: 1.5rem auto 0;
}

.project-search__input {
    flex: 1;
    min-width: 0;
    padding: 0.8rem 1rem;
    font: inherit;
    font-size: 0.9rem;
    color: var(--ink);
    background-color: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.project-search__input:focus {
    outline: none;
    border-color: var(--text-muted);
}

.projects .empty-state {
    margin-top: 3rem;
    text-align: center;
}
/* Add-project form: dark page, light card */
.shell {
    display: flex;
    justify-content: center;
    padding: 3.5rem 1rem 4rem;
}

.card {
    width: 100%;
    max-width: 520px;
    padding: 2.25rem 2rem 2.5rem;
    background: #f2f2f2;
    color: #161616;
    border-radius: 4px;
}

.greeting {
    text-align: center;
    font-size: clamp(2rem, 6vw, 2.6rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.greeting span {
    color: #9a9a9a;
}

.sub-greeting {
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
}

.field {
    margin-bottom: 1.1rem;
}

.field > label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.field input,
.field textarea {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1.5px solid #8a8a8a;
    border-radius: 999px;
    background: #f2f2f2;
    color: #161616;
    font: inherit;
}

.field textarea {
    border-radius: 18px;
    min-height: 150px;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #9a9a9a;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: #161616;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* "New Collaborator" + "Photo drive URL" inputs with the + button beside them */
.collab-input {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.6rem;
    align-items: center;
}

.collab-input button {
    width: 2.75rem;
    height: 2.75rem;
    border: 1.5px solid #161616;
    border-radius: 50%;
    background: #f2f2f2;
    color: #161616;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.collab-input button:hover {
    background: #e4e4e4;
}



/* Peer checkboxes rendered as pill chips */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.chips input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    padding: 0;
    border: 0;
}

.chip {
    display: inline-block;
    padding: 0.3rem 1rem;
    border: 1.5px solid #161616;
    border-radius: 999px;
    background: #f2f2f2;
    color: #161616;
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
}

.chips input:checked + .chip {
    background: var(--text-muted);
}

.chips input:focus-visible + .chip {
    outline: 2px solid #161616;
    outline-offset: 2px;
}

.actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.submit {
    padding: 0.7rem 1.4rem;
    border: 0;
    border-radius: 4px;
    background: #161616;
    color: #f2f2f2;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}



button.social-link {
    font-family: inherit;
    cursor: pointer;
}

.social-link.is-danger {
    color: #f85149;
    border-color: rgba(248, 81, 73, 0.4);
}

.social-link.is-danger:hover {
    color: var(--paper);
    background-color: #f85149;
    border-color: #f85149;
}

/* Delete confirmation (native popover) */
.confirm {
    width: min(100% - 2rem, 440px);
    margin: auto;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--button);
    color: var(--ink);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
}

.confirm::backdrop {
    background: rgba(0, 0, 0, 0.62);
}

.confirm h3 {
    font-family: "Space Grotesk", -apple-system, sans-serif;
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
}

.confirm p {
    margin: 0;
    color: var(--text-muted);
}

.confirm strong {
    color: var(--ink);
}

.confirm-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1.5rem;
}

.confirm-actions form {
    margin: 0;
}

/* Django messages, rendered by base.html */
.toast-row {
    position: fixed;
    bottom: 5rem;
    left: 0rem;
    right: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: auto;
    cursor: pointer;
}

.toast {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.9rem;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.3s ease;
    animation: toast-out 0.4s ease 4s forwards;

}

@keyframes toast-out {
    to { opacity: 0; visibility: hidden; }
}


/* 403 page */
.denied {
    padding: 5rem 1.5rem 7rem;
}

.denied h1 {
    font-size: clamp(3rem, 9vw, 5.5rem);
    line-height: 0.88;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
}

.denied .social-links {
    margin-top: 1.5rem;
}

/* Toast */
/* toast */
.toast-component {
    position: fixed;
    inset: auto 2rem 2rem auto;
    margin: 0;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(28, 25, 23, 0.15);
    display: none;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    background-color: var(--paper);
    border: 1px solid var(--line);
    color: inherit;
}

.toast-component:popover-open {
    display: flex;
}

.toast-hidden {
    opacity: 0;
    transform: translateY(150%);
    pointer-events: none;
}

.toast-show {
    opacity: 1;
    transform: translateY(0);
}

.toast-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
    font-family: "Space Grotesk", -apple-system, sans-serif;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Change the left border based on the notification type */
.toast-success { border-left: 4px solid #22c55e; }
.toast-error { border-left: 4px solid #b42318; }
.toast-normal { border-left: 4px solid var(--accent); }

/* Form Modal */
.project-form-modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 1rem;
    border: 0;
    background: transparent;
    z-index: 10;
    align-items: center;
    justify-content: center;
}

.project-form-modal:popover-open {
    display: flex;
}

.project-form-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    background: rgba(28, 25, 23, 0.58);
    cursor: default;
}

.project-form-modal__content {
    position: relative;
    z-index: 1;
    width: min(100%, 640px);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1rem 3rem rgba(28, 25, 23, 0.22);
}

.project-form-modal__content h2 {
    margin: 0 2.5rem 1.25rem 0;
    font-family: "Space Grotesk", -apple-system, sans-serif;
    font-size: 1.5rem;
}

.project-form-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.project-form-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

@media (max-width: 600px) {
    .project-form-modal {
        align-items: flex-end;
        padding: 0;
    }

    .project-form-modal__content {
        width: 100%;
        max-height: 90vh;
        padding: 1.25rem;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .project-form-modal__actions {
        flex-direction: column-reverse;
    }

    .project-form-modal__actions .button {
        width: 100%;
        text-align: center;
    }
}

/* Form errors and the login/register action row */
.form-error {
    margin-top: 0.35rem;
    color: #cf222e;
    font-size: 0.85rem;
}

.actions--split {
    justify-content: space-between;
    align-items: center;
}

.actions--split a {
    color: #161616;
    font-size: 0.9rem;
}



/* Responsiveness */
@media (max-width: 780px) {
    .container {
        padding: 0 1.25rem;
    }

    /* A tighter pill on phones */
    .site-header {
        padding: 0.6rem 0.75rem 0;
    }

    .site-header .container {
        padding: 0.35rem 0.4rem;
    }

    .site-header nav a {
        padding: 0.4rem 0.65rem;
    }

    .site-header .nav-auth {
        margin-left: 0.15rem;
        padding-left: 0.3rem;
    }

    .site-header .container a {
        font-family: "Bricolage Grotesque", system-ui, sans-serif;
        font-size: clamp(0.72rem, 3.4vw, 0.9rem);
        font-weight: 500;
        letter-spacing: normal;
        text-transform: none;
        white-space: nowrap;
    }

    .ui-full {
        display: none;
    }

    .ui-abbr {
        display: inline;
    }

    /* Icon, name, meta, then bio */
    .hero {
        padding: 4.67rem 0 6.7rem;
    }

    .hero-grid {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "photo   identity"
            "meta    meta"
            "details details";
        gap: 1.25rem 1rem;
    }

    .hero-photo {
        display: contents;
    }

    .photo-frame {
        grid-area: photo;
        align-self: center;
        width: 46.7px;
        margin: 0;
    }

    .avatar {
        border-radius: 25%;
        border: 1px solid var(--line);
    }

    .hero-identity {
        align-self: center;
        font-style:normal;
    }

    .hero-identity h1 {
        font-size: clamp(2.25rem, 11vw, 3.5rem);
    }

    .photo-meta {
        grid-area: meta;
        margin-top: 0;
        justify-content: flex-start;
        gap: 2.5rem;
    }

    .photo-meta .meta-row {
        text-align: left;
    }

    .hero-details {
        margin-top: 0.5rem;
    }

    .social-links {
        flex-wrap: nowrap;
        gap: 0.4rem;
    }

    .social-link {
        flex: 1 1 auto;
        justify-content: center;
        min-width: 0;
        gap: 0.35rem;
        font-size: 0.68rem;
        padding: 0.7rem 0.5rem;
        white-space: nowrap;
    }

        .projects {
        padding: 3.5rem 0;
        --index-col: 1.75rem;
        --rule-col: 1.5rem;
        --row-gap: 0.6rem;
    }

        .projects {
        padding: 3.5rem 0 5rem;
    }

    .projects-head h1 {
        font-size: 2rem;
    }


}


/* Motion: light and quick, and all of it off for anyone who asks for reduced motion.
   Animations fill backwards only, so once they end they never override hover or focus styles. */
@keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Phones: the signed-in name gives way so the page links and Logout stay on one row */
@media (max-width: 480px) {
    .site-header .nav-user {
        display: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    /* Moving between pages: a short cross-fade where the browser supports it */
    @view-transition { navigation: auto; }
    ::view-transition-old(root),
    ::view-transition-new(root) { animation-duration: .25s; }

    .site-header { animation: fade-in .5s ease backwards; }
    main { animation: rise-in .6s cubic-bezier(.2, .8, .2, 1) .05s backwards; }

    /* Sections that start below the screen rise in as they are reached (motion.js adds these classes) */
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity .7s cubic-bezier(.2, .8, .2, 1), transform .7s cubic-bezier(.2, .8, .2, 1);
    }
    .reveal.is-in { opacity: 1; transform: none; }

    /* Content that arrives by fetch */
    #experience-list .role { animation: rise-in .45s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
    .zr .gh-grid.is-entering .gh-d { animation: fade-in .4s ease backwards; animation-delay: calc(var(--c, 0) * 14ms); }
    .zr .venn.is-drawn .set,
    .zr .venn.is-drawn .slabel,
    .zr .venn.is-drawn .link,
    .zr .venn.is-drawn .person { animation: fade-in .5s ease backwards; }
    .zr .venn.is-drawn .person { animation-delay: .15s; }
}
