/* ==========================================================================
   Portfolio theme – deep green / sand beige, cinematic & industrial
   ========================================================================== */

@font-face { font-family: "Syncopate"; src: url("../fonts/syncopate-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Syncopate"; src: url("../fonts/syncopate-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Marcellus"; src: url("../fonts/marcellus-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
    --c-ink: #0c1511;
    --c-ink-2: #13221b;
    --c-green: #1f3a2c;
    --c-green-2: #2d5240;
    --c-sand: #c4ad84;
    --c-sand-2: #e6d9bd;
    --c-sand-3: #a8936c;
    --c-paper: #ece4d2;
    --c-muted: rgb(236 228 210 / 0.68);

    --f-label: "Syncopate", "Arial Black", sans-serif;
    --f-display: "Marcellus", "Times New Roman", serif;
    --f-body: "Manrope", system-ui, sans-serif;

    --gutter: clamp(1rem, 4vw, 3.5rem);
    --header-h: 4.5rem;
    --radius: 2px;
    --cut: .7rem; /* bevelled corners of buttons (top left + bottom right) */
    --ease: cubic-bezier(.22, .8, .2, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--c-ink);
    color: var(--c-paper);
    font: 400 1rem/1.65 var(--f-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

/* Film grain over everything */
body::after {
    content: "";
    position: fixed;
    inset: -50%;
    z-index: 100;
    pointer-events: none;
    opacity: .07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-3%, 2%); }
    50% { transform: translate(2%, -3%); }
    75% { transform: translate(-1%, 3%); }
    100% { transform: translate(3%, -1%); }
}

img, video, canvas { display: block; max-width: 100%; }
figure { margin: 0; }
a { color: inherit; }
::selection { background: var(--c-sand); color: var(--c-ink); }

:focus-visible {
    outline: 2px solid var(--c-sand);
    outline-offset: 3px;
}

.visually-hidden, .invisible {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: fixed;
    top: .75rem; left: .75rem;
    z-index: 200;
    padding: .75rem 1rem;
    background: var(--c-sand);
    color: var(--c-ink);
    font: 700 .7rem/1 var(--f-label);
    text-transform: uppercase;
    transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* --------------------------------------------------------------------------
   Header & navigation
   -------------------------------------------------------------------------- */

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    height: var(--header-h);
    padding-inline: var(--gutter);
    color: var(--c-paper);
    transition: background-color .4s var(--ease), color .4s var(--ease), backdrop-filter .4s;
}

.site-header.is-scrolled {
    background: rgb(12 21 17 / .72);
    backdrop-filter: blur(10px);
}

.site-header.is-light {
    color: var(--c-ink);
    background: rgb(196 173 132 / .72);
}

.site-logo {
    font: 700 clamp(1rem, 2.2vw, 1.6rem)/1 var(--f-label);
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}

.module-onepage-navigation { display: contents; }

.onepage-nav {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.75rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.onepage-nav a {
    position: relative;
    font: 400 .72rem/1 var(--f-label);
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
    padding-block: .5rem;
}

.onepage-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .5s var(--ease);
}

.onepage-nav a:hover::after,
.onepage-nav a[aria-current="true"]::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Last item = call to action button */
.onepage-nav li:last-child a {
    padding: .95rem 1.4rem;
    clip-path: var(--bevel);
    background: var(--c-sand);
    color: var(--c-ink);
    font-weight: 700;
    transition: background-color .3s;
}
.onepage-nav li:last-child a::after { display: none; }
.onepage-nav li:last-child a:hover { background: var(--c-sand-2); }
.is-light .onepage-nav li:last-child a { background: var(--c-ink); color: var(--c-sand-2); }

.nav-toggle {
    display: none;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0;
    border: 0;
    background: none;
    color: inherit;
    font: 400 .72rem/1 var(--f-label);
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
}

.nav-toggle__icon,
.nav-toggle__icon::before {
    display: block;
    width: 1.6rem;
    height: 1px;
    background: currentColor;
    transition: transform .4s var(--ease);
}
.nav-toggle__icon { position: relative; }
.nav-toggle__icon::before { content: ""; position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before { transform: translateY(-6px) rotate(-90deg); }

@media (max-width: 767px) {
    .nav-toggle { display: inline-flex; position: relative; z-index: 2; }

    .onepage-nav {
        position: fixed;
        inset: 0;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 1.75rem;
        padding: var(--gutter);
        background: var(--c-ink);
        color: var(--c-paper);
        clip-path: inset(0 0 100% 0);
        visibility: hidden;
        transition: clip-path .7s var(--ease), visibility 0s .7s;
    }

    .onepage-nav.is-open {
        clip-path: inset(0);
        visibility: visible;
        transition: clip-path .7s var(--ease);
    }

    .onepage-nav a { font-size: 1.6rem; font-weight: 700; }
    .onepage-nav li:last-child a { font-size: 1rem; }
    .nav-open .site-header { color: var(--c-paper); background: transparent; backdrop-filter: none; }
}

/* --------------------------------------------------------------------------
   Articles / sections
   -------------------------------------------------------------------------- */

.mod_article { position: relative; }

.section-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 0 2rem;
    font: 400 .7rem/1 var(--f-label);
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--c-sand);
}
.section-label::before {
    content: "";
    width: 3rem;
    height: 1px;
    background: currentColor;
}

.mod_article > h2.content-headline,
.section--legal > h1.content-headline,
.section-title {
    margin: 0 0 clamp(2rem, 5vw, 4rem);
    font: 400 clamp(2.4rem, 7vw, 6.5rem)/.95 var(--f-display);
    text-transform: uppercase;
    letter-spacing: -.01em;
}

/* Automatic section numbering: "01 — ME" */
main { counter-reset: section; }
.section--pad, .section--projects { counter-increment: section; }

.section--pad > h2.content-headline::before,
.project-slider__title::before {
    content: "0" counter(section) " /";
    display: block;
    margin-bottom: 1.25rem;
    font: 400 .7rem/1 var(--f-label);
    letter-spacing: .2em;
    color: var(--c-sand);
}
.section--sand h2.content-headline::before,
.section--sand .project-slider__title::before { color: var(--c-green); }

.rte p { margin: 0 0 1em; }
.rte p:last-child { margin-bottom: 0; }

/* Sand sections (ME, PROJECTS) */
.section--sand {
    background: var(--c-sand);
    color: var(--c-ink);
}
.section--sand .section-label { color: var(--c-green); }

.section--pad {
    padding: clamp(6rem, 14vw, 11rem) var(--gutter);
}

.section--pad > * {
    max-width: 82rem;
    margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Hero video (scroll scrubbed)
   -------------------------------------------------------------------------- */

.content-hero-video {
    position: relative;
    height: 320vh;
    background: var(--c-ink);
}

.hero__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

.hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(calc(1.15 - var(--p, 0) * .15));
    filter: saturate(.85) contrast(1.08);
}

.hero__shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 40%, transparent 0 35%, rgb(12 21 17 / .75) 100%),
        linear-gradient(to bottom, rgb(12 21 17 / .55), transparent 30%, transparent 60%, var(--c-ink));
}

