/* =========================================================================
   MABEL TRADING — Stylesheet
   London trading house — modernist, confident, operational
   ========================================================================= */

/* ── 01 · FONT FACES ─────────────────────────────────────────────────────── */

@font-face {
    font-family: 'Akagi Pro';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/AkagiPro-ExtraBold.woff2') format('woff2'),
         url('../fonts/AkagiPro-ExtraBold.woff') format('woff');
}

@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('../fonts/Geist-Regular.woff2') format('woff2');
}

/* ── 02 · TOKENS ─────────────────────────────────────────────────────────── */

:root {
    /* surfaces */
    --paper: #faf8f3;
    --paper-warm: #f1ede2;
    --paper-cool: #ece8dd;

    /* ink */
    --ink: #1a1815;
    --ink-deep: #14110e;
    --ink-soft: #3a3531;
    --ink-mute: #6f6c68;
    --rule: #d9d5cd;

    /* brand */
    --teal: #005577;
    --teal-mid: #0083b4;
    --teal-deep: #164b4f;
    --teal-pale: #84b9c9;

    /* type */
    --display: 'Akagi Pro', 'Helvetica Neue', Arial, sans-serif;
    --sans: 'Geist', 'Helvetica Neue', Arial, sans-serif;

    /* space scale (8px base) */
    --s-1: 0.5rem;
    --s-2: 1rem;
    --s-3: 1.5rem;
    --s-4: 2rem;
    --s-5: 3rem;
    --s-6: 4.5rem;
    --s-7: 6rem;
    --s-8: 9rem;
    --s-9: 12rem;

    /* layout */
    --gutter: clamp(1.25rem, 5vw, 4rem);
    --container: 1280px;

    /* motion */
    --easing: cubic-bezier(0.22, 1, 0.36, 1);
    --reveal-dur: 800ms;
}

/* ── 03 · RESET + BASE ───────────────────────────────────────────────────── */

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.6;
    font-feature-settings: "calt", "rlig", "kern", "ss01";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

a {
    color: inherit;
    text-decoration-color: var(--rule);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    transition: text-decoration-color 220ms var(--easing), color 220ms var(--easing);
}

a:hover {
    text-decoration-color: var(--teal);
}

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

p {
    margin: 0 0 1.1em;
}

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

::selection {
    background: var(--teal);
    color: var(--paper);
}

.skip-link {
    position: absolute;
    left: -9999px;
}
.skip-link:focus {
    left: var(--s-2);
    top: var(--s-2);
    background: var(--ink);
    color: var(--paper);
    padding: 0.6em 1em;
    text-decoration: none;
    z-index: 100;
}

/* ── 04 · TYPE ATOMS ─────────────────────────────────────────────────────── */

.section__label,
.card__sector,
.hero__fact dt,
.details__row dt,
.site-footer__legal,
.site-footer__company,
.brand__wordmark + .meta {
    font-family: var(--sans);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-mute);
}

.section__label {
    margin: 0 0 var(--s-2);
    color: var(--teal);
    letter-spacing: 0.2em;
}

.hero__sub {
    font-family: var(--sans);
    font-size: clamp(1rem, 1.4vw, 1.1875rem);
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 36rem;
    margin: var(--s-3) 0 0;
}

.hairline {
    height: 1px;
    background: var(--rule);
    border: 0;
    margin: 0;
}

/* ── 05 · LINK ARROW ─────────────────────────────────────────────────────── */

.link-arrow {
    display: inline-flex;
    align-items: baseline;
    gap: 0.55em;
    font-family: var(--sans);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-deep);
    text-decoration: none;
    padding: 0.65em 0;
    position: relative;
    transition: color 220ms var(--easing);
}

.link-arrow::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--ink-deep);
    transform-origin: left center;
    transform: scaleX(1);
    transition: transform 320ms var(--easing);
}

.link-arrow:hover {
    color: var(--teal);
}

.link-arrow:hover::after {
    background: var(--teal);
    animation: rule-slide 480ms var(--easing) forwards;
}

@keyframes rule-slide {
    0%   { transform: scaleX(1); transform-origin: right center; }
    50%  { transform: scaleX(0); transform-origin: right center; }
    51%  { transform: scaleX(0); transform-origin: left center; }
    100% { transform: scaleX(1); transform-origin: left center; }
}

.link-arrow__glyph {
    transition: transform 320ms var(--easing);
    flex-shrink: 0;
}

.link-arrow:hover .link-arrow__glyph {
    transform: translate(2px, -2px);
}

.link-arrow--strong {
    font-size: 0.9375rem;
    color: var(--paper);
    background: var(--teal);
    padding: 1.1em 1.6em;
    letter-spacing: 0.16em;
}

