/* earlamante.com, shared styles for every page */

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

:root {
    --page: #F5F6F8;
    --ink: #1C1E3A;
    --indigo: #4F5B93;
    --indigo-hover: #3B4577;
    --mist: #DDE1EA;
    --slate: #5A6075;
    --mango: #F2B705;
    --on-mango: #1C1E3A;
    --raised: #FFFFFF;

    --font: 'Schibsted Grotesk', system-ui, sans-serif;

    --column: 40rem;
    --margin: 9rem;
    --gap: 2.5rem;
    --gutter: 1rem;

    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --page: #15172B;
        --ink: #E9EAF2;
        --indigo: #A9B1E0;
        --indigo-hover: #C8CEF0;
        --mist: #2C2F4A;
        --slate: #A2A7BD;
        --raised: #1C1F38;
        color-scheme: dark;
    }
}

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

body {
    background: var(--page);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--indigo);
    text-underline-offset: .2em;
    text-decoration-thickness: 1px;
}

a:hover {
    color: var(--indigo-hover);
}

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

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

.skip {
    position: absolute;
    left: -999px;
}

.skip:focus {
    left: var(--gutter);
    top: .75rem;
    background: var(--raised);
    padding: .5rem .75rem;
    z-index: 10;
}

/* Placeholder content: remove the "ph" class once real content is in */
.ph {
    outline: 1px dashed var(--mango);
    outline-offset: 4px;
}

/* ── Frame: one reading column, with a margin column on wide screens ── */
.wrap {
    max-width: calc(var(--margin) + var(--gap) + var(--column) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.row {
    display: grid;
    grid-template-columns: var(--margin) minmax(0, var(--column));
    column-gap: var(--gap);
}

.row > .aside {
    grid-column: 1;
    color: var(--slate);
    font-size: .9375rem;
    line-height: 1.45;
    padding-top: .2rem;
}

.row > .main {
    grid-column: 2;
}

/* ── Header ── */
.site-header {
    padding: 1.5rem 0;
}

.site-header .wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-name {
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
}

.site-nav ul {
    display: flex;
    gap: 1.75rem;
    list-style: none;
}

.site-nav a {
    color: var(--slate);
    text-decoration: none;
}

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

.site-nav ul {
    align-items: center;
}

.site-nav .nav-cta {
    color: var(--indigo);
    font-weight: 700;
    border: 1.5px solid currentColor;
    border-radius: 4px;
    padding: .45rem .9rem;
}

.site-nav .nav-cta:hover {
    color: var(--page);
    background: var(--indigo);
    border-color: var(--indigo);
}

/* ── Hero ── */
.hero {
    padding: 7rem 0 6rem;
}

.hero .row > .main {
    grid-column: 1 / -1;
}

.hero h1 {
    font-size: clamp(2.4rem, 5.6vw, 4.2rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -.025em;
    max-width: 21ch;
    text-wrap: balance;
}

.hero-sub {
    margin-top: 1.75rem;
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--slate);
    max-width: 44ch;
}

.clock {
    margin-top: 3rem;
    font-size: clamp(1.2rem, 2.3vw, 1.5rem);
    line-height: 1.5;
    max-width: 40ch;
    min-height: 3em;
}

.history .years {
    font-variant-numeric: tabular-nums;
}

.clock .now {
    font-weight: 800;
    color: var(--on-mango);
    background: var(--mango);
    padding: .05em .3em;
    border-radius: 2px;
    white-space: nowrap;
}

.clock .theirs {
    font-weight: 700;
    white-space: nowrap;
}

.actions {
    margin-top: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
}

.button {
    display: inline-block;
    background: var(--indigo);
    color: var(--page);
    font-weight: 700;
    text-decoration: none;
    padding: .9rem 1.4rem;
    border-radius: 4px;
}

.button:hover {
    background: var(--indigo-hover);
    color: var(--page);
}

.text-link {
    font-weight: 500;
}

/* ── Sections ── */
.section {
    padding: 5rem 0;
    border-top: 1px solid var(--mist);
}

.section h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
    margin-bottom: 2.5rem;
}

/* ── Terms (how I work) ── */
.terms {
    display: grid;
    gap: 1.75rem;
}

.terms dt {
    font-weight: 700;
}

.terms dd {
    color: var(--slate);
    max-width: 38rem;
}

/* ── Build list ── */
.builds {
    list-style: none;
    display: grid;
    gap: 1.5rem;
}

.builds strong {
    display: block;
    font-weight: 700;
}

.builds span {
    color: var(--slate);
}

/* ── Track record ── */
.history {
    list-style: none;
}

.history li {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 1rem;
    padding: .8rem 0;
    border-bottom: 1px solid var(--mist);
}

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

.history .years {
    color: var(--slate);
}

.history .role {
    font-weight: 500;
}

.history .where {
    display: block;
    font-weight: 400;
    color: var(--slate);
    font-size: .9375rem;
}

.logos-label {
    margin-top: 3rem;
    color: var(--slate);
    font-size: .9375rem;
}

.logos {
    list-style: none;
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(3.5rem, 1fr));
    gap: 1.25rem;
    max-width: 38rem;
}

