/* =============================================================================
   Amelia Cossentino — portfolio
   Paper, ink, and one spot color. Fraunces for the words that matter,
   Schibsted Grotesk for the interface.
   ========================================================================== */

@font-face {
    font-family: "Fraunces";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/fraunces-latin-opsz-normal.woff2") format("woff2-variations"), url("../fonts/fraunces-latin-opsz-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Fraunces";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/fraunces-latin-opsz-italic.woff2") format("woff2-variations"), url("../fonts/fraunces-latin-opsz-italic.woff2") format("woff2");
}

@font-face {
    font-family: "Schibsted Grotesk";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("../fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Schibsted Grotesk";
    font-style: italic;
    font-weight: 400 900;
    font-display: swap;
    src: url("../fonts/schibsted-grotesk-latin-wght-italic.woff2") format("woff2-variations"), url("../fonts/schibsted-grotesk-latin-wght-italic.woff2") format("woff2");
}

:root {
    --paper: #ffffff;
    --paper-2: #f3f2ee;
    --ink: #000000;
    --ink-2: #5d5b57;
    --rule: #e5e3de;
    --spot: #d81b74;
    --spot-2: #ad1259;
    --night: #0f2a3a;
    --night-text: #f3efe6;
    --night-muted: rgba(243, 239, 230, 0.74);
    --amber: #f3a73b;
    --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
    --sans: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --wrap: 1200px;
    --gutter: clamp(16px, 3vw, 32px);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body.am-body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.6;
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

.am-body img {
    max-width: 100%;
}

.am-body a {
    color: inherit;
}

.am-body button {
    font: inherit;
    color: inherit;
}

.am-body :focus-visible {
    outline: 2px solid var(--spot);
    outline-offset: 3px;
}

.am-wrap {
    width: min(var(--wrap), 100% - 2 * var(--gutter));
    margin-inline: auto;
}

.am-skip {
    position: absolute;
    left: 16px;
    top: -60px;
    padding: 10px 14px;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--sans);
    font-size: 15px;
    text-decoration: none;
    z-index: 100;
}

.am-skip:focus {
    top: 12px;
}

/* ---------- Masthead ---------- */

.am-masthead {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.94);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--rule);
}

.am-masthead__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px 32px;
    flex-wrap: wrap;
    padding: 16px 0 14px;
}

.am-name {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 22px;
    line-height: 1;
    letter-spacing: -0.012em;
}

.am-name a {
    text-decoration: none;
}

.am-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.3;
}

.am-nav a {
    text-decoration: none;
    padding: 2px 0;
    border-bottom: 1.5px solid transparent;
    transition: border-color 0.2s var(--ease);
}

.am-nav a:hover {
    border-bottom-color: var(--ink);
}

/* The section on screen gets a spot (the one color on the site is the fuchsia of her leopard spots). */
.am-nav a[data-section] {
    position: relative;
}

.am-nav a[data-section]::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -9px;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    border-radius: 50%;
    background: var(--spot);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.am-nav a[aria-current="true"]::before {
    opacity: 1;
    transform: scale(1);
}

.am-nav__mail {
    color: var(--spot);
}

.am-nav__mail:hover {
    border-bottom-color: var(--spot) !important;
}

/* ---------- Opening: one caption, set large ---------- */

.am-hero {
    padding: clamp(40px, 7vw, 84px) 0 clamp(40px, 6vw, 72px);
}

.am-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
}

.am-hero__caption {
    margin: 0 0 28px;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-variation-settings: "opsz" 144;
    line-height: 1.08;
    letter-spacing: -0.015em;
    text-indent: -0.4em;
    text-wrap: balance;
    font-size: clamp(34px, 4.8vw, 64px);
}

.am-hero__caption[data-len="medium"] {
    font-size: clamp(30px, 3.9vw, 52px);
}

.am-hero__caption[data-len="long"] {
    font-size: clamp(26px, 3.1vw, 40px);
    line-height: 1.15;
}

/* Caption contest: the caption is hidden until asked for. */
.am-hero__cap {
    position: relative;
}

.am-hero__cap.is-hidden .am-hero__caption {
    visibility: hidden;
}