.link-arrow--strong::after {
    display: none;
}

.link-arrow--strong:hover {
    color: var(--paper);
    background: var(--teal-deep);
}

.link-arrow--block {
    margin-top: var(--s-3);
}

/* ── 06 · HEADER ─────────────────────────────────────────────────────────── */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem var(--gutter);
    transition: background-color 320ms var(--easing), border-color 320ms var(--easing), backdrop-filter 320ms var(--easing);
    border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
    background: rgba(250, 248, 243, 0.85);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom-color: var(--rule);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--ink-deep);
}

.brand picture,
.brand img {
    display: block;
}

.brand img {
    height: clamp(40px, 4.5vw, 56px);
    width: auto;
}

.brand--footer img {
    height: 44px;
}

.site-nav__list {
    display: flex;
    gap: clamp(1rem, 3vw, 2.5rem);
}

.site-nav__list a {
    font-family: var(--sans);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-deep);
    text-decoration: none;
    position: relative;
    padding: 0.4em 0;
    transition: color 220ms var(--easing);
}

.site-nav__list a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.1em;
    height: 1px;
    background: currentColor;
    transform-origin: right center;
    transform: scaleX(0);
    transition: transform 320ms var(--easing);
}

.site-nav__list a:hover {
    color: var(--teal);
}

.site-nav__list a:hover::after {
    transform-origin: left center;
    transform: scaleX(1);
}

/* ── 07 · HERO ───────────────────────────────────────────────────────────── */

.hero {
    position: relative;
    min-height: 100svh;
    padding: clamp(7rem, 16vh, 12rem) var(--gutter) var(--s-5);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero__inner {
    position: relative;
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
}

.hero__heading {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(2.5rem, 7.5vw, 6.5rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
    color: var(--ink-deep);
    margin: 0;
    max-width: 18ch;
}

.hero__foot {
    margin-top: clamp(var(--s-5), 5vw, var(--s-6));
}

/* facts strip at the bottom of the hero — operational confidence */
.hero__facts {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-3);
    width: 100%;
    max-width: var(--container);
    margin: clamp(var(--s-6), 12vh, var(--s-8)) auto 0;
    padding-top: var(--s-3);
    border-top: 1px solid var(--rule);
}

@media (min-width: 720px) {
    .hero__facts {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--s-4);
    }
}

.hero__fact {
    display: flex;
    flex-direction: column;
    gap: var(--s-1);
}

.hero__fact dt {
    margin: 0;
}

.hero__fact dd {
    margin: 0;
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.125rem, 1.6vw, 1.375rem);
    letter-spacing: -0.01em;
    color: var(--ink-deep);
}

/* ── 08 · SECTION FRAME ──────────────────────────────────────────────────── */

.section {
    position: relative;
    padding: clamp(var(--s-7), 12vw, var(--s-9)) var(--gutter);
    max-width: var(--container);
    margin: 0 auto;
}

.section + .section {
    border-top: 1px solid var(--rule);
}

.section__head {
    margin-bottom: var(--s-5);
}

.section__heading {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.875rem, 4.2vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--ink-deep);
    margin: 0;
    max-width: 28ch;
}

/* ── 09 · ABOUT ──────────────────────────────────────────────────────────── */

.section--about {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-3);
}

@media (min-width: 920px) {
    .section--about {
        grid-template-columns: 1fr 2fr;
        grid-template-areas:
            "label   heading"
            "prose   mark";
        column-gap: clamp(2rem, 6vw, 5rem);
        row-gap: clamp(2.5rem, 5vw, 4rem);
        align-items: start;
    }

    .section--about .section__label   { grid-area: label; margin-top: 0.4em; }
    .section--about .section__heading { grid-area: heading; }
    .section--about .prose            { grid-area: prose; }
    .section--about .about__collage   { grid-area: collage; align-self: start; }

    .section--about {
        grid-template-areas:
            "label   heading"
            "prose   collage";
    }
}

/* ── 09a · ABOUT — photo collage ─────────────────────────────────────── */

.about__collage {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(0.5rem, 1vw, 0.75rem);
    width: 100%;
    margin-top: var(--s-2);
}

.about__tile {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin: 0;
    background: var(--paper-cool);
}

.about__tile picture,
.about__tile img {
    display: block;
    width: 100%;
    height: 100%;
}

.about__tile img {
    object-fit: cover;
    transition: transform 1200ms var(--easing), filter 600ms var(--easing);
    filter: saturate(0.94);
}

.about__tile:hover img {
    transform: scale(1.04);
    filter: saturate(1.05);
}

/* ── 10 · PROSE ──────────────────────────────────────────────────────────── */

