/* --------------------------------------------------------------------------
   Design tokens — light default, dark via [data-theme="dark"]
   -------------------------------------------------------------------------- */

:root {
    color-scheme: light;
    --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
    --font-display: "Outfit", var(--font-sans);

    --bg: #f3f2ef;
    --bg-elevated: #ebeae6;
    --surface: #ffffff;
    --text: #121211;
    --text-muted: #5b5a54;
    --border: rgba(18, 17, 17, 0.1);
    /* Hairline dividers between sections (minimal) */
    --border-section: color-mix(in srgb, var(--border) 42%, transparent);
    --shadow: 0 18px 50px rgba(18, 17, 17, 0.08);
    --shadow-hover: 0 24px 60px rgba(18, 17, 17, 0.12);

    --accent: #3d5a80;
    --accent-bright: #5d7a9e;
    --accent-soft: rgba(61, 90, 128, 0.12);
    --accent-text: #e8eef5;

    --radius-lg: 1.25rem;
    --radius-md: 0.75rem;
    --radius-sm: 0.5rem;

    --header-h: 4rem;
    --max: 72rem;
    --gutter: clamp(1rem, 4vw, 2rem);

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c0c0b;
    --bg-elevated: #141413;
    --surface: #1a1a18;
    --text: #f4f3ef;
    --text-muted: #9c9b94;
    --border: rgba(244, 243, 239, 0.08);
    --border-section: color-mix(in srgb, var(--border) 45%, transparent);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 28px 70px rgba(0, 0, 0, 0.55);

    --accent: #8ab4d4;
    --accent-bright: #a8c8e6;
    --accent-soft: rgba(138, 180, 212, 0.15);
    --accent-text: #0c1218;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    transition: background-color 0.35s var(--ease-out), color 0.25s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--accent-bright);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: var(--accent-text);
    border-radius: var(--radius-sm);
    z-index: 100;
}

.skip-link:focus {
    left: var(--gutter);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    border-bottom: 1px solid var(--border-section);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    transition: border-color 0.25s ease, background 0.25s ease;
}

.site-header__inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
    text-decoration: none;
}

.logo:hover {
    color: var(--accent);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    justify-content: flex-end;
    flex: 1;
}

.nav__link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
}

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

.theme-toggle {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

.theme-toggle::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffd27a, #e8a317 55%, transparent 56%);
    opacity: 1;
    transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
}

[data-theme="dark"] .theme-toggle::before {
    opacity: 0;
    transform: scale(0.4);
}

.theme-toggle::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 50%;
    box-shadow: inset -0.35rem -0.2rem 0 0 #c9d6e8;
    opacity: 0;
    transform: rotate(-12deg) scale(0.5);
    transition: opacity 0.25s ease, transform 0.25s var(--ease-out);
}

[data-theme="dark"] .theme-toggle::after {
    opacity: 1;
    transform: rotate(-12deg) scale(1);
}

/* --------------------------------------------------------------------------
   Layout sections
   -------------------------------------------------------------------------- */

main {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter) 2.75rem;
}

.section {
    padding: clamp(2rem, 5vw, 3.25rem) 0;
    border-bottom: 1px solid var(--border-section);
    transition: border-color 0.25s ease;
}

main > .section:last-child {
    border-bottom: none;
}

.section--tight {
    padding-top: 1.25rem;
}

/* Flat: no gradient band or breakout — spacing carries the layout */
.section--muted {
    background: transparent;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
    border-radius: 0;
}

.section__head {
    max-width: 40rem;
    margin-bottom: 1.5rem;
}

.section__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    line-height: 1.15;
}

.section__lede {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.prose p {
    margin: 0 0 1rem;
    color: var(--text-muted);
    max-width: 40rem;
}

.prose p:last-child {
    margin-bottom: 0;
}

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(1.25rem);
    transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.reveal.reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
    padding-top: clamp(1.75rem, 4vw, 2.75rem);
    padding-bottom: clamp(2rem, 5vw, 3rem);
}