.am-hero__reveal {
    position: absolute;
    left: 0;
    top: 0;
    appearance: none;
    padding: 0;
    border: 0;
    background: none;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-variation-settings: "opsz" 144;
    font-size: clamp(30px, 3.9vw, 52px);
    line-height: 1.08;
    letter-spacing: -0.015em;
    color: var(--ink-2);
    cursor: pointer;
    text-align: left;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 8px;
    text-decoration-color: var(--spot);
    transition: color 0.2s var(--ease);
}

.am-hero__reveal:hover {
    color: var(--ink);
}

.am-hero__reveal[hidden] {
    display: none;
}

.am-textlink--quiet {
    appearance: none;
    padding: 0;
    border: 0;
    background: none;
    color: var(--ink-2);
    cursor: pointer;
}

.am-textlink--quiet[aria-pressed="true"] {
    color: var(--spot);
}

.am-hero__line {
    margin: 0 0 30px;
    max-width: 42ch;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink-2);
}

.am-hero__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 26px;
}

.am-hero__art {
    display: flex;
    align-items: center;
    justify-content: center;
    height: min(70vh, 640px);
    text-decoration: none;
}

.am-hero__art img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.35s var(--ease);
}

.am-hero__art.is-swapping img {
    opacity: 0;
}

/* ---------- Buttons and links ---------- */

.am-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: transparent;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.am-btn:hover {
    background: var(--ink);
    color: var(--paper);
}

.am-btn--quiet {
    border-color: var(--rule);
    font-weight: 500;
}

.am-btn--quiet:hover {
    background: transparent;
    color: var(--ink);
    border-color: var(--ink);
}

.am-textlink {
    font-family: var(--sans);
    font-size: 15px;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    transition: color 0.2s var(--ease);
}

.am-textlink:hover {
    color: var(--spot);
}

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

.am-section {
    padding: clamp(48px, 7vw, 88px) 0;
}

.am-section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px 32px;
    margin-bottom: clamp(28px, 4vw, 44px);
}

.am-h2 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(30px, 3.4vw, 40px);
    line-height: 1.1;
    letter-spacing: -0.015em;
}

.am-h3 {
    margin: 40px 0 10px;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    color: var(--ink-2);
}

.am-note {
    margin: 10px 0 0;
    max-width: 58ch;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink-2);
}

/* ---------- Cartoons ---------- */

.am-views {
    display: flex;
    gap: 22px;
    font-family: var(--sans);
    font-size: 15px;
}

.am-view {
    appearance: none;
    padding: 4px 0 6px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--ink-2);
    cursor: pointer;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.am-view:hover {
    color: var(--ink);
}

.am-view.is-active {
    color: var(--ink);
    border-bottom-color: var(--ink);
}

.am-grid {
    columns: 2;
    column-gap: clamp(28px, 4vw, 56px);
}

.am-grid[hidden] {
    display: none;
}

.am-tile {
    display: block;
    break-inside: avoid;
    margin: 0 0 clamp(32px, 4vw, 56px);
    text-decoration: none;
    cursor: zoom-in;
}

.am-tile[hidden] {
    display: none;
}

.am-tile img {
    display: block;
    width: 100%;
    height: auto;
}

.am-captions {
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 50ch;
}

.am-captions[hidden] {
    display: none;
}

.am-captions li {
    margin: 0 0 18px;
    padding-left: 0.5em;
    text-indent: -0.5em;
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(20px, 2vw, 25px);
    line-height: 1.28;
    letter-spacing: -0.005em;
}

.am-captions li.am-captions__title {
    font-style: normal;
}

.am-captions a {
    text-decoration: none;
    transition: color 0.15s var(--ease);
}

.am-captions a:hover,
.am-captions a:focus-visible {
    color: var(--spot);
}

/* The drawing for the caption under the pointer, held steady on the right while the list is read. */
.am-peek {
    position: fixed;
    top: 50%;
    left: calc(50% + 2vw);
    width: min(40vw, 560px);
    max-height: 72vh;
    height: auto;
    object-fit: contain;
    object-position: left center;
    transform: translateY(-50%);
    background: var(--paper);
    padding: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 28px 64px -24px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.18s var(--ease);
}

.am-peek.is-on {
    opacity: 1;
}

.am-peek[hidden] {
    display: none;
}

.am-more {
    margin: clamp(8px, 2vw, 24px) 0 0;
    text-align: center;
}

/* ---------- Sketchbook ---------- */

