/* Patrick Hand (Google Fonts) */
@import url("https://fonts.googleapis.com/css2?family=Patrick+Hand&display=swap");

/* === FONTS (local .ttf as you requested) === */
@font-face {
    font-family: "Inter";
    src: url("../fonts/Inter-VariableFont_opsz,wght.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}
@font-face {
    font-family: "IBM Plex Mono";
    src: url("../fonts/IBMPlexMono-Regular.ttf") format("truetype"); /* if your file isn't .ttf, change the extension here */
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

/* Design tokens */
:root {
--bg: #ffffff;
    --text: #666666;       /* body text */
    --heading: #000000;    /* headings */
    --hero-text: #000000;  /* hero copy */
    --rule: #aaaaaa;
    --accent: #8347fc;
    --accent-2: #ffe100;
    --maxw: 1040px;

}

/* Reset-ish + basics */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--text);
    line-height: 1.3;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
    font-size: 18px;
    font-feature-settings: "blwf" on, "cv09" on, "cv03" on, "cv04" on, "cv11" on;
    letter-spacing: -0.25px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
@media (min-width: 1040px) {
    body {
        max-width: 1040px;
        margin: 0 auto;
    }
}

p, ul, li {
    max-width: 600px;
}
p {
    margin-bottom: 20px;
}
li {
    padding-left: 0.5em;
    margin-bottom: 0.5em;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    max-width: 600px;
}
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }

/* Hero text must be black, even paragraphs */
.hero .hero-text {
    color: var(--hero-text);
}


img, svg { display: block; max-width: 100%; height: auto; }
a { color: #000000; text-decoration: none; }
a:hover { color: var(--accent); }

/* Helpers */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 16px;
}
@media (min-width: 1040px) {
    .container {
        padding-inline: 32px;
    }
}
.section { padding: 48px 0; }
.section-title {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    margin-bottom: 60px;
}
.section-title .rule {
    height: 1px;
    background: var(--rule);
}
.section-title h2 {
    margin: 0;
    font-family: "Inter", sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Header / Nav */
.site-header {
    background: var(--bg);
    position: relative;
    z-index: 1001;
    transition: background 0.3s ease;
    animation: fadeInHeader 1s ease 0s forwards;
}
.nav-open .site-header {
    background: var(--accent-2);
}

@keyframes fadeInHeader {
    from { opacity: 0; }
    to { opacity: 1; }
}
.nav {
    display: flex;
    align-items: center;
    min-height: 64px;
    gap: 20px;
    position: relative;
}
.brand {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    color: #000000;
}
.main-nav {
    display: flex;
    gap: 20px;
    margin-left: auto;
}
.main-nav a {
    color: #000000;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
}
.main-nav a:hover {
    color: var(--accent);
    text-decoration: underline;
}
.main-nav a {
    line-height: 2;
}
.main-nav .lang {
    margin-left: auto;
}
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: absolute;
    top: 11px;
    right: 16px;
    width: 34px;
    height: 34px;
}
.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: #000000;
    margin: 4px 0;
    transition: 0.3s;
    transform-origin: center;
}
.nav-open .hamburger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.nav-open .hamburger span:nth-child(2) {
    opacity: 0;
}
.nav-open .hamburger span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}
.lang {
    margin-left: 4px;
}
.lang-toggle {
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 1.25rem;
    text-decoration: none;
    color: #000000;
}


/* Hero */
.hero { 
    min-height: 100vh;
    padding-top: 10vh;
    opacity: 0;
    animation: fadeInHero 1s ease 0.3s forwards;
}