.hero__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 860px) {
    .hero__grid {
        grid-template-columns: 1.1fr 0.9fr;
        gap: 2.5rem;
    }
}

.eyebrow {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 0.35rem;
}

.hero__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 3.75rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin: 0 0 1rem;
}

.hero__tagline {
    font-size: clamp(1.1rem, 2.2vw, 1.35rem);
    color: var(--text-muted);
    max-width: 32rem;
    margin: 0 0 1.75rem;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero__visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 14rem;
}

.avatar {
    position: relative;
    z-index: 2;
    width: clamp(9rem, 28vw, 12rem);
    height: clamp(9rem, 28vw, 12rem);
    border-radius: 2rem;
    background: linear-gradient(145deg, var(--surface), var(--bg-elevated));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: grid;
    place-items: center;
    transform: rotate(-3deg);
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s ease;
}

.avatar:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.avatar__letters {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 3.25rem);
    letter-spacing: -0.06em;
    color: var(--accent);
}

.avatar--photo {
    padding: 0;
    overflow: hidden;
    background: var(--bg-elevated);
}

.avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.hero__blobs {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(48px);
    opacity: 0.55;
}

.blob--a {
    width: 60%;
    height: 60%;
    top: 5%;
    right: 10%;
    background: #7eb8da;
}

.blob--b {
    width: 55%;
    height: 55%;
    bottom: 0;
    left: 5%;
    background: #c4a8e8;
}

[data-theme="dark"] .blob--a {
    background: #4a7ab0;
}

[data-theme="dark"] .blob--b {
    background: #7b5fb8;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.65rem 1.25rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn--primary {
    background: var(--accent);
    color: var(--accent-text);
    box-shadow: 0 4px 14px rgba(61, 90, 128, 0.35);
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(61, 90, 128, 0.4);
    color: var(--accent-text);
}

