/* Theseus homepage. Same layout family as hydratrade.ciyalabs.com, in the warm Ciya Labs palette.
   Colours are tokens: light by default, dark from the system or the toggle. */

:root {
    --bg: #F6F0E7;             /* paper */
    --bg-2: #FBF8F3;
    --ink: #1D1613;
    --ink-2: #5A4D46;
    --ink-3: #8A7D75;
    --rule: #E2D8CC;
    --accent: #B5382B;         /* ember, darkened for text on paper */
    --accent-ink: #FFFFFF;
    --plank: #2B201C;          /* the head's planks */
    --night: #17110F;          /* hero shade, scrolled nav, footer: dark in both themes */
    --on-night: #EDE5DA;
    --art-filter: none;
    --serif: "Newsreader", Georgia, "Times New Roman", serif;
    --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "DejaVu Sans Mono", monospace;

    --space-sm: clamp(1rem, 2vw, 2rem);
    --space-md: clamp(2rem, 5vw, 5rem);
    --space-lg: clamp(4rem, 10vh, 10rem);
    --space-xl: clamp(5rem, 14vh, 13rem);
    --gutter: clamp(1rem, 4vw, 4rem);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0D0A09;
        --bg-2: #17110F;
        --ink: #EDE5DA;
        --ink-2: #A09389;
        --ink-3: #7D7069;
        --rule: #2B201C;
        --accent: #D9473A;
        --accent-ink: #0D0A09;
        --plank: #EDE5DA;
        --night: #0D0A09;
        --art-filter: brightness(0.7) saturate(0.9);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0D0A09;
    --bg-2: #17110F;
    --ink: #EDE5DA;
    --ink-2: #A09389;
    --ink-3: #7D7069;
    --rule: #2B201C;
    --accent: #D9473A;
    --accent-ink: #0D0A09;
    --plank: #EDE5DA;
    --night: #0D0A09;
    --art-filter: brightness(0.7) saturate(0.9);
    color-scheme: dark;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font: 400 17px/1.7 var(--sans);
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
}

img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

a {
    color: var(--accent);
    text-decoration: none;
}

.skip {
    position: absolute;
    left: -9999px;
}

.skip:focus {
    left: 16px;
    top: 12px;
    z-index: 300;
    background: var(--ink);
    color: var(--bg);
    padding: 8px 12px;
}

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

/* the mark: a head built of planks, one of them replaced */
.mark {
    width: 24px;
    height: 24px;
    flex: none;
}

.mark .plank {
    fill: currentColor;
}

.mark .new {
    fill: #D9473A;
}

/* ------------------------------------------------------------ navigation */

.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.4rem var(--gutter);
    color: var(--on-night);
    border-bottom: 1px solid transparent;
    transition: background 0.5s ease, padding 0.4s ease, border-color 0.5s ease;
}

.nav-bar.scrolled {
    background: color-mix(in srgb, var(--night) 80%, transparent);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    backdrop-filter: blur(16px) saturate(1.3);
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font: 600 1.05rem/1 var(--sans);
    letter-spacing: 0.01em;
    color: inherit;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font: 500 0.75rem/1 var(--sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(237, 229, 218, 0.72);
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #fff;
}

.theme {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(237, 229, 218, 0.3);
    border-radius: 50%;
    background: none;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.theme span {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--on-night) 50%, transparent 50%);
    border: 1.5px solid var(--on-night);
}

.theme:hover {
    border-color: rgba(237, 229, 218, 0.7);
}

/* ------------------------------------------------------------ hero (the cover) */

.hero {
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    overflow: hidden;
    background: var(--night);
    color: var(--on-night);
}

.hero-image {
    position: absolute;
    inset: 0;
}

.hero-image img {
    object-position: 72% 50%;
}

.hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    /* the art is light paper: shade the bottom for the title and the top for the nav */
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--night) 62%, transparent) 0%,
            transparent 22%),
        linear-gradient(0deg,
            color-mix(in srgb, var(--night) 88%, transparent) 0%,
            color-mix(in srgb, var(--night) 45%, transparent) 42%,
            color-mix(in srgb, var(--night) 10%, transparent) 100%);
}

/* until the cover art exists: the mark, large and faint, on the dark cover */
.hero--plain .hero-image::before {
    content: "";
    position: absolute;
    right: 8%;
    top: 50%;
    width: min(46vh, 42vw);
    aspect-ratio: 1;
    transform: translateY(-50%);
    background: url("logo-dark.svg") center / contain no-repeat;
    opacity: 0.16;
}

.hero-content {
    position: absolute;
    bottom: clamp(3rem, 9vh, 8rem);
    left: var(--gutter);
    right: var(--gutter);
}