.hero__content {
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    bottom: clamp(5rem, 14vh, 9rem);
    opacity: calc(1 - var(--p, 0) * 2.2);
    transform: translateY(calc(var(--p, 0) * -18vh));
}

.hero__title {
    margin: 0;
    max-width: 14ch;
    font: 400 clamp(2.8rem, 9.5vw, 9.5rem)/.9 var(--f-display);
    text-transform: uppercase;
    letter-spacing: -.02em;
    color: var(--c-paper);
}

.hero__text {
    max-width: 34rem;
    margin-top: 1.75rem;
    font: 400 .75rem/1.9 var(--f-label);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--c-sand-2);
}

.hero__progress {
    position: absolute;
    right: var(--gutter);
    bottom: 2rem;
    width: min(30vw, 14rem);
    height: 1px;
    background: rgb(236 228 210 / .25);
}
.hero__progress span {
    display: block;
    height: 100%;
    background: var(--c-sand);
    transform: scaleX(var(--p, 0));
    transform-origin: left;
}

.hero__hint {
    position: absolute;
    left: var(--gutter);
    bottom: 1.5rem;
    margin: 0;
    font: 400 .65rem/1 var(--f-label);
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--c-muted);
    opacity: calc(1 - var(--p, 0) * 6);
}
.hero__hint::after {
    content: "";
    display: inline-block;
    width: 1px;
    height: 2.2rem;
    margin-left: 1rem;
    vertical-align: middle;
    background: currentColor;
    animation: hint 2s var(--ease) infinite;
    transform-origin: top;
}
@keyframes hint {
    0% { transform: scaleY(0); }
    50% { transform: scaleY(1); transform-origin: top; }
    51% { transform-origin: bottom; }
    100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Pixel glitch canvas (like scan lines in the reference) */
.glitch {
    position: absolute;
    pointer-events: none;
}
.glitch--hero {
    left: 0; right: 0;
    bottom: 0;
    width: 100%;
    height: 22%;
    opacity: .5;
}

/* --------------------------------------------------------------------------
   ME + timeline
   -------------------------------------------------------------------------- */

.me-intro {
    display: grid;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: start;
    margin-bottom: clamp(4rem, 10vw, 8rem);
}

.me-intro .content-text {
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    line-height: 1.5;
}

.me-intro .content-image img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    filter: grayscale(.25) contrast(1.05);
}