.am-sketchbook {
    background: var(--paper-2);
    padding-bottom: clamp(40px, 6vw, 72px);
}

.am-section__head--strip {
    margin-bottom: clamp(20px, 3vw, 32px);
}

.am-strip__controls {
    display: flex;
    gap: 10px;
}

.am-arrow {
    appearance: none;
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.am-arrow:hover {
    background: var(--ink);
    color: var(--paper);
}

.am-arrow svg,
.am-lb__nav svg,
.am-lb__close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.am-strip {
    display: flex;
    gap: clamp(20px, 3vw, 36px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: max(var(--gutter), calc((100% - var(--wrap)) / 2));
    padding: 6px max(var(--gutter), calc((100% - var(--wrap)) / 2)) 24px;
    scrollbar-width: thin;
    scrollbar-color: #c9c6bf transparent;
}

.am-strip::-webkit-scrollbar {
    height: 6px;
}

.am-strip::-webkit-scrollbar-thumb {
    background: #c9c6bf;
    border-radius: 3px;
}

.am-page {
    flex: 0 0 auto;
    width: min(420px, 78vw);
    margin: 0;
    scroll-snap-align: start;
}

.am-page a {
    display: block;
    text-decoration: none;
    cursor: zoom-in;
}

.am-page img {
    display: block;
    width: 100%;
    height: auto;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 14px 32px -16px rgba(0, 0, 0, 0.35);
}

.am-page figcaption {
    margin-top: 14px;
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink-2);
}

.am-page__date {
    display: block;
    color: var(--ink);
}

.am-page__note {
    display: block;
}

/* ---------- Look Left! ---------- */

.am-ll {
    background: var(--night);
    color: var(--night-text);
}

.am-ll .am-note {
    color: var(--night-muted);
}

.am-ll__head {
    margin-bottom: clamp(32px, 5vw, 56px);
    max-width: 70ch;
}

.am-ll__art {
    display: grid;
    gap: clamp(20px, 3vw, 36px);
    align-items: end;
}

.am-ll__key {
    grid-template-columns: 1.25fr 1fr 1fr;
    margin-bottom: clamp(32px, 5vw, 56px);
}

.am-ll__sheets {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.am-ll__piece {
    display: block;
    text-decoration: none;
    cursor: zoom-in;
    min-width: 0;
}

.am-ll__piece img {
    display: block;
    width: 100%;
    height: auto;
}

.am-ll__name {
    display: block;
    margin-top: 12px;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--amber);
}

.am-ll :focus-visible {
    outline-color: var(--amber);
}

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

.am-about__grid {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 80px);
    align-items: start;
}

.am-about__photo {
    margin: 0;
}

.am-about__photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.am-about__text p {
    margin: 0 0 1em;
    max-width: 58ch;
    font-size: 19px;
    line-height: 1.62;
}

.am-about__text .am-h2 {
    margin-bottom: 22px;
}

/* Her mark, the way she signs the Look Left! art, as the sign-off under the bio. */
.am-signoff {
    display: block;
    width: 84px;
    height: auto;
    margin: 18px 0 8px -4px;
    transform: rotate(-3deg);
}

.am-credits,
.am-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.am-credits li {
    font-size: 19px;
    line-height: 1.5;
}

.am-email {
    margin: 4px 0 14px !important;
    font-size: clamp(22px, 2.4vw, 28px) !important;
    line-height: 1.3 !important;
}

.am-email a {
    color: var(--spot);
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 1px;
}

.am-email a:hover {
    color: var(--spot-2);
}

.am-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    font-family: var(--sans);
    font-size: 16px;
}

.am-links a {
    text-decoration: none;
    border-bottom: 1.5px solid var(--rule);
    padding-bottom: 2px;
    transition: border-color 0.2s var(--ease);
}

.am-links a:hover {
    border-bottom-color: var(--ink);
}

.am-links span {
    color: var(--ink-2);
}

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

.am-footer {
    padding: 32px 0 56px;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--ink-2);
}

.am-footer__row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 32px;
}

.am-footer p {
    margin: 0;
}

.am-footer a {
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
}

.am-footer a:hover {
    border-bottom-color: var(--ink);
}

/* ---------- Lightbox ---------- */

.am-lb {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
}

.am-lb::backdrop {
    background: rgba(255, 255, 255, 0.97);
}

