/* Subset to Latin (see README) and converted to WOFF2; the build step content-
   hashes both the fonts and this stylesheet, so they can be cached forever. */
@font-face {
    font-family: "Glacial Indifference";
    src: url("./GlacialIndifference-Regular.b646ceea9b.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Glacial Indifference";
    src: url("./GlacialIndifference-Bold.af42e3c818.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --theme-purple: #8365e7;
    --theme-medium-purple: #879be4;
    --theme-light-blue: #8bd3e1;

    --theme-dark-purple: #754cfc;
}

body {
    margin: 0;
}

* {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    list-style: square;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "Glacial Indifference", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
}

.subtitle {
    color: var(--theme-dark-purple);
    font-size: 20px
}

#header-purple {
    min-height: 50px;
    background-color: var(--theme-purple);
}

.body-image {
    width: 100%;
    cursor: pointer;
}

.image-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-overlay[hidden] {
    display: none;
}

.image-overlay-image {
    max-width: 95vw;
    max-height: 95vh;
}

.image-overlay-close {
    position: absolute;
    top: 16px;
    right: 24px;
    background: none;
    border: none;
    outline: none;
    color: white;
    font-size: 48px;
    line-height: 1;
    cursor: pointer;
}

.content {
    color: #282828;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 1100px;
    max-width: min(90vw, 100% - 40px);
}

/* min-width is 100%, not 100vw: 100vw counts the vertical scrollbar's width,
   so on any page tall enough to scroll it overflows the content box by exactly
   the scrollbar and adds a spurious horizontal scrollbar. */
.page-black {
    color: aliceblue;
    background-color: black;
    min-height: 100vh;
    min-width: 100%;
}

.page-white {
    background-color: white;
    min-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.centered-image {
    text-align: center;
}

address {
    margin: 1em 0;
}

address p {
    margin: 0;
    line-height: 1.4;
}

@media screen and (max-width: 900px) {
    .site-header {
        padding: 8px 16px;
    }
    .header-logo {
        height: 40px;
    }
    #contact-form-section {
        scroll-margin-top: 64px;
    }
}

/* start contact form */
#contact-form-section {
    margin: 24px 0;
    padding: 36px 0 48px 0;
    min-width: 100%;
    background-color: #000;
    color: white;
    display: flex;
    justify-content: center;
}

#contact-form-container {
    width: 90vw;
    max-width: 600px;
}

.form-input {
    max-width: 600px;
    height: 24px;
    font-size: 16px;
}

.form-group {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
}

textarea {
    min-height: 120px;
    max-width: 600px;
}

.form-input.input-error {
    border: 2px solid #e53935;
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.field-error {
    margin: 4px 0 0;
    font-size: 14px;
    color: #ff6b6b;
    max-width: 600px;
}

.field-error:empty {
    display: none;
}

.char-counter {
    margin: 2px 0 0;
    font-size: 12px;
    color: #9e9e9e;
    text-align: right;
    max-width: 600px;
}

#submit-button {
    height: 40px;
    width: 100px;
    font-size: 16px;
}

.form-privacy-note {
    margin: 12px 0 0;
    font-size: 13px;
    color: #9e9e9e;
    max-width: 600px;
}

.loader {
    width: 28px;
    height: 28px;
    margin: 6px 36px;
    border: 4px solid #404040;
    border-top-color: var(--theme-purple);
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}

@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}

/* end contact form */

html {
    scroll-behavior: smooth;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #000;
    color: white;
    padding: 12px 24px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 12px;
}

.header-content {
    width: 1100px;
    max-width: 90vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    height: 60px;
    display: block;
}

#contact-form-section {
    scroll-margin-top: 80px;
}

footer {
    margin-top: 48px;
    padding: 20px 0 48px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #000;
    color: white;
}

/* Both containers space their rows the same way, so a line of address fields
   sits the same distance from its neighbours as any other footer line. The
   column gap holds the separator: 12px of air on either side of the glyph. */
.footer-texts, .footer-address {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 24px;
    column-gap: 28px;
}

.footer-texts {
    padding: 12px 20px 0 20px;
}

/* The page-level `address` rule adds a 1em block margin that would space the
   contact fields apart from the rest of the footer. */
.footer-address {
    font-style: normal;
    margin: 0;
}

.footer-item {
    position: relative;
}

/* The separator lives on the item that follows it, so it wraps along with that
   item instead of being left behind at the end of a line. It is taken out of
   flow and centred in the gap the container already reserves: showing or
   hiding one then cannot change an item's width, so it cannot move the line
   break that footer.js measured. */
.footer-item::before {
    content: "|";
    position: absolute;
    top: 0;
    left: -14px;
    transform: translateX(-50%);
    color: white;
    pointer-events: none;
}

/* Nothing sits to the left of these on their line, so there is nothing to
   separate. `line-leader` is set by footer.js after every reflow; the
   first-child rule covers the first item before (or without) that script. */
.footer-item.line-leader::before,
.footer-address .footer-item:first-child::before {
    content: none;
}

.footer-logo {
    height: 100px;
    margin: 12px 0 24px 0;
}

.link-on-dark {
    color: var(--theme-medium-purple);
}

/* start logo animation */

.logo-middle {
    display: flex;
}

