/*
Theme Name: SpatioTemporal Primary
Theme URI: https://spatiotemporal.ai/
Author: SpatioTemporal
Description: Publishing-capable primary theme for SpatioTemporal Motion Intelligence.
Version: 0.1.42
Requires at least: 6.5
Requires PHP: 8.2
Text Domain: spatiotemporal-primary
*/

:root {
    --site-edge: clamp(1.5rem, 4vw, 4rem);
    --site-gutter: var(--site-edge);
    --header-top: var(--site-edge);
    --header-height: 2.75rem;
    --content-fade-midpoint: calc(var(--header-top) + (var(--header-height) / 2));
    --content-fade-end: calc(var(--header-top) + var(--header-height) + clamp(1rem, 2.5vh, 2rem));
    --content-anchor-offset: calc(var(--content-fade-end) + 1.5rem);
    --measure: 62rem;
    --wide: 76rem;
    --white: rgba(255, 255, 255, 0.96);
    --soft-white: rgba(255, 255, 255, 0.78);
    --quiet-white: rgba(255, 255, 255, 0.58);
}

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

html, body { margin: 0; min-height: 100%; }

html { scroll-behavior: smooth; }

body, button, input, textarea, select {
    font-family: "greycliff-cf", "roboto-sans", system-ui, sans-serif;
    font-weight: 200;
}

