/* ---------- Theme ---------- */

:root {
    --background: hsl(215 30% 97%);
    --tint: hsl(214 45% 93%);
    --foreground: hsl(218 45% 14%);
    --foreground-soft: hsl(218 45% 14% / .8);
    --primary-light: hsl(218 38% 24%);
    --primary-glow: hsl(214 62% 44%);
    --muted-foreground: hsl(217 18% 38%);
    --border: hsl(216 22% 86%);
    --card: hsl(0 0% 100%);
    --accent: hsl(212 90% 92%);
    --on-dark: hsl(215 30% 97%);
    --on-dark-soft: hsl(215 30% 97% / .8);
    --on-dark-line: hsl(215 30% 97% / .16);
    --sky: hsl(212 85% 72%);

    --header-height: 4.25rem;
    --shadow-medium: 0 8px 40px hsl(218 45% 14% / .14);
    --transition: .3s cubic-bezier(.4, 0, .2, 1);

    font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 1rem);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--foreground);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

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

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

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

h1:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: .25rem;
}

/* Soft cross-fade when switching language (a full page load). */
@view-transition {
    navigation: auto;
}

.container {
    width: 100%;
    max-width: 78rem;
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.icon {
    flex: none;
    width: 1rem;
    height: 1rem;
}

.eyebrow {
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted-foreground);
}

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

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 50;
    background: hsl(0 0% 100% / .8);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid hsl(216 22% 86% / .6);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: var(--header-height);
}

.brand img {
    height: 2.5rem;
    width: auto;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-nav a {
    color: var(--foreground-soft);
    transition: color var(--transition);
}

.site-nav a:hover {
    color: var(--foreground);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    padding: 0 .75rem;
    border: 0;
    border-radius: .375rem;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition);
}

.icon-button:hover {
    background: var(--accent);
    color: var(--foreground);
}

.menu-button {
    display: none;
    color: var(--foreground);
}

.lang-toggle {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 1;
    color: var(--muted-foreground);
    transition: border-color var(--transition);
}

.lang-toggle:hover {
    border-color: var(--muted-foreground);
}

.lang-toggle span {
    padding: .4rem .65rem;
    border-radius: 999px;
}

.lang-toggle .is-active {
    background: var(--foreground);
    color: var(--on-dark);
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    border-radius: .75rem;
    font-weight: 500;
    transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

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

.button-glass {
    padding: 1.125rem 2rem;
    font-size: 1.0625rem;
    color: #fff;
    background: hsl(0 0% 100% / .1);
    border: 1px solid hsl(0 0% 100% / .2);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.button-glass:hover {
    background: hsl(0 0% 100% / .18);
}

.button-primary {
    padding: .9rem 1.75rem;
    color: var(--on-dark);
    background: var(--foreground);
}

.button-primary:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow-medium);
}

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

.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: var(--header-height);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(60rem 34rem at 50% 42%, hsl(214 62% 30% / .55), transparent 70%),
        linear-gradient(160deg, hsl(218 45% 14%), hsl(224 52% 7%));
}

/* A faint drawing grid that fades out towards the edges. */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(hsl(212 60% 85% / .07) 1px, transparent 1px),
        linear-gradient(90deg, hsl(212 60% 85% / .07) 1px, transparent 1px);
    background-size: 4rem 4rem;
    background-position: center;
    -webkit-mask-image: radial-gradient(ellipse 65% 60% at 50% 42%, #000 15%, transparent 75%);
    mask-image: radial-gradient(ellipse 65% 60% at 50% 42%, #000 15%, transparent 75%);
    pointer-events: none;
}

.hero > * {
    position: relative;
}

.hero-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-block: 4rem;
    text-align: center;
}

.hero .eyebrow {
    color: hsl(212 55% 80%);
}