@media (min-width: 900px) {
    .me-intro { grid-template-columns: 5fr 7fr; }
}

/* Portrait: double exposure + shifted strips (layers built by JS) */
.portrait-fx {
    position: relative;
}

.portrait-fx.is-active > img { visibility: hidden; }

.portrait-fx__layers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.me-intro .portrait-fx__layers img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    will-change: transform;
}

.me-intro .portrait-fx__ghost {
    opacity: .35;
}
.me-intro .portrait-fx__ghost--sand {
    filter: grayscale(1) sepia(.7) brightness(1.15);
    mix-blend-mode: screen;
}
.me-intro .portrait-fx__ghost--green {
    filter: grayscale(1) sepia(1) hue-rotate(85deg) saturate(1.6) brightness(.55);
    mix-blend-mode: multiply;
}

.content-timeline {
    position: relative;
}

.content-timeline > h2,
.content-timeline > h3 {
    margin: 0 0 3rem;
    font: 700 .8rem/1 var(--f-label);
    letter-spacing: .2em;
    text-transform: uppercase;
}

.timeline__line {
    position: absolute;
    top: 4.5rem;
    bottom: 0;
    left: .5rem;
    width: 1px;
    background: rgb(12 21 17 / .2);
}
.timeline__line span {
    display: block;
    height: 100%;
    background: var(--c-ink);
    transform: scaleY(var(--tp, 0));
    transform-origin: top;
}

.timeline__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline__item {
    position: relative;
    display: grid;
    gap: .5rem 3rem;
    padding: 0 0 clamp(2.5rem, 6vw, 4.5rem) 2.75rem;
}

/* Marker: diagonal stroke from bottom left to top right, centred on the line */
.timeline__dot {
    position: absolute;
    left: calc(.5rem + .5px - .7rem);
    top: .175rem;
    width: 1.4rem;
    height: 1.4rem;
}
.timeline__dot::before {
    content: "";
    position: absolute;
    top: 0;
    left: calc(50% - 1.25px);
    width: 2.5px;
    height: 100%;
    background: rgb(12 21 17 / .35);
    transform: rotate(45deg);
    transition: background-color .5s var(--ease);
}
.timeline__item.is-active .timeline__dot::before { background: var(--c-ink); }
.timeline__item.is-current .timeline__dot { animation: star-pulse 1.6s ease-in-out infinite; }
.reduced-motion .timeline__dot { animation: none; }

.timeline__period {
    margin: 0;
    font: 700 .78rem/1.6 var(--f-label);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--c-green);
}

.timeline__title {
    margin: 0 0 .75rem;
    font: 400 clamp(1.6rem, 3.4vw, 2.6rem)/1.05 var(--f-display);
    text-transform: uppercase;
}

