/* =========================================================
   DANIEL MORRIS
   Personal Academic Website
   Dark Navy Theme
   ========================================================= */


/* =========================================================
   COLOR VARIABLES
   ========================================================= */

:root {
    --background: #0B2233;

    --text: #F4F6F7;
    --muted-text: #B7C4CC;

    --accent: #8BCBF3;
    --accent-soft: #B7DDF5;

    --line: rgba(244, 246, 247, 0.15);

    --panel: rgba(255, 255, 255, 0.045);
    --panel-hover: rgba(255, 255, 255, 0.075);

    --field: rgba(255, 255, 255, 0.075);
    --field-focus: rgba(255, 255, 255, 0.11);

    --deep: #071923;
}


/* =========================================================
   GLOBAL RESET
   ========================================================= */

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


html {
    scroll-behavior: smooth;
}


body {
    margin: 0;

    min-height: 100vh;

    background: var(--background);
    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Helvetica,
        Arial,
        sans-serif;

    font-size: 16px;
    line-height: 1.65;

    -webkit-font-smoothing: antialiased;
}


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


a {
    color: inherit;
}


main {
    width: 100%;
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.skip-link {
    position: absolute;

    top: 12px;
    left: -9999px;

    z-index: 1000;

    padding: 10px 15px;

    background: var(--text);
    color: var(--background);

    border: 1px solid var(--text);

    text-decoration: none;
}


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


a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(139, 203, 243, 0.55);
    outline-offset: 3px;
}


/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    width: calc(100% - 96px);
    max-width: 1180px;

    margin: 0 auto;
    padding: 34px 0 30px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 40px;

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


.site-name {
    color: var(--text);

    text-decoration: none;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 32px;
    font-weight: 600;

    line-height: 1;

    letter-spacing: -0.9px;

    white-space: nowrap;

    transition: opacity 0.2s ease;
}


