/* Airmail.
   Kraft paper, postal red-and-blue, typewriter type - and a stamp whose
   artwork is the month's own clip art, cut out of the 1999 backgrounds.
   The month sets --season-ink on <body> (Season::cssVariables); every other
   accent is derived from it, so the whole site turns over with the calendar. */
:root {
    /* overwritten per month on <body>; this is the fallback */
    --season-ink: #c0431a;

    --paper: #f2e8d5;
    --paper-card: #fffdf7;
    --paper-edge: #dccdae;
    --post-red: #c8102e;
    --post-blue: #15397f;

    --color-bg: var(--paper);
    --color-surface: var(--paper-card);
    --color-text: #2c2317;
    --color-text-muted: #8a7558;
    --color-border: var(--paper-edge);
    --color-primary: var(--season-ink);
    --color-primary-dark: color-mix(in srgb, var(--season-ink) 72%, #000);
    --color-accent: var(--post-blue);
    --color-accent-light: #e7ecf7;
    --color-yellow: #d99b00;
    --color-purple: #6b4fa8;

    /* paper sits on paper: a hairline and a short shadow, not a float */
    --shadow-card: 0 1px 0 rgba(68, 52, 28, 0.05), 0 2px 6px rgba(68, 52, 28, 0.09);
    --shadow-pop: 0 2px 0 rgba(68, 52, 28, 0.07), 0 10px 20px rgba(68, 52, 28, 0.16);
    --radius: 3px;
    --max-width: 1120px;
    --font-display: "Special Elite", "Courier New", Courier, monospace;
    --font-hand: "Caveat", "Bradley Hand", "Segoe Script", cursive;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #1f1a14;
        --paper-card: #2a241c;
        --paper-edge: #473e31;
        --post-red: #e2596c;
        --post-blue: #7f9ad6;

        --color-text: #f2e9da;
        --color-text-muted: #b0a08a;
        /* the month's ink is mixed for a dark ground - several months (May's
           navy, December's green) are far too dark to read as an accent here */
        --color-primary: color-mix(in srgb, var(--season-ink) 42%, #ffffff);
        --color-primary-dark: color-mix(in srgb, var(--season-ink) 60%, #ffffff);
        --color-accent-light: #28313f;
        --color-yellow: #e8bb4a;
        --color-purple: #a48cff;

        --shadow-card: 0 1px 0 rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.4);
        --shadow-pop: 0 2px 0 rgba(0, 0, 0, 0.35), 0 12px 26px rgba(0, 0, 0, 0.5);
        color-scheme: dark;
    }
}

* {
    box-sizing: border-box;
}

/* `hidden` has to mean hidden.
   The browser's own [hidden] { display: none } is defined at the weakest
   specificity there is, so any rule of ours that gives an element a
   display - flex, grid, inline-block - silently beats it and the thing
   stays on screen. That had already been patched once by hand for the
   scheduling panel; this is the rule that patch should have been. */
[hidden] {
    display: none !important;
}

/* Every interactive thing shows where the keyboard is.
   Several controls set `outline: none` and relied on a border colour
   changing instead, which is a weak signal and nothing at all on the
   ones that have no border. :focus-visible means a mouse click does not
   leave a ring behind, so this costs the pointer user nothing. */
:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* The first thing the Tab key reaches, out of the way until then.
   Eleven category links sit between the top of the page and the
   content, and without this every keyboard user tabs through all of
   them on every page. */
.skip-link {
    position: absolute;
    left: 0.5rem;
    top: -4rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-display);
    text-decoration: none;
    border-radius: 0 0 var(--radius) var(--radius);
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 0;
}

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

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* kraft stock: a flat ground with a faint woven tint over it */
    background-color: var(--color-bg);
    background-image:
        repeating-linear-gradient(90deg, rgba(120, 95, 55, 0.022) 0 2px, transparent 2px 4px),
        repeating-linear-gradient(0deg, rgba(120, 95, 55, 0.022) 0 2px, transparent 2px 4px);
    color: var(--color-text);
    line-height: 1.55;
}

h1, h2, h3,
.brand,
.btn,
.category-card__name,
.template-card__label,
.chip,
.section-title {
    font-family: var(--font-display);
}

a {
    color: var(--color-primary);
}

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

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* The red-and-blue chevron band across the top of every page. */
.airmail-edge {
    height: 7px;
    background: repeating-linear-gradient(
        45deg,
        var(--post-red) 0 10px,
        var(--paper-card) 10px 20px,
        var(--post-blue) 20px 30px,
        var(--paper-card) 30px 40px
    );
}

/* Header */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Three columns, and the outer two are the same width.
   The search belongs in the middle of the header, and "middle" has to
   mean the middle of the page - not the middle of whatever space is
   left over. Centring it in the leftover space put it 80px off, and it
   would have moved again the moment somebody signed in and the pill on
   the right grew to hold their name. Equal outer columns hold it still. */
.site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0.55rem 1.25rem;
    max-width: var(--max-width);
    margin: 0 auto;
    gap: 1rem;
}

.site-header__inner .brand {
    justify-self: start;
}

.site-header__inner .site-search {
    justify-self: center;
}

/* The stamp and the account pill, together on the right. */
.site-header__tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    gap: 0.5rem;
}

/* The categories, on a row of their own across the full page. */
.site-nav-row {
    border-top: 1px solid var(--color-border);
    background: color-mix(in srgb, var(--color-surface) 70%, var(--color-bg));
}

@media (max-width: 860px) {
    /* Two columns: the wordmark and the stamp keep each other company on
       the first line, and the search takes the whole of the second. */
    .site-header__inner {
        grid-template-columns: 1fr auto;
        padding: 0.7rem 1.25rem 0.5rem;
        gap: 0.55rem 0.8rem;
    }

    .site-header__inner .brand {
        grid-area: 1 / 1;
    }

    .site-header__tools {
        grid-area: 1 / 2;
        flex-wrap: wrap;
    }

    .site-header__inner .site-search {
        grid-area: 2 / 1 / 3 / -1;
        width: 100%;
        justify-self: stretch;
    }
}

.brand {
    font-family: var(--font-display);
    font-size: 1.3rem;
    text-decoration: none;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.brand__text small {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.56rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-top: 1px;
}

.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    font-size: 1.3rem;
    line-height: 1;
    transform: rotate(-6deg);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.brand:hover .brand__mark {
    transform: rotate(6deg) scale(1.06);
}

.site-nav {
    display: flex;
    gap: 0.45rem 1.3rem;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.78rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.5rem 1.25rem;
}

.site-nav a {
    position: relative;
    text-decoration: none;
    color: var(--color-text-muted);
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
    padding-bottom: 3px;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    right: 50%;
    bottom: 0;
    height: 2px;
    background: var(--color-primary);
    transition: left 0.18s ease, right 0.18s ease;
}

@media (max-width: 860px) {
    .site-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        /* centring a scroll container makes its leading overflow unreachable,
           so the strip must start at the left once it scrolls */
        justify-content: flex-start;
        gap: 1.1rem;
        padding: 0.45rem 1.25rem 0.2rem;
        -webkit-overflow-scrolling: touch;
    }
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--color-primary);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
    left: 0;
    right: 0;
}

/* ---- The franked corner --------------------------------------------------
   A postmark lands half over the stamp, as it does on a posted envelope. The
   postmark is pure CSS; the stamp carries the month's original artwork.    */
