:root {
    --bg: #1d1d1b;
    --folder: #c99a56;
    --folder-dark: #926637;
    --paper: #fffefd;
    --paper-edge: #e6e1d6;
    --ink: #242019;
    --muted: #756e62;
    --red: #a24538;
    --radius: 3px;
    --nav-height: 260px;
    --demo-offset: 0px;
    --panel-height: calc(100vh - var(--nav-height));
    --panel-tab-height: 48px;
    --panel-tab-left: 0%;
    --panel-tab-width: 43%;
    --panel-seam-overlap: 2px;
    --folder-width: min(92vw, 1180px);
    --folder-texture: url("../assets/manila-texture.png");
    --folder-back-hold: 505vh;
    --folder-front-delay: 20vh;
    --horse-width: clamp(170px, 22vw, 360px);
}

@font-face {
    font-family: "Dymo";
    src: url("../assets/Dymo.ttf") format("truetype");
    font-display: swap;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
}

body {
    font-family: "Space Grotesk", Arial, sans-serif;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg);
    content: "";
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
p {
    margin: 0;
}

h1 {
    color: #4b3924;
    font-family: "DM Mono", monospace;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.18em;
    line-height: 1;
}

.site-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 10;
    height: var(--nav-height);
    overflow: hidden;
    background: transparent;
    pointer-events: none;
}

.language-switcher {
    position: fixed;
    top: 18px;
    left: clamp(16px, 2.35vw, 34px);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.62);
    font-family: "DM Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
    pointer-events: auto;
}

.language-switcher button {
    padding: 3px 2px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    cursor: pointer;
}

.language-switcher button[aria-pressed="true"] {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.language-switcher button:focus-visible {
    outline: 1px solid currentColor;
    outline-offset: 2px;
}

.brand-lettering {
    display: block;
    width: min(53vw, 680px);
    height: auto;
}

.logo-link {
    display: none;
    align-items: flex-end;
    gap: 10px;
    margin-top: 0;
    pointer-events: auto;
    will-change: transform;
}

.logo {
    display: block;
    height: 180px;
    translate: 0 -10px;
    will-change: transform;
}

.horse-crossing {
    position: fixed;
    top: calc(var(--nav-height) - clamp(170px, 18vw, 230px));
    left: calc(0px - var(--horse-width) - 10vw);
    z-index: 9;
    width: var(--horse-width);
    opacity: 0;
    pointer-events: none;
    animation: horse-cross 4.8s linear infinite;
    transition: opacity 120ms linear;
    will-change: transform;
}

body.is-dark-background .horse-crossing {
    opacity: 1;
}

.horse-stop-motion {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 8px 8px rgba(53, 34, 16, 0.16));
    transform: translateZ(0);
}

@keyframes horse-cross {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(100vw + var(--horse-width) + 20vw));
    }
}

.demo-reel {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100vh;
    min-height: 560px;
    overflow: hidden;
    background: var(--bg);
}

.demo-reel::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.16);
    content: "";
}

.demo-reel video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    filter: saturate(0.82) contrast(1.06);
}

.demo-fade {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 80ms linear;
}

.landing-brand-link {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 20;
    display: block;
    width: min(78vw, 920px);
    height: auto;
    transform: translate(-50%, -50%);
    transform-origin: center;
    will-change: transform;
}

.landing-brand {
    display: block;
    width: 100%;
    height: auto;
    max-height: 42vh;
    object-fit: contain;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.28));
    will-change: transform;
}

.folder-back {
    position: relative;
    z-index: 1;
    display: flex;
    width: var(--folder-width);
    height: calc(var(--panel-height) + var(--folder-back-hold));
    margin: 100vh auto 0;
}

.folder-back-surface {
    position: sticky;
    top: var(--nav-height);
    width: 100%;
    height: var(--panel-height);
    overflow: hidden;
    border: 1px solid rgba(99, 64, 30, 0.45);
    border-radius: var(--radius);
    background:
        linear-gradient(115deg, rgba(255, 231, 176, 0.16), transparent 30%),
        linear-gradient(240deg, rgba(98, 58, 23, 0.11), transparent 42%),
        var(--folder) var(--folder-texture) center / cover;
    box-shadow: 0 16px 28px rgba(84, 55, 27, 0.16);
}