.timeline__body .rte { max-width: 40rem; color: rgb(12 21 17 / .8); }

@media (min-width: 900px) {
    .timeline__line { left: calc(16rem + .5rem); }
    .timeline__item {
        grid-template-columns: 16rem 1fr;
        padding-left: 0;
    }
    .timeline__item .timeline__dot { left: calc(16.5rem + .5px - .7rem); }
    .timeline__period { padding-right: 2rem; text-align: right; }
    .timeline__body { padding-left: 3rem; }
}

/* --------------------------------------------------------------------------
   Skills
   -------------------------------------------------------------------------- */

.section--skills {
    background: var(--c-ink);
    background-image: radial-gradient(ellipse at 80% 0%, rgb(45 82 64 / .45), transparent 60%);
}

.skills-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 700px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1400px) { .skills-grid { grid-template-columns: repeat(4, 1fr); } }

/* Bevelled tiles, like the buttons but with a larger cut */
.skills-grid .content-text {
    --cut: 1.5rem;
    --edge: rgb(196 173 132 / .25);
    padding: clamp(1.75rem, 4vw, 3rem);
    border: 1px solid var(--edge);
    /* Spelled out: --bevel is resolved on :root with the smaller button cut */
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    background:
        linear-gradient(to bottom right, transparent calc(50% - .75px), var(--edge) 0 calc(50% + .75px), transparent 0) top left / var(--cut) var(--cut) no-repeat border-box,
        linear-gradient(to bottom right, transparent calc(50% - .75px), var(--edge) 0 calc(50% + .75px), transparent 0) bottom right / var(--cut) var(--cut) no-repeat border-box,
        var(--c-ink);
    transition: background-color .5s var(--ease);
}
.skills-grid .content-text:hover { background-color: var(--c-ink-2); }

/* 3D tilt towards the pointer (angles set by JS); must outrank the reveal styles */
.js .skills-grid .content-text.is-visible {
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: opacity 1s var(--ease), background-color .5s var(--ease), transform .6s var(--ease);
}
.js .skills-grid .content-text.is-visible.is-tilting {
    transition: opacity 1s var(--ease), background-color .5s var(--ease), transform .12s linear;
}

.skills-grid .content-text h3 {
    margin: 0 0 1.75rem;
    font: 400 clamp(1.5rem, 2.6vw, 2.1rem)/1.05 var(--f-display);
    text-transform: uppercase;
    color: var(--c-sand-2);
}

.skills-grid ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.skills-grid li {
    padding: .8rem 0;
    border-top: 1px solid rgb(196 173 132 / .25);
    font: 400 .7rem/1.5 var(--f-label);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--c-muted);
}

/* --------------------------------------------------------------------------
   Projects – diagonal scroll track
   -------------------------------------------------------------------------- */

.section--projects { background: var(--c-sand); color: var(--c-ink); }

.content-project-slider {
    position: relative;
    /* height is set by JS according to the number of tiles */
    height: calc(var(--slides, 4) * 85vh + 100vh);
}

.project-slider__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

.project-slider__title {
    position: absolute;
    top: calc(var(--header-h) + 1.5rem);
    left: var(--gutter);
    z-index: 0;
    margin: 0;
    font: 400 clamp(2.2rem, 6vw, 5.5rem)/.9 var(--f-display);
    text-transform: uppercase;
    pointer-events: none;
}

.project-slider__counter {
    position: absolute;
    right: var(--gutter);
    bottom: 1.75rem;
    z-index: 2;
    margin: 0;
    font: 700 .75rem/1 var(--f-label);
    letter-spacing: .2em;
}

.glitch--projects {
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: .9;
}

.project-slider__track {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    /* Tile shadow lives here, as the tiles' clip-path would cut a box-shadow off */
    filter: drop-shadow(0 30px 40px rgb(12 21 17 / .45));
    will-change: transform;
}

.project-tile {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--tile-w, 40vw);
    aspect-ratio: 4 / 5;
    max-height: 72vh;
    color: var(--c-paper);
    --cut: 2rem;
    background: var(--c-ink-2);
    /* Spelled out: --bevel is resolved on :root with the smaller button cut */
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    transform-origin: 50% 50%;
    will-change: transform;
}