.hero h1 {
    margin-top: 1.5rem;
    font-size: clamp(2.5rem, 6.4vw, 4.75rem);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.hero-accent {
    display: block;
    color: var(--sky);
}

.hero-lead {
    max-width: 36rem;
    margin-top: 1.75rem;
    font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
    color: hsl(0 0% 100% / .8);
    text-wrap: balance;
}

.hero .button {
    margin-top: 2.75rem;
}

/* Spread by the space between the titles, not by equal columns: the titles differ
   a lot in length, and equal columns would leave uneven gaps between them. */
.hero-areas {
    display: flex;
    justify-content: space-between;
    column-gap: 2rem;
    border-top: 1px solid var(--on-dark-line);
}

.hero-areas a {
    display: block;
    padding: 1.5rem 0 1.75rem;
    white-space: nowrap;
    font-size: .9375rem;
    font-weight: 500;
    line-height: 1.35;
    color: hsl(0 0% 100% / .72);
    transition: color var(--transition);
}

.hero-areas a:hover {
    color: #fff;
}

.hero-inner > * {
    animation: rise .8s cubic-bezier(.2, .7, .2, 1) both;
}

.hero-inner > :nth-child(2) { animation-delay: .08s; }
.hero-inner > :nth-child(3) { animation-delay: .16s; }
.hero-inner > :nth-child(4) { animation-delay: .24s; }

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

/* ---------- Sections ---------- */

.section {
    padding-block: clamp(4.5rem, 10vw, 8rem);
}

.section-head {
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-head h2,
.contact h2,
.plain-page h1 {
    font-size: clamp(2rem, 4.4vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.015em;
}

.section-head p {
    margin-top: .75rem;
    font-size: 1.125rem;
    color: var(--muted-foreground);
}

/* Typographic rows rather than boxes: a heading on the left, a sentence on the right. */

.row {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    column-gap: 3rem;
    align-items: baseline;
}

.rows > .row {
    padding-block: clamp(2rem, 4vw, 3rem);
    border-top: 1px solid var(--border);
}

.rows > .row:last-child {
    border-bottom: 1px solid var(--border);
}

.row-body {
    max-width: 36rem;
    font-size: 1.125rem;
    color: var(--foreground-soft);
}

.area h3 {
    font-size: clamp(1.5rem, 2.7vw, 2.125rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.01em;
    transition: color var(--transition);
}

.area:hover h3 {
    color: var(--primary-glow);
}

.row-body .area-keywords {
    margin-top: 1rem;
    font-size: .8125rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted-foreground);
}

/* About */

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

.about-statement {
    color: var(--foreground);
    font-size: clamp(1.5rem, 2.9vw, 2.25rem);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -.01em;
    text-wrap: pretty;
}

.about-text {
    margin-top: 1.75rem;
}

.about-text + .about-text {
    margin-top: 1rem;
}

/* Experience: the same rows, set smaller. */

.rows > .role {
    padding-block: 1.75rem;
}

.role h3 {
    font-size: 1.1875rem;
    font-weight: 600;
    line-height: 1.3;
}

.role-period {
    margin-top: .25rem;
    font-size: .8125rem;
    font-weight: 500;
    letter-spacing: .08em;
    color: var(--muted-foreground);
}

/* Clients: a quiet strip of logos that closes the experience section. */

.clients {
    padding-top: 0;
    text-align: center;
}

.clients h2 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

.client-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2rem;
}

.client-logos li {
    flex: 0 0 20%;
    display: grid;
    place-items: center;
    height: 6.5rem;
    padding-inline: 1.25rem;
}

/* Every logo is drawn in one dark tone so the row reads as a whole; colour returns on hover. */
.client-logo {
    width: auto;
    max-width: min(100%, 8.75rem);
    max-height: 2.5rem;
    filter: brightness(0);
    opacity: .55;
    transition: filter var(--transition), opacity var(--transition);
}

.client-logo.keep-tones {
    max-height: 3.75rem;
    filter: grayscale(1);
    opacity: .7;
}

.client-logos li:hover .client-logo {
    filter: none;
    opacity: 1;
}

/* Contact */

.contact,
.plain-page {
    text-align: center;
}

.contact p,
.plain-page p {
    margin-top: .75rem;
    font-size: 1.125rem;
    color: var(--muted-foreground);
}

.contact .button,
.plain-page .button {
    margin-top: 2.25rem;
}

.plain-page {
    padding-top: calc(var(--header-height) + clamp(4.5rem, 10vw, 8rem));
}

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

.site-footer {
    padding-block: 4rem;
    background: var(--foreground);
    color: var(--on-dark);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 3rem;
}

.footer-logo {
    height: 2.5rem;
    width: auto;
    margin-bottom: 1rem;
}

.footer-blurb {
    max-width: 22rem;
    margin-bottom: 1.5rem;
    color: var(--on-dark-soft);
}

.site-footer h2 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.site-footer li + li {
    margin-top: .875rem;
}

.site-footer li,
.site-footer li a {
    color: var(--on-dark-soft);
    transition: color var(--transition);
}

.site-footer li a:hover {
    color: var(--on-dark);
}

.with-icon {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.site-footer .icon-button {
    margin-left: -.75rem;
    color: var(--on-dark-soft);
}

.site-footer .icon-button:hover,
.footer-lang:hover {
    background: hsl(215 30% 97% / .1);
    color: var(--on-dark);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--on-dark-line);
    font-size: .875rem;
}

.footer-bottom p {
    color: hsl(215 30% 97% / .6);
}

.footer-lang {
    padding: .5rem .75rem;
    border-radius: .375rem;
    font-weight: 500;
    color: var(--on-dark-soft);
    transition: background-color var(--transition), color var(--transition);
}

/* ---------- Smaller screens ---------- */

@media (max-width: 56rem) {
    .row {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 1rem;
    }

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

    .footer-grid > :first-child {
        grid-column: 1 / -1;
    }

    .client-logos li {
        flex-basis: 33.333%;
    }
}

@media (max-width: 48rem) {
    .menu-button {
        display: inline-flex;
    }

    .header-social {
        display: none;
    }

    .site-nav {
        position: absolute;
        inset: 100% 0 auto 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: .5rem 1.5rem 1rem;
        background: var(--card);
        border-bottom: 1px solid var(--border);
    }

    .site-header[data-open] .site-nav {
        display: flex;
    }

    .site-nav a {
        padding-block: .75rem;
    }

    .hero-areas {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 0;
    }

    .hero-areas li:nth-child(n + 3) {
        border-top: 1px solid var(--on-dark-line);
    }

    .hero-areas a {
        padding: 1.125rem 1.5rem 1.25rem 0;
        white-space: normal;
    }
}

@media (max-width: 36rem) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .client-logos li {
        flex-basis: 50%;
        height: 5.5rem;
    }
}

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

    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---------- Blazor ---------- */

.blazor-error-boundary {
    padding: 1rem;
    color: #fff;
    background: #b32121;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}
