@font-face {
    font-family: "Bricolage Grotesque";
    src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2");
    font-weight: 200 800;
    font-display: swap;
}

/* The world: a polished showroom floor. Everything stands on a horizon line
   and is answered by its reflection, like the "Ma" in the logo. */

:root {
    --stone: #eef1f4;
    --stone-deep: #dde2e8;
    --ink: #0b0d12;
    --ink-soft: #1a1e27;
    --graphite: #4d5562;
    --mist: #b7bfcb;
    --minutes: #e3141b;
    --money: #f0533f;

    --font: "Bricolage Grotesque", system-ui, sans-serif;
    --measure: 66ch;
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --gap: clamp(6rem, 14vw, 11rem);
    --line: 2px;

    /* One motion clock for every lift and every reflection */
    --clock: 420ms;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --lift: -14px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 1rem;
    scrollbar-color: var(--graphite) var(--stone);
}

body {
    margin: 0;
    overflow-x: clip;
    background: var(--stone);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1.125rem;
    line-height: 1.55;
}

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

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

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

a:hover {
    text-decoration-thickness: 2px;
}

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

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.05;
    font-weight: 700;
    text-wrap: balance;
}

h3 {
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

p {
    margin: 0;
    max-width: var(--measure);
    text-wrap: pretty;
}

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

.skip-link {
    position: absolute;
    z-index: 10;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--ink);
    color: var(--stone);
    transform: translateY(-200%);
}

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

.wrap {
    max-width: 84rem;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

/* The horizon: one full-bleed line under whatever it carries */

.on-line {
    position: relative;
}

.on-line::before {
    content: "";
    position: absolute;
    z-index: 0;
    left: 50%;
    bottom: 0;
    width: 100vw;
    height: var(--line);
    background: currentColor;
    transform: translateX(-50%);
    transform-origin: left center;
}

/* Mirrored text: a flipped copy below the baseline, fading out */

.mirror {
    position: relative;
    display: block;
}

.mirror::after {
    content: attr(data-text);
    position: absolute;
    inset-inline: 0;
    top: 100%;
    margin-top: var(--mirror-gap, 0.04em);
    opacity: var(--mirror-strength, 0.16);
    transform: scaleY(-1);
    -webkit-mask-image: linear-gradient(to bottom, transparent 30%, #000 100%);
    mask-image: linear-gradient(to bottom, transparent 30%, #000 100%);
    pointer-events: none;
    transition: opacity var(--clock) var(--ease);
}

/* Objects standing on the line: the image and its reflection */

.stand {
    position: relative;
    margin: 0;
}

.stand .object,
.stand .reflection {
    transition: transform var(--clock) var(--ease), opacity var(--clock) var(--ease);
}

.stand .reflection {
    position: absolute;
    left: 0;
    top: calc(100% + var(--line) + 2px);
    width: 100%;
    opacity: 0.22;
    transform: scaleY(-1);
    -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 45%);
    mask-image: linear-gradient(to top, #000 0%, transparent 45%);
    pointer-events: none;
    user-select: none;
}

/* Depth is the only state: focus lifts the object off the line, and the
   reflection drops away by the same distance */

.stand:hover .object,
.stand:focus-within .object {
    transform: translateY(var(--lift));
}

.stand:hover .reflection,
.stand:focus-within .reflection {
    opacity: 0.12;
    transform: scaleY(-1) translateY(var(--lift));
}

.stand figcaption {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.9rem);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
}

.screen {
    border-radius: 10px;
    box-shadow: 0 18px 40px -12px rgb(11 13 18 / 0.35);
}

.phone {
    border: 6px solid var(--ink);
    border-radius: 26px;
    background: var(--ink);
    box-shadow: 0 18px 40px -12px rgb(11 13 18 / 0.35);
}

/* Header */

.site-bar {
    display: flex;
    align-items: center;
    gap: 1rem 2rem;
    padding-block: 1.25rem;
}

.logo img {
    width: 44px;
    height: 44px;
}

.site-nav {
    display: flex;
    gap: 0.25rem 1.75rem;
    margin-left: auto;
    font-weight: 500;
}

.site-nav a,
.languages a {
    text-decoration: none;
    transition: font-weight var(--clock) var(--ease);
}

.site-nav a:hover {
    font-weight: 700;
}

.languages ul {
    display: flex;
    gap: 0.15rem;
}

.languages a {
    display: block;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--graphite);
}

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

.languages a[aria-current="page"] {
    background: var(--ink);
    color: var(--stone);
}

/* Hero */

.hero {
    padding-top: clamp(1.5rem, 5vh, 3.5rem);
}

.hero-copy {
    max-width: 40rem;
}

.lead {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    line-height: 1.25;
    letter-spacing: -0.015em;
    font-weight: 500;
}

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

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.4rem;
    border-radius: 999px;
    background: var(--ink);
    color: var(--stone);
    font-weight: 700;
    text-decoration: none;
    transition: transform var(--clock) var(--ease), box-shadow var(--clock) var(--ease), background-color 150ms;
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px -10px rgb(11 13 18 / 0.6);
}

