:root {
    --color-deep-sky-blue: #386e92;
    --color-nav-black: #081622;
    --card-background: #ffffff;
    --card-radius: 1rem;
    --card-shadow: 0 0.75rem 2.5rem rgba(24, 39, 51, 0.07);
    --content-width: 72rem;
    --page-gutter: clamp(1.25rem, 5vw, 4rem);
    --section-spacing: clamp(4rem, 8vw, 7rem);
    --card-gap: clamp(1.5rem, 4vw, 2.5rem);
}

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

html {
    line-height: 1.7;
}

body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    margin: 0;
    color: #182733;
    background-color: #f6f7f8;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)),
        url(img/small/landscape-home-alternating.jpg);
    background-position: center top;
    background-repeat: repeat-y;
    background-size: 100% auto;
    font-family: "Fira Sans", sans-serif;
    font-size: 1rem;
    font-weight: 400;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    align-items: center;
    padding: 1.5rem max(var(--page-gutter), calc((100% - var(--content-width)) / 2));
    background: var(--color-nav-black);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

nav a {
    color: #f5f8fa;
    font-weight: 500;
    text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
    color: #82cfff;
}

main {
    flex: 1;
    width: min(100% - (2 * var(--page-gutter)), var(--content-width));
    margin-inline: auto;
    padding-block: var(--section-spacing);
}

main > section + section {
    margin-top: var(--section-spacing);
}

.science > section + section,
.press > section + section {
    margin-top: calc(var(--card-gap) * 2);
}

.science h2,
.press h2 {
    margin-bottom: 0.65rem;
}

h1,
h2,
h3 {
    margin-top: 0;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

h1 {
    margin-bottom: 2rem;
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 700;
}

h2 {
    margin-bottom: 1.25rem;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
}

h3 {
    margin-bottom: 1rem;
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
    font-weight: 600;
}

p,
ul {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

li + li {
    margin-top: 1rem;
}

a {
    color: var(--color-deep-sky-blue);
    text-underline-offset: 0.2em;
}

footer {
    position: relative;
    padding: 1.5rem var(--page-gutter);
    color: #ffffff;
    text-align: center;
    background: rgba(8, 22, 34, 0.72);
}

footer::before {
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    height: 6rem;
    background: linear-gradient(
        to top,
        rgba(8, 22, 34, 0.72) 0%,
        rgba(8, 22, 34, 0.55) 30%,
        rgba(8, 22, 34, 0.25) 60%,
        rgba(8, 22, 34, 0.07) 82%,
        rgba(8, 22, 34, 0) 100%
    );
    content: "";
    pointer-events: none;
}

footer p {
    margin: 0;
}

.card {
    margin-block: 2rem;
    padding: clamp(1.5rem, 4vw, 2.75rem);
    overflow: hidden;
    color: #ffffff;
    background: var(--color-nav-black);
    border: 0;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
}

.card > :first-child {
    margin-top: 0;
}

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

.card img {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 1.5rem;
    border-radius: calc(var(--card-radius) / 2);
    object-fit: cover;
}

.card a {
    color: #ffffff;
}

.card > a {
    display: inline-block;
    margin-top: 0.75rem;
    font-weight: 500;
}

.block-container {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 4vw, 2.5rem);
}

.photo-block,
.text-block,
.photo-text-block {
    overflow: hidden;
    border-radius: var(--card-radius);
}

.block-container > .photo-block,
.block-container > .text-block,
.photo-text-block {
    box-shadow: var(--card-shadow);
}

.photo-block img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.text-block {
    padding: clamp(1.5rem, 4vw, 2.75rem);
    background: var(--card-background);
}

.text-block > :first-child {
    margin-top: 0;
}

.text-block > :last-child {
    margin-bottom: 0;
}

.photo-text-block {
    display: flex;
    background: var(--card-background);
    border: 1px solid rgba(7, 89, 199, 0.18);
}

.photo-text-block > .photo-block {
    flex: 0 0 38%;
    border-radius: 0;
}

.photo-text-block > .text-block {
    flex: 1;
    border-radius: 0;
}

.photo-text-block--stacked {
    flex-direction: column;
}

.photo-text-block--stacked > .photo-block {
    flex-basis: auto;
}

.photo-text-block--stacked > .photo-block img {
    aspect-ratio: 16 / 9;
}

.photo-text-block h1 {
    font-size: clamp(2.25rem, 5vw, 4rem);
}

.block-container > .photo-block img {
    aspect-ratio: 16 / 9;
}

@media (max-width: 48rem) {
    .photo-text-block {
        flex-direction: column;
    }

    .photo-text-block > .photo-block {
        flex-basis: auto;
    }

    .photo-text-block > .photo-block img {
        max-height: 32rem;
        aspect-ratio: 4 / 5;
    }
}

.contact.card {
    display: flex;
    width: min(100%, 34rem);
    min-height: 20rem;
    flex-direction: column;
    justify-content: center;
    margin: auto;
    padding: clamp(1.5rem, 4vw, 3rem);
    color: #ffffff;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--card-radius);
    box-shadow: 0 1rem 3rem rgba(8, 22, 34, 0.28);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.contact.card h1 {
    margin-bottom: 1rem;
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    text-align: center;
}

.contact.card address {
    width: min(100%, 28rem);
    margin-inline: auto;
    font-style: normal;
}

.contact.card address p {
    margin-bottom: 0.35rem;
}

.contact.card address p:last-child {
    margin-bottom: 0;
}

.contact.card a {
    color: #ffffff;
}

.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--card-gap);
}