@media (min-width: 900px) {
    .project-tile { aspect-ratio: 5 / 4; }
}

.project-tile__media,
.project-tile__media figure,
.project-tile__media picture {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.project-tile__media { isolation: isolate; }

.project-tile__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08);
    filter: grayscale(1) contrast(1.1);
    transition: transform 1.2s var(--ease), filter .8s var(--ease);
}
.project-tile:hover .project-tile__media img { transform: scale(1.02); }

/* Duotone in theme colours: dark tones turn green, light tones sand.
   Hover or keyboard focus reveals the original screenshot. */
.project-tile__media::before,
.project-tile__media figure::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    transition: opacity .8s var(--ease);
}
.project-tile__media figure::after {
    background: var(--c-sand-2);
    mix-blend-mode: multiply;
}
.project-tile__media::before {
    background: var(--c-green);
    mix-blend-mode: lighten;
}

.project-tile:is(:hover, :focus-within) .project-tile__media img { filter: none; }
.project-tile:is(:hover, :focus-within) .project-tile__media::before,
.project-tile:is(:hover, :focus-within) .project-tile__media figure::after { opacity: 0; }

.project-tile__media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(to top, rgb(12 21 17 / .75), transparent 45%);
}

.project-tile__bar {
    position: absolute;
    left: clamp(1rem, 2.5vw, 1.75rem);
    right: clamp(1rem, 2.5vw, 1.75rem);
    bottom: clamp(1rem, 2.5vw, 1.75rem);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.project-tile__name {
    margin: 0;
    font: 700 clamp(.7rem, 1.1vw, .9rem)/1.3 var(--f-label);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.project-tile__toggle {
    position: relative;
    flex: none;
    width: 3.5rem;
    height: 3.5rem;
    --cut: .7rem; /* do not inherit the larger tile cut */
    --edge: currentColor;
    border: 1px solid currentColor;
    clip-path: var(--bevel);
    /* Diagonal border lines along the cut corners */
    background:
        linear-gradient(to bottom right, transparent calc(50% - .75px), var(--edge) 0 calc(50% + .75px), transparent 0) top left / var(--cut) var(--cut) no-repeat border-box,
        linear-gradient(to bottom right, transparent calc(50% - .75px), var(--edge) 0 calc(50% + .75px), transparent 0) bottom right / var(--cut) var(--cut) no-repeat border-box;
    color: var(--c-paper);
    cursor: pointer;
    transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s;
}

.project-tile__toggle::before,
.project-tile__toggle::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 1rem;
    height: 1px;
    margin: -.5px 0 0 -.5rem;
    background: currentColor;
    transition: transform .4s var(--ease);
}
.project-tile__toggle::after { transform: rotate(90deg); }

.project-tile__toggle:hover::before { transform: rotate(90deg); }
.project-tile__toggle:hover::after { transform: rotate(180deg); }

.project-tile__toggle[aria-expanded="true"] {
    --edge: var(--c-sand);
    background-color: var(--c-sand);
    border-color: var(--c-sand);
    color: var(--c-ink);
}
.project-tile__toggle[aria-expanded="true"]::before { transform: none; }
.project-tile__toggle[aria-expanded="true"]::after { transform: rotate(0deg); }

.project-tile__panel {
    position: absolute;
    inset: clamp(.75rem, 2vw, 1.5rem);
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding-bottom: 4.5rem;
    background: var(--c-ink);
    color: var(--c-paper);
    --cut: 1.25rem;
    /* Closed: all bevel points collapsed onto the bottom edge */
    clip-path: polygon(var(--cut) 100%, 100% 100%, 100% 100%, calc(100% - var(--cut)) 100%, 0 100%, 0 100%);
    transition: clip-path .7s var(--ease);
}
.project-tile__panel[hidden] { display: flex; visibility: hidden; }
.project-tile__panel.is-open {
    clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
    visibility: visible;
}

.project-tile__panel-inner {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    outline: none;
}

.project-tile__meta {
    margin: 0 0 1rem;
    font: 400 .65rem/1 var(--f-label);
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--c-sand);
}

