/* Variables */

:root {
    --chalk: #F6E9D9;
    --iron: #010101;
    --bumper-plate: #231F20;
    --heavy: #FF000C;
}

/* Base */

* { cursor: none; }

::selection { background-color: transparent; color: inherit; }

h1::selection, h2::selection, h3::selection, h4::selection,
h5::selection, h6::selection,
p:not(.small-text, .pill)::selection {
    background-color: var(--heavy);
    color: var(--chalk);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Neue Montreal', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    background-color: var(--iron);
    color: var(--chalk);
    overflow-wrap: break-word; /* makes long text */
    word-break: break-word; /* and paragraphs */
    text-wrap: balance; /* more visually pleasing */
}

header {
    display: flex;
    flex-direction: column;
    padding: 120px 40px 80px 40px;
}

section {
    display: flex;
    flex-direction: column;
    gap: 80px;
    padding: 160px 40px;
}

footer {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 40px 40px;
}

/* Type Scale */

h1, h2, h3, h4 {
    font-family: 'Nikkei', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
}

h5, h6 {
    font-family: 'Neue Montreal', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
}

h1 { font-size: 120px; line-height: 0.8; }
h2 { font-size: 80px;  line-height: 0.9; }
h3 { font-size: 60px;  line-height: 0.9; }
h4 { font-size: 40px;  line-height: 1; }
h5 { font-size: 32px;  line-height: 1.25; }
h6 { font-size: 24px;  line-height: 1.333; }

p, a {
    font-family: 'Neue Montreal', sans-serif;
    font-weight: 400;
    font-size: 32px;
    line-height: 1.25;
}

a {
    text-transform: uppercase;
    text-decoration: none;
    color: var(--chalk);
}

blockquote {
    font-family: 'Nikkei', sans-serif;
    font-weight: 800;
    font-size: clamp(28px, 6.944vw, 100px); /* scales the text to the viewport width */
    line-height: 0.9;
    text-align: center;
    text-transform: uppercase;
    font-style: italic;
}

/* Header */

nav {
    position: fixed;
    top: 0;
    left: 0;
    padding: 20px 40px;
    width: 100%;
    z-index: 1020;
    mix-blend-mode: difference; /* blends nav text against page content */
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1); /* slide hide/show — spring easing */
    will-change: transform;
}

