/* ------------------------------------------------------------------
   Michael Ambass — personal site
   Tokens: white, navy ink, one red. Surfaces are flat panels, no borders.
------------------------------------------------------------------ */
:root {
    --bg: #ffffff;
    --panel: #f4f5f8;
    --panel-2: #e8eaf1;
    --panel-light: #f8f9fb;
    --ink: #0c1020;
    --muted: #5b6178;
    --accent: #ffe61a;
    --accent-deep: #f5d800;
    --accent-soft: rgba(255, 230, 26, 0.9);

    --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
    --font-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
    --font-mono: var(--font-body);

    --gutter: clamp(1.25rem, 4vw, 3rem);
    --max: 88rem;
    --radius: 1rem;
    --radius-pill: 999px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

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

::selection {
    background: var(--accent);
    color: var(--ink);
}

h1, h2, h3, p, ul, ol, dl, figure {
    margin: 0;
}

ul, ol {
    padding: 0;
    list-style: none;
}

.icon {
    width: 1.25em;
    height: 1.25em;
    flex: none;
}

.icon--lg {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--ink);
}

/* Highlighter ("stabilo") */
.hl {
    color: inherit;
    background-color: transparent;
    background-image: linear-gradient(
        98deg,
        rgba(255, 241, 60, 0) 0%,
        rgba(255, 236, 40, 0.95) 2.5%,
        rgba(255, 232, 30, 0.85) 30%,
        rgba(255, 244, 90, 0.9) 60%,
        rgba(255, 234, 40, 0.95) 97.5%,
        rgba(255, 241, 60, 0) 100%
    );
    background-repeat: no-repeat;
    background-size: 100% 88%;
    background-position: 0 60%;
    border-radius: 0.45em 0.2em 0.5em 0.25em / 0.6em 0.35em 0.4em 0.55em;
    padding: 0.02em 0.28em;
    margin: 0 -0.12em;
    mix-blend-mode: multiply;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.cta .hl {
    color: var(--ink);
    mix-blend-mode: normal;
    background-image: linear-gradient(
        98deg,
        rgba(255, 230, 26, 0) 0%,
        #ffeb2e 2.5%,
        #ffe61a 30%,
        #fff35c 60%,
        #ffe82a 97.5%,
        rgba(255, 230, 26, 0) 100%
    );
}

.icon-hl {
    position: relative;
    display: inline-flex;
    align-self: flex-start;
    padding: 0.45rem 0.55rem;
    margin: 0 0 1.25rem -0.35rem;
    z-index: 0;
}

.icon-hl::before {
    content: "";
    position: absolute;
    inset: 0.15rem -0.1rem 0.1rem -0.2rem;
    z-index: -1;
    background-image: linear-gradient(98deg, rgba(255, 230, 26, 0) 0%, #ffeb2e 4%, #ffe61a 40%, #fff35c 70%, #ffe82a 96%, rgba(255, 230, 26, 0) 100%);
    border-radius: 0.6em 0.3em 0.7em 0.35em / 0.5em 0.7em 0.4em 0.6em;
    transform: rotate(-3deg) skewX(-8deg);
}

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    padding: 0.5rem 0.75rem;
    background: var(--accent);
    color: var(--ink);
    z-index: 20;
}

.skip:focus {
    top: 1rem;
}

/* ------------------------------------------------------------------
   Navigation (under the hero)
------------------------------------------------------------------ */
.nav {
    background: var(--panel-light);
}

.nav__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem clamp(1.5rem, 4vw, 3rem);
}

.nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 4.25rem;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 160ms var(--ease);
}

.nav .icon {
    color: var(--ink);
    transition: transform 160ms var(--ease);
}

.nav a:hover,
.nav a:focus-visible {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 0.35em;
    text-underline-offset: 0.2em;
    text-decoration-skip-ink: none;
}

.nav a:hover .icon {
    transform: translateY(2px);
}

.lang-wrap {
    position: relative;
    height: 0;
}

.lang {
    display: inline-flex;
    gap: 0.25rem;
    position: absolute;
    right: var(--gutter);
    top: 1.25rem;
    z-index: 2;
}