.card-grid > .card,
.card-grid > .photo-text-block {
    margin: 0;
    min-height: 100%;
}

@media (min-width: 48rem) {
    .card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.press__tedx-card,
.science__essay {
    grid-column: 1 / -1;
}

.press__video {
    position: relative;
    margin-top: 1rem;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: calc(var(--card-radius) / 2);
}

.press__video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.speaking__topics {
    margin-top: 0.65rem;
}

.speaking__topic.card {
    display: flex;
    aspect-ratio: 1;
    flex-direction: column;
    justify-content: center;
    margin-block: 0;
    color: inherit;
    text-align: center;
    text-decoration: none;
}

.speaking__topic.card h2 {
    margin-bottom: 0.75rem;
}

.speaking__topic.card p {
    margin-bottom: 0;
}

.speaking__topic--full {
    aspect-ratio: auto;
    min-height: 0;
    color: inherit;
    text-decoration: none;
    grid-column: 1 / -1;
}

.speaking__topic--full .text-block {
    text-align: center;
}


.booking-card.card {
    display: block;
    box-sizing: border-box;
    width: 100%;
    margin-top: clamp(4rem, 8vw, 7rem);
    padding: clamp(1rem, 2vw, 1.5rem);
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.3);
    border: 4px solid var(--color-deep-sky-blue);
    box-shadow:
        inset 0 0 0 0 var(--color-deep-sky-blue),
        0 1rem 3rem rgba(8, 22, 34, 0.24);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: box-shadow 80ms ease;
}

.booking-card.card:hover,
.booking-card.card:focus-visible,
.booking-card.card:focus-within {
    box-shadow:
        inset 0 0 0 2px var(--color-deep-sky-blue),
        0 1rem 3rem rgba(8, 22, 34, 0.4);
}

.booking-card.card h2 {
    font-weight: 500;
}

.booking-card .button {
    display: inline-block;
    margin-top: 0.75rem;
    color: #ffffff;
    background: var(--color-deep-sky-blue);
}

.booking-card .button:hover,
.booking-card .button:focus-visible {
    color: #ffffff;
    background: var(--color-deep-sky-blue);
}

.button {
    padding: 0.85rem 1.5rem;
    color: #ffffff;
    background: var(--color-deep-sky-blue);
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.button:hover,
.button:focus-visible {
    background: #194d5b;
}


body#home,
body#contact {
    min-height: 100vh;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

body#home {
    background-image: url(img/small/landscape-home-alternating.jpg);
    background-position: center top;
    background-repeat: repeat-y;
    background-size: 100% auto;
}

body#contact {
    background-image: url(img/small/contact-ocean.jpg);
}

body#home main {
    padding-top: 0;
}

.home-hero__text {
    margin-bottom: clamp(3rem, 6vw, 5rem);
    padding-block: clamp(1.5rem, 4vw, 3rem);
    color: inherit;
    text-align: left;
}

.home-hero__text h1 {
    margin-bottom: 1rem;
    font-size: clamp(3rem, 6vw, 4.75rem);
}

.home-hero__text p {
    margin: 0;
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    font-weight: 500;
}

.home-bio {
    margin-top: auto;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    backdrop-filter: blur(4px);
}

.home-bio > :last-child {
    margin-bottom: 0;
}

.home-intro {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(18rem, 2fr);
    min-height: max(28rem, calc(min(75vw, 85vh) - 5rem));
    gap: clamp(1rem, 2vw, 2rem);
    align-items: stretch;
}

.home-intro > .text-block {
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 2rem 0 0 1rem;
    color: #ffffff;
    background: transparent;
    text-shadow: 0 0.15rem 1rem rgba(8, 22, 34, 0.4);
}

.home-intro > .photo-block {
    width: min(100%, 28rem);
    height: auto;
    align-self: end;
    justify-self: end;
    border-radius: 0;
    box-shadow: 0 1rem 3rem rgba(8, 22, 34, 0.3);
}

.home-intro > .photo-block img {
    height: auto;
    object-position: center;
}

@media (max-width: 48rem) {
    .home-intro {
        grid-template-columns: 1fr;
        padding-block: 3rem;
    }

    .home-intro > .photo-block {
        width: min(100%, 28rem);
        justify-self: center;
    }

    .home-intro > .photo-block img {
        height: auto;
    }
}

body#about main {
    width: min(100% - (2 * var(--page-gutter)), 64rem);
}

body#about .block-container {
    gap: clamp(2.5rem, 6vw, 4.5rem);
}

body#about main > section + section {
    margin-top: clamp(5rem, 10vw, 8rem);
}

body#contact main {
    display: grid;
    width: 100%;
    padding: var(--page-gutter);
    place-items: center;
}
