/* Little Byte Studio — shared styles. Variant sheets (voxel.css, tide.css, builder.css) only
   override the tokens and the hero flourishes; everything structural lives here. */

/* ---------- fonts (latin subsets, self-hosted) ---------- */
@font-face {
    font-family: 'Chakra Petch';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/chakra-petch-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Chakra Petch';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/chakra-petch-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Rubik';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/rubik-var.woff2') format('woff2');
}

/* ---------- tokens ---------- */
:root {
    color-scheme: light dark;

    --navy: #132b4a;
    --orange: #fa7637;
    --blue: #1e4e7c;
    --teal: #29a89d;

    --paper: #f3eee4;
    --paper-2: #fffdf8;
    --night: #0a1627;
    --night-2: #112340;

    --bg: var(--paper);
    --bg-panel: var(--paper-2);
    --ink: var(--navy);
    --ink-2: #44536a;
    --ink-3: #6b7786;
    --line: rgba(19, 43, 74, 0.16);
    --line-strong: var(--navy);
    --shadow: var(--navy);
    --accent: var(--orange);
    --accent-ink: #ffffff;
    --link: var(--blue);
    --canvas-bg: var(--paper);
    --canvas-alpha: 1;

    --font-display: 'Chakra Petch', 'Avenir Next Condensed', 'Arial Narrow', sans-serif;
    --font-body: 'Rubik', 'Helvetica Neue', Helvetica, Arial, sans-serif;

    --cut: 14px;
    --gutter: clamp(16px, 4vw, 48px);
    --measure: 62ch;
    --header-h: 72px;
    --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

:root[data-theme='dark'] {
    --bg: var(--night);
    --bg-panel: var(--night-2);
    --ink: #f2ede3;
    --ink-2: #b7c1d0;
    --ink-3: #8b98ab;
    --line: rgba(242, 237, 227, 0.16);
    --line-strong: #f2ede3;
    --shadow: #05101f;
    --link: #7cc9c1;
    --canvas-bg: var(--night);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --bg: var(--night);
        --bg-panel: var(--night-2);
        --ink: #f2ede3;
        --ink-2: #b7c1d0;
        --ink-3: #8b98ab;
        --line: rgba(242, 237, 227, 0.16);
        --line-strong: #f2ede3;
        --shadow: #05101f;
        --link: #7cc9c1;
        --canvas-bg: var(--night);
    }
}

/* ---------- reset-ish ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}
img,
svg,
video {
    display: block;
    max-width: 100%;
    height: auto;
}
a {
    color: inherit;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.2em;
}
p {
    margin: 0 0 1em;
    max-width: var(--measure);
}
h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.01em;
    margin: 0;
    text-wrap: balance;
}
button {
    font: inherit;
    color: inherit;
}
:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: 3px;
}
::selection {
    background: var(--orange);
    color: #fff;
}

.visually-hidden {
    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: 8px;
    left: 8px;
    z-index: 100;
    padding: 0.6em 1em;
    background: var(--orange);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 600;
    transform: translateY(-200%);
}
.skip-link:focus {
    transform: none;
}

/* ---------- the stage: one fullscreen canvas behind everything ---------- */
.stage {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: var(--canvas-bg);
    opacity: var(--canvas-alpha);
    pointer-events: none;
}