.franking {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.postmark {
    width: 78px;
    height: 78px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    color: var(--color-primary);
    opacity: 0.5;
    transform: rotate(-12deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    /* overlaps the stamp, and sits above it */
    margin-right: -26px;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.postmark::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid currentColor;
    border-radius: 50%;
}

.postmark__place {
    font-size: 0.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    max-width: 62px;
    text-align: center;
    line-height: 1.1;
}

.postmark__month {
    font-family: var(--font-display);
    font-size: 0.95rem;
    line-height: 1;
    letter-spacing: 0.04em;
}

.postmark__year {
    font-size: 0.42rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

@media (max-width: 1040px) {
    .postmark {
        display: none;
    }
}

/* ---- The month's stamp ----------------------------------------------------
   Perforation is punched with a radial-gradient mask: transparent discs on a
   grid eat half-circles out of every edge. The artwork inside is the original
   clip art for this month, pulled from the 1999 background GIFs.           */
.season-stamp {
    flex-shrink: 0;
    /* The stamp alone sets the height of the header's top row, and the
       header is sticky - every pixel here is a pixel off the top of
       every page, forever. 96px made it 193px tall. */
    width: 78px;
    padding: 6px;
    background: var(--paper-card);
    text-align: center;
    /* Perforation. The hole grid alone would punch holes through the middle of
       the stamp too, so it is unioned with a solid core that covers everything
       but a ~7px rim - leaving the holes only where an edge can show them. */
    --notch: radial-gradient(circle at center, transparent 0 3.1px, #000 3.3px) -4px -4px / 11px 11px;
    --core: linear-gradient(#000 0 0) center / calc(100% - 15px) calc(100% - 15px) no-repeat;
    -webkit-mask: var(--notch), var(--core);
    -webkit-mask-composite: source-over;
    mask: var(--notch), var(--core);
    mask-composite: add;
    filter: drop-shadow(0 1px 1px rgba(60, 45, 20, 0.28));
    transform: rotate(1.5deg);
}

.season-stamp__inner {
    border: 1.5px solid var(--color-primary);
    padding: 0.35rem 0.2rem 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.season-stamp img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.season-stamp__month {
    font-family: var(--font-display);
    font-size: 0.66rem;
    color: var(--color-text);
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.season-stamp__value {
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--color-primary);
}

/* July's background was a 2000x1 sliver that tiled into stripes - there was no
   clip art to extract, so its stamp wears the stripes where the art would go.
   They stay out of the label's way, which sits on plain paper like the rest. */
.season-stamp__stripes {
    display: block;
    width: 48px;
    height: 48px;
    background: repeating-linear-gradient(
        180deg,
        var(--post-red) 0 5px,
        #fffdf7 5px 10px,
        var(--post-blue) 10px 15px,
        #fffdf7 15px 20px
    );
}

/* At phone width the brand and the stamp have to share one row, or the stamp
   wraps onto a line of its own at the left, which reads as a stray graphic. */
@media (max-width: 480px) {
    .brand {
        font-size: 1.05rem;
        gap: 0.45rem;
    }

    .brand__mark {
        width: 1.7rem;
        height: 1.7rem;
        font-size: 1.05rem;
    }

    .brand__text small {
        font-size: 0.5rem;
        letter-spacing: 0.13em;
    }
}

@media (max-width: 420px) {
    .season-stamp {
        width: 74px;
    }

    .season-stamp img {
        width: 34px;
        height: 34px;
    }
}

/* Hero */
.hero {
    position: relative;
    text-align: center;
    padding: 3rem 1.25rem 2.2rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4.6vw, 2.8rem);
    font-weight: 400;
    margin: 0 0 0.5rem;
    letter-spacing: 0.01em;
    text-wrap: balance;
}

.hero p {
    color: var(--color-text-muted);
    max-width: 40rem;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* A torn dashed rule under the hero, like a perforated tear-off. */
.hero-rule {
    max-width: var(--max-width);
    margin: 0 auto 0.5rem;
    height: 1px;
    background: repeating-linear-gradient(
        90deg,
        var(--color-border) 0 7px,
        transparent 7px 14px
    );
}

/* Category grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    padding: 1rem 0 3rem;
}

.category-card {
    --cat-color: var(--color-primary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 1.5rem 1.25rem;
    text-decoration: none;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
    transform: translateY(-4px) rotate(-1deg);
    border-color: var(--cat-color);
    box-shadow: var(--shadow-pop);
}

.category-grid .category-card:nth-child(9n+2):hover { transform: translateY(-4px) rotate(1deg); }
.category-grid .category-card:nth-child(9n+4):hover { transform: translateY(-4px) rotate(1deg); }
.category-grid .category-card:nth-child(9n+6):hover { transform: translateY(-4px) rotate(1deg); }
.category-grid .category-card:nth-child(9n+8):hover { transform: translateY(-4px) rotate(1deg); }

.category-grid .category-card:nth-child(9n+1) { --cat-color: #ff6b6b; }
.category-grid .category-card:nth-child(9n+2) { --cat-color: #ff9f45; }
.category-grid .category-card:nth-child(9n+3) { --cat-color: #ffc145; }
.category-grid .category-card:nth-child(9n+4) { --cat-color: #6bcb77; }
.category-grid .category-card:nth-child(9n+5) { --cat-color: #2ec4b6; }
.category-grid .category-card:nth-child(9n+6) { --cat-color: #3fa7ff; }
.category-grid .category-card:nth-child(9n+7) { --cat-color: #6f5ce6; }
.category-grid .category-card:nth-child(9n+8) { --cat-color: #9b5de5; }
.category-grid .category-card:nth-child(9n+9) { --cat-color: #ff6b9d; }

.category-card__icon {
    font-size: 1.6rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--cat-color) 18%, transparent);
    margin-bottom: 0.2rem;
}

.category-card__name {
    font-weight: 700;
    font-size: 1.15rem;
}

.category-card__desc {
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

/* Subcategory / template pickers */
.section-title {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 2rem 0 0.25rem;
}

.section-sub {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}

.chip {
    display: inline-block;
    padding: 0.45rem 1rem;
    border-radius: 2px;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.chip.is-active,
.chip:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    transform: translateY(-1px);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    padding-bottom: 3rem;
}

.template-card {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--color-text);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.template-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-pop);
}

.template-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--color-accent-light);
}

.template-card__label {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 700;
}

.snippet-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.snippet-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-pop);
}

.snippet-card blockquote {
    margin: 0;
    font-size: 1.05rem;
    font-style: italic;
}

.snippet-card cite {
    color: var(--color-text-muted);
    font-size: 0.88rem;
}

.snippet-card .btn {
    margin-top: auto;
}

.btn {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    padding: 0.65rem 1.2rem;
    border-radius: 2px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 3px 0 var(--color-primary-dark);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--color-primary-dark);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 var(--color-primary-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    box-shadow: none;
    padding: calc(0.65rem - 2px) calc(1.2rem - 2px);
}

.btn-secondary:hover {
    background: var(--color-primary);
    color: #fff;
    box-shadow: none;
}

.btn-secondary:active {
    transform: translateY(1px);
}

/* Forms */
.card-form {
    max-width: 100%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 1.75rem;
    margin: 0;
}

/* Personalize page: preview stacked on top, form below */
.personalize-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.25rem;
    margin: 1.5rem 0 3rem;
}

.live-preview-col,
.personalize-form-col {
    width: 100%;
    max-width: 780px;
}

.live-preview-col__label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    margin: 0 0 0.75rem;
    text-align: center;
}


.field {
    margin-bottom: 1.1rem;
}

.field label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    border: 2px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--color-primary);
}

