/* ==========================================================================
   CreateACard — Homepage styles
   Direction: editorial print (letterpress, post room, paper) meets
   interactive 3D. One signature accent — Post Red.
   --------------------------------------------------------------------------
   1. Tokens            6. Hero: envelope + card      11. Dashboard
   2. Base              7. How it works (pinned)      12. Call to action
   3. Type & links      8. Card artwork               13. Footer
   4. Buttons           9. Collection                 14. Motion prefs
   5. Navigation       10. AI creator
   ========================================================================== */

/* 1. TOKENS =============================================================== */
:root {
    /* Colour — paper, ink and one signature red */
    --paper: #EFE9DE;
    --paper-2: #E5DDCF;
    --stock: #FBF8F2;          /* card stock white */
    --ink: #1B1814;
    --ink-2: #2A2520;
    --ink-soft: #4B443C;
    --muted: #7A7064;
    --red: #E4472B;            /* Post Red — the signature accent */
    --red-deep: #C2361F;
    --moss: #2F4A3C;
    --blush: #F0C7B8;
    --butter: #F2D98A;
    --gold: #B8924A;
    --line: rgba(27, 24, 20, .14);
    --line-soft: rgba(27, 24, 20, .08);
    --line-light: rgba(239, 233, 222, .16);

    /* Type */
    --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
    --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

    --fs-display: clamp(3.4rem, 9.6vw, 11.5rem);
    --fs-h2: clamp(2.6rem, 6vw, 6.4rem);
    --fs-h3: clamp(1.6rem, 2.2vw, 2.2rem);
    --fs-lede: clamp(1.05rem, 1.2vw, 1.25rem);
    --fs-small: .875rem;
    --fs-mono: .78rem;

    /* Space */
    --gutter: clamp(1.25rem, 4vw, 3.5rem);
    --container: 1440px;
    --section-y: clamp(6rem, 12vw, 11rem);

    /* Shape & depth */
    --radius: 3px;
    --shadow-paper: 0 1px 1px rgba(27, 24, 20, .06), 0 10px 20px -10px rgba(27, 24, 20, .25), 0 30px 60px -30px rgba(27, 24, 20, .35);
    --shadow-lift: 0 2px 4px rgba(27, 24, 20, .08), 0 30px 60px -20px rgba(27, 24, 20, .45);

    /* Motion */
    --ease: cubic-bezier(.22, 1, .36, 1);
    --ease-io: cubic-bezier(.65, 0, .35, 1);

    /* Hero card width (envelope is sized from it) */
    --card-w: clamp(220px, 19vw, 330px);

    --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.09  0 0 0 0 0.08  0 0 0 .5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");

    /* Torn / deckled paper edge used between sections */
    --deckle: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 24' preserveAspectRatio='none'><path d='M0 24V10l18 3 22-6 30 5 26-4 20 6 34-7 22 4 30-5 28 6 24-3 30 4 26-6 32 5 20-3 34 6 26-7 22 5 30-4 28 6 24-5 32 3 22-6 30 7 26-4 20 3 34-6 22 5 28-3 30 6 24-6 26 4 32-5 22 6 30-3 26 4 24-6 32 5 20-4 30 6 24-3 28 4 22-5 32 6 26-4 20 3 30-6 24 5 28-2 22 4V24z' fill='black'/></svg>");
}

/* 2. BASE ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body {
    margin: 0; font-family: var(--sans); font-size: 1rem; line-height: 1.6; font-variation-settings: "wdth" 100;
    color: var(--ink); background: var(--paper);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
body::before { /* paper texture across the whole page */
    content: ""; position: fixed; inset: 0; z-index: 9990; pointer-events: none;
    background-image: var(--grain); opacity: .16; mix-blend-mode: multiply;
}
body.menu-open { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: var(--red); color: var(--stock); }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 10000; background: var(--ink); color: var(--paper); padding: 10px 16px; }
.skip-link:focus { top: 16px; }
[data-lucide], .lucide { width: 1.05em; height: 1.05em; stroke-width: 1.6; flex-shrink: 0; }

/* 3. TYPE & LINKS ========================================================= */
.link-arrow {
    display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; font-size: 1rem;
    padding-bottom: 3px; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
    transition: background-size .5s var(--ease), color .3s;
}
.link-arrow:hover { color: var(--red); background-size: 0 1px; background-position: 100% 100%; }
.link-arrow svg { transition: transform .5s var(--ease); }
.link-arrow:hover svg { transform: translate(2px, 2px); }

/* 4. BUTTONS ============================================================== */
.btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    height: 50px; padding: 0 1.6rem; border-radius: var(--radius);
    font-weight: 600; font-size: .95rem; letter-spacing: -.005em; white-space: nowrap;
    transition: background-color .35s var(--ease), color .35s, transform .45s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn--sm { height: 40px; padding: 0 1.1rem; font-size: .88rem; }
.btn--lg { height: 58px; padding: 0 2rem; font-size: 1rem; }
.btn--xl { height: 68px; padding: 0 2.6rem; font-size: 1.08rem; }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--red); color: var(--stock); }
.btn--red { background: var(--red); color: var(--stock); }
.btn--red:hover { background: var(--stock); color: var(--ink); }
.btn--line { border: 1px solid var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }
.btn.is-loading { pointer-events: none; opacity: .8; }