.logos img {
    width: 3.5rem;
    height: 3.5rem;
    filter: grayscale(1);
    opacity: .7;
}

@media (prefers-color-scheme: dark) {
    .logos img {
        filter: grayscale(1) brightness(1.6);
    }
}

/* ── Contact ── */
.section.contact h2 {
    font-size: clamp(2rem, 4.4vw, 3rem);
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: 1.25rem;
}

.email-big {
    display: inline-block;
    font-size: clamp(1.35rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -.01em;
    overflow-wrap: anywhere;
}

.contact p {
    color: var(--slate);
    max-width: 36rem;
    margin-top: 1rem;
}

.contact-other {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 2rem;
    font-weight: 500;
}

.portrait {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    object-fit: cover;
}

.site-footer {
    padding: 2.5rem 0 3rem;
    border-top: 1px solid var(--mist);
    color: var(--slate);
    font-size: .9375rem;
}

.site-footer .wrap {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem 2rem;
}

/* ── Narrow screens: margin column folds above each block ── */
@media (max-width: 860px) {
    .hero {
        padding: 4rem 0;
    }

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

    .row > .aside, .row > .main {
        grid-column: 1;
    }

    .row > .aside {
        padding-top: 0;
        margin-bottom: .35rem;
    }

    .row > .aside:empty {
        display: none;
    }

    .section {
        padding: 3.5rem 0;
    }

    .portrait {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 520px) {
    .site-nav ul {
        gap: 1.25rem;
    }

    .history li {
        grid-template-columns: 1fr;
        gap: .1rem;
    }
}

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

/* ── Error page ── */
.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.error-page main {
    flex: 1;
}


/* ═════════ Portfolio and case studies ═════════
   Same frame as the home page: the margin column carries short notes
   (industry, role, where a claim comes from). The one loud element is the
   workflow route on a case study, which breaks out across the full width.
   Mango marks things that are not the real thing: drafts and concept art. */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.site-nav a[aria-current="page"] {
    color: var(--ink);
    font-weight: 500;
}

.hero-page {
    padding: 4.5rem 0 4rem;
}

.hero-page h1 {
    font-size: clamp(2.2rem, 4.8vw, 3.5rem);
    max-width: 20ch;
}

.hero-note {
    margin-top: 1rem;
    color: var(--slate);
    max-width: 44ch;
}

/* Breadcrumbs */
.crumbs {
    margin-bottom: 2rem;
    font-size: .9375rem;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .5rem;
    list-style: none;
    color: var(--slate);
}

.crumbs li + li::before {
    content: "/";
    margin-right: .5rem;
    color: var(--slate);
}

/* Label/value pairs */
.facts {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 2.25rem;
    margin-top: 1.25rem;
}

.facts dt {
    color: var(--slate);
    font-size: .9375rem;
}

.facts dd {
    font-weight: 500;
}

.facts-hero {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    margin-top: 2.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--mist);
}

/* Draft markers (local preview only) */
.draft-note {
    margin-bottom: 3rem;
    padding: .9rem 1.1rem;
    background: var(--raised);
    border-left: 4px solid var(--mango);
    font-size: .9375rem;
}

.draft-note code {
    font-size: .875em;
}

.draft-tag {
    display: inline-block;
    margin: .5rem 0 0;
    padding: .1rem .45rem;
    background: var(--mango);
    color: var(--on-mango);
    font-size: .8125rem;
    font-weight: 700;
    border-radius: 2px;
}

.draft-tag + .work-thumb {
    margin-top: 1rem;
}

/* Work lists */
.work-list {
    list-style: none;
}

.work-item + .work-item {
    margin-top: 4rem;
    padding-top: 4rem;
    border-top: 1px solid var(--mist);
}

.work-project {
    color: var(--slate);
    font-weight: 500;
    margin-bottom: .4rem;
}

.section .work-title {
    font-size: clamp(1.5rem, 2.6vw, 1.875rem);
    line-height: 1.2;
    margin-bottom: 0;
    text-wrap: balance;
}

.work-title a {
    color: var(--ink);
    text-decoration: none;
}

.work-title a:hover {
    color: var(--indigo);
    text-decoration: underline;
}

.work-thumb {
    margin-top: 1.75rem;
}

.work-summary {
    margin-top: 1.5rem;
    max-width: 38rem;
}

.work-more {
    margin-top: 1.5rem;
    font-weight: 700;
}

.story {
    display: grid;
    gap: 1.1rem;
    margin-top: 1.5rem;
    max-width: 38rem;
}

.story dt {
    font-weight: 700;
}

.story dd {
    color: var(--slate);
}

/* Figures. Concept art sits in a mango frame with its label on top, never optional. */
.shot {
    margin: 0;
}

.shot img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top left;
    border: 1px solid var(--mist);
    border-radius: 4px;
}