.folder-back-surface.is-fixed {
    position: fixed;
    top: var(--nav-height);
    left: 50%;
    width: var(--folder-width);
    transform: translateX(-50%);
}

.folder-back-surface::before,
.folder-back-surface::after {
    position: absolute;
    content: "";
    pointer-events: none;
}

.folder-back-surface::before {
    inset: 11% 5% auto;
    height: 1px;
    background: rgba(93, 63, 30, 0.2);
    box-shadow: 0 1px rgba(255, 237, 190, 0.18);
    transform: rotate(-0.35deg);
}

.folder-back-surface::after {
    right: 8%;
    bottom: 9%;
    width: min(32vw, 320px);
    height: min(18vw, 170px);
    border: 1px solid rgba(92, 58, 23, 0.16);
    opacity: 0.72;
    transform: rotate(4deg);
}

.folder-back-crease {
    position: absolute;
    display: block;
    height: 1px;
    background: rgba(93, 63, 30, 0.18);
    transform-origin: left;
}

.folder-back-crease.crease-one {
    top: 31%;
    left: 9%;
    width: 43%;
    transform: rotate(-3deg);
}

.folder-back-crease.crease-two {
    top: 51%;
    right: 10%;
    width: 30%;
    transform: rotate(5deg);
}

.folder-back-crease.crease-three {
    bottom: 21%;
    left: 19%;
    width: 34%;
    transform: rotate(2deg);
}

.panel {
    position: sticky;
    top: var(--nav-height);
    z-index: 2;
    display: flex;
    width: var(--folder-width);
    height: var(--panel-height);
    margin: 100vh auto 0;
    pointer-events: none;
}

.panel-card {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: var(--panel-align, flex-start);
    min-width: 0;
}

.panel-title {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--panel-tab-width);
    height: var(--panel-tab-height);
    margin-bottom: calc(-1 * var(--panel-seam-overlap));
    cursor: pointer;
    isolation: isolate;
    pointer-events: auto;
    user-select: none;
}

.panel-title:focus-visible {
    outline: 2px solid var(--folder-dark);
    outline-offset: 4px;
}

.panel-title h1 {
    font-family: "Dymo", "DM Mono", monospace;
    color: var(--bg);
    font-size: 32px;
    font-weight: 200;
    letter-spacing: 0;
    text-shadow: none;
    transform: rotate(var(--title-tilt, -1deg));
}

.panel-title::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    border: 1px solid rgba(80, 69, 53, 0.18);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: var(--paper) url("../assets/paper-texture.png") center / cover;
    box-shadow:
        0 -5px 11px -2px rgba(55, 35, 16, 0.08),
        9px -3px 14px -6px rgba(55, 35, 16, 0.13);
    content: "";
    transform: perspective(80px) rotateX(7deg);
    transform-origin: bottom;
}

.panel-content {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(80, 69, 53, 0.18);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 0;
    background: var(--paper) url("../assets/paper-texture.png") center / cover;
    box-shadow: 0 12px 22px rgba(84, 55, 27, 0.13);
    color: var(--ink);
    pointer-events: auto;
}

.panel-content::before,
.panel-content::after {
    position: absolute;
    display: none;
    z-index: 2;
    content: "";
    pointer-events: none;
}

.panel-content::before {
    inset: 10% 0 auto;
    height: 1px;
    background: rgba(111, 72, 34, 0.26);
    box-shadow: 0 1px rgba(255, 237, 190, 0.28);
    transform: rotate(-0.25deg);
}

.panel-content::after {
    inset: 0 auto 0 6%;
    width: 1px;
    background: linear-gradient(transparent, rgba(111, 72, 34, 0.18) 24%, transparent 94%);
    box-shadow: 1px 0 rgba(255, 237, 190, 0.22);
    transform: rotate(0.4deg);
}