.field textarea {
    min-height: 110px;
    resize: vertical;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.field-row--three {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 540px) {
    .field-row,
    .field-row--three {
        grid-template-columns: 1fr;
    }
}

/* honeypot field - hidden from real users, visible to bots that fill every field */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

.alert {
    padding: 0.9rem 1.1rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.alert-error {
    background: #fbe4de;
    color: #7a2412;
    border: 1px solid #efb7a8;
}

.alert-success {
    background: var(--color-accent-light);
    color: var(--color-accent);
    border: 1px solid #b9ddd0;
}

/* ---- The virtual postcard -------------------------------------------------
   Deliberately keeps its paper/ink colors in both light and dark mode: it's a
   physical object sitting on the page, not a UI panel. Shared by the live
   preview (send.php) and the delivered card (card.php).                     */
.postcard {
    --paper: #fdfaf3;
    --paper-edge: #e3d7c3;
    --ink: #39302e;
    --ink-soft: #8a7d72;
    /* the card keeps light paper in dark mode, so it keeps true postal ink
       too - the lightened dark-mode red and blue wash out on cream */
    --post-red: #c8102e;
    --post-blue: #15397f;

    position: relative;
    max-width: 780px;
    margin: 0 auto;
    background: var(--paper);
    border-radius: 2px;
    /* the chevron frame IS the border, so the card needs room for it */
    padding: 9px;
    background-image: repeating-linear-gradient(
        45deg,
        var(--post-red) 0 11px,
        var(--paper) 11px 22px,
        var(--post-blue) 22px 33px,
        var(--paper) 33px 44px
    );
    box-shadow:
        0 1px 2px rgba(30, 20, 10, 0.14),
        0 18px 44px rgba(30, 20, 10, 0.3);
}

/* the card face, laid inside the chevron frame */
.postcard > * {
    background: var(--paper);
    position: relative;
}

.postcard__photo {
    background: var(--paper);
    padding: 14px 14px 0;
}

/* direct child only - the snow globe widget has its own nested imgs.
   `contain` (not `cover`) because the sender picked this exact design -
   cropping it would cut off the art they chose. */
.postcard__photo > img {
    width: 100%;
    max-height: 460px;
    object-fit: contain;
    display: block;
    border-radius: 3px;
}

.postcard__photo .snowglobe-widget {
    margin: 0 auto 0.5rem;
}

.postcard__paper {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    padding: 1.6rem 1.75rem 1.75rem;
}

.postcard__note {
    padding-right: 1.6rem;
    min-width: 0;
}

.postcard__greeting,
.postcard__message,
.postcard__signoff {
    font-family: var(--font-hand);
    color: var(--ink);
    margin: 0;
}

.postcard__greeting {
    font-size: 1.55rem;
    margin-bottom: 0.4rem;
}

.postcard__message {
    font-size: 1.45rem;
    line-height: 1.45;
    white-space: pre-line;
    overflow-wrap: break-word;
    margin-bottom: 0.7rem;
}

.postcard__message.is-placeholder {
    color: var(--ink-soft);
    opacity: 0.75;
}

.postcard__signoff {
    font-size: 1.4rem;
    color: var(--ink-soft);
}

.postcard__quote {
    margin: 0 0 0.9rem;
    padding-left: 0.85rem;
    border-left: 3px solid var(--color-primary);
    font-style: italic;
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--ink);
}

.postcard__quote cite {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

/* Right half: stamp, postmark, addressee */
.postcard__address {
    position: relative;
    border-left: 1px solid var(--paper-edge);
    padding-left: 1.6rem;
    display: flex;
    flex-direction: column;
}

.postcard__stamp {
    position: relative;
    width: 72px;
    height: 86px;
    margin-left: auto;
    background: #fffdf7;
    border: 1.5px solid var(--season-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    transform: rotate(3deg);
    flex-shrink: 0;
}

/* punches paper-colored notches around the edge = perforated stamp */
.postcard__stamp::before {
    content: "";
    position: absolute;
    inset: -5px;
    background:
        radial-gradient(circle, var(--paper) 4px, transparent 4.5px) left top / 10px 10px repeat-x,
        radial-gradient(circle, var(--paper) 4px, transparent 4.5px) left bottom / 10px 10px repeat-x,
        radial-gradient(circle, var(--paper) 4px, transparent 4.5px) left top / 10px 10px repeat-y,
        radial-gradient(circle, var(--paper) 4px, transparent 4.5px) right top / 10px 10px repeat-y;
    pointer-events: none;
}

.postcard__stamp-art {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.postcard__stamp-value {
    font-family: var(--font-display);
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    color: var(--season-ink);
}

/* July's 1999 background was stripes, with no clip art to cut out. */
.postcard__stamp-stripes {
    display: block;
    width: 46px;
    height: 46px;
    background: repeating-linear-gradient(
        180deg,
        var(--post-red) 0 5px,
        #fffdf7 5px 10px,
        var(--post-blue) 10px 15px,
        #fffdf7 15px 20px
    );
}

.postcard__postmark {
    position: absolute;
    top: 4px;
    right: 78px;
    width: 84px;
    height: 84px;
    border: 2px solid var(--ink-soft);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 1px;
    color: var(--ink-soft);
    opacity: 0.55;
    transform: rotate(-13deg);
    pointer-events: none;
}

.postcard__postmark-place {
    font-size: 0.4rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    max-width: 66px;
    line-height: 1.1;
}

.postcard__postmark-month {
    font-family: var(--font-display);
    font-size: 0.95rem;
    line-height: 1;
    letter-spacing: 0.04em;
}

.postcard__postmark::after {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid currentColor;
    border-radius: 50%;
}

.postcard__addressee {
    margin-top: auto;
    padding-top: 1.75rem;
    display: flex;
    flex-direction: column;
}

.postcard__to {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.postcard__to-name {
    font-family: var(--font-hand);
    font-size: 1.3rem;
    color: var(--ink);
    border-bottom: 1px solid var(--paper-edge);
    padding-bottom: 0.2rem;
    overflow-wrap: break-word;
}

/* The address lines. Ruled like the blanks they replaced, but written on. */
.postcard__line {
    display: block;
    border-bottom: 1px solid var(--paper-edge);
    margin-top: 0.9rem;
    padding-bottom: 0.2rem;
    min-height: 1.1rem;
    overflow-wrap: anywhere;
}

.postcard__line--email {
    font-size: 0.8rem;
    color: var(--ink);
}

.postcard__line--email.is-placeholder {
    color: var(--ink-soft);
    opacity: 0.6;
}

.postcard__line--meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.7rem;
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    border-bottom: 0;
}

.postcard-cta {
    text-align: center;
    margin: 1.75rem 0 3rem;
}

@media (max-width: 640px) {
    .postcard__paper {
        grid-template-columns: 1fr;
        padding: 1.35rem;
    }

    .postcard__note {
        padding-right: 0;
    }

    .postcard__address {
        border-left: none;
        border-top: 1px solid var(--paper-edge);
        padding-left: 0;
        margin-top: 1.25rem;
        padding-top: 1.25rem;
    }

    .postcard__postmark {
        right: 84px;
        top: 18px;
    }

    .postcard__addressee {
        padding-top: 1.25rem;
    }
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.site-footer::before {
    content: "";
    display: block;
    height: 5px;
    max-width: 420px;
    margin: -1rem auto 1.4rem;
    background: repeating-linear-gradient(
        45deg,
        var(--post-red) 0 8px,
        var(--color-bg) 8px 16px,
        var(--post-blue) 16px 24px,
        var(--color-bg) 24px 32px
    );
    opacity: 0.75;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}

/* Confetti burst (sent.php) */
.confetti-piece {
    position: fixed;
    top: -12px;
    width: 9px;
    height: 14px;
    opacity: 0.9;
    border-radius: 2px;
    pointer-events: none;
    animation: confetti-fall linear forwards;
    z-index: 50;
}

@keyframes confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(105vh) rotate(540deg); opacity: 0.9; }
}

/* Snow Globe widget */
.snowglobe-widget {
    width: 325px;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

.snowglobe-body {
    position: relative;
    transform-origin: 50% 88%;
}

.snowglobe-scene {
    position: relative;
    width: 100%;
    aspect-ratio: 325 / 300;
}

/* The source art has flat white corners around the round scene - clip it into
   a circle and draw our own ring instead of showing that square mask. */
.snowglobe-sphere {
    position: absolute;
    inset: 3%;
    border-radius: 50%;
    overflow: hidden;
    border: 7px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35), inset 0 0 14px rgba(255, 255, 255, 0.3);
}

.snowglobe-widget .snowglobe-figure,
.snowglobe-widget .snowglobe-glass,
.snowglobe-widget .snowglobe-snow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.snowglobe-glass {
    pointer-events: none;
}

.snowglobe-snow {
    pointer-events: none;
}

.snowglobe-widget .snowglobe-base {
    display: block;
    width: 82%;
    margin: -10% auto 0;
    position: relative;
    z-index: 1;
}

.snowglobe-hint {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

@keyframes snowglobe-shake {
    0%, 100% { transform: rotate(0deg) translateX(0); }
    20% { transform: rotate(-4deg) translateX(-4px); }
    40% { transform: rotate(3deg) translateX(3px); }
    60% { transform: rotate(-3deg) translateX(-2px); }
    80% { transform: rotate(2deg) translateX(2px); }
}

.snowglobe-widget.is-shaking .snowglobe-body {
    animation: snowglobe-shake 0.5s ease-in-out;
}

/* Make Your Own editor */
.dyo-app {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 3rem;
}

.dyo-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.dyo-tool {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    color: var(--color-text);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.dyo-tool.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.dyo-toolbar input[type="color"] {
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: none;
    cursor: pointer;
}

.dyo-toolbar input[type="range"] {
    width: 100px;
}

.dyo-sep {
    width: 1px;
    align-self: stretch;
    background: var(--color-border);
    margin: 0 0.25rem;
}

.dyo-canvas-wrap {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

#dyo-canvas {
    background: #ffffff;
    border-radius: 6px;
    box-shadow: var(--shadow-card);
    cursor: crosshair;
    touch-action: none;
    /* The drawing surface is 960x640. It scales down to fit narrow screens -
       dyo.js maps pointer coordinates through the displayed size, so drawing
       stays accurate at any scale. */
    max-width: 100%;
    height: auto;
}

.dyo-clipart {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
}

.dyo-clipart-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.dyo-clipart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.6rem;
}

.dyo-clipart-item {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 0.3rem;
    cursor: pointer;
}

.dyo-clipart-item.is-active {
    border-color: var(--color-primary);
}

.dyo-clipart-item img {
    width: 100%;
    height: auto;
    display: block;
}

.dyo-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

@media (max-width: 700px) {
    .dyo-toolbar {
        justify-content: center;
    }
}

/* Games */
.game-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 3rem;
}

.game-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.game-stats strong {
    color: var(--color-text);
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.7rem;
    max-width: 420px;
    margin: 0 auto;
}

.memory-card {
    aspect-ratio: 55 / 63;
    border-radius: 8px;
    border: none;
    padding: 0;
    cursor: pointer;
    background: var(--color-accent);
    overflow: hidden;
    perspective: 400px;
}

.memory-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.memory-card.is-matched {
    opacity: 0.4;
}

#game-canvas {
    background: #0a1e2a;
    border-radius: 10px;
    /* height:auto matters - without it the canvas squashes vertically
       instead of scaling when max-width kicks in */
    max-width: 100%;
    height: auto;
    touch-action: none;
    cursor: pointer;
}

.game-controls {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Category browse: search + pagination */
.search-bar {
    display: flex;
    gap: 0.6rem;
    max-width: 560px;
    margin: 1rem 0 1.25rem;
}

.search-bar input[type="search"] {
    flex: 1 1 auto;
    padding: 0.65rem 0.9rem;
    border-radius: 2px;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 1rem;
    min-width: 0;
    transition: border-color 0.15s ease;
}

.search-bar input[type="search"]:focus {
    border-color: var(--color-primary);
}

.results-count {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 1rem 0 3rem;
}

.pagination__status {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.search-hit {
    background: var(--color-yellow);
    color: #2b2300;
    padding: 0 0.15em;
    border-radius: 3px;
}

.design-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.6rem;
}

.design-picker__item {
    position: relative;
    display: block;
    border-radius: 10px;
    border: 2px solid var(--color-border);
    overflow: hidden;
    cursor: pointer;
    line-height: 0;
    transition: transform 0.15s ease;
}

.design-picker__item:hover {
    transform: translateY(-2px);
}

.design-picker__item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.design-picker__item input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
    cursor: pointer;
}

.design-picker__item:has(input:checked) {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary);
}

/* ---- Famous Birthdays ------------------------------------------------- */
.bday-picker {
    margin-bottom: 1.6rem;
}

.bday-days {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
    gap: 5px;
    margin-top: 0.8rem;
    max-width: 560px;
}

.bday-day {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    font-family: var(--font-display);
    font-size: 0.86rem;
    text-decoration: none;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 2px;
    transition: 0.14s;
}

.bday-day:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.bday-day.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.bday-day:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.bday-result {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem 1.3rem;
    margin-bottom: 2rem;
}

.bday-result__title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0 0 0.8rem;
}