.lang a {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-decoration: none;
    transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.lang a:hover {
    color: var(--ink);
    background: var(--panel);
}

.lang a.is-active {
    color: var(--ink);
    background: var(--accent);
}

.lang--inline {
    position: static;
    vertical-align: middle;
}

.lang--inline a {
    min-height: 1.6rem;
    padding: 0 0.55rem;
    font-size: 0.72rem;
}

.foot a {
    color: var(--ink);
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
}

/* ------------------------------------------------------------------
   Type
------------------------------------------------------------------ */
.display {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 96, "wdth" 90;
    font-weight: 800;
    font-size: clamp(1.9rem, 3.8vw, 3.1rem);
    line-height: 1.04;
    letter-spacing: -0.025em;
    text-wrap: balance;
    max-width: 22ch;
}

/* ------------------------------------------------------------------
   Hero
------------------------------------------------------------------ */
.hero {
    position: relative;
    padding-top: clamp(3.5rem, 8vw, 7rem);
    padding-bottom: clamp(2.5rem, 5vw, 4rem);
    overflow: hidden;
}


.hero__inner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
    padding-bottom: clamp(3rem, 7vw, 5.5rem);
}

.hero__name {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 96, "wdth" 100;
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 6.75rem);
    line-height: 0.9;
    letter-spacing: -0.02em;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.75rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.95rem;
    border-radius: var(--radius-pill);
    background: var(--panel);
    color: var(--ink);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.badge .icon {
    width: 1.15rem;
    height: 1.15rem;
    color: var(--ink);
}

.badge--dot::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--ink);
}

.lede {
    max-width: 60ch;
    margin-top: 1.75rem;
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--muted);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0 1.6rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}

.button:hover {
    transform: translateY(-1px);
}

.button--primary {
    background: var(--ink);
    color: #fff;
}

.button--primary:hover {
    background: var(--accent);
    color: var(--ink);
}

.button--ghost {
    background: var(--panel);
    color: var(--ink);
}

.button--ghost:hover {
    background: var(--panel-2);
}

.button--light {
    background: #fff;
    color: var(--ink);
}

.button--light:hover {
    background: var(--accent);
    color: var(--ink);
}

/* Portrait: natural colours, no frame. */
.portrait {
    position: relative;
    width: min(100%, 30rem);
    justify-self: end;
}

.portrait__block {
    display: none;
}

.portrait__frame {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
}

.portrait__frame img {
    width: 100%;
    aspect-ratio: 520 / 414;
    object-fit: cover;
}

/* Stats strip */
.stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.stats > div {
    padding: 1.5rem 1.5rem;
    background: var(--panel);
    border-radius: var(--radius);
}

.stats dt {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.stats dd {
    margin: 0.35rem 0 0;
    font-family: var(--font-display);
    font-variation-settings: "wdth" 90;
    font-weight: 800;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stats dd span {
    color: var(--ink);
}

/* ------------------------------------------------------------------
   Sections
------------------------------------------------------------------ */
.section {
    padding-top: clamp(4rem, 9vw, 7.5rem);
    padding-bottom: clamp(4rem, 9vw, 7.5rem);
}

.section--panel {
    background: var(--panel);
}

/* About */
.about {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: start;
}

.about__lead {
    position: sticky;
    top: 2rem;
}

.about__text p {
    max-width: 62ch;
    color: var(--muted);
}

.about__text > p + p {
    margin-top: 1.25rem;
}

.pillars {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: clamp(3rem, 6vw, 5rem);
}

.pillars li {
    display: flex;
    flex-direction: column;
    padding: 2rem;
    background: var(--panel);
    border-radius: var(--radius);
}

.pillars h3 {
    font-family: var(--font-display);
    font-variation-settings: "wdth" 92;
    font-weight: 800;
    font-size: 1.45rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.pillars p {
    margin-top: 0.75rem;
    font-size: 0.98rem;
    color: var(--muted);
}

/* Timeline */
.timeline {
    position: relative;
    margin-top: 3rem;
    padding-left: 2rem;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    left: 0.3rem;
    width: 2px;
    background: var(--panel-2);
}

.timeline__item {
    position: relative;
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr) auto;
    gap: 1.5rem;
    padding: 1.5rem 0;
}

.timeline__item:first-child {
    padding-top: 0;
}

.timeline__item:last-child {
    padding-bottom: 0;
}

.timeline__item::before {
    content: "";
    position: absolute;
    top: 2.1rem;
    left: calc(-2rem + 0.3rem - 5px);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--ink), 0 0 0 6px var(--panel);
}

.timeline__item:first-child::before {
    top: 0.6rem;
}

.timeline__when {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding-top: 0.4rem;
}

.timeline__logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
    align-self: start;
    padding-top: 0.35rem;
}