.prose {
    max-width: 38rem;
    font-size: clamp(1rem, 1.2vw, 1.0625rem);
    line-height: 1.65;
    color: var(--ink);
}

.prose p {
    margin-bottom: 1.1em;
}

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

.prose p:first-child {
    font-size: 1.18em;
    font-weight: 500;
    line-height: 1.5;
    color: var(--ink-deep);
}

/* ── 11 · PORTFOLIO (subsidiary cards) ───────────────────────────────────── */

.portfolio {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-7);
    margin-top: var(--s-3);
}

@media (min-width: 920px) {
    .portfolio {
        grid-template-columns: 1fr 1fr;
        gap: clamp(2.5rem, 5vw, 5rem);
        align-items: start;
    }
    .card--offset-up {
        margin-top: 0;
    }
    .card--offset-down {
        margin-top: clamp(3rem, 8vw, 6rem);
    }
}

.card {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.card__cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: var(--paper-cool);
}

.card__cover picture {
    display: block;
    width: 100%;
    height: 100%;
}

.card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1200ms var(--easing), filter 600ms var(--easing);
    filter: saturate(0.94);
}

.card:hover .card__cover img {
    transform: scale(1.04);
    filter: saturate(1.06);
}

.card__body {
    padding: var(--s-2) 0 0;
}

.card__sector {
    margin: 0 0 var(--s-2);
    color: var(--teal);
}

.card__heading {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.75rem, 3.2vw, 2.5rem);
    line-height: 1;
    letter-spacing: -0.025em;
    color: var(--ink-deep);
    margin: 0 0 var(--s-3);
}

.card .prose {
    font-size: 1rem;
    max-width: 34rem;
}

/* ── 12 · CONTACT DETAILS ────────────────────────────────────────────────── */

.details {
    display: grid;
    grid-template-columns: 1fr;
    border-top: 1px solid var(--rule);
    margin: var(--s-3) 0 0;
    padding: 0;
}

.details__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-1);
    padding: var(--s-3) 0;
    border-bottom: 1px solid var(--rule);
}

@media (min-width: 720px) {
    .details__row {
        grid-template-columns: 16rem 1fr;
        gap: var(--s-4);
        align-items: baseline;
        padding: var(--s-4) 0;
    }
}

.details__row dt {
    margin: 0;
}

.details__row dd {
    margin: 0;
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.5;
    color: var(--ink-deep);
}

.details__row address {
    font-style: normal;
}

.details__row a {
    text-decoration-color: var(--rule);
}

.details__social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85em;
}

.details__social li:not(:last-child)::after {
    content: "·";
    margin-left: 0.85em;
    color: var(--rule);
}

.details__social a {
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.05em;
    transition: border-color 220ms var(--easing), color 220ms var(--easing);
}

.details__social a:hover {
    color: var(--teal);
    border-bottom-color: var(--teal);
}

/* ── 13 · FOOTER ─────────────────────────────────────────────────────────── */

.site-footer {
    border-top: 1px solid var(--rule);
    background: var(--paper-warm);
    padding: var(--s-5) var(--gutter) var(--s-4);
    color: var(--ink-soft);
}

.site-footer__inner {
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-3);
    align-items: start;
}

@media (min-width: 720px) {
    .site-footer__inner {
        grid-template-columns: auto 1fr auto;
        gap: var(--s-5);
        align-items: center;
    }
}

.brand--footer .brand__wordmark {
    font-size: 1.25rem;
}

.site-footer__company {
    margin: 0;
    font-size: 0.6875rem;
    line-height: 1.7;
    letter-spacing: 0.06em;
    text-transform: none;
    color: var(--ink-mute);
}

.site-footer__legal {
    display: flex;
    gap: 1.25rem;
}

.site-footer__legal a {
    text-decoration: none;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-mute);
    transition: color 220ms var(--easing);
}

.site-footer__legal a:hover {
    color: var(--teal);
}

.site-footer__copy {
    grid-column: 1 / -1;
    margin: var(--s-3) 0 0;
    padding-top: var(--s-3);
    border-top: 1px solid var(--rule);
    font-size: 0.8125rem;
    color: var(--ink-mute);
    text-align: center;
}

/* ── 14 · REVEAL ANIMATIONS ──────────────────────────────────────────────── */

[data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--reveal-dur) var(--easing), transform var(--reveal-dur) var(--easing);
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

/* ── 15 · MOBILE TWEAKS ──────────────────────────────────────────────────── */

@media (max-width: 720px) {
    .site-nav__list {
        gap: 1rem;
    }

    .site-nav__list a {
        font-size: 0.6875rem;
    }

    .brand__wordmark {
        font-size: 1.25rem;
    }

    .hero__heading {
        line-height: 0.98;
    }
}