.project-tile__panel-title {
    margin: 0 0 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px double rgb(196 173 132 / .5);
    font: 400 clamp(1.5rem, 2.8vw, 2.6rem)/1 var(--f-display);
    text-transform: uppercase;
}

.project-tile__panel .rte { font-size: .95rem; color: var(--c-muted); }

.project-tile__panel .rte ul {
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}

.project-tile__panel .rte li {
    padding: .85rem 0;
    border-top: 1px solid rgb(196 173 132 / .25);
    font: 400 .68rem/1.5 var(--f-label);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--c-paper);
}

.project-tile__link {
    display: inline-block;
    margin-top: 1.5rem;
    font: 700 .7rem/1 var(--f-label);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--c-sand);
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.section--contact {
    isolation: isolate;
    overflow: hidden;
    background: var(--c-green);
    background-image: linear-gradient(160deg, var(--c-green) 0%, var(--c-ink) 85%);
}

/* Sand glow circling along the edges. The layer is twice the section size with the
   glow in its centre, so translate(x/2, y/2) puts the glow at x/y of the section and
   only the compositor has to move it. */
.section--contact::before {
    content: "";
    position: absolute;
    top: -100%;
    left: -100%;
    z-index: -1;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse 35% 39% at 50% 50%, rgb(196 173 132 / .18), transparent);
    pointer-events: none;
    transform: translate(5%, 50%);
    animation: contact-glow 32s linear infinite;
    will-change: transform;
}

@keyframes contact-glow {
    0%, 100% { transform: translate(5%, 50%); }  /* bottom left */
    30% { transform: translate(50%, 50%); }      /* bottom right */
    50% { transform: translate(50%, 0); }        /* top right */
    80% { transform: translate(0, 0); }          /* top left */
    95% { transform: translate(0, 45%); }        /* down the left edge */
}

.reduced-motion .section--contact::before { animation: none; }

.contact-grid {
    display: grid;
    gap: clamp(2.5rem, 6vw, 6rem);
}

@media (min-width: 900px) {
    .contact-grid { grid-template-columns: 5fr 7fr; }
}

.contact-grid .content-text { color: var(--c-muted); font-size: 1.1rem; }
.contact-grid .content-text a { color: var(--c-sand-2); }

.contact-grid form .widget {
    margin-bottom: 1.75rem;
}

.contact-grid form label {
    display: block;
    margin-bottom: .6rem;
    font: 400 .65rem/1.4 var(--f-label);
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--c-sand);
}

.contact-grid form .mandatory span.mandatory,
.contact-grid form label .mandatory { color: var(--c-sand-2); }

.contact-grid form input.text,
.contact-grid form textarea {
    width: 100%;
    padding: .9rem 0;
    border: 0;
    border-bottom: 1px solid rgb(196 173 132 / .45);
    border-radius: 0;
    background: transparent;
    color: var(--c-paper);
    font: 400 1.1rem/1.5 var(--f-body);
    transition: border-color .3s;
}

.contact-grid form textarea { min-height: 9rem; resize: vertical; }

.contact-grid form input.text:focus,
.contact-grid form textarea:focus {
    outline: none;
    border-bottom-color: var(--c-sand-2);
    box-shadow: 0 1px 0 0 var(--c-sand-2);
}

.contact-grid form .widget-checkbox fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}
.contact-grid form .widget-checkbox legend { display: none; }
.contact-grid form .widget-checkbox label {
    display: inline;
    font: 400 .9rem/1.5 var(--f-body);
    letter-spacing: 0;
    text-transform: none;
    color: var(--c-muted);
}
.contact-grid form input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0 .6rem 0 0;
    vertical-align: -.15rem;
    accent-color: var(--c-sand);
}

.contact-grid form .error,
.contact-grid form p.error {
    margin: .5rem 0 0;
    color: #f0b48a;
    font-size: .85rem;
}