.am-lb[open] {
    display: block;
}

.am-lb__frame {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    background: rgba(255, 255, 255, 0.97);
}

.am-lb__fig {
    margin: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px clamp(56px, 8vw, 96px) 8px;
}

.am-lb__fig img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 170px);
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.25s var(--ease);
}

.am-lb.is-swapping .am-lb__fig img {
    opacity: 0;
}

.am-lb__cap {
    margin-top: 14px;
    text-align: center;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.45;
    color: var(--ink-2);
    max-width: 70ch;
}

.am-lb__text {
    display: block;
    color: var(--ink);
}

.am-lb__text:empty,
.am-lb__meta:empty {
    display: none;
}

.am-lb__meta {
    display: block;
}

.am-lb__bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 10px 16px 22px;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--ink-2);
}

.am-lb__copy {
    appearance: none;
    border: 0;
    background: none;
    padding: 6px 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
    color: var(--ink);
}

.am-lb__copy:hover {
    color: var(--spot);
}

.am-lb__close,
.am-lb__nav {
    position: absolute;
    appearance: none;
    width: 48px;
    height: 48px;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    background: var(--paper);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), opacity 0.2s var(--ease);
}

.am-lb__close:hover,
.am-lb__nav:hover {
    background: var(--ink);
    color: var(--paper);
}

.am-lb__close {
    top: 16px;
    right: 16px;
}

.am-lb__nav {
    top: 50%;
    transform: translateY(-50%);
}

.am-lb__nav--prev {
    left: 16px;
}

.am-lb__nav--next {
    right: 16px;
}

.am-lb__nav[disabled] {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

body.am-lb-open {
    overflow: hidden;
}

/* Opening a cartoon: the drawing travels from its place on the page into the lightbox
   (View Transitions, where the browser has them; elsewhere the lightbox simply opens). */
::view-transition-group(cartoon) {
    animation-duration: 0.42s;
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
}

::view-transition-old(cartoon),
::view-transition-new(cartoon) {
    animation: none;
    mix-blend-mode: normal;
    height: 100%;
    object-fit: contain;
    overflow: clip;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.3s;
}

.am-lb__pair[hidden] {
    display: none;
}

/* ---------- Smaller screens ---------- */

@media (max-width: 980px) {
    /* On a narrow screen the opening reads like a cartoon: drawing first, caption beneath it. */
    .am-hero {
        padding-top: clamp(20px, 4vw, 40px);
    }

    .am-hero__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .am-hero__art {
        order: -1;
        height: auto;
        justify-content: center;
    }

    .am-hero__art img {
        max-height: 58vh;
    }

    .am-hero__caption {
        font-size: clamp(28px, 7vw, 40px);
        margin-bottom: 18px;
    }

    .am-hero__caption[data-len="medium"] {
        font-size: clamp(24px, 5.8vw, 34px);
    }

    .am-hero__caption[data-len="long"] {
        font-size: clamp(21px, 4.8vw, 28px);
    }

    .am-hero__line {
        margin-bottom: 20px;
    }

    .am-about__grid {
        grid-template-columns: 1fr;
    }

    .am-about__photo {
        max-width: 420px;
    }
}

@media (max-width: 980px) {
    .am-peek {
        display: none !important;
    }

    .am-captions {
        max-width: none;
    }
}

@media (max-width: 760px) {
    .am-grid {
        columns: 1;
    }

    .am-nav__mail {
        display: none;
    }

    .am-lb__fig {
        padding: 72px 12px 8px;
    }

    .am-lb__fig img {
        max-height: calc(100vh - 200px);
    }

    .am-lb__nav {
        top: auto;
        bottom: 14px;
        transform: none;
        width: 44px;
        height: 44px;
    }

    .am-lb__nav--prev {
        left: 16px;
    }

    .am-lb__nav--next {
        right: 16px;
    }

    .am-lb__bar {
        padding: 10px 72px 22px;
    }

    .am-ll__key,
    .am-ll__sheets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .am-ll__key .am-ll__piece:first-child {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .am-masthead__row {
        padding: 14px 0 12px;
    }

    .am-nav {
        gap: 4px 18px;
        font-size: 14px;
    }
}

@media (hover: none) {
    .am-peek {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .am-body *,
    .am-body *::before,
    .am-body *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}