.shot figcaption {
    margin-top: .75rem;
    color: var(--slate);
    font-size: .9375rem;
}

.shot.is-concept {
    border: 2px solid var(--mango);
    border-radius: 6px;
    overflow: hidden;
    background: var(--raised);
}

.shot.is-concept img {
    border: 0;
    border-radius: 0;
}

.concept-label {
    background: var(--mango);
    color: var(--on-mango);
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.4;
    padding: .5rem .85rem .55rem;
}

.shot.is-concept figcaption {
    margin: 0;
    padding: .7rem .85rem .8rem;
    border-top: 1px solid var(--mist);
}

/* Case study text */
.section .prose h2 {
    margin-bottom: 1.25rem;
}

.prose p {
    max-width: 38rem;
}

.prose p + p {
    margin-top: 1rem;
}

.prose h3 {
    margin: 2.25rem 0 .5rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.case .section > .wrap + .wrap {
    margin-top: 4rem;
}

/* Workflow route: numbered because it is a real sequence */
.route-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.route {
    list-style: none;
    counter-reset: step;
    display: grid;
    grid-template-columns: repeat(var(--steps, 5), minmax(0, 1fr));
}

.route li {
    position: relative;
    counter-increment: step;
    padding: 3.1rem 1.5rem 0 0;
}

.route li::before {
    content: counter(step);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--indigo);
    color: var(--page);
    font-weight: 700;
    font-size: .9375rem;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 5px var(--page);
}

.route li::after {
    content: "";
    position: absolute;
    top: calc(1.125rem - 1px);
    left: 0;
    right: 0;
    height: 2px;
    background: var(--indigo);
}

.route li:last-child::after {
    display: none;
}

.route strong {
    display: block;
    font-size: 1.125rem;
    line-height: 1.3;
}

.route-text {
    display: block;
    margin-top: .4rem;
    color: var(--slate);
    font-size: .9375rem;
    line-height: 1.45;
}

.branches {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .55rem;
}

.branches span {
    padding: .1rem .5rem;
    border: 1.5px solid var(--indigo);
    border-radius: 4px;
    color: var(--indigo);
    font-size: .875rem;
    font-weight: 500;
}

.route-summary {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--mist);
    color: var(--slate);
    max-width: 40rem;
}

/* Outcome */
.outcome {
    font-size: clamp(1.3rem, 2.4vw, 1.625rem);
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -.01em;
}

.prose .outcome {
    max-width: 36rem;
}

.takeaway {
    margin-top: 1.75rem;
    color: var(--slate);
}

.tech {
    margin-top: 3rem;
    border-top: 1px solid var(--mist);
    border-bottom: 1px solid var(--mist);
    max-width: 38rem;
}

.tech summary {
    cursor: pointer;
    padding: 1rem 0;
    font-weight: 700;
}

.tech ul {
    padding: 0 0 1.25rem 1.25rem;
    color: var(--slate);
}

.tech li + li {
    margin-top: .3rem;
}

.contact .actions {
    margin-top: 2rem;
}

/* Portfolio card grid: one card per row at every width */
.card-grid {
    list-style: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
}

@media (min-width: 40rem) {
    .card-grid {
        gap: 3.5rem;
    }
}

.card-grid > li {
    display: flex;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--raised);
    border: 1px solid var(--mist);
    border-radius: 6px;
    overflow: hidden;
}

.card:focus-within {
    outline: 2px solid var(--indigo);
    outline-offset: 3px;
}

/* The title link covers the whole card, so there is one tab stop per project. */
.card-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.card-title a:focus-visible {
    outline: none;
}