@keyframes fadeInHero {
    from { opacity: 0; }
    to { opacity: 1; }
}
.hero-grid {
    display: flex;
    flex-direction: column;
    gap: 200px;
}
.hero-text {
    max-width: 450px;
}
.hero-photos {
    width: 100%;
}
.hero-text .kicker {
    font-family: "Inter", sans-serif;
    font-weight: 400;
    margin: 0 0 8px 0;
    font-size: 18px;
}
.hero-text .lead {
    margin: 0 0 16px 0;
    font-weight: 400;
    font-size: 18px;
}
.hero-photos {
    position: relative;
    min-height: 280px;
}
.hero-photos .sun {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: var(--accent-2);
    top: -40px;
    right: 0;
    z-index: 0;
    opacity: 0;
    animation: rise 0.8s ease-out 0.6s forwards;
}
.photo {
    position: absolute;
    width: 46%;
    border-radius: 16px;
    box-shadow:
        0 1px 1px rgba(0,0,0,0.15),
        0 8px 8px rgba(0,0,0,0.08),
        0 20px 20px rgba(0,0,0,0.05);
    z-index: 1;
    object-fit: cover;
}
.p1 .photo {
    aspect-ratio: 5 / 4;
}
.p2 .photo {
    aspect-ratio: 7 / 5;
    object-position: top;
}
.p3 .photo {
    aspect-ratio: 11 / 8;
}
.p1 .photo { top: 0; right: 0; transform: rotate(4deg); }
.p2 .photo {
    bottom: 6%;
    left: 24%;
    /* transform: rotate(-4deg) translateY(40px); */
}
.p3 .photo { top: -8px; left: 0; transform: rotate(4deg); }

/* Timeline */
.timeline {
    display: grid;
    gap: 128px;
    position: relative;
}
.timeline-item {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 16px;
    align-items: start;
}
.timeline-item .timeline-pin {
    position: relative;
    width: 20px;
    min-height: 100%;
}
.timeline-item .timeline-pin::before {
    content: "";
    position: absolute;
    left: 9px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #eee;
}
.timeline-item .timeline-pin::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 4px;
    width: 10px;
    height: 10px;
    background: var(--accent-2);
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(255, 225, 0, 0.15);
}
.timeline-content .time {
    margin: 0 0 6px 0;
    color: #999;
    font-weight: 500;
}
.timeline-content h3 {
    margin: 0 0 10px 0;
    font-weight: 600;
    letter-spacing: 0;
}
.timeline-item.with-image {
    display: flex;
    align-items: center;
    gap: 16px;
}
.side-photo {
    margin: 16px 0 0 50px;
    border: 6px solid #fff;
    border-radius: 16px;
    width: 25%;
    aspect-ratio: 3 / 4;
    transform: rotate(45deg);
    transition: opacity 800ms ease, transform 800ms ease;
    box-shadow:
        0 1px 1px rgba(0,0,0,0.15),
        0 8px 8px rgba(0,0,0,0.08),
        0 20px 20px rgba(0,0,0,0.05);
    flex-shrink: 0;
}
.side-photo img { 
    border-radius: 10px; 
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Art intro */
.art-intro ul { padding-left: 20px; }
.art-intro li { margin-bottom: 6px; padding-left: 1em; }

/* Masonry gallery (pure CSS columns) */
.masonry {
    column-count: 4;
    column-gap: 8px;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 68px 8px 8px 8px;
    overflow-x: hidden;
}
.masonry-item {
    break-inside: avoid;
    margin: 0 0 8px 0;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}
.masonry-item img {
    width: 100%;
    transition: transform 220ms ease;
}
.masonry-item:hover img { transform: scale(1.06); }
.masonry-item figcaption {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 8px;
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0));
    opacity: 0;
    transition: opacity 160ms ease;
    line-height: 1;
}
.masonry-item:hover figcaption { opacity: 1; }
.masonry-item .title { font-weight: 700; font-size: 14px; display: block; }
.masonry-item .desc { font-size: 12px; opacity: 0.9; }

