/* valueaddapps.com: one stylesheet, no external requests. Colours are the app's own tokens (src/ui/theme.ts). */

@font-face {
    font-family: 'Space Grotesk';
    src: url('fonts/SpaceGrotesk-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Space Grotesk';
    src: url('fonts/SpaceGrotesk-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;
    --lime: #c6f432;
    --ink: #0b0c0f;
    --ground: #f3f4f1;
    --surface: #ffffff;
    --text: #0f1115;
    --muted: #5b6370;
    --line: #dcdfd6;
    --link: #4f7a00;
    --paper: #fbfaf6;
    --paper-ink: #1c1d20;
    --paper-faint: #86827a;
    --fade-from: #5b6370;
    --fade-to: #848980;
    --chip: #0b0c0f;
    --display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
    --body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --measure: 68ch;
    --page: 72rem;
    --gutter: clamp(1rem, 4vw, 2.5rem);
}

@media (prefers-color-scheme: dark) {
    :root {
        --ground: #0b0c0f;
        --surface: #16181d;
        --text: #f4f5f7;
        --muted: #9aa1ad;
        --line: #2a2e37;
        --link: #c6f432;
        --fade-from: #9aa1ad;
        --fade-to: #6b717c;
        --chip: #23262e;
    }
}

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

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

body {
    margin: 0;
    background: var(--ground);
    color: var(--text);
    font: 400 1.0625rem/1.6 var(--body);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--link);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

a:hover {
    text-decoration-thickness: 0.14em;
}

:focus-visible {
    outline: 3px solid var(--lime);
    outline-offset: 3px;
    border-radius: 4px;
    box-shadow: 0 0 0 6px var(--ink);
}

.skip {
    position: absolute;
    left: var(--gutter);
    top: -4rem;
    padding: 0.5rem 0.875rem;
    background: var(--lime);
    color: var(--ink);
    font: 500 1rem var(--display);
    border-radius: 8px;
    z-index: 2;
}

.skip:focus {
    top: 1rem;
}

.wrap {
    max-width: var(--page);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* Header and footer */

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text);
    text-decoration: none;
    font: 700 1.25rem/1 var(--display);
    letter-spacing: -0.01em;
}

.brand img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
}

.nav {
    display: flex;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font: 500 1rem/1.2 var(--display);
}

.nav a:hover {
    background: var(--surface);
}

.nav a[aria-current='page'] {
    background: var(--text);
    color: var(--ground);
}

.foot {
    margin-top: clamp(4rem, 10vw, 7rem);
    padding-bottom: 2.5rem;
    color: var(--muted);
    font-size: 0.9375rem;
}

.foot ul {
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin: 0 0 0.75rem;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
    list-style: none;
}

.foot p {
    margin: 0;
}

/* Type */

h1,
h2,
h3 {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0;
}

/* Landing hero */

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    align-items: start;
    gap: clamp(1.5rem, 3vw, 2.5rem) clamp(2rem, 6vw, 5rem);
    padding-top: clamp(2rem, 7vw, 5.5rem);
}

.headline {
    grid-column: 1 / -1;
    font-size: clamp(2.75rem, 8.2vw, 6.5rem);
    line-height: 0.98;
    letter-spacing: -0.035em;
}

.headline span {
    display: block;
}

/* Thermal paper fading: the first line loses its ink from left to right, and stays readable (3:1 for large text). */
.headline .fades {
    background: linear-gradient(90deg, var(--fade-from), var(--fade-to));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    margin: 1.5rem 0 0;
    max-width: 30ch;
    font: 500 clamp(1.25rem, 2.2vw, 1.5rem) / 1.35 var(--display);
    letter-spacing: -0.01em;
}

.stores {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

/* Until the store IDs exist these are labels, not links. Swap each for an <a> with the official badge then. */
.store {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    min-height: 3.25rem;
    padding: 0.5rem 1.125rem;
    border: 1.5px dashed var(--muted);
    border-radius: 12px;
    color: var(--text);
    font: 700 1.0625rem/1.15 var(--display);
}

.store small {
    color: var(--muted);
    font: 500 0.8125rem/1.3 var(--display);
}

.promise {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 1.75rem 0 0;
    color: var(--muted);
    font-size: 1rem;
}

.promise::before {
    content: '';
    flex: none;
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lime) 30%, transparent);
}

/* The receipt: what PaperTin reads, marked as a person would with a highlighter. */

.slip {
    justify-self: center;
    width: min(100%, 22rem);
    margin: 0;
}

.receipt {
    position: relative;
    padding: 1.75rem 1.5rem 2.25rem;
    background: var(--paper);
    color: var(--paper-ink);
    font: 500 0.9375rem/1.55 var(--display);
    letter-spacing: 0.01em;
    transform: rotate(-2deg);
    box-shadow:
        0 1px 0 rgb(0 0 0 / 0.04),
        0 18px 40px -18px rgb(11 12 15 / 0.35);
}

.receipt p {
    margin: 0;
}

.receipt .shop {
    font-weight: 700;
    font-size: 1.0625rem;
    letter-spacing: 0.04em;
}

.receipt .faint {
    color: var(--paper-faint);
}

.receipt .row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.receipt hr {
    border: 0;
    border-top: 1.5px dashed #c9c5bb;
    margin: 0.875rem 0;
}

