/* ==========================================================================
   Ekstra Software

   1. Fonts
   2. Tokens
   3. Base
   4. Header
   5. Hero
   6. Sections
   7. Profile
   8. Roles
   9. Expertise
   10. Clients
   11. Contact
   12. Footer
   13. Not found page
   14. Motion
   ========================================================================== */

/* 1. Fonts
   ========================================================================== */

@font-face {
    font-family: "Jost";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/jost-latin-wght-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Jost";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/jost-latin-wght-italic.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

/* 2. Tokens
   ========================================================================== */

:root {
    color-scheme: light dark;

    /* Brand: the colours of the triangle mosaic, from navy to amber. */
    --navy: #03234a;
    --navy-deep: #021a38;
    --blue: #01407f;
    --azure: #0580d0;
    --teal: #2cc1b9;
    --lime: #c4cc52;
    --amber: #f5b81f;
    --amber-bright: #ffd04a;

    --paper: #f6f8fb;
    --surface: #ffffff;
    --ink: #0b1f38;
    --ink-soft: #44566e;
    --heading: var(--blue);
    --link: var(--blue);
    --line: rgb(1 64 127 / 0.22);
    --focus: var(--azure);
    --marker-1: var(--blue);

    --font-sans: "Jost", "Century Gothic", "Avenir Next", "Segoe UI", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

    --header-height: 64px;
    --gutter: clamp(20px, 5vw, 48px);
    --measure: 1200px;
    --section-space: clamp(40px, 5vw, 68px);

    /* "Net dat beetje ekstra": lines run a little past the corner they meet. */
    --overshoot: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #061529;
        --surface: #0a2140;
        --ink: #e8eef6;
        --ink-soft: #a8b8cc;
        --heading: #ffffff;
        --link: #7cc4f4;
        --line: rgb(255 255 255 / 0.2);
        --focus: var(--amber);
        --marker-1: #2f6fc0;
    }
}

/* 3. Base
   ========================================================================== */

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

img,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: inherit;
}

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

::selection {
    background: var(--amber);
    color: var(--navy);
}

.wrap {
    width: 100%;
    max-width: var(--measure);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.sprite {
    position: absolute;
}

.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 30;
    padding: 10px 16px;
    background: var(--amber);
    color: var(--navy);
    font-weight: 500;
    text-decoration: none;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border: 1px solid transparent;
    font-size: 1.0625rem;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn svg {
    width: 18px;
    height: 18px;
    transition: translate 0.2s;
}

.btn:hover svg {
    translate: 3px 0;
}

.btn--primary {
    background: var(--amber);
    color: var(--navy);
}

.btn--primary:hover {
    background: var(--amber-bright);
}

.btn--ghost {
    border-color: rgb(255 255 255 / 0.45);
    color: #fff;
}

.btn--ghost:hover {
    border-color: #fff;
}

/* 4. Header
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--navy);
    color: #fff;
}

.site-header :focus-visible,
.hero :focus-visible,
.section--dark :focus-visible,
.site-footer :focus-visible {
    outline-color: var(--amber);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: var(--header-height);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1.0625rem;
    letter-spacing: 0.16em;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand__mark {
    flex: none;
    width: 30px;
    height: 28px;
    fill: currentColor;
}

.brand__name span {
    font-weight: 300;
    opacity: 0.78;
}

.nav {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.6vw, 34px);
    font-size: 1.0625rem;
    line-height: 1.3;
}

.nav a {
    padding-block: 6px;
    border-bottom: 2px solid transparent;
    color: rgb(255 255 255 / 0.84);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}

.nav a:hover,
.nav a[aria-current] {
    color: #fff;
}

.nav a[aria-current] {
    border-bottom-color: var(--amber);
}

.nav a.nav__cta {
    padding: 7px 16px;
    border: 1px solid rgb(255 255 255 / 0.45);
    color: #fff;
}

.nav a.nav__cta:hover,
.nav a.nav__cta[aria-current] {
    border-color: var(--amber);
    color: var(--amber);
}

@media (max-width: 819px) {
    .nav a:not(.nav__cta) {
        display: none;
    }
}

@media (max-width: 419px) {
    .site-header__inner {
        gap: 12px;
    }

    .brand {
        gap: 10px;
        font-size: 0.9375rem;
        letter-spacing: 0.12em;
    }
}

@media (max-width: 359px) {
    .brand__name span {
        display: none;
    }
}

/* 5. Hero
   ========================================================================== */

.hero {
    --mark-width: clamp(190px, 25vw, 316px);

    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--navy);
    color: #fff;
}

.hero__art {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: -1;
    width: min(60%, 960px);
}