/* Ending + Footer */
.end h2 { margin: 0 0 8px 0; }
.end p {
    margin: 0 0 8px 0;
    max-width: none;
    color: #000000;
}
.end a {
    color: var(--accent);
    text-decoration: none;
}
.end a:hover {
    text-decoration: underline;
}
.site-footer {
    padding: 12px 0 6px 0;
    color: #000000;
    text-align: center;
    font-size: 0.8125rem;
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.site-footer p {
    max-width: none;
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }

/* Accessibility */
.sr-only {
    position: absolute !important;
    height: 1px; width: 1px;
    overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap; clip-path: inset(50%);
}

/* Responsive */
@media (min-width: 561px) and (max-width: 1039px) {
    .hero-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 28px;
        /* align-items: center; */
        width: 80%;
    }
    .hero-photos .sun {
        width: 70%;
        height: 100%;
    }
    .hero-photos {
        position: relative;
        display: flex;
        align-items: flex-end;
        gap: -30px;
        padding-block: 6px 0;
    }
    .hero-photos .sun {
        position: absolute;
        z-index: 0;
        right: 15%;
        top: -25%;
        width: 18vw;
        height: 18vw;
        border-radius: 50%;
        background: var(--accent-2);
    }
    .hero-photos .photo {
        position: relative;
        inset: auto;
        width: clamp(150px, 25vw, 356px);
        border-radius: 16px;
        object-fit: cover;
        z-index: 1;
        transform-origin: center;
    }
    .hero-photos .p1 {
        aspect-ratio: 5 / 4;
    }
    .hero-photos .p2 {
        aspect-ratio: 7 / 5;
        object-position: top;
    }
    .hero-photos .p3 {
        aspect-ratio: 11 / 8;
    }
    .hero-photos .p1 { transform: rotate(4deg); }
.hero-photos .p2 {
    /* transform: rotate(-4deg) translateY(40px); */
}
    .hero-photos .p3 { transform: rotate(4deg); }
    .photo-wrapper.p1 figcaption { bottom: -35px; }
}
@media (max-width: 1039px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-photos { min-height: 240px; }
    .masonry { column-count: 3; }
}
@media (max-width: 560px) {
    .masonry { column-count: 2; }
    .container { padding-inline: 24px; }
    .hamburger { display: block; }
    .lang-toggle { position: absolute; right: 64px; top: 50%; transform: translateY(-50%); }
    .main-nav {
        position: fixed;
        top: 64px;
        left: 0;
        width: 100%;
        height: calc(100vh - 64px);
        background: var(--accent-2);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 16px 24px;
        gap: 32px;
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .nav-open .main-nav {
        opacity: 1;
        pointer-events: auto;
    }
    .main-nav a {
        font-size: 1.5rem;
    }
    .main-nav .lang-select {
        font-size: 1.125rem;
    }
    .main-nav .lang {
        margin-left: 0;
    }
    .timeline-item.with-image {
        display: grid;
        grid-template-columns: 20px 1fr;
        grid-template-rows: auto auto;
        gap: 16px;
    }
    .timeline-item.with-image .timeline-pin {
        grid-row: 1;
        grid-column: 1;
    }
    .timeline-item.with-image .timeline-content {
        grid-row: 1;
        grid-column: 2;
    }
    .timeline-item.with-image .side-photo {
        grid-row: 2;
        grid-column: 1 / -1;
        width: 60%;
        max-width: 360px;
        margin: 16px auto 0;
    }
}

/* === HERO: vertical layout === */
.hero-grid {
    display: flex;
    flex-direction: column;  /* text first, then images */
    gap: 28px;
}

/* The images row (horizontal) */
.hero-photos {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: -30px;
    padding-block: 6px 0;
}

/* The yellow sun behind images */
.hero-photos .sun {
    position: absolute;
    width: 18vw;
    height: 18vw;
    border-radius: 50%;
    background: var(--accent-2);
    top: -25%;
    right: 14%;
    z-index: 0;
}

/* Photo wrappers for hover captions */
.photo-wrapper {
    position: relative;
    margin: 0;
}
.photo-wrapper.p2 {
    transition-delay: 0.2s;
}
.photo-wrapper.p3 {
    transition-delay: 0.4s;
}
.hero-caption .decoration {
    display: inline-block;
    width: 36px;
    height: 36px;
    margin-right: 6px;
    vertical-align: -1px;
    color: currentColor;
}
.hero-caption--left .decoration {
    position: absolute;
    left: -21px;
    top: -15px;
    margin-right: 0;
}
.hero-caption--center .decoration {
    position: absolute;
    left: -40px;
    top: -5px;
    margin-right: 0;
}
.hero-caption--right .decoration {
    position: absolute;
    left: -36px;
    top: -8px;
    width: 36px;
    height: 36px;
}
.photo-wrapper figcaption {
    position: absolute;
    opacity: 0;
    transition: opacity 180ms ease-out, transform 180ms ease-out;
    font-family: 'Patrick Hand', cursive;
    font-size: 18px;
    line-height: 1.3;
    color: #666666;
    background: none;
    padding: 0;
    letter-spacing: 0;
    z-index: 10;
    pointer-events: none;
}
.photo-wrapper:hover figcaption,
.photo-wrapper:focus-within figcaption {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion) {
    .photo-wrapper figcaption {
        transition: opacity 180ms ease-out;
    }
    .photo-wrapper:hover figcaption,
    .photo-wrapper:focus-within figcaption {
        transform: none;
    }
}
.photo-wrapper.p1 figcaption {
    bottom: -50px;
    left: 20px;
    transform: rotate(4deg);
}
.photo-wrapper.p1 figcaption .decoration {
    transform: rotate(-38deg);
}
.photo-wrapper.p2 figcaption {
    top: -40px;
    left: 20%;
    /* transform: rotate(-4deg); */
}
.photo-wrapper.p2 figcaption .decoration {
    transform: rotate(4deg);
}
.photo-wrapper.p3 figcaption {
    bottom: -65px;
    left: 60px;
    transform: rotate(4deg);
}
.photo-wrapper.p3 figcaption .decoration {
    transform: rotate(-4deg);
}

/* Make photos participate in the row (no absolute positioning) */
.hero-photos .photo {
    position: relative;              /* overrides earlier absolute */
    inset: auto;                     /* clear any previous offsets */
    width: clamp(150px, 25vw, 356px);
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    object-fit: cover;
    z-index: 1;
    transform-origin: center;
}

/* Keep the playful tilt */
.hero-photos .p1 {
    top: -8px;
    left: 0;
    /* transform: rotate(4deg); */
}
.hero-photos .p2 { transform: rotate(-4deg) translateY(40px); }
.hero-photos .p3 {
    top: 0;
    right: 0;
    /* transform: rotate(4deg); */
}

/* Small screens: allow wrapping if needed */
@media (max-width: 560px) {
    .hero-grid { gap: 60px; }
    .hero-photos {
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero-photos.reveal.in-view {
        width: 90%;
        margin: 0 auto;
    }
    .hero-photos .p3 {
        width: 90%;
    }
    .hero-photos .photo {
        width: 100%;
    }
    .photo-wrapper figcaption {
        opacity: 1;
        transform: none;
        font-size: 18px;
        margin-top: 8px;
    }
    .photo-wrapper figcaption::before {
        display: none;
    }
    .photo-wrapper {
        text-align: center;
    }
    .photo-wrapper figcaption {
        display: none;
    }
    .hero-photos .p1,
    .hero-photos .p2 {
        display: none;
    }
    .hero-photos .sun {
        left: 50%;
        top: -10%;
        width: 48vw;
        height: 48vw;
        transform: translateX(-50%);
    }
}

/* === GLOBAL: on-scroll fade/slide reveal === */
.reveal {
    opacity: 0;
    transition: opacity 420ms ease;
}
.reveal.in-view {
    opacity: 1;
}
.side-photo.reveal.in-view {
    transform: rotate(10deg);
}

/* === TIMELINE base (keeps the subtle gray spine) === */
.timeline {
    position: relative; /* needed for absolute connectors */
}
.timeline-item {
    /* timeline items will also get .reveal from JS */
}
.timeline-item .timeline-pin {
    position: relative;
    width: 20px;
    min-height: 100%;
}
.timeline-item .timeline-pin::before {
    /* thin gray guide within each item */
    content: "";
    position: absolute;
    left: 9px;               /* aligns with dot center */
    top: 0;
    bottom: 0;
    width: 2px;
    background: #eee;
}

/* Dot: appears (scales in) when item enters view */
.timeline-item .timeline-pin::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 4px;
    width: 10px;
    height: 10px;
    background: var(--accent-2); /* yellow */
    border-radius: 50%;
    transform: scale(0);
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1) 40ms, box-shadow 300ms ease;
    box-shadow: 0 0 0 0 rgba(255, 225, 0, 0.0);
}
.timeline-item.in-view .timeline-pin::after {
    transform: scale(1);
    box-shadow: 0 0 0 4px rgba(255, 225, 0, 0.18);
}

/* Yellow connector streak from top to current item (inserted by JS) */
.timeline-connector {
    position: absolute;
    left: 9px;               /* center of the spine */
    top: 0;
    width: 2px;
    height: 0;
    background: var(--accent-2); /* yellow */
    transition: height 900ms ease;
    z-index: 2;              /* on top of the gray spine */
}

/* === SCROLL TO TOP BUTTON === */
#scroll-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: white;
    color: black;
    border: 2px solid black;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#scroll-to-top:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

#scroll-to-top svg {
    width: 20px;
    height: 20px;
}

/* Sun rise animation */
@keyframes rise {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}