.hero-issue {
    font: 500 0.72rem/1.5 var(--mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 1.4rem;
    opacity: 0.85;
}

.hero-title {
    font: 500 clamp(3.2rem, 9vw, 8rem)/0.95 var(--serif);
    letter-spacing: -0.03em;
}

.hero-dek {
    margin-top: 1.1rem;
    max-width: 24ch;
    font: 400 clamp(1.35rem, 2.8vw, 2.1rem)/1.25 var(--serif);
}

.hero-dek em {
    font-style: italic;
    opacity: 0.85;
}

.hero-scroll {
    position: absolute;
    bottom: clamp(3rem, 9vh, 8rem);
    right: var(--gutter);
    writing-mode: vertical-rl;
    font: 500 0.65rem/1 var(--sans);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: inherit;
    opacity: 0.65;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hero-scroll::before {
    content: "";
    width: 1px;
    height: 60px;
    background: currentColor;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.7; }
}

/* ------------------------------------------------------------ the name, the purpose */

.essay {
    padding: var(--space-xl) var(--gutter);
    background: var(--bg-2);
}

.essay--alt {
    background: var(--bg);
}

.essay-inner {
    max-width: 62ch;
    margin: 0 auto;
}

.essay-label,
.status-label {
    font: 500 0.72rem/1.5 var(--mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.essay-label::after {
    content: "";
    flex: 1;
    max-width: 120px;
    height: 1px;
    background: currentColor;
    opacity: 0.35;
}

.essay-text {
    font: 400 clamp(1.2rem, 2.3vw, 1.55rem)/1.7 var(--serif);
    letter-spacing: -0.005em;
}

.essay-text + .essay-text {
    margin-top: 1.2em;
}

.essay-text--lead::first-letter {
    float: left;
    font-weight: 600;
    font-size: 5.2em;
    line-height: 0.82;
    margin: 0.06em 0.08em 0 0;
    color: var(--accent);
}

.pullquote {
    margin-top: var(--space-md);
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.pullquote p {
    font: italic 400 clamp(1.45rem, 3vw, 2.2rem)/1.4 var(--serif);
    letter-spacing: -0.015em;
    color: var(--accent);
}

.pullquote cite {
    display: block;
    margin-top: 1rem;
    font: 500 0.72rem/1.5 var(--mono);
    font-style: normal;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
}

/* ------------------------------------------------------------ status */

.status {
    padding: var(--space-lg) var(--gutter) var(--space-xl);
    background: var(--bg);
}

.status-inner {
    max-width: 62ch;
    margin: 0 auto;
    padding-top: var(--space-md);
    border-top: 2px solid var(--ink);
}

.status-label {
    margin-bottom: 1rem;
}

.status-title {
    font: 400 clamp(2rem, 4vw, 3rem)/1.15 var(--serif);
    letter-spacing: -0.02em;
}

.status-text {
    margin-top: 1rem;
    color: var(--ink-2);
    max-width: 52ch;
}

.button {
    display: inline-block;
    margin-top: 1.6rem;
    padding: 0.85rem 1.3rem;
    background: var(--accent);
    color: var(--accent-ink);
    font: 600 0.74rem/1 var(--sans);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.button:hover {
    filter: brightness(1.08);
}

/* ------------------------------------------------------------ footer */

.site-footer {
    padding: var(--space-lg) var(--gutter) var(--space-md);
    background: var(--night);
    color: var(--on-night);
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--gutter);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(237, 229, 218, 0.1);
}

.footer-brand .mark {
    display: block;
    width: 44px;
    height: 44px;
    margin-bottom: 1.2rem;
}

.footer-brand-title {
    font: 400 clamp(2rem, 4vw, 3rem)/1.1 var(--serif);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.footer-brand-desc {
    font-size: 0.86rem;
    line-height: 1.7;
    color: rgba(237, 229, 218, 0.55);
    max-width: 34ch;
}

.footer-col-title {
    font: 500 0.68rem/1.5 var(--mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(237, 229, 218, 0.4);
    margin-bottom: 1.4rem;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-col a {
    font-size: 0.86rem;
    color: rgba(237, 229, 218, 0.75);
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    padding-top: var(--space-sm);
    font-size: 0.76rem;
    color: rgba(237, 229, 218, 0.45);
}

/* ------------------------------------------------------------ scroll reveal (only with JS) */

.js .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.js .reveal.visible {
    opacity: 1;
    transform: none;
}

/* ------------------------------------------------------------ phone */

@media (max-width: 760px) {
    .nav-links {
        display: none;
    }

    .hero-scroll {
        display: none;
    }

    .hero--plain .hero-image::before {
        right: 50%;
        top: 34%;
        width: 60vw;
        transform: translate(50%, -50%);
    }

    .essay-text--lead::first-letter {
        font-size: 4em;
    }

    .footer-top {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .js .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .hero-scroll::before {
        animation: none;
    }
}