.bday-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.5rem 1.5rem;
}

.bday-list li {
    border-bottom: 1px dotted var(--color-border);
    padding-bottom: 0.4rem;
    min-width: 0;
}

.bday-list__name {
    font-weight: 600;
}

.bday-list__year {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--color-primary);
    margin-left: 0.35rem;
}

.bday-list__blurb {
    display: block;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}

/* On the card itself the list is set small and tight - it is a postscript to
   the sender's message, not the main event. */
.postcard__birthdays {
    margin-top: 0.9rem;
    padding-top: 0.7rem;
    border-top: 1px dotted var(--paper-edge);
}

.postcard__birthdays-head {
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--season-ink);
    margin: 0 0 0.35rem;
}

.postcard__birthdays ul {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 2;
    column-gap: 1.2rem;
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--ink);
}

.postcard__birthdays li {
    break-inside: avoid;
}

.postcard__birthdays li span {
    color: var(--ink-soft);
    margin-left: 0.3rem;
}

@media (max-width: 560px) {
    .postcard__birthdays ul {
        columns: 1;
    }
}

.bday-continue {
    margin: 0 0 2.5rem;
}


/* ---- Games ------------------------------------------------------------- */
.game-widget {
    text-align: center;
}

.game-widget canvas {
    display: block;
    margin: 0 auto;
}

.game-send {
    margin: 1.4rem 0 2.5rem;
    text-align: center;
}

/* A game sits where the picture would, inside the card's chevron frame. */
.postcard__photo--game {
    padding: 14px 14px 4px;
}

.postcard__photo--game .game-controls {
    margin-top: 0.7rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Six across rather than four: 24 cards four rows deep suits a postcard,
   where six rows made the card absurdly tall. */
.postcard__photo--game .memory-grid {
    grid-template-columns: repeat(6, 1fr);
    max-width: 420px;
    gap: 0.4rem;
}

/* Text typed straight onto the canvas, where it will land. */
.dyo-text-input {
    position: absolute;
    z-index: 50;
    transform: translateY(-50%);
    min-width: 12ch;
    max-width: 70vw;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px dashed var(--color-primary);
    border-radius: 2px;
}

#dyo-error {
    margin: 0 0 0.8rem;
}