/* Keeps the left edge of the mosaic quiet where text may run over it. */
.hero__art::after {
    position: absolute;
    inset: 0 60% 0 0;
    background: linear-gradient(90deg, var(--navy), rgb(3 35 74 / 0));
    content: "";
    opacity: 0.7;
}

.hero__art picture {
    display: contents;
}

.hero__mosaic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
}

.hero__mark {
    position: absolute;
    top: 50%;
    right: max(var(--gutter), calc((100vw - var(--measure)) / 2 + var(--gutter)));
    z-index: 1;
    width: var(--mark-width);
    height: auto;
    aspect-ratio: 560 / 531;
    fill: #fff;
    translate: 0 -50%;
}

.hero__inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: min(74svh, 680px);
    padding-block: clamp(56px, 8vw, 104px);
}

/* Leave room for the monogram on the right. */
.hero__inner > * {
    max-width: calc(100% - var(--mark-width) - 40px);
}

.hero__title {
    font-size: clamp(2.125rem, 1.2rem + 4.2vw, 4.5rem);
    font-weight: 300;
    line-height: 1.06;
    letter-spacing: -0.015em;
    text-wrap: balance;
}

.hero__title em {
    color: var(--amber);
    font-weight: 400;
}

.hero__lede {
    width: 26em;
    margin-top: clamp(20px, 2.4vw, 32px);
    color: rgb(255 255 255 / 0.86);
    font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
    font-weight: 300;
    line-height: 1.5;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: clamp(28px, 3.4vw, 44px);
}

/* On narrower screens there is no room for the mosaic panel: a navy-only mosaic fills the hero behind the text instead (see the picture source in the markup). */
@media (max-width: 899px) {
    .hero__art {
        width: 100%;
    }

    .hero__art::after,
    .hero__mark {
        display: none;
    }

    .hero__inner {
        min-height: 0;
    }

    .hero__inner > * {
        max-width: 100%;
    }
}

/* 6. Sections
   ========================================================================== */

.section {
    padding-block: var(--section-space);
}

.hero + .section {
    padding-top: calc(var(--section-space) + var(--overshoot));
}

.section--dark {
    --heading: #fff;
    --line: rgb(255 255 255 / 0.28);

    margin-top: var(--section-space);
    padding-block: calc(var(--section-space) * 1.25);
    background: var(--navy);
    color: #fff;
}

.section__grid {
    position: relative;
    display: grid;
    gap: 28px 48px;
    padding-top: 36px;
}

/* The section rule and the tick that crosses it: a corner where both lines overshoot. */
.section__grid::before,
.section__grid::after {
    position: absolute;
    content: "";
    pointer-events: none;
}

.section__grid::before {
    top: 0;
    right: calc(var(--gutter) - var(--overshoot));
    left: calc(var(--gutter) - var(--overshoot));
    border-top: 1px solid var(--line);
}

.section__grid::after {
    top: calc(var(--overshoot) * -1);
    left: var(--gutter);
    height: calc(var(--overshoot) * 2);
    border-left: 1px solid var(--line);
}

.section__title {
    color: var(--heading);
    font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
    font-weight: 300;
    line-height: 1.12;
    letter-spacing: -0.01em;
}

@media (min-width: 900px) {
    .section__grid {
        grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
        padding-top: 48px;
    }

    .section__title {
        position: sticky;
        top: calc(var(--header-height) + 32px);
        align-self: start;
    }
}

/* 7. Profile
   ========================================================================== */

.profile {
    display: grid;
    grid-template-areas: "portrait" "lede" "text";
    gap: 28px 56px;
}

.profile__lede {
    grid-area: lede;
    font-size: clamp(1.375rem, 1.15rem + 0.9vw, 1.75rem);
    font-weight: 300;
    line-height: 1.38;
}

.profile__text {
    grid-area: text;
    max-width: 34em;
}

.profile__text p + p {
    margin-top: 1em;
}

/* Justified running text; hyphenation keeps the word spacing even. */
.profile__lede,
.profile__text p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* Portrait frame: the horizontal and vertical lines cross at the corners. */
.portrait {
    position: relative;
    grid-area: portrait;
    width: 240px;
    max-width: calc(100% - 20px);
    margin: calc(10px + var(--overshoot)) 10px;
}

.portrait::before,
.portrait::after {
    position: absolute;
    content: "";
    pointer-events: none;
}

.portrait::before {
    inset: -10px calc(-10px - var(--overshoot));
    border-block: 1px solid var(--line);
}

.portrait::after {
    inset: calc(-10px - var(--overshoot)) -10px;
    border-inline: 1px solid var(--line);
}

.portrait img {
    width: 100%;
}