.site-name:hover {
    opacity: 0.68;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

nav {
    display: flex;
    align-items: center;

    gap: 28px;
}


nav a {
    position: relative;

    color: var(--text);

    text-decoration: none;

    font-size: 15px;
    font-weight: 400;

    transition:
        opacity 0.2s ease,
        color 0.2s ease;
}


nav a:hover {
    color: var(--accent-soft);
}


nav a[aria-current="page"] {
    font-weight: 600;
}


nav a[aria-current="page"]::after {
    content: "";

    position: absolute;

    left: 0;
    right: 0;
    bottom: -7px;

    height: 1px;

    background: var(--accent);
}


/* =========================================================
   HOMEPAGE HERO
   ========================================================= */

.hero {
    width: calc(100% - 96px);
    max-width: 1180px;

    margin: 65px auto 115px;

    display: grid;

    grid-template-columns:
        minmax(0, 0.95fr)
        minmax(0, 1.05fr);

    gap: 70px;

    align-items: center;
}


/*
    Text appears on left and portrait appears on right,
    similar to the layout you liked.
*/

.hero-text {
    grid-column: 1;
    grid-row: 1;

    width: 100%;
    max-width: 540px;
}


.hero-image {
    grid-column: 2;
    grid-row: 1;

    position: relative;

    min-width: 0;

    display: flex;
    align-items: center;
    justify-content: center;
}


/*
    Very subtle blue glow behind portrait.
    This helps the image feel integrated into the page.
*/

.hero-image::before {
    content: "";

    position: absolute;

    width: 88%;
    height: 78%;

    left: 7%;
    top: 12%;

    background:
        radial-gradient(
            ellipse at center,
            rgba(66, 123, 158, 0.18) 0%,
            rgba(31, 77, 105, 0.10) 42%,
            rgba(11, 34, 51, 0) 74%
        );

    filter: blur(30px);

    pointer-events: none;
}


.hero-image img {
    position: relative;

    z-index: 1;

    width: 100%;
    height: auto;

    max-height: 640px;

    object-fit: contain;
    object-position: center;

    border-radius: 0;

    /*
       The PNG itself already has transparent feathered edges,
       so the #0B2233 page background comes through naturally.
    */

    filter:
        saturate(0.93)
        contrast(1.02);

    -webkit-filter:
        saturate(0.93)
        contrast(1.02);
}


.hero h1 {
    margin: 0 0 30px;

    color: var(--text);

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(48px, 5vw, 66px);
    font-weight: 600;

    line-height: 1.05;

    letter-spacing: -1.8px;
}


.hero p {
    margin: 0 0 22px;

    color: var(--text);

    font-size: 19px;
    line-height: 1.7;
}


/* =========================================================
   TEXT LINKS
   ========================================================= */

.text-link {
    display: inline-block;

    color: var(--accent);

    text-decoration: none;

    border-bottom: 1px solid rgba(139, 203, 243, 0.65);

    padding-bottom: 2px;

    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        opacity 0.2s ease;
}


.text-link:hover {
    color: var(--accent-soft);

    border-color: var(--accent-soft);
}


/* =========================================================
   STANDARD INTERIOR PAGES
   ========================================================= */

.page {
    width: calc(100% - 96px);
    max-width: 1000px;

    margin: 70px auto 120px;
}


.page-header {
    margin-bottom: 60px;
}


.page h1,
.page-header h1 {
    margin: 0 0 22px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(44px, 5vw, 58px);
    font-weight: 600;

    line-height: 1.08;

    letter-spacing: -1.3px;

    color: var(--text);
}


.page-description {
    max-width: 720px;

    margin: 0;

    color: var(--muted-text);

    font-size: 19px;
    line-height: 1.75;
}


.page h2 {
    margin: 60px 0 18px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 30px;
    font-weight: 600;

    color: var(--text);
}


.page h3 {
    margin: 40px 0 12px;

    font-size: 21px;

    color: var(--text);
}


.page p {
    max-width: 760px;

    margin: 0 0 22px;

    font-size: 18px;
    line-height: 1.75;
}


/* =========================================================
   CONTENT SECTIONS
   ========================================================= */

.content-section {
    margin-bottom: 80px;
}


.content-section + .content-section {
    padding-top: 65px;

    border-top: 1px solid var(--line);
}


/* =========================================================
   GENERIC RESEARCH GRID
   ========================================================= */

.intro {
    width: calc(100% - 96px);
    max-width: 1180px;

    margin: 0 auto;
    padding: 80px 0 120px;

    border-top: 1px solid var(--line);
}


.intro h2 {
    margin: 0 0 20px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 40px;
    font-weight: 600;

    letter-spacing: -0.8px;
}


.section-intro {
    max-width: 680px;

    margin: 0 0 60px;

    color: var(--muted-text);

    font-size: 19px;
    line-height: 1.7;
}


.research-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 50px;
}


.research-grid h3 {
    margin: 0 0 12px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 22px;
    font-weight: 600;
}


.research-grid p {
    margin: 0;

    color: var(--muted-text);

    line-height: 1.7;
}


/* =========================================================
   GENERIC PROJECT CARDS
   ========================================================= */

.project-list {
    display: grid;

    gap: 70px;
}


.project-card {
    display: grid;

    grid-template-columns:
        minmax(220px, 0.8fr)
        minmax(0, 1.2fr);

    gap: 50px;

    align-items: start;
}


.project-card img {
    width: 100%;

    aspect-ratio: 4 / 3;

    object-fit: cover;

    border-radius: 3px;
}


/* =========================================================
   GENERIC PUBLICATIONS
   ========================================================= */

.publication-list {
    display: flex;
    flex-direction: column;
}


.publication {
    padding: 27px 0;

    border-top: 1px solid var(--line);
}


.publication:last-child {
    border-bottom: 1px solid var(--line);
}


.publication-year {
    margin-bottom: 6px;

    color: var(--muted-text);

    font-size: 14px;
    font-weight: 600;
}