/* 5. NAVIGATION =========================================================== */
.nav { position: fixed; inset: 0 0 auto; z-index: 900; transition: transform .6s var(--ease), background .4s, box-shadow .4s, color .4s; }
.nav.is-hidden { transform: translateY(-100%); }
.nav.is-scrolled { background: rgba(239, 233, 222, .97); box-shadow: 0 1px 0 var(--line); }
.nav.is-dark { color: var(--paper); }
.nav.is-dark.is-scrolled { background: rgba(27, 24, 20, .97); box-shadow: 0 1px 0 var(--line-light); }
.nav__inner {
    width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; height: 76px;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; justify-self: start; }
.brand__mark { width: 30px; height: 30px; transition: transform .7s var(--ease); }
.brand:hover .brand__mark { transform: rotate(-12deg); }
.brand__word { font-family: var(--sans); font-weight: 700; font-size: 1.25rem; letter-spacing: -.035em; font-variation-settings: "wdth" 88; }
.brand__word b { font-family: var(--serif); font-weight: 500; font-style: italic; color: var(--red); font-size: 1.15em; padding: 0 .02em; }
.brand--light { color: var(--paper); }

.nav__links { display: flex; align-items: center; }
.nav__link { position: relative; margin: 0 1rem; padding: .4rem 0; font-size: .92rem; font-weight: 500; }
.nav__link::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
    transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease);
}
.nav__link:hover::after, .nav__link.is-current::after { transform: scaleX(1); transform-origin: left; }
.nav__actions { display: flex; align-items: center; justify-content: flex-end; gap: 1.3rem; }
.nav__login { font-size: .92rem; font-weight: 600; transition: color .3s; }
.nav__login:hover { color: var(--red); }
.nav__logout { display: contents; } /* logout is a POST form; let its button sit in the nav layout */
.nav.is-dark .btn--ink { background: var(--paper); color: var(--ink); }
.nav.is-dark .btn--ink:hover { background: var(--red); color: var(--stock); }

.nav__burger { display: none; position: relative; width: 44px; height: 44px; }
.nav__burger span { position: absolute; left: 10px; right: 10px; height: 1.5px; background: currentColor; transition: transform .5s var(--ease), top .5s var(--ease); }
.nav__burger span:first-child { top: 18px; }
.nav__burger span:last-child { top: 26px; }
.menu-open .nav__burger span:first-child, .menu-open .nav__burger span:last-child { top: 22px; }
.menu-open .nav__burger span:first-child { transform: rotate(45deg); }
.menu-open .nav__burger span:last-child { transform: rotate(-45deg); }
.menu-open .nav { color: var(--ink); background: transparent; box-shadow: none; }