/* ── legal pages ─────────────────────────────────────────────────────────
   Terms and privacy are long-form reading rather than browsing, so the
   column is narrowed to a comfortable measure instead of the full grid
   width the card pages use. */

.legal {
    max-width: 44rem;
    /* The footer rule sits directly under this, so the last thing in the
       column - usually a submit button - needs clearance or it reads as
       sitting on the line. */
    margin: 0 auto 4.5rem;
}

.legal__lede {
    font-size: 1.05rem;
    line-height: 1.75;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--rule, rgba(255, 255, 255, 0.12));
}

.legal h2 {
    margin: 2.25rem 0 0.75rem;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}

.legal p,
.legal li {
    line-height: 1.7;
}

.legal ul {
    padding-left: 1.25rem;
    margin: 0.75rem 0 1rem;
}

.legal li {
    margin-bottom: 0.5rem;
}

.site-footer__line,
.site-footer__links {
    margin: 0.35rem 0;
}

.site-footer__links a {
    text-decoration: underline;
}

.site-footer__links span {
    margin: 0 0.5rem;
    opacity: 0.5;
}

/* The sender's own address, under their name on the card. Quieter than the
   signature itself: it is there to be checked and replied to, not read. */
.postcard__sender-email {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
}

/* --ink, not --ink-soft and not an inherited colour at reduced opacity.
   This sits on cream paper and is the one thing on the card a reader may
   need to copy down or click, so it has to be legible first and quiet
   second. The earlier version inherited a pale colour and then dimmed it
   further, which made it almost invisible. */
.postcard__sender-email a {
    color: var(--ink);
    opacity: 0.8;
    text-decoration: underline;
    text-decoration-color: var(--ink-soft);
    text-underline-offset: 2px;
}

.postcard__sender-email a:hover,
.postcard__sender-email a:focus-visible {
    opacity: 1;
    text-decoration-color: var(--ink);
}

/* Read-receipt opt-in on the send form. */
.field--check {
    margin-top: 0.25rem;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.check input {
    width: auto;
    margin: 0;
}

.field__hint {
    margin: 0.3rem 0 0 1.6rem;
    font-size: 0.8rem;
    opacity: 0.65;
}

/* A note about the form as a whole rather than one field, sitting between
   the last field and the button - so it needs real space on both sides or
   it reads as a caption on the textarea and crowds the button. */
.form-note {
    margin: 1.4rem 0 1.6rem;
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.7;
}

/* Contact form: required markers and the result notices. */
.req {
    color: #d98b7a;
}

.notice {
    padding: 0.9rem 1.1rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.notice ul {
    margin: 0;
    padding-left: 1.1rem;
}

.notice--ok {
    background: rgba(120, 170, 120, 0.15);
    border: 1px solid rgba(120, 170, 120, 0.45);
}

.notice--error {
    background: rgba(200, 110, 95, 0.14);
    border: 1px solid rgba(200, 110, 95, 0.45);
}

.legal select,
.legal input,
.legal textarea {
    width: 100%;
}

.legal textarea {
    min-height: 11rem;
}

/* The contact form's topic picker. A select keeps the operating system's
   own chrome unless appearance is reset, which on this dark page renders a
   light grey box among the dark fields. */
.field select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.2rem;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                      linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 1.15rem) 1.15rem, calc(100% - 0.8rem) 1.15rem;
    background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
    background-repeat: no-repeat;
}

.field select option {
    background: var(--color-bg);
    color: var(--color-text);
}

/* ── the private stats dashboard ─────────────────────────────────────── */

.stats {
    max-width: 68rem;
    margin: 0 auto 4rem;
}

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

.stats h2 {
    margin: 2.5rem 0 0.9rem;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.75;
}

.stats__note {
    font-size: 0.85rem;
    opacity: 0.65;
    line-height: 1.6;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.75rem;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
}