.publication p {
    max-width: 850px;

    margin: 0 0 10px;

    font-size: 16px;
}


.publication-links {
    display: flex;
    flex-wrap: wrap;

    gap: 14px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.button {
    display: inline-block;

    padding: 11px 18px;

    border: 1px solid rgba(244, 246, 247, 0.65);
    border-radius: 3px;

    background: transparent;
    color: var(--text);

    text-decoration: none;

    font-size: 15px;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}


.button:hover {
    background: var(--text);
    color: var(--background);

    border-color: var(--text);
}


.button-secondary {
    border-color: rgba(244, 246, 247, 0.36);
}


/* =========================================================
   CV PAGE
   ========================================================= */

.cv-page {
    width: calc(100% - 96px);
    max-width: 1180px;

    margin: 60px auto 110px;
}


.cv-heading {
    margin-bottom: 35px;

    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    gap: 40px;
}


.cv-heading h1 {
    margin: 0 0 12px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(44px, 5vw, 58px);
    font-weight: 600;

    line-height: 1.08;

    letter-spacing: -1.3px;

    color: var(--text);
}


.cv-heading p {
    margin: 0;

    color: var(--muted-text);

    font-size: 18px;
}


.cv-actions {
    display: flex;

    gap: 12px;
}


.cv-viewer {
    width: 100%;
    height: 82vh;

    min-height: 700px;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.06);

    border: 1px solid var(--line);
}


.cv-viewer iframe {
    display: block;

    width: 100%;
    height: 100%;

    border: 0;
}


.pdf-fallback {
    margin-top: 15px;

    color: var(--muted-text);

    font-size: 14px;
}


.pdf-fallback a {
    color: var(--accent);

    text-underline-offset: 3px;
}


/* =========================================================
   CONTACT PAGE
   ========================================================= */

.contact-body {
    background: var(--background);

    color: var(--text);
}


/*
   Keeping this rule means your older Contact HTML will also
   look consistent if it still has the "contact-header" class.
*/

.contact-header .site-name {
    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 32px;
    font-weight: 600;
}


.contact-page {
    width: calc(100% - 96px);
    max-width: 980px;

    margin: 65px auto 120px;
}


.contact-intro {
    max-width: 760px;

    margin-bottom: 95px;
}


.contact-intro h1 {
    margin: 0 0 28px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(58px, 7vw, 84px);
    font-weight: 600;

    line-height: 1;

    letter-spacing: -2.5px;

    color: var(--text);
}


.contact-tagline {
    max-width: 640px;

    margin: 0 0 18px;

    color: var(--muted-text);

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 21px;
    font-style: italic;

    line-height: 1.65;
}


.contact-email {
    margin: 0;
}


.contact-email a {
    color: var(--accent);

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 18px;

    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;

    transition: color 0.2s ease;
}


.contact-email a:hover {
    color: var(--accent-soft);
}


/* ---------- CONTACT FORM ---------- */

.contact-form-section {
    width: 100%;
    max-width: 820px;

    padding: 48px;

    background: var(--panel);

    border: 1px solid var(--line);
    border-radius: 8px;

    box-shadow:
        0 14px 45px rgba(0, 0, 0, 0.10);
}


.contact-form-heading {
    margin: 0 0 35px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 30px;
    font-weight: 600;

    line-height: 1.2;

    color: var(--text);
}


.contact-form-heading em {
    font-weight: 400;
}


.name-fieldset {
    margin: 0 0 23px;
    padding: 0;

    border: 0;
}


.name-fieldset legend {
    margin-bottom: 10px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 17px;

    color: var(--text);
}


.form-row {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 20px;
}


.form-field {
    margin-bottom: 25px;
}


.form-field label {
    display: block;

    margin-bottom: 8px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 16px;
    font-weight: 400;

    color: var(--text);
}


.required-text {
    margin-left: 4px;

    color: var(--muted-text);

    font-size: 14px;
    font-style: italic;
}