.contact-grid form button.submit {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 2rem;
    border: 0;
    clip-path: var(--bevel);
    background: var(--c-sand);
    color: var(--c-ink);
    font: 700 .72rem/1 var(--f-label);
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .3s, transform .3s var(--ease);
}
.contact-grid form button.submit:hover { background: var(--c-sand-2); transform: translateY(-2px); }

.contact-grid .form-confirmation,
.contact-grid .content-form .confirm,
.contact-grid .content-form .message {
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--c-sand);
    color: var(--c-sand-2);
}

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

.site-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem var(--gutter);
    background: var(--c-ink);
    border-top: 1px solid rgb(196 173 132 / .2);
    font: 400 .65rem/1.4 var(--f-label);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--c-muted);
}
.site-footer p { margin: 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--c-sand); }

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

.js [data-reveal] {
    opacity: 0;
    transform: translateY(2.5rem);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* --------------------------------------------------------------------------
   Reduced motion / no JS fallbacks
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    body::after { animation: none; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Without JS or with reduced motion the projects are a simple stacked list */
html:not(.js) .content-project-slider,
.reduced-motion .content-project-slider { height: auto; }

html:not(.js) .project-slider__sticky,
.reduced-motion .project-slider__sticky {
    position: relative;
    height: auto;
    padding: calc(var(--header-h) + 7rem) var(--gutter) 5rem;
}

html:not(.js) .project-slider__track,
.reduced-motion .project-slider__track {
    position: static;
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
}

html:not(.js) .project-tile,
.reduced-motion .project-tile {
    position: relative;
    width: auto;
    transform: none !important;
}

html:not(.js) .project-slider__counter,
.reduced-motion .project-slider__counter { display: none; }

html:not(.js) .content-hero-video,
.reduced-motion .content-hero-video { height: 100vh; }

/* ALTCHA spam protection widget in theme colours */
.contact-grid altcha-widget {
    --altcha-color-base: transparent;
    --altcha-color-text: var(--c-paper);
    --altcha-color-border: rgb(196 173 132 / .45);
    --altcha-color-border-focus: var(--c-sand-2);
    --altcha-color-footer-bg: transparent;
    --altcha-border-radius: var(--radius);
    --altcha-max-width: 100%;
}

/* Keep logo and toggle above the open mobile menu */
.site-logo { position: relative; z-index: 2; }

/* --------------------------------------------------------------------------
   Cursor: pulsing four-pointed star (enabled by JS on fine pointers only)
   -------------------------------------------------------------------------- */
.has-star-cursor,
.has-star-cursor * { cursor: none !important; }

.has-star-cursor :is(input:not([type="checkbox"], [type="radio"], [type="submit"]), textarea, select) { cursor: text !important; }
.has-star-cursor select { cursor: pointer !important; }

.star-cursor {
    position: fixed;
    top: 0; left: 0;
    z-index: 300;
    width: 0; height: 0;
    pointer-events: none;
    mix-blend-mode: difference;
    opacity: 0;
    transition: opacity .2s;
}
.star-cursor.is-visible { opacity: 1; }
.star-cursor.is-hidden { opacity: 0; }

.star-cursor svg {
    position: absolute;
    left: -11px; top: -11px;
    width: 22px; height: 22px;
    fill: var(--c-sand-2);
    transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}
.star-cursor.is-hover svg { transform: scale(1.7) rotate(45deg); }
.star-cursor.is-down svg { transform: scale(.7); }

.star-cursor svg path {
    transform-origin: 12px 12px;
    animation: star-pulse 1.6s ease-in-out infinite;
}

@keyframes star-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(.6); opacity: .65; }
}

.reduced-motion .star-cursor svg path { animation: none; }

/* Bevelled buttons: the clip-path would cut off an outer focus ring */
:root {
    --bevel: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

:is(.onepage-nav li:last-child a, .project-tile__toggle, .contact-grid form button.submit):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -6px;
}

/* Legal pages (Datenschutz): readable line length and modest sub-headings */
.section--legal .rte > * { max-width: 46rem; }

.section--legal .rte h3 {
    margin: 2.75rem 0 .75rem;
    font: 700 .78rem/1.4 var(--f-label);
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--c-sand);
}

.section--legal .rte small { color: var(--c-muted); }
