/* ═══════════════════════════════════════════════════════
   Newsletter sign-up: the banner (parts/subscribe-banner.php)
   and the strip at the top of the footer (footer.php).
   Sending is nl-subscribe.js. Light mode at the bottom.
   ═══════════════════════════════════════════════════════ */

/* ── Banner frame ─────────────────────────────────────── */
.nl-sub-wrap { padding: clamp(56px, 9vw, 112px) 16px; }
@media (min-width: 640px) { .nl-sub-wrap { padding-left: 24px; padding-right: 24px; } }
.nl-sub-wrap--inset { padding: 0; }

.nl-sub {
  position: relative;
  max-width: 80rem;
  margin: 0 auto;
  border-radius: 32px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(160deg, #101010 0%, #070707 55%, #0b0b0b 100%);
  overflow: hidden;
  isolation: isolate;
}
/* dot grid, fading out toward the right */
.nl-sub::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(120% 90% at 0% 0%, #000 20%, transparent 75%);
          mask-image: radial-gradient(120% 90% at 0% 0%, #000 20%, transparent 75%);
}
/* soft light drifting behind the envelopes */
.nl-sub__glow {
  position: absolute; z-index: -1;
  width: 620px; height: 620px; right: -140px; top: -180px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,0.11), rgba(255,255,255,0.03) 55%, transparent);
  filter: blur(10px);
  animation: nl-sub-drift 16s ease-in-out infinite alternate;
}
@keyframes nl-sub-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-90px, 70px) scale(1.12); }
}

.nl-sub__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding: clamp(28px, 5.5vw, 72px);
}
@media (min-width: 900px) {
  .nl-sub__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: center; gap: 56px; }
}

/* ── Copy ─────────────────────────────────────────────── */
.nl-sub__eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 22px;
  padding: 6px 14px 6px 11px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  font-family: 'Geist', sans-serif; font-size: 12.5px; font-weight: 500; letter-spacing: -0.01em;
  color: rgba(255,255,255,0.72);
}
.nl-sub__dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.nl-sub__dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6);
  animation: nl-sub-ping 2.4s cubic-bezier(0,0,0.2,1) infinite;
}
@keyframes nl-sub-ping { 0% { transform: scale(0.6); opacity: 1; } 80%, 100% { transform: scale(1.8); opacity: 0; } }

.nl-sub__title {
  margin: 0 0 18px;
  max-width: 15ch;
  font-family: 'Geist', sans-serif; font-weight: 500;
  font-size: clamp(2rem, 4.4vw, 3.25rem); line-height: 1.04; letter-spacing: -0.045em;
  color: #fff;
  text-wrap: balance;
}
.nl-sub__text {
  margin: 0 0 32px;
  max-width: 46ch;
  font-family: 'Geist', sans-serif; font-size: clamp(1rem, 1.3vw, 1.125rem); line-height: 1.6;
  color: rgba(255,255,255,0.6);
  text-wrap: pretty;
}