.mobile-menu {
    position: fixed; inset: 0; z-index: 850; display: flex; flex-direction: column; justify-content: space-between;
    padding: 110px var(--gutter) calc(32px + env(safe-area-inset-bottom)); background: var(--paper);
    clip-path: inset(0 0 100% 0); visibility: hidden;
    transition: clip-path .7s var(--ease-io), visibility 0s .7s;
}
.menu-open .mobile-menu { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .7s var(--ease-io), visibility 0s; }
.mobile-menu__links { display: grid; }
.mobile-menu__link {
    font-family: var(--serif); font-size: clamp(2.4rem, 11vw, 3.6rem); line-height: 1.15; letter-spacing: -.02em;
    border-bottom: 1px solid var(--line); padding: .35rem 0;
    opacity: 0; transform: translateY(20px); transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.menu-open .mobile-menu__link { opacity: 1; transform: none; }
.menu-open .mobile-menu__link:nth-child(2) { transition-delay: .05s; }
.menu-open .mobile-menu__link:nth-child(3) { transition-delay: .1s; }
.menu-open .mobile-menu__link:nth-child(4) { transition-delay: .15s; }
.menu-open .mobile-menu__link:nth-child(5) { transition-delay: .2s; }
.mobile-menu__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mobile-menu__actions .btn { height: 56px; }

.toast {
    position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 1000;
    padding: .9rem 1.3rem; background: var(--ink); color: var(--paper); font-size: .92rem;
    transform: translate(-50%, 200%); visibility: hidden; transition: transform .6s var(--ease), visibility 0s .6s; pointer-events: none;
}
.toast.is-visible { transform: translate(-50%, 0); visibility: visible; transition: transform .6s var(--ease); }

/* 6. HERO ================================================================= */
.hero {
    --edge: max(var(--gutter), calc((100vw - var(--container)) / 2));
    position: relative; min-height: max(100svh, 780px);
    padding: 108px var(--edge) 40px;
    display: grid; grid-template-rows: 1fr auto; overflow: hidden;
}
.hero__title {
    position: relative; z-index: 1;
    font-family: var(--serif); font-weight: 450; font-size: var(--fs-display);
    line-height: .9; letter-spacing: -.035em;
    display: flex; flex-direction: column; justify-content: space-between; min-height: 100%;
}
.hero__line { display: block; }
.hero__line--1 { padding-left: .02em; }
.hero__line--2 { align-self: flex-end; font-style: italic; color: var(--red); padding-right: .08em; margin-top: auto; }
.word { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .02em .1em; margin-bottom: -.1em; }
.word > span { display: inline-block; will-change: transform; }

.hero__foot {
    position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 30rem) auto; justify-content: space-between; align-items: end; gap: 2rem;
    margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.hero__lede { font-size: var(--fs-lede); color: var(--ink-soft); line-height: 1.55; }
.hero__ctas { display: flex; align-items: center; gap: 2rem; }

/* --- Stage ------------------------------------------------------------------ */
.stage {
    --env-w: calc(var(--card-w) * 1.12);
    --env-h: calc(var(--card-w) * 1.5);
    position: absolute; z-index: 2; left: 50%; top: 47%;
    width: var(--env-w); height: var(--env-h);
    transform: translate(-28%, -50%);
    perspective: 2000px;
}
.stage__float { position: absolute; inset: 0; transform-style: preserve-3d; animation: drift 7s var(--ease-io) infinite; }
@keyframes drift { 0%, 100% { transform: translate3d(0, 0, 0) rotateZ(-1deg); } 50% { transform: translate3d(0, -16px, 0) rotateZ(.6deg); } }
.stage.is-open .stage__float { animation-play-state: paused; }
.stage__obj { position: absolute; inset: 0; transform-style: preserve-3d; cursor: pointer; will-change: transform; }
.stage.is-open .stage__obj { cursor: default; }

/* Envelope */
.env { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform; }
.env__back, .env__pocket, .env__flap-out, .env__flap-in { position: absolute; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.env__back {
    inset: 0; border-radius: 4px;
    background: var(--red-deep);
    background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 9px);
    box-shadow: var(--shadow-lift);
}
.env__pocket {
    inset: 0; border-radius: 4px;
    background:
        linear-gradient(to top right, transparent calc(50% - .6px), rgba(27, 24, 20, .09) 50%, transparent calc(50% + .6px)),
        linear-gradient(to top left, transparent calc(50% - .6px), rgba(27, 24, 20, .09) 50%, transparent calc(50% + .6px)),
        linear-gradient(170deg, #F8F2E6, #EADFCC);
    clip-path: polygon(0 0, 50% 44%, 100% 0, 100% 100%, 0 100%);
    transform: translateZ(6px);
}
.env__name {
    position: absolute; left: 0; right: 0; bottom: 14%; text-align: center;
    font-family: var(--serif); font-style: italic; font-size: calc(var(--card-w) * .12); color: var(--ink);
}
.env__flap { position: absolute; left: 0; right: 0; top: 0; height: 50%; transform-origin: 50% 0; transform-style: preserve-3d; transform: translateZ(8px); }
.env__flap-out, .env__flap-in { inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 4px 4px 0 0; }
.env__flap-out { background: linear-gradient(180deg, #F3EBDD, #E4D7C1); }
.env__flap-in {
    transform: rotateX(180deg);
    background: var(--red);
    background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .08) 0 2px, transparent 2px 9px);
}
.env__seal {
    position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 45%) translateZ(1px);
    width: calc(var(--card-w) * .17); height: calc(var(--card-w) * .17); border-radius: 50%;
    display: grid; place-items: center;
    background: radial-gradient(circle at 35% 30%, #F0705A, var(--red-deep) 70%);
    box-shadow: 0 3px 8px rgba(120, 30, 15, .4), inset 0 -2px 4px rgba(0, 0, 0, .2);
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.env__seal img { width: 52%; height: auto; filter: grayscale(1) brightness(3); opacity: .85; }

/* Card */
.cardmove {
    position: absolute; left: 50%; top: 50%; width: var(--card-w); aspect-ratio: 5 / 7;
    margin-left: calc(var(--card-w) * -.5); margin-top: calc(var(--card-w) * -.7);
    transform-style: preserve-3d; will-change: transform;
}
.sig__shift { position: absolute; inset: 0; transform-style: preserve-3d; }
.sig__card { position: absolute; inset: 0; transform-style: preserve-3d; }
.sig__inside, .sig__front, .sig__back { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.sig__inside { background: var(--stock); border-radius: 1px 4px 4px 1px; overflow: hidden; box-shadow: var(--shadow-paper); }
.sig__inside-content { position: absolute; inset: 0; padding: 13% 11%; display: flex; flex-direction: column; gap: calc(var(--card-w) * .045); }
.sig__kicker { font-family: var(--mono); font-size: calc(var(--card-w) * .036); color: var(--red); }
.sig__greeting { font-family: var(--serif); font-size: calc(var(--card-w) * .12); line-height: 1; letter-spacing: -.03em; }
.sig__message { font-size: calc(var(--card-w) * .044); line-height: 1.6; color: var(--ink-soft); }
.sig__sign { margin-top: auto; font-size: calc(var(--card-w) * .042); color: var(--muted); line-height: 1.3; }
.sig__sign span { font-family: var(--serif); font-style: italic; font-size: 2.2em; color: var(--ink); }
.sig__inside-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(27, 24, 20, .4), transparent 55%); pointer-events: none; }

.sig__cover { position: absolute; inset: 0; transform-origin: 0 50%; transform-style: preserve-3d; transform: translateZ(1px); }
.sig__front { border-radius: 1px 4px 4px 1px; overflow: hidden; background: var(--ink); box-shadow: var(--shadow-paper); }
.sig__front img { width: 100%; height: 100%; object-fit: cover; }
.sig__front::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6%; z-index: 2; background: linear-gradient(90deg, rgba(0, 0, 0, .4), transparent); }
.sig__front-text { position: absolute; left: 0; right: 0; bottom: 10%; text-align: center; z-index: 2; display: grid; line-height: 1; }
.sig__front-text span { font-family: var(--serif); font-style: italic; font-size: calc(var(--card-w) * .07); color: #E9D3A0; }
.sig__front-text strong {
    font-family: var(--serif); font-weight: 400; font-size: calc(var(--card-w) * .21); letter-spacing: -.03em;
    background: linear-gradient(115deg, #F8E6B4 0%, #B8924A 40%, #F3D695 var(--foil-x, 60%), #9C7533 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sig__foil {
    position: absolute; inset: 0; z-index: 3; pointer-events: none; mix-blend-mode: overlay;
    background: linear-gradient(115deg, transparent 30%, rgba(255, 236, 190, .4) 46%, transparent 62%);
    background-size: 260% 100%; background-position: var(--foil-x, 50%) 0;
}
.sig__back { transform: rotateY(180deg); background: var(--stock); border-radius: 4px 1px 1px 4px; box-shadow: var(--shadow-paper); overflow: hidden; }
.sig__back-mark { position: absolute; left: 0; right: 0; bottom: 12%; display: grid; justify-items: center; gap: .5rem; font-size: calc(var(--card-w) * .04); color: var(--muted); }
.sig__back-mark img { width: calc(var(--card-w) * .09); height: auto; }
.sig__back-shade { position: absolute; inset: 0; background: linear-gradient(270deg, rgba(27, 24, 20, .35), transparent 55%); }
.sig__burst { position: absolute; left: 0; top: 50%; transform: translateZ(30px); pointer-events: none; }
.sig__burst i { position: absolute; display: block; }

.stage__shadow {
    position: absolute; left: 0; right: 0; margin-inline: auto; bottom: -9%; width: 100%; height: 9%;
    background: radial-gradient(closest-side, rgba(27, 24, 20, .32), transparent); pointer-events: none;
}

.stage__btn {
    position: absolute; right: calc(100% + 2.5rem); top: 50%;
    font-family: var(--mono); font-size: var(--fs-mono); white-space: nowrap;
    padding: .55rem .9rem; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--paper);
    transition: opacity .4s var(--ease), background .3s, color .3s;
}
.stage__btn:hover { background: var(--ink); color: var(--paper); }
.stage__btn--close { opacity: 0; pointer-events: none; right: auto; left: 50%; top: calc(100% + 1.2rem); }
.stage.is-open .stage__btn--open { opacity: 0; pointer-events: none; }
.stage.is-open .stage__btn--close { opacity: 1; pointer-events: auto; transition-delay: 2.2s; }

/* No JavaScript: show the card open and flat */
.no-js .env, .no-js .sig__cover, .no-js .stage__btn, .no-js .sig__inside-shade { display: none; }

/* 7. HOW IT WORKS ========================================================= */
.how { background: var(--paper-2); position: relative; overflow-x: clip; }
main { overflow-x: clip; }
.how__pin { position: relative; height: 100svh; min-height: 640px; overflow: hidden; }
.how__track { display: flex; height: 100%; width: max-content; will-change: transform; }
.how__intro {
    width: min(46vw, 640px); flex-shrink: 0; padding: 0 4vw 0 var(--gutter);
    display: flex; flex-direction: column; justify-content: center; gap: 2rem;
}
.how__title { font-family: var(--serif); font-weight: 450; font-size: clamp(2.6rem, 4.8vw, 5.2rem); line-height: .98; letter-spacing: -.035em; }
.how__title span { color: var(--red); }
.how__lede { max-width: 30ch; color: var(--ink-soft); font-size: var(--fs-lede); }

.panel {
    position: relative; flex-shrink: 0; width: min(78vw, 1100px); height: 100%;
    display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 4vw;
    padding: 90px 4vw 70px; border-left: 1px solid var(--line);
}
.panel__num {
    position: absolute; right: 3vw; bottom: 5vh; z-index: 0;
    font-family: var(--sans); font-weight: 800; font-variation-settings: "wdth" 62;
    font-size: clamp(9rem, 34vh, 22rem); line-height: .8; letter-spacing: -.04em; color: var(--red);
}
.panel__visual { position: relative; z-index: 1; height: min(62vh, 520px); display: grid; place-items: center; }
.panel__text { position: relative; z-index: 1; align-self: start; padding-top: 12vh; display: grid; gap: 1rem; max-width: 22rem; }
.panel__text h3 { font-family: var(--sans); font-size: var(--fs-h3); font-weight: 700; letter-spacing: -.03em; font-variation-settings: "wdth" 112; }
.panel__text p { color: var(--ink-soft); font-size: 1.05rem; }

.fan { position: relative; width: 100%; height: 100%; }
.fan__card { --w: clamp(150px, 15vw, 230px); position: absolute; left: 50%; top: 50%; width: var(--w); margin: calc(var(--w) * -.7) 0 0 calc(var(--w) * -.5); transform-origin: 50% 110%; box-shadow: var(--shadow-paper); }

.letter {
    width: min(100%, 460px); aspect-ratio: 7 / 5; padding: 2.4rem; background: var(--stock); box-shadow: var(--shadow-lift);
    display: flex; flex-direction: column; justify-content: space-between; transform: rotate(-2deg);
}
.letter__text { font-family: var(--serif); font-size: clamp(1.4rem, 2vw, 2rem); line-height: 1.25; letter-spacing: -.02em; }
.letter__text .ch { opacity: .08; transition: opacity .15s; }
.letter__text .ch.on { opacity: 1; }
.caret { display: inline-block; width: 1.5px; height: .95em; margin-left: 2px; vertical-align: -.1em; background: var(--red); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.letter__tools { display: flex; align-items: center; gap: .6rem; padding-top: 1rem; border-top: 1px solid var(--line-soft); }
.letter__tool { display: grid; place-items: center; width: 36px; height: 30px; border: 1px solid var(--line); font-size: .95rem; }
.letter__tool--serif { font-family: var(--serif); border-color: var(--ink); }
.letter__swatch { width: 20px; height: 20px; border-radius: 50%; background: var(--c); }
.letter__swatch:first-of-type { box-shadow: 0 0 0 2px var(--stock), 0 0 0 3px var(--ink); }

.sent { position: relative; width: min(100%, 440px); aspect-ratio: 1.55; }
.sent__env {
    position: absolute; inset: 0; background: linear-gradient(170deg, #F8F2E6, #E8DCC8); box-shadow: var(--shadow-lift);
    display: grid; place-items: center; transform: rotate(2deg);
}
.sent__env::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom right, transparent calc(50% - .6px), var(--line) 50%, transparent calc(50% + .6px)), linear-gradient(to bottom left, transparent calc(50% - .6px), var(--line) 50%, transparent calc(50% + .6px)); clip-path: polygon(0 0, 100% 0, 50% 55%); }
.sent__env span { position: relative; margin-top: 30%; font-family: var(--mono); font-size: .85rem; padding: .5rem .8rem; background: var(--stock); border: 1px solid var(--line); }
.sent__mark { position: absolute; right: -6%; top: -18%; width: 52%; color: var(--red); mix-blend-mode: multiply; }

.postmark { width: 100%; height: auto; overflow: visible; }
.postmark__ring { fill: none; stroke: currentColor; stroke-width: 2.5; }
.postmark__ring--inner { stroke-width: 1.5; }
.postmark__ringtext { font-family: var(--mono); font-size: 11.5px; letter-spacing: 1.6px; fill: currentColor; }
.postmark__centre { font-family: var(--sans); font-weight: 800; font-variation-settings: "wdth" 70; font-size: 30px; fill: currentColor; }

.how__progress { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px; height: 1px; background: var(--line); }
.how__progress span { display: block; height: 100%; width: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }

/* 8. CARD ARTWORK ========================================================= */
.art {
    position: relative; aspect-ratio: 5 / 7; overflow: hidden; border-radius: 2px;
    container-type: inline-size; background: var(--stock);
}
.art::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.art__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.art--bokeh .art__bokeh-text { position: absolute; left: 9%; bottom: 8%; color: #FFF6EA; font-family: var(--sans); font-weight: 300; font-size: 13cqw; line-height: .95; letter-spacing: -.015em; font-variation-settings: "wdth" 80; }

.art--thirty { background: var(--red); color: var(--ink); }
.art__thirty-num { position: absolute; left: -6%; top: -8%; font-family: var(--serif); font-weight: 400; font-size: 118cqw; line-height: .85; letter-spacing: -.08em; }
.art__thirty-text { position: absolute; left: 9%; right: 9%; bottom: 7%; font-family: var(--mono); font-size: 5.2cqw; color: var(--stock); }

.art--cutout { background: #F3EBDD; }

.art--quiet { background: var(--stock); }
.art__quiet-dot { position: absolute; left: 50%; top: 40%; width: 6cqw; height: 6cqw; margin-left: -3cqw; border-radius: 50%; background: var(--red); }
.art__quiet-text { position: absolute; left: 10%; bottom: 8%; font-family: var(--serif); font-size: 9cqw; }

.art--sea .art__sea-text { position: absolute; left: 0; right: 0; top: 9%; text-align: center; color: #FFF6EA; font-family: var(--serif); font-style: italic; font-size: 9cqw; }

.art--thanks { background: var(--ink); color: var(--paper); display: flex; flex-direction: column; justify-content: center; }
.art__thanks-word { display: block; font-family: var(--sans); font-weight: 800; font-variation-settings: "wdth" 125; font-size: 38cqw; line-height: .8; letter-spacing: -.05em; margin-left: -4%; white-space: nowrap; }
.art__thanks-word + .art__thanks-word { color: var(--butter); margin-left: 22%; }
.art__thanks-small { position: absolute; left: 9%; bottom: 7%; font-family: var(--mono); font-size: 5cqw; opacity: .7; }

.art--garden .art__garden-text { position: absolute; left: 0; right: 0; bottom: 9%; text-align: center; font-family: var(--serif); font-size: 11cqw; letter-spacing: -.02em; }
.art--foil .art__foil-text {
    position: absolute; left: 0; right: 0; bottom: 11%; text-align: center; font-family: var(--serif); font-style: italic; font-size: 14cqw;
    background: linear-gradient(115deg, #F8E6B4, #B8924A 45%, #F3D695 70%, #9C7533); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.art--sunset .art__sunset-text { position: absolute; left: 0; right: 0; top: 10%; text-align: center; font-family: var(--serif); font-size: 15cqw; letter-spacing: -.03em; color: var(--ink); }

/* 9. COLLECTION =========================================================== */
.collection { padding: var(--section-y) 0 calc(var(--section-y) * .7); position: relative; }
.collection__head { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: end; margin-bottom: clamp(3rem, 6vw, 6rem); }
.collection__title { font-family: var(--serif); font-weight: 450; font-size: var(--fs-h2); line-height: .95; letter-spacing: -.035em; }
.collection__aside { display: grid; gap: 1.8rem; padding-bottom: .6rem; }
.collection__aside p { color: var(--ink-soft); max-width: 42ch; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.filter { position: relative; padding: .2rem 0; font-weight: 500; color: var(--muted); transition: color .3s; }
.filter sup { font-family: var(--mono); font-size: .65rem; margin-left: .2rem; }
.filter:hover, .filter.is-active { color: var(--ink); }
.filter.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--red); }

/* The table: an art-directed, uneven grid */
.table { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(1rem, 2vw, 2rem); row-gap: clamp(3rem, 6vw, 6rem); align-items: start; }
.piece { position: relative; transition: opacity .6s var(--ease), filter .6s var(--ease); }
.piece--1 { grid-column: 1 / span 4; rotate: -2.5deg; }
.piece--2 { grid-column: 6 / span 3; margin-top: 18%; rotate: 2deg; }
.piece--3 { grid-column: 10 / span 3; margin-top: -4%; rotate: -1deg; }
.piece--4 { grid-column: 2 / span 2; margin-top: -10%; rotate: 3deg; }
.piece--5 { grid-column: 4 / span 4; margin-top: 8%; rotate: -1.5deg; z-index: 1; }
.piece--6 { grid-column: 9 / span 3; margin-top: -14%; rotate: 2.5deg; }
.piece--7 { grid-column: 1 / span 3; margin-top: -6%; rotate: 1.5deg; }
.piece--8 { grid-column: 6 / span 3; margin-top: -20%; rotate: -2deg; }
.piece.is-dimmed { opacity: .18; filter: grayscale(1); }

.piece__card { position: relative; display: block; perspective: 1400px; cursor: pointer; outline: none; }
.piece__card:focus-visible { outline: 2px solid var(--red); outline-offset: 6px; }
.piece__inner { position: relative; transform-style: preserve-3d; transition: transform .9s var(--ease); will-change: transform; }
.piece__front, .piece__back { -webkit-backface-visibility: hidden; backface-visibility: hidden; box-shadow: var(--shadow-paper); }
.piece__back {
    position: absolute; inset: 0; transform: rotateY(180deg); background: var(--stock);
    padding: 12% 10%; display: flex; flex-direction: column; gap: 1rem;
}
.piece__back-label { font-family: var(--mono); font-size: var(--fs-mono); color: var(--red); }
.piece__back-msg { font-family: var(--serif); font-size: clamp(1.05rem, 1.5vw, 1.45rem); line-height: 1.25; letter-spacing: -.01em; }
.piece__use { margin-top: auto; display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .9rem; align-self: flex-start; border-bottom: 1px solid currentColor; }
.piece__use:hover { color: var(--red); }
.piece.is-flipped .piece__inner { transform: rotateY(180deg) !important; }
.piece figcaption { margin-top: 1.1rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .7rem; font-size: .9rem; }
.piece figcaption strong { font-weight: 600; }
.piece figcaption span { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); }

/* 10. AI CREATOR ========================================================== */
.ai {
    position: relative; background: var(--ink); color: var(--paper);
    padding: calc(var(--section-y) + 2rem) 0 var(--section-y); margin-top: 2rem;
}
.ai::before, .cta::before { /* torn paper edge */
    content: ""; position: absolute; left: 0; right: 0; top: -22px; height: 24px; background: inherit;
    -webkit-mask: var(--deckle) 0 0 / 100% 100% no-repeat; mask: var(--deckle) 0 0 / 100% 100% no-repeat;
}
.ai__grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: clamp(1rem, 2vw, 2rem); row-gap: 3rem; align-items: start; }
.ai__title {
    grid-column: 1 / span 9; font-family: var(--sans); font-weight: 700; font-variation-settings: "wdth" 125;
    font-size: clamp(2.6rem, 6.4vw, 7.2rem); line-height: .9; letter-spacing: -.055em;
}
.ai__lede { grid-column: 10 / span 3; align-self: end; color: rgba(239, 233, 222, .66); }

.prompt { grid-column: 1 / span 7; display: grid; gap: 1.3rem; margin-top: 1rem; }
.prompt__label { font-family: var(--mono); font-size: var(--fs-mono); color: var(--red); }
.prompt__input {
    width: 100%; resize: none; border: 0; outline: none; background: transparent; padding: 0 0 1rem;
    border-bottom: 1px solid var(--line-light);
    font-family: var(--serif); font-size: clamp(1.6rem, 2.7vw, 2.8rem); line-height: 1.15; letter-spacing: -.025em; color: var(--paper);
    transition: border-color .3s;
}
.prompt__input:focus { border-bottom-color: var(--red); }
.prompt__row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.prompt__styles { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; }
.finish { position: relative; padding: .2rem 0; color: rgba(239, 233, 222, .55); font-weight: 500; transition: color .3s; }
.finish:hover, .finish.is-active { color: var(--paper); }
.finish.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--red); }
.prompt__note { font-size: .88rem; color: rgba(239, 233, 222, .45); }

.ai__result { grid-column: 9 / span 4; grid-row: 2 / span 2; margin-top: -1rem; display: grid; justify-items: center; gap: 1.3rem; }
.print { width: 100%; max-width: 360px; perspective: 1200px; }
.print__card { position: relative; padding: 5% 5% 18%; background: var(--stock); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); transform: rotate(3deg); transition: transform .6s var(--ease); }
.print__card .art { border-radius: 0; }
.print__card .art__img { transition: filter 1.2s var(--ease); }
.print__card[data-style="foil"] .art__img, .finish-foil { filter: sepia(.45) saturate(1.35) hue-rotate(-12deg) brightness(1.03); }
.print__card[data-style="dusk"] .art__img, .finish-dusk { filter: hue-rotate(-38deg) saturate(1.25) brightness(.85) contrast(1.05); }
.print__card[data-style="mono"] .art__img, .finish-mono { filter: grayscale(.95) contrast(1.1) brightness(1.05); }
.print__develop { position: absolute; left: 5%; right: 5%; top: 5%; bottom: 18%; background: #2B1E14; opacity: 0; pointer-events: none; }
.print__card.is-developing .print__develop { animation: develop 2.4s var(--ease-io) forwards; }
@keyframes develop { 0% { opacity: 1; } 35% { opacity: .92; } 100% { opacity: 0; } }
.ai__status { font-family: var(--mono); font-size: var(--fs-mono); color: rgba(239, 233, 222, .6); }
.ai__variants { display: flex; gap: .6rem; }
.ai__variant { width: 46px; opacity: .45; outline: 1px solid transparent; outline-offset: 3px; transition: opacity .3s, outline-color .3s; }
.ai__variant img { aspect-ratio: 5 / 7; object-fit: cover; }
.ai__variant:hover { opacity: .8; }
.ai__variant.is-active { opacity: 1; outline-color: var(--paper); }

/* 11. DASHBOARD =========================================================== */
.manage { padding: var(--section-y) 0 calc(var(--section-y) + 7rem); overflow: hidden; }
.manage__head { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: end; margin-bottom: clamp(3rem, 6vw, 5rem); }
.manage__title { font-family: var(--serif); font-weight: 450; font-size: var(--fs-h2); line-height: .95; letter-spacing: -.035em; }
.manage__lede { color: var(--ink-soft); max-width: 40ch; padding-bottom: .5rem; }
.manage__stage { position: relative; perspective: 1800px; margin-left: 8%; }

.dash { background: var(--stock); border: 1px solid var(--line); box-shadow: var(--shadow-lift); font-size: .9rem; transform-origin: 50% 0; }
.dash__top { display: flex; align-items: center; gap: 2rem; padding: 1rem 1.6rem; border-bottom: 1px solid var(--line); }
.dash__brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; }
.dash__tabs { display: flex; gap: 1.2rem; color: var(--muted); }
.dash__tabs b { color: var(--ink); font-weight: 600; box-shadow: 0 2px 0 var(--red); }
.dash__new { margin-left: auto; padding: .5rem .9rem; background: var(--ink); color: var(--paper); font-weight: 600; font-size: .85rem; border-radius: var(--radius); }
.dash__stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.dash__stat { padding: 1.4rem 1.6rem; display: flex; align-items: baseline; gap: .8rem; }
.dash__stat + .dash__stat { border-left: 1px solid var(--line); }
.dash__stat strong { font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 3.6vw, 3.6rem); line-height: 1; letter-spacing: -.04em; }
.dash__stat:nth-child(2) strong { color: var(--red); }
.dash__stat span { color: var(--muted); }
.dash__list { padding: .4rem 0; }
.row { display: grid; grid-template-columns: 38px 1.3fr .7fr 1.2fr 1.3fr; align-items: center; gap: 1.2rem; padding: .85rem 1.6rem; border-bottom: 1px solid var(--line-soft); }
.row:last-child { border-bottom: 0; }
.row__thumb { width: 38px; box-shadow: 0 2px 6px rgba(27, 24, 20, .2); }
.row__who { display: grid; line-height: 1.3; }
.row__who strong { font-weight: 600; }
.row__who span { color: var(--muted); font-size: .8rem; }
.row__status { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 500; }
.row__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--moss); }
.row__status--awaiting::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.row__when { font-family: var(--mono); font-size: var(--fs-mono); color: var(--muted); }
.row__expiry { display: grid; gap: .35rem; }
.row__bar { height: 2px; background: var(--line); }
.row__bar span { display: block; height: 100%; width: var(--w); background: var(--ink); }
.row--soon .row__bar span { background: var(--red); }
.row__left { font-family: var(--mono); font-size: var(--fs-mono); }
.row--soon .row__left { color: var(--red); }