.form-field input,
.form-field textarea {
    display: block;

    width: 100%;

    background: var(--field);
    color: var(--text);

    border: 1px solid rgba(244, 246, 247, 0.34);
    border-radius: 5px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 17px;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}


.form-field input {
    height: 52px;

    padding: 11px 14px;
}


.form-field textarea {
    min-height: 165px;

    padding: 14px;

    line-height: 1.55;

    resize: vertical;
}


.form-field input:hover,
.form-field textarea:hover {
    background: rgba(255, 255, 255, 0.095);
}


.form-field input:focus,
.form-field textarea:focus {
    outline: none;

    background: var(--field-focus);

    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(139, 203, 243, 0.15);
}


.form-submit {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 145px;
    height: 58px;

    margin-top: 5px;

    padding: 0 28px;

    background: var(--text);
    color: var(--background);

    border: 1px solid var(--text);
    border-radius: 30px;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: 15px;
    letter-spacing: 0.7px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


.form-submit:hover {
    background: var(--accent);
    color: var(--deep);

    border-color: var(--accent);

    transform: translateY(-1px);
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    width: calc(100% - 96px);
    max-width: 1180px;

    margin: 0 auto;

    padding: 30px 0 38px;

    border-top: 1px solid var(--line);

    color: var(--muted-text);

    font-size: 14px;
}


footer p {
    margin: 0;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 950px) {

    .site-header,
    .hero,
    footer {
        width: calc(100% - 64px);
    }


    .page,
    .cv-page,
    .contact-page {
        width: calc(100% - 64px);
    }


    .hero {
        gap: 45px;
    }


    .hero-image img {
        max-height: 560px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 750px) {

    .site-header {
        width: calc(100% - 44px);

        padding: 24px 0 20px;

        flex-direction: column;
        align-items: flex-start;

        gap: 18px;
    }


    .site-name,
    .contact-header .site-name {
        font-size: 29px;
    }


    nav {
        width: 100%;

        flex-wrap: wrap;

        gap: 10px 20px;
    }


    nav a {
        font-size: 14px;
    }


    .hero {
        width: calc(100% - 44px);

        margin-top: 40px;
        margin-bottom: 80px;

        grid-template-columns: 1fr;

        gap: 20px;
    }


    .hero-text {
        grid-column: 1;
        grid-row: 1;

        max-width: 600px;
    }


    .hero-image {
        grid-column: 1;
        grid-row: 2;

        margin-top: 8px;
    }


    .hero-image img {
        width: 100%;
        max-height: 520px;
    }


    .hero h1 {
        font-size: 44px;
    }


    .hero p {
        font-size: 18px;
    }


    .page {
        width: calc(100% - 44px);

        margin-top: 45px;
        margin-bottom: 85px;
    }


    .cv-page {
        width: calc(100% - 44px);

        margin-top: 40px;
    }


    .cv-heading {
        flex-direction: column;
        align-items: flex-start;

        gap: 22px;
    }


    .cv-actions {
        flex-wrap: wrap;
    }


    .cv-viewer {
        height: 72vh;

        min-height: 520px;
    }


    .contact-page {
        width: calc(100% - 44px);

        margin-top: 45px;
        margin-bottom: 85px;
    }


    .contact-intro {
        margin-bottom: 65px;
    }


    .contact-intro h1 {
        font-size: 56px;

        letter-spacing: -1.7px;
    }


    .contact-tagline {
        font-size: 19px;
    }


    .contact-form-section {
        padding: 30px 22px;
    }


    .form-row {
        grid-template-columns: 1fr;

        gap: 0;
    }


    .form-submit {
        width: 100%;
    }


    footer {
        width: calc(100% - 44px);
    }

}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 420px) {

    .site-name,
    .contact-header .site-name {
        font-size: 27px;
    }


    nav {
        gap: 8px 15px;
    }


    .hero h1 {
        font-size: 38px;
    }


    .contact-intro h1 {
        font-size: 48px;
    }

}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }


    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }

}