.stat__n {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat__l {
    font-size: 0.78rem;
    opacity: 0.7;
}

/* The chart is wider than a phone, so it scrolls sideways rather than
   squashing 30 bars into something unreadable. */
.chart-scroll {
    overflow-x: auto;
    padding-bottom: 0.4rem;
}

.chart {
    max-width: 100%;
    height: auto;
}

/* An explicit colour, not var(--color-primary): an SVG fill resolving to
   a missing variable falls back to black, which on this page is a bar you
   cannot see against the background. */
.chart__bar {
    fill: #e2a08c;
}

.chart__bar.is-empty {
    fill: currentColor;
    opacity: 0.18;
}

.chart__grid {
    stroke: currentColor;
    stroke-opacity: 0.12;
    stroke-width: 1;
}

.chart__axis {
    stroke: currentColor;
    stroke-opacity: 0.35;
    stroke-width: 1;
}

.chart__tick {
    fill: currentColor;
    opacity: 0.5;
    font-size: 10px;
    text-anchor: end;
}

.chart__label {
    fill: currentColor;
    opacity: 0.6;
    font-size: 10px;
    text-anchor: middle;
}

.chart-views {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.stats-table th,
.stats-table td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}

.stats-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.stats-table .r {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.stats-table td.thumb {
    width: 3rem;
}

.stats-table td.thumb img {
    width: 2.6rem;
    height: 2.6rem;
    object-fit: contain;
}

/* Secondary text: a recipient's address under their name, where a
   quotation came from, what kind of thing a search result is.
   This was only ever defined inside the stats tables, so the twenty-odd
   other places that say class="muted" were saying nothing at all. */
.muted {
    color: var(--color-text-muted);
}

.stats-table .muted,
.stats h2 .muted {
    opacity: 0.6;
    font-size: 0.8rem;
}

.is-hidden-cat {
    opacity: 0.55;
}

.tag {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    margin-left: 0.3rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.8;
}

.stats__cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 0 2rem;
}

/* ── meme captions ───────────────────────────────────────────────────────
   Laid over the picture rather than burned into it, so the live preview
   and the sent card are the same markup and the words stay selectable.
   The outline is four text-shadows rather than -webkit-text-stroke, which
   thins the glyphs on some browsers; this keeps Impact's weight. */

.postcard__photo {
    position: relative;
    /* So the caption can size itself against the picture's own width with
       cqw, which keeps it identical in the small preview and on the full
       card. Sizing against the viewport would make it wrong in both. */
    container-type: inline-size;
}

.meme-caption {
    position: absolute;
    left: 0;
    right: 0;
    padding: 0 3%;
    font-family: Impact, 'Haettenschweiler', 'Arial Narrow Bold', 'Franklin Gothic Bold', sans-serif;
    font-weight: 400;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.08;
    color: #fff;
    text-shadow:
         2px  2px 0 #000, -2px  2px 0 #000,
         2px -2px 0 #000, -2px -2px 0 #000,
         0 3px 5px rgba(0, 0, 0, 0.5);
    /* Scales with the card, not the viewport, so it looks the same in the
       small preview and on the opened card. */
    font-size: clamp(1.1rem, 7cqw, 2.6rem);
    pointer-events: none;
    word-break: break-word;
}

.meme-caption:empty {
    display: none;
}

.meme-caption--top {
    top: 3%;
}

.meme-caption--bottom {
    bottom: 3%;
}

/* Licence credit under the Make Your Own clip art. */
.dyo-credit {
    margin: 0.9rem 0 0.2rem;
    font-size: 0.75rem;
}

.dyo-credit a {
    text-decoration: underline;
}

/* ── accounts ────────────────────────────────────────────────────────── */

/* Its own header section, not part of .site-nav. The nav is where you go to
   browse cards; this is where you are. Keeping them apart is the point. */
.site-account {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    /* Last thing in the header row, past the franked corner. The stamp is
       the site's own mark and belongs beside the nav it decorates; the
       account control is the reader's own business and sits outside it. */
    margin-left: 0.25rem;
}

.account-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.33rem 0.8rem 0.33rem 0.62rem;
    border: 1.5px solid var(--color-primary);
    border-radius: 999px;
    color: var(--color-primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.account-pill:hover,
.account-pill:focus-visible {
    background: var(--color-primary);
    /* The page background, not a fixed colour: the palette changes with the
       season, and a hardcoded dark here goes muddy half the year. */
    color: var(--color-bg);
}

/* Signed in reads as a settled state rather than a call to action, so it is
   filled in and quieter than the invitation to sign in. */
.account-pill.is-in {
    background: color-mix(in srgb, var(--color-primary) 16%, transparent);
}

.account-pill__icon {
    width: 1.05em;
    height: 1.05em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    flex-shrink: 0;
}

@media (max-width: 860px) {
    /* It sits beside the stamp in the tools group, and wraps underneath
       it on a narrow phone rather than taking a whole row of the header
       to itself. */
    .site-account {
        margin-left: 0;
    }
}

.history-table td {
    vertical-align: top;
}

.history-actions {
    white-space: nowrap;
}

.history-actions a,
.history-actions .linkish {
    display: inline-block;
    margin-left: 0.6rem;
    font-size: 0.82rem;
    text-decoration: underline;
}

.inline-form {
    display: inline;
}

/* A destructive action should look like a link, not a button you might hit
   by accident while reaching for "Send another". */
.linkish {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    opacity: 0.7;
    cursor: pointer;
    font: inherit;
}

.linkish:hover {
    opacity: 1;
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

/* Scheduling block on the send form. */
.schedule {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0.85rem 1rem 1rem;
    margin-top: 0.25rem;
}

.schedule legend {
    padding: 0 0.4rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.schedule .check {
    margin-bottom: 0.3rem;
}

.schedule__when {
    margin-top: 0.7rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--color-border);
}

.schedule .field__hint {
    margin-left: 0;
}

/* ── the sign-in explainer ───────────────────────────────────────────── */

.signin__split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0 2.5rem;
}

.signin__split h2 {
    margin-top: 1.5rem;
    font-size: 1rem;
}

.signin__note {
    margin: 1.25rem 0 1.5rem;
    font-size: 0.88rem;
    line-height: 1.7;
    opacity: 0.8;
}

/* The decision, first thing on the page, in a panel of its own.
   Boxed and centred so it reads as the one thing being asked rather than
   as the first paragraph of a page. */
.signin__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 27rem;
    margin: 1.5rem auto 0;
    padding: 1.9rem 1.8rem 1.6rem;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    text-align: center;
}



/* The explanation, under a rule so it reads as "more, if you want it"
   rather than as something to get through first. */
.signin__detail {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    opacity: 0.9;
}

.signin__detail li {
    font-size: 0.92rem;
}

/* Google asks that the button carry their unmodified mark and stay
   legible, so this keeps the white face and the official four-colour G
   rather than restyling them into the site's palette. It is the one
   element here allowed to look like somebody else's. */
.google-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1.4rem 0.7rem 0.7rem;
    background: #fff;
    color: #1f1f1f;
    border-radius: 8px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    transition: box-shadow 0.15s ease, transform 0.08s ease;
}

.google-btn:hover,
.google-btn:focus-visible {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    color: #1f1f1f;
}

.google-btn:active {
    transform: translateY(1px);
}

.google-btn__g {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: #fff;
    border-radius: 4px;
}

/* Deliberately quiet, but a real option and not hidden: on this site
   sending without an account is the normal path, not a consolation. */
.signin__skip {
    font-size: 0.85rem;
    opacity: 0.7;
    text-decoration: underline;
}

.signin__skip:hover {
    opacity: 1;
}

/* Email sign-in, shown alongside Google. */
.signin__email {
    width: 100%;
    max-width: 30rem;
}

.signin__email label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.signin__email-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.signin__email-row input {
    flex: 1 1 14rem;
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    border: 2px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: inherit;
    font-size: 1rem;
}

.signin__email-row input:focus {
    border-color: var(--color-primary);
}

.signin__email .field__hint {
    margin-left: 0;
}

/* A rule with the word sitting in it, so the two routes read as equals
   rather than one being the fallback for the other. */
.signin__or {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    max-width: 30rem;
    margin: 0.4rem 0;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.5;
}

.signin__or::before,
.signin__or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: currentColor;
}

/* The scheduling pitch shown to signed-out senders. Quieter than the real
   scheduling block: it is an offer, not a control, and must not compete
   with the Send button three inches below it. */
.schedule--locked {
    border-style: dashed;
}

.schedule__pitch {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.85;
}

.schedule--locked .field__hint {
    margin: 0.5rem 0 0;
}

/* On an occasion page a card is shown out of its own category, so the tile
   says which one it came from - otherwise "Send this" lands somewhere the
   visitor has never heard of. */
.template-card__from {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.72rem;
    opacity: 0.6;
}

/* Marked out from the categories it sits among: it is a different axis
   through the same cards, not another subject. */
.site-nav__occasions {
    color: var(--color-primary) !important;
}

/* The occasion strip above the category grid on the home page. */
.occasion-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed var(--color-border);
}

.occasion-strip__label {
    margin-right: 0.3rem;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.7;
}

/* Sister site, under the copyright line. Quieter than the policy links:
   it points off this site, so it should not compete with the things a
   visitor here might actually need. */
.site-footer__sister {
    margin: 0.5rem 0 0.2rem;
    font-size: 0.82rem;
    opacity: 0.7;
}

.site-footer__sister a {
    text-decoration: underline;
}

/* Breadcrumbs. Small and quiet: a way back, not a feature. */
.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.25rem 0;
    font-size: 0.8rem;
    opacity: 0.65;
}

.crumbs a {
    text-decoration: none;
}

.crumbs a:hover {
    text-decoration: underline;
    opacity: 1;
}

.crumbs [aria-current="page"] {
    font-weight: 700;
}

/* On a page whose own container already pads, the crumb should not pad
   twice and drift away from the edge the heading sits on. */
.container > .crumbs {
    padding-left: 0;
    padding-right: 0;
    margin-bottom: 0.4rem;
}

/* Inside the sign-in panel. These come last on purpose: the generic
   .signin__email-row rules are defined further up with the same
   specificity, and a column flex container reads flex-basis as a height,
   which is what turned the email field into a tall empty box. */
.signin__actions .signin__email,
.signin__actions .signin__or {
    max-width: none;
    width: 100%;
}

.signin__actions .signin__email label,
.signin__actions .field__hint {
    text-align: center;
}

/* Stacked rather than side by side: in a 27rem panel, an input and a
   button sharing a line leaves the input too short to read your own
   address back. */
.signin__actions .signin__email-row {
    flex-direction: column;
}

.signin__actions .signin__email-row input,
.signin__actions .signin__email-row .btn {
    width: 100%;
    flex: 0 0 auto;
}

.signin__actions .google-btn {
    width: 100%;
    justify-content: center;
}

/* Support lookup on the dashboard. */
.support-search {
    max-width: 32rem;
    margin-bottom: 1.5rem;
}