.rect-center {
    width: 300px;
    height: 300px;
    background-color: black;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rect-left {
    width: 5px;
    height: 150px;
    background: linear-gradient(var(--theme-light-blue), var(--theme-medium-purple));
    transform-origin: bottom;
    animation: fillVertical 0.25s linear both;
}

.rect-top {
    width: 310px;
    height: 5px;
    background-color: var(--theme-light-blue);

    transform-origin: left;
    animation: fillHorizontal 0.5s linear both;
    animation-delay: 0.25s;
}

.rect-right {
    width: 5px;
    height: 300px;
    background: linear-gradient(var(--theme-light-blue), var(--theme-purple));

    transform-origin: top;
    animation: fillVertical 0.5s linear both;
    animation-delay: 0.75s;
}

.rect-bottom {
    width: 160px;
    height: 5px;
    background-color: var(--theme-purple);
    margin-left: 150px;

    transform-origin: right;
    animation: fillHorizontal 0.25s linear both;
    animation-delay: 1.25s;
}

.logo-text {
    font-size: 90px;
    font-family: "Trebuchet MS", sans-serif;
    font-weight: lighter;
    background-image: linear-gradient(to right, var(--theme-purple), var(--theme-light-blue));
    color: transparent;
    background-clip: text;
}

@keyframes fillVertical {
    from {
        transform: scaleY(0);
    }
    to {
        transform: scaleY(1);
    }
}

@keyframes fillHorizontal {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* end logo animation */
/* start header navigation */

.header-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.nav-link {
    color: white;
    font-family: "Glacial Indifference", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 18px;
    text-decoration: none;
    letter-spacing: 0.04em;
    white-space: nowrap;
    padding: 10px 12px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link[aria-current="page"] {
    border-bottom-color: var(--theme-light-blue);
}

/* end header navigation */

/* start gallery */

.gallery-intro {
    width: 100%;
}

.gallery-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.gallery-item {
    display: block;
    line-height: 0;
}

/* The photos mix portrait (mostly 3:4, one 1152x2048) and landscape (mostly
   4:3). Full-height portraits would make a tile nearly a full viewport tall at
   this width. Square tiles centre-crop either orientation by about the same
   amount, staying close to the original shape, and a fixed ratio keeps the
   rows even whatever the source dimensions. */
.gallery-item img {
    display: block;
    width: 100%;
    /* The width/height attributes (there to reserve space before the lazy load)
       are presentational hints, so without this the height attribute wins and
       aspect-ratio is ignored. */
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background-color: #ebebeb;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.gallery-item:hover img {
    opacity: 0.85;
}

.gallery-item:focus-visible img {
    opacity: 0.85;
    outline: 2px solid var(--theme-light-blue);
    outline-offset: 2px;
}

/* Leave room beside the photo for the arrows, and below it for the counter. */
.image-overlay--gallery .image-overlay-image {
    max-width: min(95vw, calc(100vw - 160px));
    max-height: 84vh;
}

/* The neighbouring slides sit outside the viewport until a drag pulls them in. */
.image-overlay--gallery {
    overflow: hidden;
}

/* The controls are painted over the track, which is positioned and would
   otherwise cover the ones that precede it in the markup. */
.image-overlay--gallery .image-overlay-close,
.image-overlay--gallery .overlay-nav,
.image-overlay--gallery .overlay-counter {
    z-index: 1;
}

/* One viewport wide with three slides overflowing it, so translateX(-100%) is
   exactly one slide: the current one, centred. touch-action hands us horizontal
   gestures while the browser keeps vertical ones, which is what lets the touch
   listeners stay passive — no preventDefault, no scroll-jank penalty.
   `pinch-zoom` has to be listed explicitly: `pan-y` alone would surrender only
   vertical panning and take pinch-zoom away with everything else. */
.overlay-track {
    position: absolute;
    inset: 0;
    display: flex;
    transform: translateX(-100%);
    touch-action: pan-y pinch-zoom;
    will-change: transform;
}

/* While the photo is zoomed, hand every gesture back to the browser so a
   one-finger drag pans the magnified image instead of swiping to the next. */
.overlay-track.is-zoomed {
    touch-action: auto;
}

.overlay-slide {
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-track.is-settling {
    transition: transform 0.25s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .overlay-track.is-settling {
        transition: none;
    }
}

.overlay-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.35);
    border: none;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.overlay-nav:hover,
.overlay-nav:focus-visible {
    background-color: rgba(0, 0, 0, 0.7);
}

.overlay-prev {
    left: 8px;
}

.overlay-next {
    right: 8px;
}

.overlay-counter {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    margin: 0;
    text-align: center;
    color: white;
    font-size: 16px;
}

/* Keep the page behind the overlay from scrolling under it. */
.overlay-open {
    overflow: hidden;
}

/* end gallery */

@media screen and (max-width: 900px) {
    .nav-link {
        font-size: 16px;
        padding: 8px 12px;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .image-overlay--gallery .image-overlay-image {
        max-width: 96vw;
        max-height: 78vh;
    }
    .overlay-nav {
        width: 44px;
        height: 64px;
    }
    .overlay-prev {
        left: 4px;
    }
    .overlay-next {
        right: 4px;
    }
}