/* ---------- header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--header-h);
    display: flex;
    align-items: center;
    padding-inline: var(--gutter);
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(10px) saturate(1.2);
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}
.site-header.is-scrolled {
    border-bottom-color: var(--line);
}
.site-header__inner {
    width: 100%;
    max-width: 76rem;
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
}
.brand svg {
    height: 30px;
    width: auto;
}
.brand .wordmark {
    fill: currentColor;
}
.site-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 2vw, 1.75rem);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.site-nav a {
    text-decoration: none;
    padding: 0.4em 0.1em;
    position: relative;
}
.site-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.1em;
    height: 3px;
    background: var(--orange);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s var(--ease-out);
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after {
    transform: scaleX(1);
}

.theme-toggle {
    inline-size: 40px;
    block-size: 40px;
    padding: 0;
    display: grid;
    place-items: center;
    border: 2px solid var(--line-strong);
    background: transparent;
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
    transition: background 0.2s, color 0.2s;
}
.theme-toggle:hover {
    background: var(--ink);
    color: var(--bg);
}
.theme-toggle svg {
    width: 20px;
    height: 20px;
}
.theme-toggle .icon-moon {
    display: none;
}
:root[data-theme='dark'] .theme-toggle .icon-sun {
    display: none;
}
:root[data-theme='dark'] .theme-toggle .icon-moon {
    display: block;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .theme-toggle .icon-sun {
        display: none;
    }
    :root:not([data-theme='light']) .theme-toggle .icon-moon {
        display: block;
    }
}

/* ---------- layout ---------- */
main {
    position: relative;
    z-index: 1;
}
.container {
    width: 100%;
    max-width: 76rem;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* bytes: the four coloured squares from the logo, used as a glyph */
.bytes {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 3px;
    vertical-align: middle;
}
.bytes i {
    width: 10px;
    height: 10px;
    background: var(--blue);
}
.bytes i:nth-child(2) {
    background: var(--teal);
}
.bytes i:nth-child(3) {
    background: var(--orange);
}
.bytes i:nth-child(4) {
    background: var(--ink);
}

/* ---------- hero ---------- */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-block: calc(var(--header-h) + 2rem) clamp(3rem, 8vh, 6rem);
    margin-top: calc(-1 * var(--header-h));
}
.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.8rem;
    color: var(--ink-2);
    margin-bottom: 1.25rem;
}
.hero__title {
    font-size: clamp(3rem, 11vw, 8.5rem);
    line-height: 0.92;
    letter-spacing: -0.025em;
    text-transform: uppercase;
    max-width: 12ch;
}
.hero__title em {
    font-style: normal;
    color: var(--orange);
}
.hero__lede {
    margin-top: 1.5rem;
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
    max-width: 38ch;
    color: var(--ink-2);
    font-weight: 400;
}
.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 2rem;
}
.hero__cue {
    position: absolute;
    right: var(--gutter);
    bottom: 2rem;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-3);
    writing-mode: vertical-rl;
}
.hero__cue::after {
    content: '';
    width: 2px;
    height: 56px;
    background: linear-gradient(var(--ink-3), transparent);
    animation: cue 1.8s ease-in-out infinite;
}
@media (min-width: 60em) {
    .hero__cue {
        display: flex;
    }
}
@keyframes cue {
    0%,
    100% {
        transform: scaleY(0.4);
        transform-origin: top;
        opacity: 0;
    }
    40% {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* hero reveal choreography */
.js .hero [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    animation: rise 0.9s var(--ease-out) forwards;
    animation-delay: calc(var(--i, 0) * 110ms + 120ms);
}
@keyframes rise {
    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- buttons ---------- */
.btn {
    --btn-bg: var(--ink);
    --btn-ink: var(--bg);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.85em 1.4em;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--btn-ink);
    background: var(--btn-bg);
    border: 0;
    cursor: pointer;
    clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
    transition: transform 0.18s var(--ease-out), background 0.18s;
}
.btn:hover {
    transform: translate(-2px, -2px);
}
.btn:active {
    transform: translate(1px, 1px);
}
.btn--accent {
    --btn-bg: var(--orange);
    --btn-ink: #fff;
}
.btn--ghost {
    --btn-bg: transparent;
    --btn-ink: var(--ink);
    box-shadow: inset 0 0 0 2px var(--line-strong);
}
.btn--ghost:hover {
    --btn-bg: var(--ink);
    --btn-ink: var(--bg);
}
.btn svg {
    width: 1.1em;
    height: 1.1em;
}

/* ---------- sections ---------- */
.section {
    padding-block: clamp(4rem, 10vh, 8rem);
}
.section__head {
    display: grid;
    gap: 0.75rem;
    margin-bottom: clamp(2rem, 5vh, 3.5rem);
}
.section__label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-2);
}
.section__label .bytes i {
    width: 8px;
    height: 8px;
}
.section__title {
    font-size: clamp(2rem, 5vw, 3.75rem);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}
