/* A small invitation in the opening; the same sheet comes forward to be read.
   Desktop composition and the shared printed artwork are owned elsewhere. */
@media (max-width: 900px) {
  .about-page {
    background: #0b0d09;
    overflow-x: clip;
  }
  .about-page .about-header {
    position: relative;
    height: 78px;
    padding: 0 25px;
  }
  .about-page .about-header .wordmark { font-size: 29px; }
  .about-page .about-header .quiet-link { font-size: 10px; }
  .invitation-ready .about-hero,
  .invitation-ready .about-company,
  .invitation-ready .about-arrival { display: none; }
  .about-page .pocket-invitation {
    display: block;
    width: min(calc(100% - 48px), 384px);
    margin: 12px auto 0;
    container-type: inline-size;
    --paper-unit: calc(100cqw / 390);
    --invitation-open: 0;
  }
  .pocket-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    padding-top: 13px;
  }
  .pocket-stage:before {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 115px -90px 20px;
    background: radial-gradient(ellipse 48% 48% at 50% 50%, #44552933, transparent);
    pointer-events: none;
  }
  .pocket-intro {
    position: relative;
    z-index: 3;
    pointer-events: none;
    opacity: clamp(0, calc(1 - var(--invitation-open) * 3), 1);
    transform: translateY(calc(-24px * var(--invitation-open)));
  }
  .pocket-intro .eyebrow {
    color: #a7b198;
    font-size: 7px;
    letter-spacing: .17em;
  }
  .pocket-intro h1 {
    margin: 24px 0 0;
    font: 700 clamp(44px, 14vw, 56px)/.94 var(--serif);
    letter-spacing: -.043em;
  }
  .pocket-intro h1 em { color: #a7bb8b; font-style: normal; }
  .pocket-scene {
    order: 1;
    position: relative;
    margin-top: -100px;
    perspective: 1300px;
    touch-action: pan-y;
    transform-origin: 50% 50%;
    transform: translateY(calc(60px - 110px * var(--invitation-open)))
      rotateZ(calc(-9deg * (1 - var(--invitation-open))))
      rotateY(calc(-10deg * (1 - var(--invitation-open))))
      scale(calc(.71 + .29 * var(--invitation-open)));
  }
  .pocket-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    aspect-ratio: 390 / 562;
    transform-style: preserve-3d;
    transform-origin: 50% 50%;
    transform: rotateZ(-1.5deg);
    --front-shade: 0;
    --back-shade: 0;
  }
  .pocket-shadow {
    position: absolute;
    inset: 6% 2% 0;
    background: #000b;
    border-radius: 4%;
    filter: blur(11px);
    pointer-events: none;
  }
  .pocket-face {
    position: relative;
    grid-area: 1 / 1;
    min-width: 0;
    display: grid;
    grid-template-rows: 1fr calc(83 * var(--paper-unit));
    color: #192b11;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(.65px);
  }
  .pocket-front.invitation-print { display: flex; }
  .pocket-back { transform: rotateY(180deg) translateZ(.65px); }
  .pocket-edge {
    position: absolute;
    inset: 0;
    background: #567c34;
    box-shadow: 1px 0 0 #bfde84, 2px 1px 0 #304c1b;
  }
  .pocket-face, .pocket-edge {
    --invitation-notch: calc(4.5 * var(--paper-unit));
    mask-image:
      radial-gradient(circle at 0 calc(100% - 83 * var(--paper-unit)), transparent calc(var(--invitation-notch) - .15px), #000 calc(var(--invitation-notch) + .35px)),
      radial-gradient(circle at 100% calc(100% - 83 * var(--paper-unit)), transparent calc(var(--invitation-notch) - .15px), #000 calc(var(--invitation-notch) + .35px));
    mask-composite: intersect;
  }
  .pocket-face:after {
    content: '';
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    background: #020500;
    opacity: var(--front-shade);
  }
  .pocket-back:after { opacity: var(--back-shade); }
  .pocket-front:before {
    content: '';
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(128deg, #eaffd514, transparent 29%, #05100024 68%, #0206004a);
    box-shadow: inset 0 .8px 0 #e2ffc099, inset -1.2px 0 0 #32531699, inset 0 -1px 0 #244610b3;
  }
  .pocket-sheen {
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 24%, #ffffe338 42%, #ffffe314 47%, transparent 59%);
    opacity: 0;
  }
  .pocket-tap { position: absolute; z-index: 4; inset: 0; background: transparent; cursor: pointer; }
  .pocket-tap:focus-visible { outline: 2px solid #213313; outline-offset: -10px; }
  /* Paint the invitation before JS; reveal its controls only once they work.
     The static About sections remain readable below when enhancement is absent. */
  .about-page:not(.invitation-ready) .pocket-turn,
  .about-page:not(.invitation-ready) .pocket-tap { visibility: hidden; }
  .pocket-stock {
    position: relative;
    min-width: 0;
    padding: 24px 26px 20px;
    display: flex;
    flex-direction: column;
    text-align: center;
    background: linear-gradient(125deg, #acd874, #8dd04a 48%, #81c23f);
  }
  .pocket-stock:before {
    content: '';
    position: absolute;
    inset: calc(7 * var(--paper-unit));
    border: calc(1 * var(--paper-unit)) solid #2448104d;
    pointer-events: none;
  }
  .invitation-letterhead { font: 700 12px/1.1 var(--serif); letter-spacing: -.04em; }
  .invitation-salutation { margin: 18px 0 10px; font: 700 6px/1.5 var(--sans); letter-spacing: .17em; }
  .pocket-back h2 { margin: 0 -6px; font: 700 clamp(29px, 8.6vw, 35px)/.98 var(--serif); letter-spacing: -.035em; }
  .invitation-message { margin: 15px -5px 17px; font: 500 14px/1.5 var(--sans); }
  .invitation-particulars { display: grid; grid-template-columns: 1fr 1fr; padding: 13px 0; border-block: 1px solid #365b2a4d; }
  .invitation-particulars > div + div { border-left: 1px solid #365b2a4d; }
  .invitation-particulars span { display: block; margin-bottom: 6px; font: 700 6px/1.4 var(--sans); letter-spacing: .13em; }
  .invitation-particulars p { font: 700 22px/1.05 var(--serif); letter-spacing: -.035em; }
  .invitation-rsvp { padding-top: 16px; }
  .invitation-rsvp .eyebrow { margin-bottom: 8px; font-size: 6px; letter-spacing: .13em; }
  .invitation-rsvp > p:last-child { font: 500 13px/1.5 var(--sans); }
  .invitation-postscript { margin-top: auto; padding-top: 17px; font: 700 19px/1.1 var(--serif); letter-spacing: -.025em; }
  .pocket-stub {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-content: center;
    gap: 5px 12px;
    padding: calc(18 * var(--paper-unit)) calc(27 * var(--paper-unit));
    border: calc(1 * var(--paper-unit)) solid #567c34;
    border-top: calc(1 * var(--paper-unit)) dashed #365b2a80;
    background: #8dd04a;
    font: 700 calc(7.5 * var(--paper-unit))/1.5 var(--sans);
    letter-spacing: .08em;
  }
  .pocket-stub > span:last-child { letter-spacing: 0; }
  .pocket-age { grid-row: span 2; grid-column: 2; align-self: center; font-size: 12px; border: 1px solid #365b2a66; padding: 8px 5px; }
  .pocket-controls { order: 2; position: relative; display: flex; justify-content: space-between; align-items: center; min-height: 44px; color: #a7b198; }
  .pocket-controls > span { font: 600 10px/1.4 var(--sans); }
  .pocket-turn { min-height: 44px; display: inline-flex; align-items: center; gap: 10px; background: none; color: #e0e6d7; padding: 0 0 0 12px; font: 600 11px/1.4 var(--sans); }
  .pocket-turn svg { width: 30px; height: 24px; }
  .pocket-download { padding: 16px 0 26px; }
  .pocket-download .button-mount { display: block; width: 200px; max-width: 100%; margin-inline: auto; }
  .pocket-download .neopop-control { width: 100%; }
  .pocket-download .neopop-control .button-face { flex: 1; }
  .pocket-download .neopop-control .button-face > .font { width: 100%; }
  .pocket-download .neopop-label { min-height: 52px; padding: 0 22px; justify-content: space-between; }
  .pocket-download .button-fallback { display: flex; width: calc(100% - 3px); min-height: 52px; padding: 0 22px; justify-content: space-between; }
  .pocket-download > p { margin-top: 16px; color: #939d88; text-align: center; font: 500 11px/1.5 var(--sans); }
  .invitation-ready .about-footer { max-width: 440px; margin: 0 auto; padding: 0 24px 28px; }
  .invitation-ready .about-footer > .wordmark,
  .invitation-ready .about-footer > p { display: none; }
  .invitation-ready .about-footer .legal-links { justify-content: center; width: 100%; gap: 24px; }
}
@media (min-width: 500px) and (max-width: 900px) {
  .about-page .about-header { height: 98px; padding: 0 40px; }
  .about-page .pocket-invitation { margin-top: 28px; }
  .pocket-scene { margin-top: -95px; }
  .pocket-intro h1 { font-size: 62px; }
  .pocket-scene { transform: translateY(calc(60px - 140px * var(--invitation-open))) rotateZ(calc(-9deg * (1 - var(--invitation-open)))) rotateY(calc(-10deg * (1 - var(--invitation-open)))) scale(calc(.71 + .29 * var(--invitation-open))); }
}
@media (max-width: 360px) {
  .about-page .pocket-invitation { width: calc(100% - 40px); }
  .pocket-scene { margin-top: -53px; }
  .pocket-intro .eyebrow { font-size: 6px; }
  .pocket-stock { padding: 20px 20px 10px; }
  .invitation-salutation { margin: 12px 0 8px; }
  .pocket-back h2 { font-size: 28px; }
  .invitation-message { font-size: 13px; margin: 12px -4px; }
  .invitation-particulars { padding: 10px 0; }
  .invitation-particulars p { font-size: 20px; }
  .invitation-rsvp { padding-top: 12px; }
  .invitation-rsvp > p:last-child { font-size: 12px; }
  .invitation-postscript { padding-top: 12px; font-size: 17px; }
}
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .pocket-scene { transform: translateY(calc(60px - 110px * var(--invitation-open))) scale(calc(.71 + .29 * var(--invitation-open))); }
  .pocket-intro { transform: none; }
}
