/* caedvx.github.io, on ODIVM Graphite */

:root {
    --bg: #000000;
    --bg-deep: #000000;
    --text: #f2f2f0;
    --text-dim: rgba(242, 242, 240, 0.56);
    --text-faint: rgba(242, 242, 240, 0.35);
    --accent: #e6e6e3;
    --accent-strong: #8a8a86;
    --success: #6ee7b7;
    --warning: #fbbf24;
    --glass-bg: rgba(255, 255, 255, 0.045);
    --glass-border: rgba(255, 255, 255, 0.11);
    --line: rgba(255, 255, 255, 0.14);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    --font-display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
    --font-body: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
}

html,
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Only body clips: on html as well, body becomes its own scroll container and the sticky profile stops sticking */
body {
    overflow-x: hidden;
}

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

button {
    font: inherit;
    color: inherit;
}

h1, h2, h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
}

p {
    margin: 0;
    max-width: 52ch;
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--text-dim);
    text-wrap: pretty;
}

:focus-visible {
    outline: 1px solid var(--text);
    outline-offset: 4px;
    border-radius: 4px;
}

::selection {
    background: var(--text);
    color: var(--bg);
}

.num {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.skip {
    position: fixed;
    top: -100px;
    left: 1rem;
    z-index: 100;
    padding: 0.5rem 0.9rem;
    background: var(--text);
    color: var(--bg);
    border-radius: 8px;
    font-size: 0.85rem;
}

.skip:focus {
    top: 1rem;
}


/* ── Ambient layer ── */

.glow-field {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(ellipse 140% 100% at 50% 0%, var(--bg) 0%, var(--bg-deep) 100%);
}

.orb {
    position: absolute;
    overflow: hidden;
    border-radius: 50%;
    opacity: var(--op, 0.5);
    mix-blend-mode: screen;
    background: radial-gradient(circle closest-side, rgba(var(--c), 1.000) 0%, rgba(var(--c), 0.961) 10%, rgba(var(--c), 0.851) 20%, rgba(var(--c), 0.696) 30%, rgba(var(--c), 0.524) 40%, rgba(var(--c), 0.363) 50%, rgba(var(--c), 0.230) 60%, rgba(var(--c), 0.132) 70%, rgba(var(--c), 0.066) 80%, rgba(var(--c), 0.025) 90%, rgba(var(--c), 0) 100%);
}

.orb--a {
    width: 90vmax;
    height: 90vmax;
    left: -40.6vmax;
    top: -36.6vmax;
    --c: 138, 138, 134;
    --op: 0.12;
    animation: drift-a 52s ease-in-out infinite;
}

.orb--b {
    width: 72vmax;
    height: 72vmax;
    right: -31.8vmax;
    top: -7.8vmax;
    --c: 230, 230, 227;
    --op: 0.06;
    animation: drift-b 68s ease-in-out infinite;
}

.orb--c {
    width: 80vmax;
    height: 80vmax;
    left: calc(22vw - 22vmax);
    bottom: -42vmax;
    --c: 42, 42, 40;
    --op: 0.3;
    animation: drift-c 61s ease-in-out infinite;
}

/* Dithered canvas versions of the background and orbs, drawn by the script in index.html */
.glow-field > canvas,
.orb > canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.orb.is-dithered {
    background: #000;
    opacity: 1;
}

/* Static grain for texture */
.glow-field::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.12;
    mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='discrete' tableValues='0 1'/%3E%3CfeFuncG type='discrete' tableValues='0 1'/%3E%3CfeFuncB type='discrete' tableValues='0 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes drift-a {
    0%   { transform: translate(0, 0) scale(1); }
    22%  { transform: translate(8vw, 6vh) scale(1.08); }
    47%  { transform: translate(3vw, 14vh) scale(0.96); }
    71%  { transform: translate(-6vw, 5vh) scale(1.04); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes drift-b {
    0%   { transform: translate(0, 0) scale(1); }
    30%  { transform: translate(-9vw, 9vh) scale(0.94); }
    58%  { transform: translate(-2vw, -4vh) scale(1.1); }
    83%  { transform: translate(6vw, 3vh) scale(1); }
    100% { transform: translate(0, 0) scale(1); }
}

@keyframes drift-c {
    0%   { transform: translate(0, 0) scale(1); }
    26%  { transform: translate(7vw, -8vh) scale(1.05); }
    54%  { transform: translate(-4vw, -3vh) scale(0.95); }
    79%  { transform: translate(-8vw, -12vh) scale(1.02); }
    100% { transform: translate(0, 0) scale(1); }
}


/* ── Buttons ── */

.btn-solid,
.btn-glass {
    display: inline-block;
    padding: 0.7rem 1.4rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.btn-solid {
    background: #f2f2f0;
    color: #0a0a0a;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
}

.btn-solid:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 28px rgba(255, 255, 255, 0.22);
}

.btn-glass {
    background: linear-gradient(135deg, rgba(42, 42, 40, 0.36), rgba(90, 90, 86, 0.24));
    color: #f2f2f0;
    border: 1px solid rgba(154, 154, 150, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn-glass:hover {
    background: linear-gradient(135deg, rgba(42, 42, 40, 0.48), rgba(90, 90, 86, 0.34));
    border-color: rgba(154, 154, 150, 0.7);
    transform: translateY(-1px);
}


/* ── Layout: sticky profile left, content right ── */

.layout {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 5vw, 3.5rem);
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(2rem, 6vw, 5rem);
}

.profile {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    padding: clamp(3rem, 10vh, 6rem) 0 clamp(2rem, 6vh, 3.5rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2.5rem;
}

.profile-top {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.name {
    display: flex;
    align-items: center;
    gap: 0.24em;
    font-size: clamp(2.4rem, 4.4vw, 3.9rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
}

.name-mark {
    width: 1.05em;
    height: 1.05em;
    flex: none;
    fill: currentColor;
    overflow: visible;
}

/* Letters rise out of this mask on load */
.name-text {
    display: inline-flex;
    overflow: hidden;
    padding-block: 0.08em;
    margin-block: -0.08em;
}

.name-text .char {
    display: inline-block;
}

.tagline {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    color: var(--text);
    max-width: 26ch;
}

.toc {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: clamp(1.5rem, 6vh, 3.5rem);
}

.toc a {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    width: fit-content;
    padding: 0.45rem 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-faint);
    transition: color 0.2s;
}

.toc i {
    display: block;
    width: 2rem;
    height: 1px;
    background: currentColor;
    transition: width 0.45s var(--ease), background 0.2s;
}

.toc a:hover,
.toc a.is-current {
    color: var(--text);
}

.toc a:hover i,
.toc a.is-current i {
    width: 4rem;
}

.profile-bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.email {
    position: relative;
    width: fit-content;
    font-family: var(--font-display);
    font-size: clamp(1rem, 1.8vw, 1.35rem);
    font-weight: 500;
}

.email::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.15em;
    height: 1px;
    background: currentColor;
    transform: scaleX(0.2);
    transform-origin: left;
    transition: transform 0.7s var(--ease);
}

.email:hover::after {
    transform: scaleX(1);
}

.socials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.social,
.filter {
    padding: 0.45rem 0.9rem;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.social:hover,
.social.is-copied,
.filter:hover {
    color: var(--text);
    border-color: rgba(242, 242, 240, 0.35);
}

.filter.is-active {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}


/* ── Content column ── */

.content {
    padding: clamp(3rem, 10vh, 6rem) 0 0;
}

.section {
    padding-bottom: clamp(4rem, 12vh, 7rem);
}

.label {
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.label-row .label {
    margin: 0;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.filter {
    padding: 0.3rem 0.75rem;
    font-size: 0.68rem;
}

.prose {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.inline {
    color: var(--text);
    border-bottom: 1px solid rgba(242, 242, 240, 0.3);
    transition: border-color 0.2s;
}

.inline:hover {
    border-color: var(--text);
}

strong {
    color: var(--text);
    font-weight: 600;
}


/* ── ODIVM panel ── */

.company {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: clamp(1.4rem, 3vw, 2rem);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background:
        radial-gradient(ellipse at 100% 0%, rgba(242, 242, 240, 0.07), transparent 55%),
        var(--glass-bg);
    backdrop-filter: blur(28px) saturate(170%);
    -webkit-backdrop-filter: blur(28px) saturate(170%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.company-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.eyebrow svg {
    width: 12px;
    height: 12px;
    color: var(--text-dim);
}

.company-name {
    margin: 0.6rem 0 0.3rem;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1;
}

.motto {
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-faint);
}

.corner {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    transition: color 0.2s, border-color 0.2s, transform 0.3s var(--ease);
}

.corner:hover {
    color: var(--text);
    border-color: rgba(242, 242, 240, 0.35);
    transform: translate(2px, -2px);
}

.features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin-top: 0.25rem;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.08);
}

.feature {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 1.1rem;
    background: rgba(0, 0, 0, 0.55);
    font-family: var(--font-display);
    font-size: 0.92rem;
    font-weight: 600;
    transition: background 0.25s;
}

.feature:hover {
    background: rgba(30, 30, 29, 0.6);
}

.feature .num {
    font-size: 0.62rem;
    font-weight: 400;
    color: var(--text-faint);
}

.feature small {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text-dim);
}

.feature-cta {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.feature-cta a {
    padding: 0.55rem 1rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
}


/* ── Work list ── */

.work {
    list-style: none;
    margin: 0 -1.1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 1rem;
    border-radius: 16px;
    border: 1px solid transparent;
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.item[hidden] {
    display: none;
}

.item:hover {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.item-side {
    padding: 1.35rem 0 0 1.1rem;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.item-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.1rem 1.1rem 1.2rem 0;
}

.item h3 {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4em;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.item p {
    font-size: 0.93rem;
    line-height: 1.6;
}

.arrow {
    font-family: var(--font-body);
    font-size: 0.85em;
    color: var(--text-faint);
    transition: transform 0.4s var(--ease), color 0.2s;
}

a.item-body:hover .arrow {
    color: var(--text);
    transform: translate(3px, -3px);
}

.chips {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.chips li {
    padding: 2px 9px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.04em;
    color: var(--text-dim);
}

.chips .live {
    color: var(--success);
    border-color: rgba(110, 231, 183, 0.3);
    background: rgba(110, 231, 183, 0.07);
}

.chips .private {
    color: var(--text-faint);
    border-style: dashed;
}


/* ── Now ── */

.now {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--line);
}

.now li {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0 0 1.4rem 1.5rem;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.5;
}

.now li:last-child {
    padding-bottom: 0;
}

.now li::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0.3rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid var(--text-dim);
}

.now li:first-child::before {
    background: var(--text);
    border-color: var(--text);
}

.now-tag {
    font-size: 0.64rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-faint);
}


/* ── Stack ── */

.stack {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
    gap: 1.5rem 2rem;
}

.stack div {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
}

.stack dt {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
}

.stack dd {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-dim);
}


/* ── Footer ── */

.footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding: 2rem 0 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    color: var(--text-faint);
}

.footer a {
    color: var(--text-dim);
    transition: color 0.18s;
}

.footer a:hover {
    color: var(--text);
}


/* ── Small screens: profile becomes an intro block ── */

@media (max-width: 900px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .profile {
        position: static;
        height: auto;
        min-height: 88svh;
        justify-content: center;
        gap: 2.5rem;
    }

    .toc {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.3rem 1.2rem;
        margin-top: 1rem;
    }

    .toc i {
        display: none;
    }

    .content {
        padding-top: 2rem;
    }
}

@media (max-width: 520px) {
    .features {
        grid-template-columns: minmax(0, 1fr);
    }

    .item {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .item-side {
        padding: 1.1rem 1.1rem 0;
    }

    .item-body {
        padding: 0.4rem 1.1rem 1.2rem;
    }
}


/* ── Motion: visible by default, hidden only once JS opts in ──
   GSAP drives every entrance; `is-shown` hands the stay-visible guarantee back to CSS. */

.motion [data-intro],
.motion .reveal,
.motion .name {
    opacity: 0;
}

.motion [data-intro].is-shown,
.motion .reveal.is-shown,
.motion .name.is-shown {
    opacity: 1;
}

/* Lenis owns the smoothing while it runs */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

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

    .orb {
        animation: none !important;
    }
}
