/* You've Got Mail: monthly print subscription (mail.html)
   Builds on style.css. 5 x 7 prints, a mailer envelope with stamp and postmark, the year-ahead grid and an airmail checkout card. */

:root {
  --postal-rust: #a65a44;
  --postal-navy: #34475c;
  --postal-ink: rgba(52, 71, 92, .78);
  --card-paper: #fbf8f2;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;
}

/* ---------- Hero ---------- */
.mail-hero { padding: clamp(40px, 6vw, 84px) 0 clamp(64px, 8vw, 110px); overflow: hidden; }
.mail-hero .wrap { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.mail-hero h1 { margin-bottom: 8px; }
.mail-hero .lede { max-width: 40ch; margin: 22px 0 0; }
.mail-price { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 30px 0 30px; }
.mail-price .amt { font-family: var(--display); font-size: 46px; font-weight: 300; color: var(--ink); line-height: 1; }
.mail-price .per { font-family: var(--sans); font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.mail-hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.first-out { margin-top: 22px; font-style: italic; color: var(--muted); font-size: 17px; }
.first-out b { font-weight: 400; color: var(--ink); font-style: normal; }

/* the pile of mail */
.pile { position: relative; aspect-ratio: 1 / .92; max-width: 640px; width: 100%; justify-self: center; }
.pile > * { position: absolute; }
.pile .pc:nth-child(1) { width: 31%; left: 36%; top: -7%; transform: rotate(4deg); }
.pile .pc:nth-child(2) { width: 54%; left: 0; top: 12%; transform: rotate(-9deg); }
.pile .pc:nth-child(3) { width: 52%; right: 0; top: 7%; transform: rotate(7deg); }
.pile .pc-back { width: 76%; left: 12%; bottom: 0; transform: rotate(2.5deg); }
.pile figcaption { display: none; }
.pile .pc, .pile .pc-back { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
@media (hover: hover) {
  .pile:hover .pc:nth-child(1) { transform: rotate(4deg) translateY(-12px); }
  .pile:hover .pc:nth-child(2) { transform: rotate(-12deg) translate(-12px, -6px); }
  .pile:hover .pc:nth-child(3) { transform: rotate(10deg) translate(12px, -8px); }
  .pile:hover .pc-back { transform: rotate(1deg) translateY(6px); }
}

/* ---------- Postcard front: a photo with a white border ---------- */
.pc {
  margin: 0; background: #fff; padding: 3.2%;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 14px 34px rgba(40,34,26,.18);
}
.pc img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.pc.tall img { aspect-ratio: 3 / 4; }
.pc figcaption {
  font-family: var(--hand); font-size: clamp(17px, 1.6vw, 21px); color: var(--postal-navy);
  line-height: 1; padding: 9px 2px 1px; display: flex; justify-content: space-between; gap: 10px;
}
.pc figcaption small { font-family: var(--sans); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); align-self: end; }

/* ---------- Postcard back ---------- */
.pc-back {
  background: var(--card-paper);
  aspect-ratio: 3 / 2;
  display: grid; grid-template-columns: 1fr 1fr;
  padding: 5% 4.5%;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 18px 40px rgba(40,34,26,.22);
  container-type: inline-size;
}
.pc-back .msg { padding-right: 7%; border-right: 1px solid #d8cfc0; display: flex; flex-direction: column; justify-content: center; }
.pc-back .hand { font-family: var(--hand); color: var(--postal-navy); font-size: 5.6cqi; line-height: 1.2; margin: 0; }
.pc-back .sig { margin-top: 5cqi; }
.pc-back .addr { position: relative; padding-left: 7%; display: flex; flex-direction: column; }
.pc-back .lines { margin-top: auto; display: grid; gap: 2.4cqi; padding-bottom: 3cqi; }
.pc-back .lines span { display: block; border-bottom: 1px solid #cbbfae; font-family: var(--hand); color: var(--postal-navy); font-size: 5cqi; line-height: 1.1; padding-left: 3cqi; min-height: 6cqi; }
.pc-back .tag {
  position: absolute; left: 7%; top: 0; font-family: var(--sans); font-size: 2.1cqi; letter-spacing: .3em; text-transform: uppercase; color: #a69c8c;
}

/* perforated stamp */
.stamp {
  position: absolute; right: 0; top: 0; width: 31%;
  background: #fff; padding: 6px;
  -webkit-mask: radial-gradient(circle 3px at 50% 50%, #0000 96%, #000) -4px -4px / 8px 8px round, linear-gradient(#000 0 0) 4px 4px / calc(100% - 8px) calc(100% - 8px) no-repeat;
          mask: radial-gradient(circle 3px at 50% 50%, #0000 96%, #000) -4px -4px / 8px 8px round, linear-gradient(#000 0 0) 4px 4px / calc(100% - 8px) calc(100% - 8px) no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.15));
}
.stamp .inner { position: relative; border: 1px solid #e4ddd1; }
.stamp img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.stamp .val { position: absolute; left: 6%; top: 4%; font-family: var(--display); font-weight: 400; color: #fff; font-size: 5.4cqi; line-height: 1; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.stamp .usa { position: absolute; right: 6%; bottom: 4%; font-family: var(--sans); font-size: 2.3cqi; letter-spacing: .18em; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.45); }

/* postmark over the stamp */
.postmark { position: absolute; right: 19%; top: 3%; width: 58%; color: var(--postal-ink); transform: rotate(-12deg); pointer-events: none; mix-blend-mode: multiply; }
.postmark text { font-family: var(--sans); fill: currentColor; letter-spacing: .14em; }

/* ---------- How it works ---------- */
.mail-how .how h3 { font-family: var(--serif); }
.how .ico { width: 44px; height: 44px; color: var(--sage-deep); margin-bottom: 18px; }
.how .ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- What's in the envelope ---------- */
.envelope-feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.envelope-feature .pc-back { transform: rotate(-1.5deg); width: 100%; }
.inside { list-style: none; padding: 0; margin: 26px 0 0; }
.inside li { display: grid; grid-template-columns: 30px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line-strong); }
.inside li:first-child { border-top: 1px solid var(--line-strong); }
.inside .n { font-family: var(--display); font-size: 24px; color: var(--sage); line-height: 1.2; }
.inside strong { font-weight: 400; color: var(--ink); display: block; }
@media (max-width: 860px) { .envelope-feature { grid-template-columns: 1fr; } .envelope-feature .pc-back { max-width: 560px; margin: 0 auto; } }

/* ---------- Gift band ---------- */
.gift-band { background: var(--postal-navy); color: #e9e6df; text-align: center; position: relative; overflow: hidden; }
.gift-band .eyebrow { color: rgba(255,255,255,.62); }
.gift-band h2 { color: #fff; }
.gift-band .lede { color: #e9e6df; max-width: 56ch; margin: 20px auto 32px; }
.gift-band .btn { border-color: rgba(255,255,255,.85); color: #fff; }
.gift-band .btn:hover { background: #fff; color: var(--ink); }
.gift-band .ribbon { position: absolute; inset: 0 auto 0 0; width: 100%; height: 10px; background: repeating-linear-gradient(-45deg, var(--postal-rust) 0 16px, #fbf8f2 16px 26px, #7d93a8 26px 42px, #fbf8f2 42px 52px); }
.gift-band .ribbon.b { inset: auto auto 0 0; }

/* ---------- Join: the airmail envelope ---------- */
.airmail {
  max-width: 820px; margin: 0 auto; background: #fff; position: relative;
  border: 12px solid transparent;
  border-image: repeating-linear-gradient(-45deg, var(--postal-rust) 0 16px, #fff 16px 24px, var(--postal-navy) 24px 40px, #fff 40px 48px) 12;
  box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 24px 60px rgba(40,34,26,.14);
}
.airmail-inner { padding: clamp(28px, 5vw, 56px); }
.airmail .par-avion {
  position: absolute; right: clamp(18px, 3vw, 34px); top: clamp(16px, 2.6vw, 28px);
  font-family: var(--sans); font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--postal-navy);
  border: 1px solid currentColor; padding: 6px 10px 5px; transform: rotate(3deg);
}
.airmail h2 { margin: 0 0 6px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 30px 0 22px; }
.plan { position: relative; display: block; cursor: pointer; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan .box {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--line-strong); padding: 22px 22px 20px; background: #fff;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.plan input:checked + .box { border-color: var(--ink); background: var(--stone); box-shadow: inset 0 0 0 1px var(--ink); }
.plan input:focus-visible + .box { outline: 1px solid var(--sage-deep); outline-offset: 3px; }
.plan .name { font-family: var(--sans); font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.plan .p { font-family: var(--display); font-weight: 300; font-size: 44px; color: var(--ink); line-height: 1; margin: 14px 0 4px; }
.plan .p small { font-family: var(--serif); font-size: 17px; color: var(--muted); margin-left: 4px; }
.plan .d { font-size: 16px; color: var(--text); margin: 6px 0 0; }
.plan .flag {
  position: absolute; top: -11px; left: 20px; background: var(--postal-rust); color: #fff;
  font-family: var(--sans); font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; padding: 5px 9px 4px;
}
.plan .tick { position: absolute; right: 16px; top: 18px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; }
.plan input:checked + .box .tick { border-color: var(--ink); background: radial-gradient(circle, var(--ink) 0 4px, #fff 4.5px); }

.gift-toggle { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.gift-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 44px; height: 24px; border-radius: 24px; background: var(--line-strong); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.gift-toggle input:checked + .switch { background: var(--sage-deep); }
.gift-toggle input:checked + .switch::after { transform: translateX(20px); }
.gift-toggle input:focus-visible + .switch { outline: 1px solid var(--sage-deep); outline-offset: 3px; }
.gift-toggle .t { color: var(--ink); font-size: 18px; }
.gift-toggle .t small { display: block; color: var(--muted); font-size: 15px; }
.gift-fields { padding: 22px 0 4px; }
.gift-fields[hidden] { display: none; }
.gift-fields textarea.input { min-height: 110px; font-family: var(--hand); font-size: 23px; line-height: 1.25; color: var(--postal-navy); background: var(--card-paper); }
.count { float: right; font-family: var(--sans); font-size: 10.5px; letter-spacing: .14em; color: var(--muted); }

.join-summary { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin: 26px 0 20px; }
.join-summary .tot { font-family: var(--serif); font-size: 30px; color: var(--ink); line-height: 1.1; }
.join-summary .when { color: var(--muted); font-style: italic; font-size: 16px; text-align: right; max-width: 30ch; }
.fine { font-size: 15px; color: var(--muted); text-align: center; margin: 14px 0 0; }

/* ---------- Mail wall ---------- */
.wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(26px, 4vw, 52px) clamp(20px, 3vw, 40px); margin-top: 26px; }
.wall .pc:nth-child(3n+1) { transform: rotate(-1.6deg); }
.wall .pc:nth-child(3n+2) { transform: rotate(1.2deg) translateY(14px); }
.wall .pc:nth-child(3n) { transform: rotate(-.6deg); }
@media (max-width: 860px) { .wall { grid-template-columns: repeat(2, 1fr); } .wall .pc:nth-child(n) { transform: rotate(0); } .wall .pc:nth-child(odd) { transform: rotate(-1.2deg); } .wall .pc:nth-child(even) { transform: rotate(1deg) translateY(10px); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .mail-hero .wrap { grid-template-columns: 1fr; }
  .mail-hero .copy { text-align: center; }
  .mail-hero .lede { margin-left: auto; margin-right: auto; }
  .mail-price, .mail-hero .actions { justify-content: center; }
  .pile { max-width: 560px; }
}
@media (max-width: 600px) {
  .plans { grid-template-columns: 1fr; gap: 20px; }
  .join-summary .when { text-align: left; }
  .airmail { border-width: 9px; }
  .airmail .par-avion { display: none; }
  .wall { grid-template-columns: 1fr; max-width: 420px; margin-left: auto; margin-right: auto; }
  .wall .pc:nth-child(n) { transform: rotate(-1deg); }
  .wall .pc:nth-child(even) { transform: rotate(1deg); }
  .mail-hero .actions .btn { flex: 1 1 100%; }
}

/* ---------- 5 x 7 prints and the mailer (Oct 21: replaces the postcards) ---------- */
.print {
  margin: 0; background: #fff; padding: 3.2%;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 14px 30px rgba(40,34,26,.16);
}
.print img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: cover; }

.env {
  position: relative; aspect-ratio: 7.5 / 5.5; background: #efe7d9;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 18px 40px rgba(40,34,26,.22);
  container-type: inline-size; overflow: hidden;
}
.env .flap { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.env .stamp { right: 5%; top: 7%; width: 15%; }
.env .postmark { right: 17%; top: 6%; width: 34%; }
.env .from { position: absolute; left: 6%; top: 8%; font-family: var(--hand); color: var(--postal-navy); font-size: 3.6cqi; line-height: 1.15; }
.env .to { position: absolute; left: 34%; right: 12%; top: 46%; display: grid; gap: 1.6cqi; }
.env .to span { display: block; border-bottom: 1px solid #c9bba5; font-family: var(--hand); color: var(--postal-navy); font-size: 4.4cqi; line-height: 1.1; padding-left: 2cqi; min-height: 5cqi; }
.env .label-tag { position: absolute; left: 6%; bottom: 8%; font-family: var(--sans); font-size: 1.9cqi; letter-spacing: .28em; text-transform: uppercase; color: #9a8d78; }
.stamp .val, .stamp .usa { font-size: 2.6cqi; }
.stamp .val { font-size: 4.2cqi; }

/* hero pile: three prints and an envelope */
.pile .print { position: absolute; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.pile .print:nth-child(1) { width: 33%; left: 4%; top: 3%; transform: rotate(-8deg); }
.pile .print:nth-child(2) { width: 33%; left: 33%; top: 0; transform: rotate(1.5deg); }
.pile .print:nth-child(3) { width: 33%; right: 1%; top: 5%; transform: rotate(8deg); }
.pile .env { position: absolute; width: 80%; left: 10%; bottom: 0; transform: rotate(-2deg); }
@media (hover: hover) {
  .pile:hover .print:nth-child(1) { transform: rotate(-11deg) translate(-10px, -8px); }
  .pile:hover .print:nth-child(2) { transform: rotate(1.5deg) translateY(-14px); }
  .pile:hover .print:nth-child(3) { transform: rotate(11deg) translate(10px, -8px); }
}

/* what's inside: a print sliding out of its envelope */
.in-env { position: relative; padding-top: 52%; }
.in-env .print { position: absolute; width: 44%; left: 28%; top: 0; transform: rotate(-3deg); z-index: 0; }
.in-env .env { position: relative; z-index: 1; transform: rotate(1deg); }

/* ---------- The year ahead ---------- */
.year { list-style: none; padding: 0; margin: 38px 0 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(26px, 3vw, 44px) clamp(16px, 2vw, 30px); }
.year li { position: relative; text-align: center; }
.year .print { transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .5s; }
@media (hover: hover) { .year li:hover .print { transform: translateY(-6px); box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 22px 40px rgba(40,34,26,.2); } }
.year .mo { margin-top: 16px; font-family: var(--sans); font-size: 11.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink); }
.year .pl { font-style: italic; color: var(--muted); font-size: 16px; line-height: 1.3; margin-top: 4px; }
.year .next-tag { display: none; position: absolute; top: -10px; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap; background: var(--postal-rust); color: #fff; font-family: var(--sans); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; padding: 5px 9px 4px; }
.year li.next .next-tag { display: block; }
.year li.next .print { box-shadow: 0 0 0 2px var(--postal-rust), 0 14px 30px rgba(40,34,26,.16); }
@media (max-width: 1100px) { .year { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .year { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .year { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Launch offer ---------- */
.promo-banner { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin: 24px 0 0; padding: 14px 16px; background: #f6efe6; border-left: 3px solid var(--postal-rust); font-size: 17px; max-width: 46ch; }
.promo-banner b { font-weight: 400; color: var(--ink); }
.promo-tag, .promo-pill { font-family: var(--sans); font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; background: var(--postal-rust); color: #fff; padding: 5px 9px 4px; white-space: nowrap; }
.promo-pill { display: inline-block; margin-top: 10px; align-self: flex-start; }
.promo-banner[hidden], .promo-pill[hidden], .plan .d[hidden] { display: none; }
@media (max-width: 900px) { .promo-banner { margin-left: auto; margin-right: auto; text-align: left; } }