/* ── Form (shared by banner and footer) ───────────────── */
.nl-sub-form { position: relative; max-width: 480px; }
.nl-sub-field {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 6px 6px 18px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.nl-sub-field:focus-within {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 5px rgba(255,255,255,0.06);
}
.nl-sub-field__icon { flex: none; width: 18px; height: 18px; color: rgba(255,255,255,0.4); }
.nl-sub-field input {
  flex: 1 1 auto; min-width: 0;
  padding: 11px 8px;
  border: 0; outline: none; background: transparent;
  font-family: 'Geist', sans-serif; font-size: 15px; color: #fff;
}
.nl-sub-field input::placeholder { color: rgba(255,255,255,0.35); }
.nl-sub-field button {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border: 0; border-radius: 999px;
  background: #fff; color: #000;
  font-family: 'Geist', sans-serif; font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
  white-space: nowrap; cursor: pointer;
  transition: transform .2s ease, background .2s ease, opacity .2s ease;
}
.nl-sub-field button span { display: inline-block; transition: transform .25s ease; }
.nl-sub-field button:hover { background: rgba(255,255,255,0.9); }
.nl-sub-field button:hover span { transform: translateX(3px); }
.nl-sub-field button:active { transform: scale(0.97); }
.nl-sub-field button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.nl-sub-field button[disabled] { opacity: .6; cursor: progress; }

.nl-sub-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.nl-sub-note {
  margin: 14px 0 0 18px;
  font-family: 'Geist', sans-serif; font-size: 12.5px; color: rgba(255,255,255,0.4);
}
.nl-sub-msg {
  margin: 14px 0 0 18px;
  font-family: 'Geist', sans-serif; font-size: 14px; line-height: 1.5;
  color: #fca5a5;
}
.nl-sub-msg[data-ok="1"] { color: #fff; }

/* After a good sign-up the field gives way to a confirmation pill */
.nl-sub-form.is-done .nl-sub-field,
.nl-sub-form.is-done .nl-sub-note { display: none; }
.nl-sub-form.is-done .nl-sub-msg {
  display: inline-flex; align-items: center; gap: 12px;
  margin: 0;
  padding: 14px 22px 14px 14px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  animation: nl-sub-pop .45s cubic-bezier(.2,.9,.3,1.3);
}
.nl-sub-form.is-done .nl-sub-msg::before {
  content: '';
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 16px no-repeat;
}
@keyframes nl-sub-pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

@media (max-width: 479px) {
  .nl-sub-field { flex-wrap: wrap; border-radius: 26px; padding: 6px; }
  .nl-sub-field__icon { margin-left: 12px; }
  .nl-sub-field input { flex-basis: calc(100% - 40px); }
  .nl-sub-field button { width: 100%; padding: 13px 22px; }
  .nl-sub-note, .nl-sub-msg { margin-left: 6px; }
}

/* ── Envelope stack ───────────────────────────────────── */
.nl-sub__art {
  position: relative;
  height: 300px;
  display: flex; align-items: center; justify-content: center;
  perspective: 1200px;
}
@media (max-width: 899px) { .nl-sub__art { height: 250px; margin-top: -8px; } }
@media (max-width: 479px) {
  .nl-sub__art { height: 215px; }
  .nl-env { width: min(280px, 82%); padding: 16px; }
  .nl-env__subject { font-size: 16px; margin-top: 12px; }
  .nl-env__btn { margin-top: 12px; }
}

.nl-env {
  position: absolute;
  width: min(330px, 86%);
  padding: 20px;
  border-radius: 20px;
  transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .7s ease;
}
.nl-env i { display: block; height: 8px; margin-top: 11px; border-radius: 4px; background: rgba(255,255,255,0.12); }
.nl-env i.s { width: 58%; }
.nl-env__chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-family: 'Geist', sans-serif; font-size: 11px; font-weight: 500; color: rgba(255,255,255,0.6);
}
.nl-env--3 {
  background: #1c1c1c; border: 1px solid rgba(255,255,255,0.12);
  transform: translate(46px, -54px) rotate(10deg); opacity: .7;
}
.nl-env--2 {
  background: #262626; border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.9);
  transform: translate(24px, -28px) rotate(5deg);
}
/* The front one looks like the real (light) newsletter */
.nl-env--1 {
  background: #fff; color: #111;
  box-shadow: 0 40px 80px -24px rgba(0,0,0,0.85), 0 0 0 1px rgba(255,255,255,0.08);
  transform: rotate(-3deg);
  animation: nl-env-float 7s ease-in-out infinite;
}
.nl-env--1::after {   /* "1 new" badge */
  content: '1';
  position: absolute; top: -11px; right: -11px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: #111; color: #fff; border: 2px solid #fff;
  font: 600 12px/1 'Geist', sans-serif;
}
@keyframes nl-env-float {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50%      { transform: rotate(-2deg) translateY(-8px); }
}
.nl-sub:hover .nl-env--3 { transform: translate(78px, -72px) rotate(15deg); }
.nl-sub:hover .nl-env--2 { transform: translate(42px, -40px) rotate(8deg); }

.nl-env__from { display: flex; align-items: center; gap: 9px; font-family: 'Geist', sans-serif; }
.nl-env__from img { width: auto; height: 20px; }
.nl-env__from span { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.nl-env__from em { margin-left: auto; font-style: normal; font-size: 12px; color: #8a8a8a; }
.nl-env__subject {
  margin: 16px 0 6px;
  font-family: 'Geist', sans-serif; font-size: 18px; font-weight: 600; line-height: 1.22; letter-spacing: -0.025em;
  color: #111;
}
.nl-env__snippet { margin: 0; font-family: 'Geist', sans-serif; font-size: 13px; line-height: 1.5; color: #5a5a5a; }
.nl-env__btn {
  display: inline-block; margin-top: 16px; padding: 8px 15px; border-radius: 999px;
  background: #111; color: #fff;
  font-family: 'Geist', sans-serif; font-size: 12px; font-weight: 500;
}
/* With a newsletter to read, the whole front card is the link */
a.nl-env__btn { text-decoration: none; transition: background .2s ease; }
a.nl-env__btn::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
a.nl-env__btn span { text-decoration: none; }
.nl-env--link { cursor: pointer; }
.nl-env--link:hover a.nl-env__btn { background: #333; }
a.nl-env__btn:focus-visible { outline: 2px solid #111; outline-offset: 3px; }
.nl-env--link:has(a.nl-env__btn:focus-visible) { box-shadow: 0 0 0 3px #fff, 0 40px 80px -24px rgba(0,0,0,0.85); }

/* ── Footer strip ─────────────────────────────────────── */
.nl-foot-sub {
  display: grid; gap: 24px;
  padding-bottom: 48px; margin-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
@media (min-width: 768px) {
  .nl-foot-sub { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: center; gap: 48px; }
  .nl-foot-sub .nl-sub-form { justify-self: end; width: 100%; }
}
.nl-foot-sub__title {
  margin: 0 0 6px;
  font-family: 'Geist', sans-serif; font-size: clamp(1.375rem, 2.2vw, 1.75rem); font-weight: 500; letter-spacing: -0.035em; line-height: 1.15;
  color: #fff;
}
.nl-foot-sub__text { margin: 0; max-width: 44ch; font-family: 'Geist', sans-serif; font-size: 14px; line-height: 1.6; color: rgba(255,255,255,0.5); }
.nl-foot-sub .nl-sub-note { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .nl-sub__glow, .nl-sub__dot::after, .nl-env--1, .nl-sub-form.is-done .nl-sub-msg { animation: none; }
  .nl-env { transition: none; }
}

/* ═══ Light mode ═════════════════════════════════════════ */
[data-theme="light"] .nl-sub {
  background: linear-gradient(160deg, #ffffff 0%, #fafafa 60%, #f3f3f3 100%);
  border-color: rgba(23,23,23,0.1);
  box-shadow: 0 1px 4px rgba(23,23,23,0.06), 0 30px 60px -40px rgba(23,23,23,0.25);
}
[data-theme="light"] .nl-sub::before { background-image: radial-gradient(rgba(23,23,23,0.09) 1px, transparent 1px); }
[data-theme="light"] .nl-sub__glow { background: radial-gradient(closest-side, rgba(23,23,23,0.06), rgba(23,23,23,0.02) 55%, transparent); }
[data-theme="light"] .nl-sub__eyebrow { color: #404040; border-color: rgba(23,23,23,0.14); background: rgba(23,23,23,0.03); }
[data-theme="light"] .nl-sub__dot { background: #171717; }
[data-theme="light"] .nl-sub__dot::after { border-color: rgba(23,23,23,0.5); }
[data-theme="light"] .nl-sub__title,
[data-theme="light"] .nl-foot-sub__title { color: #171717; }
[data-theme="light"] .nl-sub__text { color: #404040; }
[data-theme="light"] .nl-foot-sub__text { color: #525252; }
[data-theme="light"] .nl-foot-sub { border-color: rgba(23,23,23,0.1); }

[data-theme="light"] .nl-sub-field { background: #fff; border-color: rgba(23,23,23,0.16); }
[data-theme="light"] .nl-sub-field:focus-within { border-color: rgba(23,23,23,0.45); background: #fff; box-shadow: 0 0 0 5px rgba(23,23,23,0.06); }
[data-theme="light"] .nl-sub-field__icon { color: #8a8a8a; }
[data-theme="light"] .nl-sub-field input { background: transparent !important; border: 0 !important; color: #171717 !important; }
[data-theme="light"] .nl-sub-field button { background: #171717; color: #fafafa; }
[data-theme="light"] .nl-sub-field button:hover { background: #333; }
[data-theme="light"] .nl-sub-field button:focus-visible { outline-color: #171717; }
[data-theme="light"] .nl-sub-note { color: #6b6b6b; }
[data-theme="light"] .nl-sub-msg { color: #b91c1c; }
[data-theme="light"] .nl-sub-msg[data-ok="1"] { color: #171717; }
[data-theme="light"] .nl-sub-form.is-done .nl-sub-msg { background: #fff; border-color: rgba(23,23,23,0.14); }
[data-theme="light"] .nl-sub-form.is-done .nl-sub-msg::before {
  background-color: #171717;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

[data-theme="light"] .nl-env--3 { background: #ececec; border-color: rgba(23,23,23,0.06); }
[data-theme="light"] .nl-env--2 { background: #f4f4f4; border-color: rgba(23,23,23,0.08); }
[data-theme="light"] .nl-env i { background: rgba(23,23,23,0.08); }
[data-theme="light"] .nl-env__chip { background: rgba(23,23,23,0.06); color: #525252; }
[data-theme="light"] .nl-env--1 { box-shadow: 0 30px 60px -24px rgba(23,23,23,0.35), 0 0 0 1px rgba(23,23,23,0.08); }