.section__title em {
    font-style: normal;
    color: var(--teal);
}

/* a panel: the paper card with a chamfered corner and a hard block shadow */
.panel {
    position: relative;
    isolation: isolate;
}
.panel__body {
    position: relative;
    background: var(--bg-panel);
    color: var(--ink);
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
    outline: 1px solid var(--line);
}
.panel::after {
    content: '';
    position: absolute;
    inset: 10px -10px -10px 10px;
    background: var(--shadow-color, var(--shadow));
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
    z-index: -1;
}
.panel--teal {
    --shadow-color: var(--teal);
}
.panel--orange {
    --shadow-color: var(--orange);
}
.panel--blue {
    --shadow-color: var(--blue);
}

/* ---------- projects ---------- */
.project {
    display: grid;
    gap: 0;
}
.project__media {
    position: relative;
    aspect-ratio: 1080 / 760;
    overflow: hidden;
    background: var(--night-2);
}
.project__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease-out);
}
.project:hover .project__media img {
    transform: scale(1.03);
}
.project__copy {
    padding: clamp(1.5rem, 3.5vw, 3rem);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.project__kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    padding: 0.35em 0.7em;
    background: var(--teal);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
}
.project__kicker::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #fff;
    animation: blink 1.6s steps(2, start) infinite;
}
@keyframes blink {
    to {
        visibility: hidden;
    }
}
.project__title {
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    text-transform: uppercase;
}
.project__title a {
    text-decoration: none;
}
.project__title a::after {
    content: '';
    position: absolute;
    inset: 0;
}
.project__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-2);
}
.project__meta li {
    padding: 0.3em 0.6em;
    border: 1.5px solid var(--line);
}
.project__cta {
    margin-top: auto;
    padding-top: 0.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}
.project__cta .btn {
    position: relative;
    z-index: 2;
}
@media (min-width: 56em) {
    .project {
        grid-template-columns: 1.15fr 1fr;
    }
    .project__media {
        aspect-ratio: auto;
        min-height: 100%;
    }
}

.project--next {
    margin-top: 3rem;
}
.project--next > .panel__body {
    background: transparent;
    outline: 2px dashed var(--line);
    clip-path: none;
}
.project--next::after {
    display: none;
}
.next-up {
    display: grid;
    gap: 1rem;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    grid-template-columns: auto 1fr;
    align-items: center;
}
.next-up__mark {
    width: 64px;
    height: 64px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}
.next-up__mark i {
    background: var(--line);
    animation: shimmer 2.4s ease-in-out infinite;
}
.next-up__mark i:nth-child(1) {
    background: var(--blue);
}
.next-up__mark i:nth-child(2) {
    animation-delay: 0.3s;
}
.next-up__mark i:nth-child(3) {
    background: var(--teal);
    animation-delay: 0.6s;
}
.next-up__mark i:nth-child(4) {
    background: var(--orange);
    animation-delay: 0.9s;
}
@keyframes shimmer {
    50% {
        opacity: 0.35;
    }
}
.next-up h3 {
    font-size: 1.4rem;
    text-transform: uppercase;
}
.next-up p {
    margin: 0.25rem 0 0;
    color: var(--ink-2);
}