.timeline__logos img {
    height: 2rem;
    width: auto;
    max-width: 9rem;
    object-fit: contain;
    filter: brightness(0);
    opacity: 0.85;
}

.timeline__logos .logo--tall {
    height: 3rem;
    max-width: 10rem;
}

.timeline__body h3 {
    font-family: var(--font-display);
    font-variation-settings: "wdth" 92;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.015em;
    line-height: 1.15;
}

.timeline__body p {
    max-width: 60ch;
    margin-top: 0.5rem;
    color: var(--muted);
}

/* Projects */
.projects {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 3rem;
}

.project {
    position: relative;
    display: flex;
    text-decoration: none;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 24rem;
    padding: 2rem;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    isolation: isolate;
}

.project__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transform: scale(1.02);
    transition: transform 600ms var(--ease);
}

.project::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(0, 0, 0, 0.55);
}

.project:hover .project__bg,
.project:focus-visible .project__bg {
    transform: scale(1.06);
}

.project__logo {
    position: relative;
    height: 2.5rem;
    width: auto;
    max-width: 12rem;
    object-fit: contain;
    object-position: left center;
    filter: brightness(0) invert(1);
}

.project__role {
    margin-top: auto;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.project__name {
    font-family: var(--font-display);
    font-variation-settings: "wdth" 92;
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: -0.03em;
    line-height: 1;
}

.project p {
    max-width: 34ch;
    color: rgba(255, 255, 255, 0.82);
}

.project__stat {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin-top: 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.82);
}

.project__stat strong {
    font-family: var(--font-display);
    font-variation-settings: "wdth" 92;
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.03em;
    line-height: 1;
    color: #fff;
}

.project__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
}

.project__domain {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
}

.project__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.6rem;
    padding: 0 1.1rem 0 1.25rem;
    border-radius: var(--radius-pill);
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.project__cta .icon {
    transition: transform 160ms var(--ease);
}

.project:hover .project__cta {
    background: var(--accent);
    color: var(--ink);
}

.project:hover .project__cta .icon {
    transform: translate(2px, -2px);
}

/* Contact block */
#contact {
    padding-top: 0;
}

.cta {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: end;
    padding: clamp(2.5rem, 6vw, 4.5rem);
    background: var(--ink);
    border-radius: var(--radius);
    color: #fff;
}

.cta .display {
    color: #fff;
}

.cta__lede {
    max-width: 46ch;
    margin-top: 1.25rem;
    color: rgba(255, 255, 255, 0.85);
}

.cta__actions {
    display: grid;
    gap: 1.5rem;
    justify-items: start;
}

.cta .button--light {
    font-weight: 600;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.socials {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-weight: 500;
    font-size: 0.92rem;
}

.socials a {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.5);
    text-underline-offset: 0.3em;
}

.socials a:hover {
    text-decoration-color: #fff;
}

/* Footer */
.foot {
    font-size: 0.85rem;
    color: var(--muted);
}

.foot__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 2.5rem;
}

/* ------------------------------------------------------------------
   Motion
------------------------------------------------------------------ */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

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

    .reveal,
    .button,
    .project__bg {
        transition: none;
    }

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

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------ */
@media (max-width: 56rem) {
    .hero__inner,
    .about,
    .cta {
        grid-template-columns: 1fr;
    }

    .about__lead {
        position: static;
    }

    .portrait {
        width: min(100%, 22rem);
        justify-self: start;
        margin: 0 0 0.5rem 0;
        order: -1;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav__inner {
        justify-content: flex-start;
        gap: 0 1.5rem;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .nav a {
        min-height: 3rem;
    }

    .pillars,
    .projects {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project {
        min-height: 18rem;
    }
}

@media (max-width: 40rem) {
    .hero__name {
        font-size: clamp(3rem, 16vw, 4.5rem);
    }

    .pillars,
    .projects {
        grid-template-columns: 1fr;
    }

    .timeline__item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .timeline__logos {
        justify-content: flex-start;
    }

    .stats > div {
        padding: 1.25rem 1rem;
    }
}