.ticket {
    position: absolute; left: -9%; bottom: -8rem; z-index: 2; width: min(380px, 80vw);
    padding: 1.4rem 1.6rem 1.3rem; background: var(--butter); color: var(--ink); rotate: -3deg;
    filter: drop-shadow(0 20px 24px rgba(27, 24, 20, .28));
    -webkit-mask: radial-gradient(circle 9px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
    mask: radial-gradient(circle 9px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 9px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.ticket__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; font-weight: 600; }
.ticket__value { font-family: var(--serif); font-size: 2.4rem; line-height: 1; letter-spacing: -.03em; white-space: nowrap; }
.ticket__value small { font-family: var(--sans); font-size: .9rem; letter-spacing: 0; }
.ticket__range { --p: 44.8%; -webkit-appearance: none; appearance: none; width: 100%; height: 2px; margin: 1.3rem 0 1rem; cursor: pointer; background: linear-gradient(90deg, var(--ink) 0 var(--p), rgba(27, 24, 20, .2) var(--p) 100%); }
.ticket__range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--red); border: 3px solid var(--butter); box-shadow: 0 0 0 1px var(--ink); }
.ticket__range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--red); border: 3px solid var(--butter); box-shadow: 0 0 0 1px var(--ink); }
.ticket__note { font-size: .85rem; color: var(--ink-soft); line-height: 1.5; border-top: 1px dashed rgba(27, 24, 20, .3); padding-top: .9rem; }