/* ---------- about ---------- */
.about {
    display: grid;
    gap: clamp(2rem, 5vw, 4rem);
}
.about__intro p {
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    color: var(--ink-2);
}
.about__intro p strong {
    color: var(--ink);
    font-weight: 600;
}
.team {
    display: grid;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    list-style: none;
    margin: 0;
    padding: 0;
}
.person {
    display: grid;
    gap: 1rem;
}
.person__photo {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--night-2);
}
.person__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.9);
    transition: filter 0.4s;
}
.person:hover .person__photo img {
    filter: saturate(1.1);
}
.person__text {
    padding: 0 1.25rem 1.25rem;
}
.person__name {
    font-size: 1.5rem;
    text-transform: uppercase;
}
.person__role {
    margin: 0.2rem 0 0.75rem;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--orange);
}
.person__bio {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.98rem;
}
@media (min-width: 40em) {
    .team {
        grid-template-columns: 1fr 1fr;
    }
}
@media (min-width: 64em) {
    .about {
        grid-template-columns: 1fr 1.3fr;
        align-items: start;
    }
    .about__intro {
        position: sticky;
        top: calc(var(--header-h) + 2rem);
    }
}

/* ---------- work with us ---------- */
.collab .panel__body {
    padding: clamp(2rem, 5vw, 4rem);
    display: grid;
    gap: 1.5rem;
    background: var(--ink);
    color: var(--bg);
}
.collab .panel::after {
    background: var(--orange);
}
.collab h2 {
    font-size: clamp(1.9rem, 4.5vw, 3.25rem);
    text-transform: uppercase;
    max-width: 18ch;
}
.collab p {
    color: color-mix(in srgb, var(--bg) 80%, transparent);
    font-size: 1.1rem;
}
.collab .btn {
    --btn-bg: var(--orange);
    --btn-ink: #fff;
    justify-self: start;
}
.collab__grid {
    display: grid;
    gap: 2rem;
}
@media (min-width: 56em) {
    .collab__grid {
        grid-template-columns: 1.2fr 1fr;
        align-items: end;
    }
}
.collab__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.9rem;
}
.collab__list li {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}
.collab__list li::before {
    content: '';
    width: 10px;
    height: 10px;
    flex: none;
    background: var(--teal);
}
.collab__list li:nth-child(2)::before {
    background: var(--orange);
}
.collab__list li:nth-child(3)::before {
    background: var(--blue);
}

/* ---------- footer ---------- */
.site-footer {
    position: relative;
    z-index: 1;
    padding-block: 0 2rem;
    background: var(--bg);
}
.site-footer .container {
    padding-top: 3rem;
}
/* the four colours of the logo, edge to edge: the card's bottom bar */
.stripe {
    display: flex;
    height: 12px;
}
.stripe b {
    flex: 1;
    background: var(--blue);
}
.stripe b:nth-child(2) {
    background: var(--teal);
}
.stripe b:nth-child(3) {
    background: var(--orange);
}
.stripe b:nth-child(4) {
    background: var(--navy);
}
.hero__logo {
    display: none;
}
.site-footer__grid {
    display: grid;
    gap: 2rem;
    align-items: start;
}
.site-footer .symbol {
    width: 56px;
    height: 56px;
}
.site-footer .symbol .frame {
    fill: currentColor;
}
.contact {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.95rem;
}
.contact a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}
.contact a:hover {
    color: var(--orange);
}
.contact svg {
    width: 20px;
    height: 20px;
}
.site-footer__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--ink-3);
}
.site-footer__meta p {
    margin: 0;
}
.variants {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.variants a[aria-current='page'] {
    color: var(--orange);
    text-decoration: none;
}
@media (min-width: 48em) {
    .site-footer__grid {
        grid-template-columns: auto 1fr auto;
    }
}

/* ---------- scroll reveal (only once scripts run: without them everything is simply there) ---------- */
.js [data-reveal-on-scroll] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.js [data-reveal-on-scroll].is-in {
    opacity: 1;
    transform: none;
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .hero [data-reveal],
    [data-reveal-on-scroll] {
        opacity: 1;
        transform: none;
    }
}