[data-theme="dark"] .btn--primary {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn--ghost:hover {
    background: var(--surface);
    color: var(--text);
    transform: translateY(-1px);
}

.btn--small {
    padding: 0.45rem 0.95rem;
    font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   Grids & cards
   -------------------------------------------------------------------------- */

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid--featured {
    grid-template-columns: 1fr;
}

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

/* Wide screens: all four featured cards on one row */
@media (min-width: 1100px) {
    .grid--featured {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.1rem;
    }

    .card--featured .card__title {
        font-size: 1.15rem;
    }

    .card--featured .card__desc {
        font-size: 0.88rem;
    }

    .card--featured .card__body {
        padding: 1rem 1rem 1.15rem;
    }
}

.grid--apps {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .grid--apps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Wide screens: match featured density + typography */
@media (min-width: 1100px) {
    .grid--apps {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.1rem;
    }

    .card--app .card__title {
        font-size: 1.15rem;
    }

    .card--app .card__desc {
        font-size: 0.88rem;
    }

    .card--app .card__body {
        padding: 1rem 1rem 1.15rem;
    }
}

.grid--compact {
    grid-template-columns: 1fr;
}

@media (min-width: 520px) {
    .grid--compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Wide screens: four experiment cards per row (matches featured grid) */
@media (min-width: 1100px) {
    .grid--compact {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.1rem;
    }

    .card--compact .card__title--sm {
        font-size: 1.05rem;
    }

    .card--compact .card__desc--sm {
        font-size: 0.82rem;
    }

    .card--compact .card__body {
        padding: 1rem 1rem 1.15rem;
    }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease, border-color 0.25s ease;
}

.card--featured:hover,
.card--compact:hover,
.card--app:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card__media {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.card__media--compact {
    aspect-ratio: 16 / 9;
}

.card__shot {
    display: block;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s var(--ease-out);
}

.card:hover .card__shot {
    transform: scale(1.04);
}

.card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.5s var(--ease-out);
}

.card:hover .card__img {
    transform: scale(1.04);
}

/* Full recording visible (no crop); 16:9 matches most 1440-wide screen captures */
.card__media--video {
    background: #0a0a0a;
    aspect-ratio: 16 / 9;
}

.card__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
}

.card__motion-fallback {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .card__media--video .card__video {
        display: none;
    }

    .card__media--video .card__motion-fallback {
        display: block;
    }
}

.card__shot--sm {
    min-height: 7rem;
}

/* Featured / experiment art — CSS-only “screenshots” */
.card__shot--doortrain {
    background: linear-gradient(135deg, #1e3a5f 0%, #3d5a80 40%, #6b9ac4 100%);
}

.card__shot--skimeow {
    background: linear-gradient(160deg, #5c9ead 0%, #e8b4bc 45%, #fef6e4 100%);
}

.card__shot--scoreboard-ref {
    background: linear-gradient(145deg, #2d3436 0%, #636e72 50%, #dfe6e9 100%);
}

.card__shot--enviromentai {
    background: linear-gradient(135deg, #2d6a4f 0%, #52b788 50%, #b7e4c7 100%);
}

.card__shot--conoshi {
    background: linear-gradient(120deg, #6c5ce7 0%, #fd79a8 100%);
}

.card__shot--printpaperai {
    background: linear-gradient(145deg, #2c3e50 0%, #95a5a6 100%);
}

.card__shot--plantisla {
    background: linear-gradient(160deg, #40916c 0%, #d8f3dc 90%);
}

.card__shot--governway {
    background: linear-gradient(135deg, #1d3557 0%, #457b9d 100%);
}

.card__shot--hotelsgrade {
    background: linear-gradient(145deg, #bc6c25 0%, #dda15e 45%, #fefae0 100%);
}

.card__body {
    padding: 1.25rem 1.35rem 1.35rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
}

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

.pill {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}

.pill--sm {
    font-size: 0.65rem;
    padding: 0.15rem 0.45rem;
}

.badge {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, #e17055 35%, transparent);
    color: var(--text);
}

[data-theme="dark"] .badge {
    background: color-mix(in srgb, #e17055 45%, transparent);
}

.card__title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.card__title--sm {
    font-size: 1.1rem;
}

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

.card__title a:hover {
    color: var(--accent);
}

.card__desc {
    margin: 0;
    flex: 1;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.card__desc--sm {
    font-size: 0.88rem;
}

.card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

/* Mobile device frames */
.card--app {
    overflow: visible;
}

.card__device {
    padding: 1.5rem 1rem 0.5rem;
    display: flex;
    justify-content: center;
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--surface) 100%);
}

.device-frame {
    width: 9.5rem;
    border-radius: 1.75rem;
    padding: 0.45rem;
    background: linear-gradient(145deg, #2d2d2d, #111);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.device-screen {
    position: relative;
    border-radius: 1.35rem;
    aspect-ratio: 9 / 19;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.device-screen--photo {
    background: #0c0c0c;
}

.device-screen__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.device-screen--scoreboard-ref {
    background: linear-gradient(180deg, #2d3436 0%, #636e72 35%, #dfe6e9 100%);
}

.device-screen--pethealthpal {
    background: linear-gradient(180deg, #ff9a8b 0%, #fecfef 50%, #fecfef 100%);
}

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

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

.skill-chips__item {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--border-section);
    background: var(--surface);
    font-size: 0.92rem;
    font-weight: 500;
    box-shadow: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.skill-chips__item:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
    background: color-mix(in srgb, var(--surface) 92%, var(--accent-soft));
}

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

.site-footer {
    border-top: 1px solid var(--border-section);
    padding: 2rem var(--gutter) 2.5rem;
    background: var(--bg);
}

.site-footer__inner {
    max-width: var(--max);
    margin: 0 auto;
    text-align: center;
}

.site-footer__line {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.site-footer__line a {
    font-weight: 600;
}

.site-footer__copy {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.dot {
    margin: 0 0.25rem;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .site-header__inner {
        height: auto;
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }

    .theme-toggle {
        order: 2;
    }
}