.paper-sheet {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    align-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 0;
    background: var(--paper) url("../assets/paper-texture.png") center / cover;
    box-shadow: none;
    transform: rotate(var(--paper-angle, -0.18deg));
}

.sheet-file-meta,
.cover-meta {
    position: absolute;
    z-index: 3;
    display: flex;
    color: var(--muted);
    font-family: "DM Mono", monospace;
    font-size: 9px;
    letter-spacing: 0.13em;
    line-height: 1.4;
    text-transform: uppercase;
}

.sheet-file-meta {
    top: 16px;
    left: 10%;
    gap: 18px;
}

.file-stamp,
.cover-stamp {
    position: absolute;
    z-index: 3;
    color: rgba(162, 69, 56, 0.56);
    border: 1px solid rgba(162, 69, 56, 0.46);
    font-family: "DM Mono", monospace;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-align: center;
    text-transform: uppercase;
}

.file-stamp {
    top: 15px;
    right: 4%;
    padding: 4px 7px;
    font-size: 8px;
    transform: rotate(5deg);
}

#film {
    --paper-angle: -0.18deg;
    --title-tilt: -1.4deg;
    margin-top: calc(var(--folder-front-delay) - var(--panel-height) - var(--folder-back-hold));
}

#photo {
    --panel-tab-left: 33%;
    --panel-align: center;
    --paper-angle: 0.16deg;
    --title-tilt: 1.1deg;
}

#about {
    --panel-tab-left: 66%;
    --panel-align: flex-end;
    --paper-angle: -0.12deg;
    --title-tilt: -0.8deg;
}

#about .paper-sheet {
    justify-content: flex-end;
    padding: clamp(28px, 6vw, 76px);
}

.about-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    align-items: center;
    gap: clamp(24px, 4vw, 64px);
    width: 100%;
}

.about-video {
    display: block;
    width: 100%;
    max-height: calc(var(--panel-height) - 170px);
    object-fit: cover;
}

.about-copy {
    width: min(680px, 100%);
    color: var(--ink);
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: clamp(18px, 2.25vw, 34px);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 1.02;
    text-align: left;
}

.about-copy p + p {
    margin-top: 0.85em;
}

.contact-section {
    position: sticky;
    top: calc(var(--nav-height) + var(--panel-tab-height));
    z-index: 3;
    display: flex;
    align-items: stretch;
    width: var(--folder-width);
    height: calc(var(--panel-height) - var(--panel-tab-height));
    margin: 100vh auto 0;
    border: 1px solid rgba(99, 64, 30, 0.45);
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--folder) var(--folder-texture) center / cover;
    box-shadow: 0 16px 26px rgba(84, 55, 27, 0.16);
    color: var(--ink);
}

.contact-inner {
    display: flex;
    width: 100%;
    padding: 0;
}

.contact-paper {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: clamp(24px, 8vw, 96px);
    width: 100%;
    min-height: 100%;
    padding: clamp(28px, 6vw, 76px);
    background: transparent;
}

.cover-meta {
    top: clamp(25px, 4vw, 48px);
    left: clamp(28px, 6vw, 76px);
    gap: 20px;
    color: rgba(78, 54, 24, 0.68);
}

.contact-section h2 {
    margin: 0;
    font-family: "Space Grotesk", Arial, sans-serif;
    font-size: clamp(52px, 13vw, 154px);
    font-weight: 700;
    letter-spacing: -0.1em;
    line-height: 0.74;
}

.contact-section h2 em {
    color: rgba(119, 63, 47, 0.88);
    font-family: "Libre Baskerville", serif;
    font-size: 0.7em;
    font-weight: 400;
    letter-spacing: -0.12em;
}

.contact-links {
    display: grid;
    gap: 12px;
    justify-items: end;
    font-family: "DM Mono", monospace;
    font-size: clamp(16px, 2vw, 28px);
}

.cover-stamp {
    right: clamp(28px, 6vw, 76px);
    bottom: clamp(38px, 6vw, 72px);
    padding: 7px 11px;
    font-size: 10px;
    transform: rotate(-7deg);
}