.manage__mark { position: absolute; right: -2%; top: -14%; z-index: 2; width: clamp(130px, 13vw, 200px); color: var(--red); rotate: -14deg; mix-blend-mode: multiply; }

/* 12. CALL TO ACTION ====================================================== */
.cta { position: relative; background: var(--red); color: var(--stock); padding: var(--section-y) 0; margin-top: 2rem; }
.cta__grid { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2.5rem 3rem; align-items: end; }
.cta__title { grid-column: 1 / -1; }
.cta__side { grid-column: 2; }
.cta__title { font-family: var(--serif); font-weight: 450; font-size: clamp(3rem, 8.4vw, 9.6rem); line-height: .92; letter-spacing: -.04em; color: var(--stock); position: relative; z-index: 2; }
.cta__side { display: grid; gap: 1.6rem; justify-items: start; position: relative; z-index: 2; padding-bottom: .8rem; }
.cta__side p { font-size: var(--fs-lede); max-width: 26ch; }
.cta .btn--ink:hover { background: var(--stock); color: var(--ink); }

.stamps { position: absolute; right: 0; top: calc(var(--section-y) * -1.35); width: min(40%, 520px); height: 300px; pointer-events: none; z-index: 1; }
.stamp {
    position: absolute; width: clamp(90px, 9vw, 140px); padding: 8px; background: var(--stock);
    filter: drop-shadow(0 10px 14px rgba(27, 24, 20, .35));
}
.stamp::before { /* perforated edge */
    content: ""; position: absolute; inset: -5px; z-index: -1; background: var(--stock);
    -webkit-mask: radial-gradient(circle 4px, transparent 96%, #000) -6px -6px / 12px 12px; mask: radial-gradient(circle 4px, transparent 96%, #000) -6px -6px / 12px 12px;
}
.stamp__inner .art { border-radius: 0; }
.stamp--1 { right: 32%; top: 10%; rotate: -10deg; }
.stamp--2 { right: 12%; top: 0; rotate: 8deg; }
.stamp--3 { right: 46%; top: 46%; rotate: 6deg; }
.stamp--4 { right: 4%; top: 52%; rotate: -5deg; }

/* 13. FOOTER ============================================================== */
.footer { background: var(--ink); color: rgba(239, 233, 222, .7); padding: clamp(4rem, 7vw, 6rem) 0 2rem; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; }
.footer__brand { display: grid; gap: 1.2rem; align-content: start; max-width: 380px; }
.footer__col { display: grid; gap: .65rem; align-content: start; }
.footer__col h3 { font-size: .95rem; font-weight: 600; color: var(--paper); margin-bottom: .4rem; }
.footer__col a { width: max-content; transition: color .3s; }
.footer__col a:hover { color: var(--red); }
.footer__bottom { margin-top: clamp(4rem, 7vw, 6rem); padding-top: 1.5rem; border-top: 1px solid var(--line-light); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: rgba(239, 233, 222, .45); }

/* 14. MOTION PREFERENCES ================================================== */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
}