.support-search label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.support-search .field__hint {
    margin-left: 0;
}

/* The text tool's "A". Set in the same type as its label it reads as the
   word "a" - "A Text". A box makes it an icon again. */
/* Tool buttons are glyph-plus-label; where no glyph exists, a drawing of
   one the same size. */
.dyo-tool__icon {
    width: 1.15em;
    height: 1.15em;
    vertical-align: -0.24em;
}

.dyo-tool__glyph {
    display: inline-block;
    min-width: 1.15em;
    padding: 0 0.1em;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    font-size: 0.8em;
    line-height: 1.3;
    text-align: center;
    vertical-align: 0.05em;
}

/* ── the fortune cookie ──────────────────────────────────────────────────
   Two halves of one picture, each clipped to a side, so every cookie
   design cracks without anyone drawing a broken one. */

.cookie {
    position: relative;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.cookie__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    /* A backstop only. The halves swing outwards as they part, and on a
       narrow screen the right one reached three pixels past the viewport
       and gave the whole page a horizontal scrollbar. The travel below is
       sized to stay inside this box, so nothing should ever meet this
       edge - if it does, the cookie is cut off square rather than the
       whole page gaining a scrollbar. */
    overflow: hidden;
}

.cookie__half {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Shutting is quick and plain. Only the live preview ever shuts one -
       by changing the design - and watching a cookie you have just
       replaced slowly reassemble itself reads as a glitch, where
       breaking it is the whole point of the animation. The opening
       timing lives on .is-cracked below. */
    transition: transform 0.18s ease;
    will-change: transform;
}

/* The seam.
   A cookie does not snap along a ruled line, and inset() gave it one -
   two halves that looked cut rather than broken. This is one zigzag
   traced in opposite directions by the two halves, so they interlock.
   Both the spacing and the depth of the teeth vary. An even sawtooth
   looked machined, which is a different wrong answer from a straight
   line but still the wrong answer.
   The two edges do not meet, they overlap by about one percent. Edges
   that merely abut are each drawn with partial coverage along every
   diagonal, and the pair of them left a pale zigzag scratch down the
   middle of a cookie that is supposed to still be whole. Overlapping
   costs nothing: the strip in question is the same picture in both
   halves, and once they part it is two pixels' difference in where each
   one broke.
   Edit one polygon and you must edit the other, in reverse. */
.cookie__half--l {
    clip-path: polygon(
        0% 0%, 51.2% 0%, 47.7% 5%, 53.2% 11%, 48.7% 15%, 45.2% 24%, 52.7% 29%,
        49.2% 36%, 54.7% 41%, 46.2% 50%, 50.7% 57%, 44.7% 63%, 52.2% 69%,
        47.7% 75%, 53.7% 83%, 48.2% 88%, 51.7% 95%, 49.2% 100%, 0% 100%
    );
}

.cookie__half--r {
    clip-path: polygon(
        100% 0%, 100% 100%, 46.8% 100%, 49.3% 95%, 45.8% 88%, 51.3% 83%,
        45.3% 75%, 49.8% 69%, 42.3% 63%, 48.3% 57%, 43.8% 50%, 52.3% 41%,
        46.8% 36%, 50.3% 29%, 42.8% 24%, 46.3% 15%, 50.8% 11%, 45.3% 5%, 48.8% 0%
    );
}

/* The halves shrink as they part, which both suggests them falling away
   and keeps them inside the frame. The numbers are not free: the cookie
   fills the stage edge to edge at rest, so any rotation at full size puts
   painted pixels outside it. Turned 10 degrees at 0.8 scale the corners
   clear the top and bottom by a few pixels, and 8 percent of travel is
   what is left over sideways once the rotation has eaten its share. */
.cookie.is-cracked .cookie__half--l,
.cookie.is-cracked .cookie__half--r {
    transition: transform 0.75s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.cookie.is-cracked .cookie__half--l {
    transform: translateX(-8%) rotate(-10deg) scale(0.8);
}

.cookie.is-cracked .cookie__half--r {
    transform: translateX(8%) rotate(10deg) scale(0.8);
}

/* The slip starts behind the whole cookie and rises between the halves. */
.cookie__slip {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: min(66%, 23rem);
    padding: 0.9rem 1.1rem;
    background: #fdfaf2;
    color: #2e2823;
    border-radius: 3px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    /* Likewise: out quickly and without the delay that staggers it behind
       the halves on the way in. */
    transition: opacity 0.12s ease, transform 0.18s ease;
    pointer-events: none;
}

.cookie.is-cracked .cookie__slip {
    opacity: 1;
    transform: translate(-50%, -58%) scale(1) rotate(-1.2deg);
    transition: opacity 0.4s ease 0.25s, transform 0.6s cubic-bezier(0.34, 1.3, 0.64, 1) 0.2s;
}

.cookie__fortune {
    margin: 0;
    font-family: var(--font-hand, cursive);
    font-size: 1.15rem;
    line-height: 1.45;
    text-align: center;
}

/* The invitation.
   This was 12px of 60%-opacity grey and nobody could see it, which left
   a fortune cookie that said nothing about being openable sitting there
   looking like an ordinary picture. It is a button now, because that is
   what it is. */
.cookie__hint {
    margin: 0.7rem 0 0;
    text-align: center;
    transition: opacity 0.3s ease;
}

.cookie__hint-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.95rem;
    border: 1px solid var(--color-primary);
    border-radius: 999px;
    color: var(--color-primary);
    background: transparent;
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    transition: background 0.18s ease, color 0.18s ease;
}

.cookie__hint-icon {
    width: 0.7em;
    height: 0.95em;
    flex: none;
}

.cookie:hover .cookie__hint-pill {
    background: var(--color-primary);
    color: var(--paper-card);
}

.cookie.is-cracked .cookie__hint {
    opacity: 0;
    pointer-events: none;
}

/* Keyboard users were being handed a focusable element with nothing to
   show for it. */
.cookie:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

/* A slow breath, so the cookie reads as something waiting to be touched
   rather than a picture of a cookie. It only ever scales DOWN: the
   artwork already meets the top and bottom of its frame, and anything
   that grows would be shaved off square by the frame's clip. */
@keyframes cookie-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(0.976); }
}

.cookie:not(.is-cracked) .cookie__stage {
    animation: cookie-breathe 4s ease-in-out infinite;
}

/* Crumbs: thrown outwards as the halves part, then gone. Without them
   the two pieces separate far too politely for something that is
   supposed to have snapped. */
.cookie__crumbs {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.cookie__crumbs i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 6px;
    border-radius: 60% 40% 55% 45%;
    background: #c4883c;
    box-shadow: inset 0 -1px 0 rgba(90, 52, 10, 0.45);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
}

@keyframes cookie-crumb {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    18%  { opacity: 1; }
    100% {
        opacity: 0;
        transform:
            translate(calc(-50% + var(--cx)), calc(-50% + var(--cy)))
            scale(1) rotate(var(--cr));
    }
}

.cookie.is-cracked .cookie__crumbs i {
    animation: cookie-crumb 0.85s ease-out forwards;
}