@media (min-width: 640px) {
    .profile {
        grid-template-areas: "lede lede" "text portrait";
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        row-gap: 36px;
    }

    .portrait {
        width: clamp(200px, 24vw, 280px);
        margin-top: calc(10px + 0.45em);
        margin-bottom: 10px;
    }
}

/* 8. Roles
   ========================================================================== */

.roles li {
    display: flex;
    align-items: baseline;
    gap: 0.55em;
    padding-block: clamp(12px, 1.6vw, 20px);
    border-bottom: 1px solid var(--line);
    font-size: clamp(1.5rem, 1.15rem + 1.9vw, 2.625rem);
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.roles li:first-child {
    padding-top: 0;
}

.roles li::before {
    flex: none;
    width: 0.4em;
    height: 0.46em;
    background: var(--marker);
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    content: "";
    translate: 0 -0.06em;
}

.roles li:nth-child(5n + 1) {
    --marker: var(--marker-1);
}

.roles li:nth-child(5n + 2) {
    --marker: var(--azure);
}

.roles li:nth-child(5n + 3) {
    --marker: var(--teal);
}

.roles li:nth-child(5n + 4) {
    --marker: var(--lime);
}

.roles li:nth-child(5n + 5) {
    --marker: var(--amber);
}

/* 9. Expertise
   ========================================================================== */

.stack__row {
    display: grid;
    gap: 12px 32px;
    padding-block: 22px;
    border-bottom: 1px solid var(--line);
}

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

.stack h3 {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.3;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chips li {
    padding: 6px 11px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.35;
}

@media (min-width: 640px) {
    .stack__row {
        grid-template-columns: 13.5rem minmax(0, 1fr);
        align-items: baseline;
    }
}

/* 10. Clients
   ========================================================================== */

.clients {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.clients li {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.clients a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 100%;
    padding: clamp(18px, 2.4vw, 28px) clamp(14px, 2vw, 24px);
    font-size: clamp(1.0625rem, 0.95rem + 0.6vw, 1.375rem);
    line-height: 1.25;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.clients svg {
    flex: none;
    width: 16px;
    height: 16px;
    opacity: 0.45;
    transition: opacity 0.15s, translate 0.2s;
}

.clients a:hover {
    background: var(--surface);
    color: var(--link);
}

.clients a:hover svg {
    opacity: 1;
    translate: 2px -2px;
}

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

/* 11. Contact
   ========================================================================== */

.contact li {
    border-bottom: 1px solid var(--line);
}

.contact a {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2.4vw, 28px);
    padding-block: clamp(18px, 2.4vw, 28px);
    text-decoration: none;
    transition: color 0.15s;
}

.contact li:first-child a {
    padding-top: 0;
}

.contact__icon {
    flex: none;
    width: clamp(24px, 2.6vw, 32px);
    height: clamp(24px, 2.6vw, 32px);
    color: var(--amber);
}

.contact__text {
    display: grid;
    flex: 1;
    gap: 6px;
    min-width: 0;
}

.contact__action {
    font-size: clamp(1.375rem, 1.1rem + 1.6vw, 2.375rem);
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.contact__detail {
    color: rgb(255 255 255 / 0.74);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.contact__arrow {
    flex: none;
    width: 22px;
    height: 22px;
    opacity: 0.6;
    transition: opacity 0.15s, translate 0.2s;
}

.contact a:hover {
    color: var(--amber);
}

.contact a:hover .contact__arrow {
    opacity: 1;
    translate: 4px 0;
}

/* 12. Footer
   ========================================================================== */

.site-footer {
    background: var(--navy-deep);
    /* The mosaic gradient as a closing line. */
    border-bottom: 4px solid;
    border-image: linear-gradient(90deg, var(--navy), var(--blue) 22%, var(--azure) 48%, var(--teal) 68%, var(--lime) 84%, var(--amber)) 1;
    color: rgb(255 255 255 / 0.78);
    font-size: 1rem;
    line-height: 1.5;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 40px;
    padding-block: 28px;
}

.site-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 28px;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

.site-footer a:hover {
    color: #fff;
}

/* 13. Not found page
   ========================================================================== */

.page-missing {
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    background: var(--navy);
}

.page-missing main {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.page-missing .hero {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.page-missing .hero__inner {
    min-height: 0;
    flex: 1;
}

/* 14. Motion
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
    .hero__title,
    .hero__lede,
    .hero__actions {
        animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    }

    .hero__lede {
        animation-delay: 0.08s;
    }

    .hero__actions {
        animation-delay: 0.16s;
    }

    .hero__mark {
        animation: appear 1.2s ease-out 0.15s both;
    }
}

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

@keyframes appear {
    from {
        opacity: 0;
    }
}

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

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