.mark {
    position: relative;
    display: inline-block;
    padding: 0 0.2em;
    margin: 0 -0.2em;
    isolation: isolate;
}

.mark::before {
    content: '';
    position: absolute;
    inset: 0.12em 0 0.06em;
    background: var(--lime);
    border-radius: 3px;
    z-index: -1;
    transform-origin: left center;
    animation: mark 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(300ms + var(--i, 0) * 220ms);
}

.m1 {
    --i: 1;
}

.m2 {
    --i: 2;
}

.m3 {
    --i: 3;
}

@keyframes mark {
    from {
        transform: scaleX(0);
    }
}

.check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: fit-content;
    margin: -0.5rem 0 0 auto;
    padding: 0.75rem 1rem;
    position: relative;
    background: var(--chip);
    color: #f4f5f7;
    border-radius: 14px;
    font: 500 0.9375rem/1.3 var(--display);
    transform: rotate(1.5deg);
}

.check strong {
    display: block;
    color: var(--lime);
    font-weight: 700;
    font-size: 1.0625rem;
}

.check img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

/* What it does */

.does {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem clamp(2rem, 5vw, 4rem);
    margin: clamp(4rem, 10vw, 7rem) 0 0;
    padding: 0;
    list-style: none;
}

.does li {
    border-top: 2px solid var(--text);
    padding-top: 1rem;
    max-width: 34rem;
}

.does h2 {
    font-size: clamp(1.375rem, 2.4vw, 1.75rem);
}

.does p {
    margin: 0.5rem 0 0;
    color: var(--muted);
}

/* Documents: privacy policy and support */

.doc {
    padding-top: clamp(2rem, 6vw, 4rem);
}

/* The page column lines up with the header; the text inside keeps a readable measure. */
.doc > * {
    max-width: var(--measure);
}

.doc h1 {
    font-size: clamp(2.25rem, 5.5vw, 3.5rem);
    letter-spacing: -0.03em;
}

.doc .lede {
    margin: 0.75rem 0 0;
    color: var(--muted);
}

.doc h2 {
    font-size: 1.5rem;
    margin: 2.75rem 0 0.75rem;
    scroll-margin-top: 1rem;
}

.doc h3 {
    font-size: 1.1875rem;
    letter-spacing: -0.01em;
    margin: 2rem 0 0.5rem;
}

.doc p,
.doc ul,
.doc ol {
    margin: 0.75rem 0 0;
}

.doc li + li {
    margin-top: 0.375rem;
}

.doc dl {
    margin: 1rem 0 0;
}

.doc dt {
    font: 700 1.0625rem/1.4 var(--display);
    margin-top: 1rem;
}

.doc dd {
    margin: 0.25rem 0 0;
}

.short {
    margin-top: 2rem;
    padding: 1.5rem 1.5rem 1.625rem;
    background: var(--surface);
    border-radius: 16px;
    border-left: 6px solid var(--lime);
}

.short h2 {
    margin: 0;
    font-size: 1.25rem;
}

.short ul {
    padding-left: 1.25rem;
}

.toc {
    margin-top: 1.75rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.doc .toc li {
    margin-top: 0;
}

.toc a {
    display: block;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font: 500 0.9375rem/1.3 var(--display);
}

.toc a:hover {
    border-color: var(--text);
}

.path {
    font-weight: 600;
}

.mail {
    font: 700 clamp(1.25rem, 3vw, 1.5rem) / 1.3 var(--display);
}

/* Publisher home */

.studio {
    padding-top: clamp(3rem, 9vw, 7rem);
    max-width: 52rem;
}

.studio h1 {
    font-size: clamp(2.5rem, 6.5vw, 4.75rem);
    line-height: 1;
    letter-spacing: -0.035em;
}

.studio .lede {
    margin: 1.25rem 0 0;
    max-width: 40ch;
    color: var(--muted);
    font-size: 1.1875rem;
}

.apps {
    margin: clamp(3rem, 8vw, 5rem) 0 0;
    padding: 0;
    list-style: none;
}

.app {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 1.5rem;
    max-width: 44rem;
    padding: 1.5rem;
    background: var(--surface);
    border-radius: 24px;
}

.app img {
    width: 112px;
    height: 112px;
    border-radius: 26px;
}

.app h2 {
    font-size: 1.75rem;
}

.app h2 a {
    color: var(--text);
    text-decoration: none;
}

/* The whole card is the link's hit area. */
.app h2 a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
}

.app h2 a:focus-visible {
    outline: none;
    box-shadow: none;
}

.app:has(a:focus-visible) {
    outline: 3px solid var(--lime);
    outline-offset: 3px;
}

.app:hover h2 a {
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

.app p {
    margin: 0.375rem 0 0;
    color: var(--muted);
}

.app .kind {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font: 500 0.9375rem/1.3 var(--display);
}

/* Small screens */

@media (max-width: 760px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .slip {
        justify-self: stretch;
        width: min(100%, 21rem);
        margin: 0 auto;
    }

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

@media (max-width: 480px) {
    .brand span {
        font-size: 1.125rem;
    }

    .nav a {
        padding: 0.5rem 0.625rem;
    }

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

    .app img {
        width: 88px;
        height: 88px;
        border-radius: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mark::before {
        animation: none;
    }
}

@media print {
    .top nav,
    .skip {
        display: none;
    }

    body {
        background: #fff;
        color: #000;
    }
}