body {
    min-width: 20rem;
    overflow: hidden;
    color: var(--soft-white);
    background-color: #84382f;
    background-image: url("assets/images/syke.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-underline-offset: 0.2em; }
img { max-width: 100%; height: auto; }

:where(a, button, input, textarea, select):focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 0.35rem;
    scroll-margin-top: var(--content-anchor-offset);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus {
    z-index: 10000;
    top: 0.75rem;
    left: 0.75rem;
    width: auto;
    height: auto;
    clip: auto;
    padding: 0.75rem 1rem;
    color: #7d302b;
    background: #fff;
}

.site-header {
    position: fixed;
    z-index: 100;
    top: var(--header-top);
    right: var(--site-gutter);
    left: var(--site-gutter);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    pointer-events: none;
}

.site-brand,
.site-navigation,
.menu-toggle { pointer-events: auto; }

.site-brand { display: block; width: clamp(11rem, 18vw, 16.5rem); }
.site-brand img { display: block; width: 100%; }

.site-navigation ul {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(1rem, 2.2vw, 2.25rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-navigation a,
.menu-toggle {
    border: 0;
    padding: 0.25rem 0;
    color: rgba(255,255,255,0.78);
    background: transparent;
    font-family: "greycliff-cf", "roboto-sans", system-ui, sans-serif;
    font-weight: 200;
    font-size: clamp(0.7rem, 0.85vw, 0.82rem);
    line-height: 1.2;
    letter-spacing: 0.075em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 0 0.15rem 1rem rgba(48, 8, 5, 0.26);
}

.site-navigation a:hover,
.site-navigation a:focus-visible { color: #fff; }

.site-navigation .current-menu-item > a,
.site-navigation .current_page_item > a,
.site-navigation .current-menu-ancestor > a,
.site-navigation .current-post-ancestor > a,
.site-navigation .current-category-ancestor > a {
    color: #fff;
    font-weight: 700;
}

.menu-toggle { display: none; cursor: pointer; }

.site-scroll {
    position: fixed;
    inset: 0;
    z-index: 1;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-padding-top: var(--content-anchor-offset);
}

@supports ((mask-image: linear-gradient(#000, #000)) or (-webkit-mask-image: linear-gradient(#000, #000))) {
    .site-scroll {
        -webkit-mask-image: linear-gradient(to bottom,
            transparent 0,
            rgba(0, 0, 0, 0.38) var(--content-fade-midpoint),
            #000 var(--content-fade-end),
            #000 100%);
        mask-image: linear-gradient(to bottom,
            transparent 0,
            rgba(0, 0, 0, 0.38) var(--content-fade-midpoint),
            #000 var(--content-fade-end),
            #000 100%);
    }
}

.site-main {
    position: relative;
    z-index: 2;
    width: min(100%, var(--wide));
    min-height: 100svh;
    margin: 0 auto;
    padding: var(--content-anchor-offset) var(--site-gutter) clamp(6rem, 14vh, 11rem);
}

.site-main--landing { display: grid; align-items: end; }
.site-main--tokens { width: 100%; padding: 0; }

.projection-layer {
    position: fixed;
    z-index: 0;
    inset: auto 0 0;
    height: 28vh;
    overflow: hidden;
    opacity: 1;
    pointer-events: none;
    contain: strict;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.18) 24%, #000 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.18) 24%, #000 100%);
}

.projection-plane {
    position: absolute;
    inset: 0;
    transform: perspective(103vh) rotateX(-58deg);
    transform-origin: center bottom;
    transform-style: preserve-3d;
}

.projection-copy {
    position: absolute;
    margin: 0;
    color: #000 !important;
    opacity: 0.6;
    filter: blur(10px);
    will-change: top;
}

.projection-copy,
.projection-copy * {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    border-color: #000 !important;
    text-shadow: none !important;
}

.projection-copy img {
    opacity: 1;
    filter: grayscale(1) brightness(0);
}

.page-intro { max-width: 58rem; margin: min(14vh, 9rem) 0 5rem; }
.page-intro--compact { margin-bottom: clamp(3rem, 7vh, 6rem); }
.archive .page-intro--compact {
    width: min(100%, 62rem);
    max-width: none;
    margin: clamp(1.5rem, 4vh, 3rem) auto clamp(1.75rem, 4vh, 3rem);
    text-align: center;
}
.archive .page-intro--compact h1 {
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    line-height: 1.08;
}

.eyebrow,
.entry-meta,
.archive-item__meta {
    margin: 0 0 1rem;
    color: var(--quiet-white);
    font-size: 0.73rem;
    line-height: 1.4;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.eyebrow,
.motion-codebook__label {
    font-family: "greycliff-cf", "roboto-sans", system-ui, sans-serif;
    font-weight: 700;
}

h1, h2, h3, h4 {
    font-family: "greycliff-cf", "roboto-sans", system-ui, sans-serif;
    color: var(--white);
    font-weight: 700;
    letter-spacing: -0.025em;
}

h1 { margin: 0; font-size: clamp(3.2rem, 9vw, 8.5rem); line-height: 0.88; }
.page-intro p { max-width: 42rem; font-size: clamp(1.15rem, 2.1vw, 1.7rem); line-height: 1.35; }

.entry-content { width: min(100%, var(--measure)); font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.7; }
.entry-content a { text-decoration: none; }
.entry-content strong,
.entry-content b { font-weight: 700; }
.entry-content > * { margin-top: 0; margin-bottom: 1.65rem; }
.entry-content h2 { margin-top: 5rem; font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: 0.98; scroll-margin-top: var(--content-anchor-offset); }
.entry-content h3 { margin-top: 3.75rem; font-size: clamp(1.6rem, 3vw, 2.7rem); line-height: 1.05; scroll-margin-top: var(--content-anchor-offset); }
.entry-content h4 { margin-top: 3rem; font-size: 1.25rem; }
.entry-content p, .entry-content li { color: var(--soft-white); }
.entry-content ul, .entry-content ol { padding-left: 1.2em; }
.entry-content blockquote {
    margin: 1.65rem 0;
    padding-left: clamp(1.25rem, 2.5vw, 2rem);
    border-left: 2px solid rgba(255, 255, 255, 0.58);
    color: #fff;
    font-size: 1.2em;
    line-height: 1.45;
}
.entry-content blockquote p { color: inherit; }
.entry-content figure { margin: 3.5rem 0; }
.entry-content figcaption {
    width: min(100%, 48rem);
    margin: 0.7rem auto 0;
    color: var(--quiet-white);
    font-size: 0.82rem;
    line-height: 1.5;
    text-align: center;
}
.entry-content pre { max-width: 100%; overflow-x: auto; padding: 1.25rem; background: rgba(45, 7, 5, 0.22); }
.entry-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 0.75rem; text-align: left; }

.article-header { width: min(100%, var(--measure)); margin: min(12vh, 8rem) auto 4.5rem; }
.article-header h1 { font-size: clamp(3rem, 7vw, 6.5rem); }
.single-post .entry-content { margin-right: auto; margin-left: auto; }
.article-footer { width: min(100%, var(--measure)); margin: 6rem auto 0; color: var(--quiet-white); font-size: 0.9rem; }
.article-footer a { color: var(--soft-white); }

.archive-list { width: min(100%, 62rem); margin: 0 auto; }
.archive-item { margin: 0; border-top: 1px solid rgba(255, 255, 255, 0.18); }
.archive-item:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.archive-item a {
    display: block;
    padding: clamp(2.25rem, 5vh, 4rem) 0;
    text-align: center;
    text-decoration: none;
}
.archive-item h2 { margin: 0 0 0.8rem; font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.08; }
.archive-item__excerpt { width: min(100%, 50rem); margin: 0 auto; line-height: 1.55; }
.archive-item__image { width: min(60%, 42rem); margin: 0 auto 1.5rem; }
.archive-item__image img { display: block; width: 100%; }
.archive-item a:hover h2,
.archive-item a:focus-visible h2 { color: #fff; }

.pagination .nav-links { display: flex; gap: 1.5rem; margin-top: 5rem; }

.motion-codebook { position: relative; width: 100%; min-height: 100svh; }
.motion-codebook canvas { position: absolute; inset: 0; display: block; }
.motion-codebook__main-canvas {
    z-index: 1;
    filter: drop-shadow(0 1.25rem 1.875rem rgba(0,0,0,.4));
}
.motion-codebook__shadow-canvas {
    z-index: 0;
    opacity: .2;
    pointer-events: none;
    transform: perspective(70rem) rotateX(-34deg) scaleY(.78);
    transform-origin: center bottom;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 52%, rgba(0,0,0,.18) 63%, #000 76%, #000 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, transparent 52%, rgba(0,0,0,.18) 63%, #000 76%, #000 100%);
}
.motion-codebook__status { position: fixed; inset: 50% auto auto 50%; transform: translate(-50%,-50%); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.motion-codebook__info { position: fixed; z-index: 90; top: calc(var(--header-top) + var(--header-height) + 0.35rem); left: 50%; width: min(90vw, 48rem); transform: translateX(-50%); text-align: center; pointer-events: none; text-shadow: 0 .125rem 1rem rgba(0,0,0,.75); }
.motion-codebook__label { font-size: clamp(1.15rem, 2.2vw, 1.9rem); }
.motion-codebook__label-light { font-weight: 200; }
.motion-codebook__label-heavy { font-weight: 700; }
.motion-codebook__id { margin-top: .3rem; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; opacity: .72; }
.motion-codebook__statement {
    position: fixed;
    z-index: 90;
    right: var(--site-gutter);
    bottom: max(var(--site-gutter), env(safe-area-inset-bottom));
    left: var(--site-gutter);
    font-size: clamp(1.15rem, 2.2vw, 1.9rem);
    line-height: 1.05;
    text-align: center;
    pointer-events: none;
    text-shadow: 0 .125rem 1rem rgba(0,0,0,.75);
}
.motion-codebook__statement-light,
.motion-codebook__statement-heavy { display: block; }
.motion-codebook__statement-light { font-weight: 200; }
.motion-codebook__statement-heavy { font-weight: 700; }

@media (max-width: 56rem) {
    :root {
        --header-height: 2.25rem;
        --content-fade-midpoint: calc(var(--header-top) + (var(--header-height) / 2));
        --content-fade-end: calc(var(--header-top) + var(--header-height) + 1rem);
        --content-anchor-offset: calc(var(--content-fade-end) + 1.25rem);
    }
    .site-brand { width: clamp(9.5rem, 38vw, 13rem); }
    .menu-toggle { display: block; }
    .site-navigation .menu {
        position: absolute;
        top: calc(var(--header-height) + 1rem);
        right: 0;
        display: none;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.65rem;
    }
    .site-navigation.is-open .menu { display: flex; }
    .site-navigation a { font-size: 0.8rem; }
    .archive-item__image { width: min(86%, 28rem); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .projection-layer { display: none; }
}

@media print {
    body { overflow: visible; color: #111; background: #fff; }
    .site-header, .projection-layer { display: none; }
    .site-scroll { position: static; overflow: visible; -webkit-mask-image: none; mask-image: none; }
    .site-main { padding: 2rem; }
    h1, h2, h3, h4, .entry-content p, .entry-content li { color: #111; }
}