.cover-note {
    position: absolute;
    right: clamp(28px, 6vw, 76px);
    bottom: clamp(102px, 14vw, 148px);
    color: rgba(78, 54, 24, 0.66);
    font-family: "Libre Baskerville", serif;
    font-size: clamp(11px, 1.5vw, 15px);
    font-style: italic;
    line-height: 1.5;
    text-align: right;
}

.crease {
    position: absolute;
    display: block;
    height: 1px;
    background: rgba(93, 63, 30, 0.18);
    transform-origin: left;
}

.crease-one {
    top: 28%;
    left: 8%;
    width: 41%;
    transform: rotate(-3deg);
}

.crease-two {
    top: 43%;
    right: 12%;
    width: 28%;
    transform: rotate(5deg);
}

.crease-three {
    bottom: 20%;
    left: 19%;
    width: 32%;
    transform: rotate(2deg);
}

.contact-links a:hover {
    text-decoration: underline;
}

.carousel {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    height: 82%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel img,
.carousel video {
    display: block;
    flex: 0 0 80%;
    width: 80%;
    min-width: 0;
    max-width: 80%;
    height: 100%;
    background: var(--ink);
    cursor: pointer;
    object-fit: cover;
    scroll-snap-align: center;
    transform: translateZ(0);
}

.carousel img:focus-visible,
.carousel video:focus-visible {
    outline: 3px solid var(--red);
    outline-offset: -3px;
}

@media (max-width: 768px) {
    :root {
        --folder-width: 100vw;
        --folder-back-hold: 551vh;
        --nav-height: 180px;
        --panel-height: calc(100vh - var(--nav-height));
        --panel-tab-height: 42px;
        --horse-width: clamp(132px, 40vw, 220px);
    }

    h1 {
        font-size: 13px;
    }

    .brand-lettering {
        width: min(80vw, 360px);
    }

    .landing-brand-link {
        width: min(84vw, 420px);
    }

    .landing-brand {
        max-height: 34vh;
    }

    main::after {
        display: block;
        height: var(--panel-height);
        content: "";
    }

    .logo-link {
        margin-top: 54px;
    }

    .logo {
        height: 82px;
        translate: 0 -10px;
    }

    .horse-crossing {
        top: calc(var(--nav-height) - 132px);
        animation-duration: 4.2s;
    }

    .folder-back-surface,
    .folder-back-surface.is-fixed {
        top: calc(var(--nav-height) - var(--panel-tab-height) + var(--panel-seam-overlap));
    }

    .panel {
        top: calc(var(--nav-height) - var(--panel-tab-height) + var(--panel-seam-overlap));
    }

    .folder-back-surface,
    .panel-content,
    .contact-section {
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .contact-section {
        top: var(--nav-height);
        height: var(--panel-height);
    }

    .panel-content {
        padding: 12px 0;
    }

    .contact-inner {
        padding: 12px 12px 0;
    }

    #about .paper-sheet {
        padding: 38px 24px 24px;
    }

    .about-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .about-video {
        aspect-ratio: 1;
        max-height: none;
        object-fit: cover;
    }

    .about-copy {
        font-size: clamp(16px, 4.8vw, 24px);
    }

    .carousel {
        gap: 12px;
        height: 86%;
    }

    .carousel img,
    .carousel video {
        flex-basis: 88%;
        width: 88%;
        max-width: 88%;
    }

    .sheet-file-meta {
        top: 12px;
        left: 11%;
        gap: 10px;
        font-size: 7px;
    }

    .file-stamp {
        top: 11px;
        right: 5%;
        padding: 3px 5px;
        font-size: 6px;
    }

    .cover-meta {
        top: 22px;
        left: 24px;
        display: grid;
        gap: 2px;
        font-size: 7px;
    }

    .cover-stamp {
        right: 24px;
        bottom: 32px;
        font-size: 8px;
    }

    .cover-note {
        right: 24px;
        bottom: 102px;
    }
}