nav ul {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

nav ul a, .contact ul a {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
    height: min-content;
}

.logo-lockup {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.logo-container { padding: 40px; transform: translateZ(0); }

.logo { width: 100% }

.mobile-logo { display: none; }

.tagline-container {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    gap: 20px;

}

.tagline {
    display: flex;
    flex-direction: column;
    align-items: center;
    white-space: pre-wrap;
}

.small-text { text-transform: uppercase; }

.tagline .small-text { line-height: 1; }

/* Hero */

.hero-container { padding: 0; height: 90vw; }

.hero {
    width: 100%;
    height: 100%;
    background-image: url('../img/hero.webp');
    background-size: cover;
    background-position: top center;
}

/* About */

.about { gap: 160px; }

.intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 80px;
}

.split-headline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.image-container {
    border-radius: 20px;
    overflow: hidden; /* clips image zoom scale */
    height: 100%; /* allows the last gallery card to grow */
}

.headshot {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.headshot .image-container { grid-column: 2; }

.grid-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    gap: 20px;
}

.services, .blockquote-container { grid-column: 2 / span 10; }

.pills {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.pill {
    padding: 19px 39px;
    font-size: 48px;
    line-height: 40px;
    text-transform: uppercase;
    border-radius: 100px;
    border: 1px solid var(--chalk);
}

/* Gallery */

.gallery {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    gap: 20px;
    container-type: inline-size; /* enables the left push on the last card */
}

.card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.caption { font-size: 20px; line-height: 1.2; }

/* Bio */

.bio-container { grid-column: 4 / span 6; }

.bio {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
}

.bio > .split-headline { align-items: flex-start; }

.button {
    font-size: 24px;
    line-height: 32px;
    text-transform: uppercase;
    background: none;
    padding: 9px 19px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    border: 1px solid var(--chalk);
    border-radius: 100px;
    position: relative;
    width: fit-content;
    height: min-content;
    overflow: hidden; /* clips .animated-bg scaleY */
}

.button:hover,
.button:focus-visible { color: var(--iron); outline: none; }

/* Blockquote */

.blockquote-bg {
    height: 90vw;
    background-image: url('../img/blockquote.webp');
    background-size: cover;
    background-position: center;
}

.blockquote {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* Contact */

.list-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.large-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.large-link-text {
    font-family: 'Nikkei', sans-serif;
    font-weight: 800;
    font-size: 60px;
    line-height: 0.9;
    text-transform: uppercase;
    text-align: center; /* fixes alignment when the text wraps */
}

#email { white-space: nowrap; } /* prevents email address from wrapping */

/* keeps animated-decoration consistent
with the text width when the address is wrapped */

a:has(> #address) { width: fit-content; } 

/* Footer */

.copyright-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 20px;
}

.copyright-container :first-child {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    flex: 1 0 0px;
}

.copyright-container :last-child {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    flex: 1 0 0px;
}

#date { justify-content: inherit; }

#time { font-variant-numeric: tabular-nums; }

/* 404 Page */

section.error { 
    justify-content: center;
    align-items: center;
    gap: 40px;
    height: 100vh;
}

.not-found { width: 122px; height: 88px; }

.dino { width: 100%; height: 100%; }

.error-message {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.bit-headline {
    font-family: 'Neue Bit', sans-serif;
    font-weight: 700;
    font-size: 64px;
    line-height: 0.9375;
    text-align: center; /* fixes alignment when the text wraps */
}

.bit-link { 
    font-family: 'Neue Bit', sans-serif; 
    font-weight: 400;
    font-size: 40px;
    line-height: 1;
    text-transform: none;
}

/* ─── Animations ──────────────────────────────────────────── */

/* Custom cursor — two-element: wrapper translates, shape scales.
   mix-blend-mode on wrapper so it blends against page, not within itself. */

.cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    mix-blend-mode: difference;
    z-index: 9999;
    will-change: transform;
}

.cursor-shape {
    width: 24px;
    height: 24px;
    background: var(--chalk);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.cursor.hover .cursor-shape  { transform: translate(-50%, -50%) scale(1.75); }
.cursor.hidden .cursor-shape { opacity: 0; }

/* Page load — elements clip-slide up through overflow:hidden containers.
   skip-intro suppresses animation on reload when page is already scrolled. */

nav ul, .logo-container, .tagline-container, .hero-container, .headline-container {
    overflow: hidden;
}

.hero-container, .hero { transform: translate3d(0, 0, 0); }

.hero { backface-visibility: hidden; }

.skip-intro header .logo,
.skip-intro .tagline,
.skip-intro .hero {
    animation: none;
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

nav ul li, header .logo, .tagline, .hero {
    animation: slideUpBehind 1.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tagline, .hero { animation-delay: 0.2s; }

@keyframes slideUpBehind {
    from { transform: translate3d(0, 100%, 0); opacity: 0; }
    to   { transform: translate3d(0, 0, 0);    opacity: 1; }
}

/* Nav hide — slides up off-screen on scroll down, returns on scroll up */

.hide-nav { transform: translateY(-100%); }

/* Link decorations — scaleX underline on hover, scaleY fill for .button */

/* Any <a> with a nested .animated-decoration gets its own positioning + clip context here,
   so the underline is always sized/anchored to its own link — not whatever positioned
   ancestor (or the viewport, lacking one) it happens to land inside. Previously this
   containment lived only on the narrowly-scoped `nav ul a, .contact ul a` rule above,
   which silently broke (decoration spanning the full viewport) the moment .animated-decoration
   was used on a plain <a> outside those two contexts. .button still sets its own
   position/overflow separately for .animated-bg. */
a:has(> .animated-decoration) {
    position: relative;
    overflow: hidden;
}

.animated-decoration {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    flex: none;
    background-color: var(--chalk);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

a:hover .animated-decoration,
a:focus-visible .animated-decoration { transform: scaleX(1); }

.animated-bg {
    position: absolute;
    bottom: -1px;
    left: -1px;
    width: calc(100% + 2px);
    height: 52px;
    flex: none;
    background-color: var(--chalk);
    border: 1px solid var(--chalk);
    border-radius: 100px;
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: -1;
}

a:hover .animated-bg,
a:focus-visible .animated-bg { transform: scaleY(1); }

/* Scroll: headlines + footer logo — rAF scroll-progress drives transform (headlines) and (footer logo).
   Headlines and logo have no opacity: .headline-container and .logo-container overflow:hidden clips them while off-screen. */

h1, h2 {
    transform: translateY(110%); /* rAF lerps to 0; % scales with type at every breakpoint */
}

footer .logo {
    transform: translateY(175%); /* rAF lerps to 0; .logo-container overflow:hidden clips hidden state */
    backface-visibility: hidden; /* own compositing layer avoids aliasing at the clip edge */
}

/* Scroll: images — rAF scroll-progress drives scale continuously.
object-fit resizes imgs to fill the .image-container while preserving aspect ratio. */

.headshot img, .gallery img { object-fit: cover; }