.card .shot.is-concept,
.card .shot img {
    border-radius: 0;
}

.card .shot.is-concept {
    border-width: 0 0 2px;
}

.card .shot img {
    border: 0;
    border-bottom: 1px solid var(--mist);
}

.card .concept-label {
    font-size: .75rem;
    padding: .35rem .7rem .4rem;
}

.cover {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: .25rem;
    aspect-ratio: 16 / 10;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--indigo), var(--indigo-hover));
    color: var(--page);
}

.cover-category {
    font-weight: 700;
    font-size: 1.125rem;
    line-height: 1.25;
}

.cover-note {
    font-size: .875rem;
    opacity: .9;
}

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.25rem 1.25rem 1.4rem;
}

.card-kicker {
    color: var(--slate);
    font-size: .8125rem;
    line-height: 1.4;
    margin-bottom: .5rem;
}

.section .card-title {
    font-size: 1.1875rem;
    line-height: 1.25;
    margin: 0;
    text-wrap: balance;
}

.card-title a {
    color: var(--ink);
    text-decoration: none;
}

.card:hover .card-title a {
    color: var(--indigo);
    text-decoration: underline;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.card-tags:empty {
    display: none;
}

.card-tags .draft-tag,
.card-tags .stage-badge {
    margin: .65rem 0 0;
}

.card-summary {
    margin-top: .85rem;
    font-size: .9375rem;
    line-height: 1.5;
}

.card-role {
    margin-top: .85rem;
    font-size: .875rem;
    font-weight: 700;
}

.chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .75rem;
}

.chips li {
    padding: .1rem .5rem;
    border: 1px solid var(--mist);
    border-radius: 999px;
    color: var(--slate);
    font-size: .8125rem;
}

.card-more {
    margin-top: auto;
    padding-top: 1.1rem;
    font-weight: 700;
    font-size: .9375rem;
}

/* Stage badge: indigo outline, so it never reads as the mango draft marker */
.stage-badge {
    display: inline-block;
    margin: 0 0 1rem;
    padding: .1rem .5rem;
    border: 1.5px solid var(--indigo);
    border-radius: 4px;
    color: var(--indigo);
    font-size: .8125rem;
    font-weight: 700;
    max-width: 100%;
}

.card-tags .stage-badge {
    font-size: .75rem;
    padding: .1rem .4rem;
}

.stage-badge.is-progress {
    background: var(--indigo);
    color: var(--page);
}

/* Case study: solution parts, implemented and planned lists */
.parts {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.75rem;
}

.part {
    padding: 1.1rem 1.25rem 1.25rem;
    background: var(--raised);
    border: 1px solid var(--mist);
    border-radius: 6px;
}

.prose .part h3 {
    margin-top: 0;
}

.part ul,
.prose .checklist,
.planned ul,
.limits {
    margin-top: .6rem;
    padding-left: 1.25rem;
    max-width: 38rem;
}

.part li + li,
.checklist li + li,
.planned li + li,
.limits li + li {
    margin-top: .35rem;
}

.planned {
    padding: 1.25rem 1.4rem 1.4rem;
    border: 2px dashed var(--slate);
    border-radius: 6px;
    max-width: 38rem;
}

.section .planned h2 {
    margin-bottom: .5rem;
    font-size: 1.375rem;
}

.case .section > .wrap.row + .wrap.row {
    margin-top: 3rem;
}

.route-note {
    margin-top: 1rem;
    color: var(--slate);
    font-size: .9375rem;
    max-width: 40rem;
}

.outcome-pending {
    font-size: 1.125rem;
    font-weight: 500;
    padding-left: 1rem;
    border-left: 4px solid var(--indigo);
}

.limits {
    color: var(--slate);
}

@media (max-width: 860px) {
    .hero-page {
        padding: 3rem 0 3rem;
    }

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

    .route li {
        padding: .3rem 0 2rem 3.5rem;
    }

    .route li::after {
        top: 0;
        bottom: 0;
        left: calc(1.125rem - 1px);
        right: auto;
        width: 2px;
        height: auto;
    }

    .route li:last-child {
        padding-bottom: 0;
    }

    .work-item + .work-item {
        margin-top: 3rem;
        padding-top: 3rem;
    }
}

@media (max-width: 520px) {
    .site-nav ul {
        gap: .9rem;
        font-size: .9375rem;
    }

    .site-nav a {
        white-space: nowrap;
    }

    .site-nav .nav-cta {
        padding: .4rem .7rem;
    }
}