.cookie__crumbs i:nth-child(1) { --cx: -46px; --cy: 26px;  --cr: -60deg; animation-delay: 0.02s; }
.cookie__crumbs i:nth-child(2) { --cx: 42px;  --cy: 34px;  --cr: 70deg;  animation-delay: 0.06s; width: 5px; height: 5px; }
.cookie__crumbs i:nth-child(3) { --cx: -24px; --cy: 48px;  --cr: 35deg;  animation-delay: 0.1s; }
.cookie__crumbs i:nth-child(4) { --cx: 20px;  --cy: 52px;  --cr: -45deg; animation-delay: 0.14s; width: 4px; height: 4px; }
.cookie__crumbs i:nth-child(5) { --cx: -8px;  --cy: -34px; --cr: 25deg;  animation-delay: 0.05s; width: 5px; height: 4px; }
.cookie__crumbs i:nth-child(6) { --cx: 12px;  --cy: -28px; --cr: -30deg; animation-delay: 0.12s; width: 4px; height: 4px; }
.cookie__crumbs i:nth-child(7) { --cx: 34px;  --cy: 8px;   --cr: 80deg;  animation-delay: 0.18s; width: 5px; height: 5px; }

.cookie__fallback {
    font-family: var(--font-hand, cursive);
    font-size: 1.15rem;
    text-align: center;
}

/* Somebody who has asked not to be animated still gets the fortune; it is
   simply already open. */
@media (prefers-reduced-motion: reduce) {
    /* These have to match the specificity of the .is-cracked rules that
       set the opening timings, or they lose to them and the animation
       plays anyway for somebody who asked for no animation. A media
       query adds no weight of its own. */
    .cookie__half,
    .cookie__slip,
    .cookie.is-cracked .cookie__half--l,
    .cookie.is-cracked .cookie__half--r,
    .cookie.is-cracked .cookie__slip {
        transition: none;
    }

    /* No breathing, and no crumbs flying across the card. The fortune is
       already open for this reader; there is nothing left to invite. */
    .cookie:not(.is-cracked) .cookie__stage {
        animation: none;
    }

    .cookie.is-cracked .cookie__crumbs i {
        animation: none;
    }

    /* Shaking the globe is something somebody chose to do, so it still
       happens - it just does not throw the whole widget about. */
    .snowglobe-widget.is-shaking {
        animation: none;
    }

    /* The airmail border's barber-pole crawl, if it has one. */
    .airmail-edge {
        animation: none;
    }
}

/* ── sending one back ────────────────────────────────────────────────────
   The reply button is the primary thing to do with a card you have just
   read, so it is the only button under one; "send your own" stays as a
   plain link beneath it rather than competing. */

.postcard-cta {
    text-align: center;
    margin: 1.75rem 0 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.postcard-cta__reply {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.02rem;
    text-decoration: none;
    padding: 0.7rem 1.4rem;
    border-radius: 2px;
    box-shadow: 0 3px 0 var(--color-primary-dark);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.postcard-cta__reply:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 0 var(--color-primary-dark);
}

.postcard-cta__reply:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 var(--color-primary-dark);
}

.postcard-cta__own {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Carried across the browse pages, because choosing a card takes a few
   clicks and arriving at a form that is already addressed is otherwise a
   small mystery. Perforated underneath, like a tear-off slip. */
.reply-bar {
    background: var(--color-accent-light);
    border-bottom: 1px dashed var(--color-border);
    color: var(--color-text);
}

.reply-bar__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.6rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem 1rem;
}

.reply-bar__text {
    margin: 0;
    font-size: 0.92rem;
}

.reply-bar__mark {
    font-size: 1.05rem;
    margin-right: 0.3rem;
    opacity: 0.75;
}

.reply-bar__cancel {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: underline;
}

/* ── birthdays worth remembering ─────────────────────────────────────────
   Sits under the history on the account page, so it needs to read as its
   own thing rather than one more table of what has already happened. */
.birthday-form {
    margin: 1.25rem 0 2.5rem;
    padding: 1.25rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.sent-remember {
    margin: 1.75rem auto 0;
    max-width: 30rem;
    padding: 1.1rem 1.25rem;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.sent-remember__text {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
}

/* ── the card's picture as a jigsaw ──────────────────────────────────────
   Played in the picture's own frame, not as a second copy below it. */

.jigsaw-board {
    /* Placed and sized by the script, over the painted picture rather
       than over the element that reserves room for it. */
    position: absolute;
    z-index: 2;
    /* A shuffled piece from the middle still has its tabs, and sitting
       in an edge slot it reaches out past the picture and onto the
       card's paper. The puzzle stays inside its own frame. */
    overflow: hidden;
    /* The mat the pieces lie on. Two pieces that do not belong together
       leave a socket with no tab in it, and without something behind
       them those holes were the cream of the card showing through -
       bright blobs scattered over the picture. Dark, they read as what
       they are: gaps, and a hint that those two do not go together. */
    background: #15110c;
}

/* The picture stays in the layout - it is what gives the frame its
   height - it simply stops being visible while the puzzle is on top. */
.postcard__art.is-puzzled {
    visibility: hidden;
}

.jigsaw__defs {
    position: absolute;
    width: 0;
    height: 0;
}

/* A piece is larger than the cell it occupies, because its tabs reach
   out over its neighbours; the clip path decides what of that box is
   actually the piece. */
.jigsaw__piece {
    position: absolute;
    border: 0;
    padding: 0;
    margin: 0;
    background-repeat: no-repeat;
    /* The mat shows through instead: a piece whose tab hangs off the
       edge of the picture has nothing to paint there. */
    background-color: transparent;
    cursor: pointer;
    transition: filter 0.12s ease, transform 0.12s ease;
}

.jigsaw__piece:hover:not(:disabled) {
    filter: brightness(1.12);
    z-index: 3;
}

/* An outline would be clipped away with the rest of the box, so a
   picked-up piece is shown by lifting and brightening it instead. */
.jigsaw__piece:focus-visible {
    filter: brightness(1.25) drop-shadow(0 0 0 var(--color-primary));
    outline: none;
    z-index: 4;
}

.jigsaw__piece[aria-pressed="true"] {
    filter: brightness(1.3) saturate(1.2);
    transform: scale(0.94);
    z-index: 4;
}

.jigsaw__piece:disabled {
    cursor: default;
}

.jigsaw {
    margin: 1rem auto 0;
    max-width: 34rem;
    text-align: center;
}

.jigsaw__options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.jigsaw__label {
    font-family: var(--font-display);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-right: 0.2rem;
}

.jigsaw__size,
.jigsaw__peek {
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    color: var(--color-text);
    border-radius: 10px;
    padding: 0.35rem 0.7rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.jigsaw__size[aria-pressed="true"] {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.jigsaw__peek {
    margin-left: 0.4rem;
}

.jigsaw__status {
    margin: 0.7rem 0 0;
    min-height: 1.3em;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

/* ── looking for something ───────────────────────────────────────────────
   One box in the header, and a page that answers in four groups. */

/* Present to a screen reader, invisible on screen. Used for the labels
   on controls whose meaning is carried by an icon. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.site-search {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 0 1 auto;
    width: 13rem;
}

.site-search input {
    width: 100%;
    min-width: 0;
    padding: 0.38rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.85rem;
}

.site-search input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
}

.site-search button {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
}

.site-search button:hover {
    color: var(--color-primary);
}

.site-search svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}


.search-group {
    margin: 2.25rem 0 0.9rem;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    border-bottom: 1px dashed var(--color-border);
    padding-bottom: 0.4rem;
}

.search-places,
.search-people {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.search-places li,
.search-people li {
    padding: 0.55rem 0.8rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.search-places .muted,
.search-people .muted {
    font-size: 0.82rem;
    margin-left: 0.5rem;
}

.search-people__blurb {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 0.15rem;
}

.snippet-card__where {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.template-card__label .muted {
    display: block;
    font-size: 0.75rem;
    font-family: var(--font-body, inherit);
    text-transform: none;
    letter-spacing: 0;
}