.button:active {
    transform: translateY(0);
    transition-duration: 100ms;
}

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

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

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

.button.ghost {
    background: transparent;
    color: inherit;
    box-shadow: inset 0 0 0 2px currentColor;
}

.button svg {
    width: 1.1em;
    height: 1.1em;
    fill: currentColor;
}

.button.ghost:hover {
    box-shadow: inset 0 0 0 2px currentColor, 0 10px 22px -10px rgb(11 13 18 / 0.45);
}

.hero-floor {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: clamp(1.5rem, 4vw, 4rem);
    margin-top: clamp(1rem, 4vh, 3rem);
}

/* The wordmark comes first for screen readers but sits on the line */
.hero-left {
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 9vh, 6rem);
}

.hero-left .wordmark {
    order: 2;
}

.wordmark {
    --mirror-gap: 0.03em;
    --mirror-strength: 0.2;
    position: relative;
    z-index: 1;
    margin: 0 0 0 -0.04em;
    font-size: clamp(4rem, 12vw, 13rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 0.74;
    white-space: nowrap;
}

.wordmark > span {
    display: inline-block;
}

/* "Software" rides the line beside MaMo; only MaMo is reflected */
.wordmark-name {
    margin-left: 0.08em;
    font-size: max(0.24em, 0.8rem);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.hero-objects {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: clamp(1rem, 2vw, 2rem);
}

.hero-objects .window {
    flex: 0 1 36rem;
    min-width: 0;
}

.hero-objects .handheld {
    flex: none;
    width: clamp(6.5rem, 9.5vw, 10rem);
}

/* Room under the line for the reflections and captions */
.hero-floor + .floor-space {
    height: clamp(7rem, 16vh, 11rem);
}

/* Entrance: the line draws, MaMo settles on it, its reflection develops,
   then the apps set down on the same line. */

@media (prefers-reduced-motion: no-preference) {
    .hero-floor::before {
        animation: draw 900ms var(--ease) both;
    }

    .wordmark > span:first-child {
        animation: settle 1100ms var(--ease) 150ms both;
    }

    .wordmark > span:first-child::after {
        animation: develop 1400ms var(--ease) 500ms both;
    }

    .hero-objects .stand {
        animation: set-down 900ms var(--ease) both;
    }

    .hero-objects .stand:nth-child(1) { animation-delay: 450ms; }
    .hero-objects .stand:nth-child(2) { animation-delay: 600ms; }

    .hero-objects .reflection {
        animation: develop-image 1200ms var(--ease) 800ms both;
    }
}

@keyframes draw {
    from { transform: translateX(-50%) scaleX(0); }
    to { transform: translateX(-50%) scaleX(1); }
}

@keyframes settle {
    from { transform: translateY(-0.12em); }
    to { transform: none; }
}

@keyframes develop {
    from { opacity: 0; }
    to { opacity: var(--mirror-strength, 0.16); }
}

@keyframes set-down {
    from { transform: translateY(-40px); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@keyframes develop-image {
    from { opacity: 0; }
    to { opacity: 0.22; }
}

/* Sections */

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

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

.section-head h2 {
    --mirror-strength: 0.14;
    position: relative;
    z-index: 1;
    padding-bottom: 0.02em;
    font-size: clamp(3rem, 9vw, 8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 0.86;
}

/* Reflections develop when a section reaches the screen (with JS only;
   without it they are simply there) */
.js .section-head:not(.is-in) .mirror::after {
    opacity: 0;
    transition-duration: 0ms;
}

.js .section-head .mirror::after {
    transition: opacity 1400ms var(--ease) 200ms;
}

@media (prefers-reduced-motion: no-preference) {
    .js .section-head.on-line::before {
        transition: transform 1000ms var(--ease);
    }

    .js .section-head:not(.is-in).on-line::before {
        transform: translateX(-50%) scaleX(0);
    }
}

.intro {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr));
    gap: 1.5rem clamp(2rem, 6vw, 6rem);
    align-items: start;
}

.intro .lead {
    max-width: 22ch;
}

.intro p + p,
.intro .actions {
    margin-top: 1.25rem;
}

.note {
    font-size: 1rem;
    opacity: 0.8;
}

/* Family Money: black polished stone */

.dark {
    background: var(--ink);
    color: var(--stone);
    scrollbar-color: var(--mist) var(--ink);
}

.dark ::selection {
    background: var(--money);
    color: var(--ink);
}

.dark :focus-visible {
    outline-color: var(--money);
}

.fm-stage {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(1.5rem, 4vw, 4rem);
    margin-top: clamp(4rem, 9vw, 7rem);
}

.fm-stage .window {
    width: min(100%, 52rem);
}

.fm-stage .handheld {
    flex: none;
    width: clamp(7rem, 15vw, 13rem);
}

.dark .stand .reflection {
    opacity: 0.3;
}

.dark .stand:hover .reflection,
.dark .stand:focus-within .reflection {
    opacity: 0.16;
}

.dark .screen,
.dark .phone {
    box-shadow: 0 24px 60px -18px rgb(0 0 0 / 0.9);
}

.dark .phone {
    border-color: var(--ink-soft);
    background: var(--ink-soft);
}

.stage-space {
    height: clamp(6rem, 14vw, 11rem);
}

/* The dense index of what Family Money does */

.index {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem clamp(1.5rem, 3vw, 3rem);
}

.index h4 {
    margin: 0;
    padding-bottom: 0.6rem;
    border-bottom: var(--line) solid currentColor;
    color: var(--money);
    font-size: 1.05rem;
    font-weight: 700;
}

.index ul {
    hyphens: auto;
    overflow-wrap: break-word;
    margin-top: 0.75rem;
    font-size: 1rem;
    line-height: 1.35;
}

.index li + li {
    margin-top: 0.45rem;
}

.index-title {
    margin-bottom: 2rem;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    letter-spacing: -0.02em;
}

/* My Meeting Minutes: the red field */

.red {
    background: var(--minutes);
    color: #fff;
    scrollbar-color: #fff var(--minutes);
}

.red ::selection {
    background: #fff;
    color: var(--minutes);
}

.red :focus-visible {
    outline-color: #fff;
}

.app-mark {
    display: inline-grid;
    place-items: center;
    width: clamp(3.5rem, 6vw, 4.75rem);
    aspect-ratio: 1;
    margin-bottom: 1.25rem;
    border-radius: 16px;
    background: #fff;
}

.app-mark img {
    width: 66%;
}

.red .app-mark {
    background: var(--ink);
}

.price {
    margin-top: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
}

.features {
    margin-top: clamp(3rem, 6vw, 4.5rem);
    columns: 2 22rem;
    column-gap: clamp(2rem, 5vw, 5rem);
}

.features li {
    break-inside: avoid;
    padding: 0.7rem 0;
    border-top: 1px solid rgb(255 255 255 / 0.45);
}

/* Screenshots stand on the line in a row that scrolls sideways */

.shots-block {
    margin-top: clamp(4rem, 8vw, 6rem);
}

.shots-block .hint {
    margin-top: 0.25rem;
    font-size: 1rem;
}

.shots {
    display: flex;
    align-items: flex-end;
    gap: clamp(1rem, 2vw, 1.75rem);
    margin-top: 1.5rem;
    /* Room above for the lift and below for the reflections */
    padding: 1.5rem 0 clamp(6rem, 11vw, 9rem);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.shots li {
    flex: none;
    width: min(78vw, 30rem);
    scroll-snap-align: start;
}

.shots .stand {
    border-bottom: var(--line) solid currentColor;
}

.shots .object {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 16px 36px -14px rgb(60 0 0 / 0.65);
}

.shots img {
    width: 100%;
    aspect-ratio: 600 / 383;
    object-fit: cover;
    object-position: top left;
}

.shots .stand .reflection {
    top: calc(100% + 4px);
    border-radius: 8px;
}

/* Lightbox */

.lightbox {
    max-width: 94vw;
    max-height: 92vh;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
}

.lightbox::backdrop {
    background: rgb(11 13 18 / 0.9);
}

.lightbox[open] {
    animation: lift-in 300ms var(--ease);
}

@keyframes lift-in {
    from { transform: translateY(16px); opacity: 0; }
}

.lightbox img {
    max-width: 94vw;
    max-height: 84vh;
    border-radius: 6px;
}

.lightbox p {
    margin-top: 0.75rem;
    color: var(--stone);
    font-size: 1rem;
}

.lightbox button {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.5rem);
    padding: 0.35rem 0.9rem;
    border: 0;
    border-radius: 999px;
    background: var(--stone);
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

/* What we build: each service is a row standing on its own line */

.services {
    margin-top: clamp(3rem, 6vw, 5rem);
    border-top: var(--line) solid var(--ink);
}

.service {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
    gap: 1rem clamp(2rem, 6vw, 6rem);
    padding-block: clamp(2rem, 4vw, 3.25rem);
    border-bottom: var(--line) solid var(--ink);
}

.service h3 {
    font-size: clamp(2rem, 4.4vw, 3.75rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 0.95;
    transition: font-weight var(--clock) var(--ease), transform var(--clock) var(--ease);
}

.service:hover h3 {
    font-weight: 800;
    transform: translateY(-6px);
}

.service p {
    color: var(--graphite);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
}

.tags li {
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: var(--stone-deep);
    font-size: 0.95rem;
    font-weight: 500;
}

.closing {
    margin-top: clamp(3rem, 6vw, 4.5rem);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
}

/* Contact: the address is the last horizon */

.contact .section-head {
    margin-bottom: clamp(3rem, 6vw, 5rem);
}

.mail-line {
    max-width: none;
    --mirror-strength: 0.18;
    margin-bottom: clamp(4rem, 8vw, 6rem);
}

.mail-line a {
    position: relative;
    z-index: 1;
    display: inline-block;
    font-size: clamp(1.6rem, 5.2vw, 5.25rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 0.9;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: transform var(--clock) var(--ease), color 150ms;
}

.mail-line a:hover,
.mail-line a:focus-visible {
    color: var(--money);
    transform: translateY(var(--lift));
}

.contact dl {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem 4rem;
    margin: 0;
}

.contact dt {
    color: var(--mist);
    font-size: 1rem;
}

.contact dd {
    margin: 0.25rem 0 0;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* Footer */

.site-footer {
    background: var(--ink);
    color: var(--mist);
    font-size: 1rem;
}

.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 2rem;
    padding-block: 2rem 2.5rem;
    border-top: 1px solid rgb(255 255 255 / 0.12);
}

.site-footer ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

/* Narrow screens */

@media (max-width: 56rem) {
    .hero-floor {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: end;
    }

    .hero-left {
        display: contents;
    }

    .hero-copy {
        grid-column: 1 / -1;
        margin-bottom: clamp(3rem, 10vh, 5rem);
    }

    .hero-objects {
        order: 3;
    }

    .hero-objects .handheld {
        flex: none;
    }

    .site-nav {
        display: none;
    }

    .languages {
        margin-left: auto;
    }

    .hero-objects .window {
        display: none;
    }

    .hero-objects .handheld {
        width: clamp(5rem, 22vw, 8rem);
    }

    .hero-objects figcaption {
        right: 0;
        left: auto;
        white-space: normal;
        width: 9rem;
        text-align: right;
    }

    .hero-floor {
        gap: 1rem;
    }

    .wordmark {
        font-size: clamp(3rem, 16vw, 8rem);
    }

    .fm-stage .window {
        display: none;
    }

    .fm-stage .handheld {
        width: min(60vw, 15rem);
    }
}

/* Language picker at the site root */

.picker {
    padding-block: clamp(3rem, 10vw, 7rem);
}

.picker .wordmark {
    padding-bottom: 0.02em;
}

.picker ul {
    margin-top: clamp(5rem, 17vw, 12rem);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 600;
}

/* Privacy policies */

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

.legal {
    max-width: var(--measure);
    margin-inline: auto;
    padding: 2rem var(--gutter) 4rem;
}

.legal > ul {
    padding-left: 1.25rem;
    list-style: disc;
}

.legal h1 {
    margin-top: 1.5rem;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.03em;
}

.legal h2 {
    margin-top: 2.5rem;
    font-size: 1.6rem;
}

.legal h3 {
    margin-top: 1.5rem;
}

.legal > p,
.legal > ul > li {
    margin-top: 0.75rem;
}

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

    :root {
        --lift: 0px;
    }

    .service:hover h3 {
        transform: none;
    }
}

@media (min-width: 60rem) {
    .index {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Family Money gallery on the black stone */

.dark .shots .object {
    box-shadow: 0 16px 36px -14px rgb(0 0 0 / 0.9);
}

.dark .shots-block {
    margin-top: 0;
}

.dark .shots-block + .index-title {
    margin-top: clamp(2rem, 5vw, 4rem);
}
