/* ============================================================
   imessage.css — page skin for the iMessage-for-apps feature page.
   Rides on the shared tokens/fonts/dark-mode from redesign.css +
   v4.css + brand-v3.css; everything here is scoped under .imsg so
   it never touches the rest of the site.
   ============================================================ */

.imsg {
  --imsg-maxw: 1120px;
  --imsg-gutter: clamp(20px, 5vw, 40px);
  --imsg-bubble: #2E7A57; /* falls back to brand green; overridden by tokens below */
  color: var(--ink);
  font-family: var(--font);
  overflow-x: clip; /* never let a wide child cause horizontal page scroll */
}
.imsg * { min-width: 0; }
.imsg { --imsg-bubble: var(--green); }

.imsg-container {
  width: 100%;
  max-width: var(--imsg-maxw);
  margin: 0 auto;
  padding-left: var(--imsg-gutter);
  padding-right: var(--imsg-gutter);
}

.imsg section { position: relative; }

/* ---- shared type ---- */
.imsg .eyebrow-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  padding: 6px 13px; border: 1px solid var(--hairline); border-radius: var(--r-pill, 999px);
  background: var(--surface);
}
.imsg .eyebrow-tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.imsg .sec-kicker {
  font-size: 13px; font-weight: 600; letter-spacing: -.002em; color: var(--green);
  margin: 0 0 14px;
}
.imsg h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem); font-weight: 700; letter-spacing: -.03em;
  line-height: 1.05; margin: 0 0 16px; color: var(--ink);
}
.imsg .sec-sub { font-size: clamp(1rem, 1.5vw, 1.15rem); color: var(--ink-2); line-height: 1.55; max-width: 60ch; margin: 0; }

/* ---- buttons ---- */
.imsg .btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font); font-size: 15px; font-weight: 600; line-height: 1;
  padding: 15px 22px; border-radius: var(--r-pill, 999px); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.imsg .btn svg { width: 16px; height: 16px; }
/* iMessage-blue primary CTA. Extra specificity + !important beats brand-v3's
   `body.zs26 .btn-primary { background: var(--ink) !important }`. */
.imsg { --imsg-blue: #007AFF; --imsg-blue-deep: #0062CC; }
.imsg .btn.btn-primary {
  background: var(--imsg-blue) !important; color: #fff !important;
  border-color: var(--imsg-blue) !important;
  box-shadow: 0 10px 24px rgba(0,122,255,.26) !important;
}
.imsg .btn.btn-primary:hover {
  background: var(--imsg-blue-deep) !important; border-color: var(--imsg-blue-deep) !important;
  transform: translateY(-1px); box-shadow: 0 14px 30px rgba(0,122,255,.32) !important;
}
.imsg .btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--hairline-2);
}
.imsg .btn-ghost:hover { background: var(--surface-2); }
/* small at-capacity note under a CTA */
.imsg .cta-note { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }
.imsg-pricing .cta-note { text-align: center; margin-top: 18px; }
/* "iMessages" tinted the CTA blue in headings */
.imsg .imsg-blue-text { color: var(--imsg-blue, #007AFF); }

/* ---- image placeholders (swap for <img> later) ---- */
.imsg .ph {
  position: relative; display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl, 20px);
  color: var(--ink-3);
  overflow: hidden;
}
.imsg .ph::after {
  content: attr(data-label);
  font-size: 12.5px; font-weight: 500; letter-spacing: .01em;
  color: var(--ink-3);
}
.imsg .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ============================================================
   Hero
   ============================================================ */
.imsg-hero { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.imsg-hero .imsg-container {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.imsg-hero h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.1rem); font-weight: 700; letter-spacing: -.035em;
  line-height: 1.02; margin: 18px 0 0; color: var(--ink);
}
.imsg-hero .hero-sub {
  font-size: clamp(1.1rem, 1.8vw, 1.4rem); color: var(--ink-2); line-height: 1.5;
  margin: 20px 0 0; max-width: 30ch;
}
.imsg-hero .cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.imsg-hero .hero-media { aspect-ratio: 4 / 3.4; }
/* hero waitlist form: inline email + button, left-aligned on desktop */
.imsg-hero .waitlist-form { margin: 30px 0 0; justify-content: flex-start; max-width: 440px; }

/* ---- iPhone frame (CSS, no image asset) ---- */
.imsg-phone {
  position: relative;
  width: min(330px, 80%);
  margin: 0 auto;
  aspect-ratio: 1206 / 2622;
  background: linear-gradient(155deg, #2b2b30 0%, #141416 42%, #0d0d0f 100%);
  border-radius: clamp(40px, 4.4vw, 56px);
  padding: clamp(7px, .95vw, 11px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.06) inset,
    0 34px 70px rgba(23,20,13,.30),
    0 6px 18px rgba(23,20,13,.20);
}
.imsg-phone-screen {
  position: relative; width: 100%; height: 100%;
  border-radius: clamp(32px, 3.6vw, 46px);
  overflow: hidden; background: #000;
  box-shadow: 0 0 0 2px #000 inset;
}
.imsg-phone-screen img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* side buttons: action/volume (left), power (right) */
.imsg-phone::before,
.imsg-phone::after { content: ""; position: absolute; background: #16161a; border-radius: 3px; }
.imsg-phone::before { left: -2px; top: 26%; width: 3px; height: 11%;
  box-shadow: 0 9% 0 #16161a; } /* volume pair hint */
.imsg-phone::after { right: -2px; top: 32%; width: 3px; height: 10%; }

/* ============================================================
   Built for iMessage — three features
   ============================================================ */
.imsg-features { padding: clamp(40px, 6vw, 80px) 0; }
.imsg-features .sec-head { max-width: 52ch; margin: 0 0 clamp(28px, 4vw, 48px); }
.imsg-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 24px);
}
.imsg-card {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-xl, 20px); padding: 0 0 24px; overflow: hidden;
  display: flex; flex-direction: column;
}
.imsg-card .card-media { aspect-ratio: 1 / 1; border: 0; border-bottom: 1px solid var(--hairline); border-radius: 0; }
/* Real product screenshots: contain on a white tile so light-mode UI reads
   cleanly in both site themes. */
.imsg-card .card-media.img-media {
  background: #fff; display: flex; align-items: center; justify-content: center;
  padding: 0;
}
/* Images fill the full tile width (no padding) so they read big. The square
   text-effect fills edge-to-edge; the wider branded/reactions shots span full
   width with their own white ground meeting the white tile — no visible band. */
.imsg-card .card-media.img-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* Tile background matched to the invisible-ink screenshot so its lavender ground
   blends seamlessly to the tile edges. */
.imsg-card .card-media.img-ink { background: linear-gradient(135deg, #eef0f4 0%, #e6e9f0 100%); }
.imsg-card .card-body { padding: 22px 22px 0; }
.imsg-card h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; margin: 0 0 8px; color: var(--ink); }
.imsg-card p { font-size: .98rem; color: var(--ink-2); line-height: 1.55; margin: 0; }
.imsg-card .maybe {
  display: inline-block; margin-top: 12px; font-size: .92rem; color: var(--ink-2);
  border: 1px solid var(--hairline); border-radius: 12px; padding: 8px 12px; background: var(--surface-2);
}
.imsg-card .maybe b { color: var(--ink); font-weight: 600; }
.imsg-reactions { display: flex; gap: 8px; margin-top: 14px; }
.imsg-reactions span {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface-2); border: 1px solid var(--hairline); font-size: 16px;
}
/* invisible-ink demo: blurred until hover/focus */
.imsg-ink {
  margin-top: 14px; display: inline-block; padding: 8px 14px; border-radius: 14px;
  background: var(--imsg-bubble); color: #fff; font-weight: 600; font-size: .95rem;
  filter: blur(5px); transition: filter .35s ease; cursor: default; user-select: none;
}
.imsg-ink:hover, .imsg-card:hover .imsg-ink { filter: blur(0); }

/* ============================================================
   Implementation
   ============================================================ */
.imsg-impl { padding: clamp(44px, 6vw, 84px) 0; }
.imsg-impl .imsg-container { max-width: 860px; text-align: center; }
.imsg-impl .impl-head { margin: 0 auto clamp(30px, 4.5vw, 48px); }
.imsg-impl .impl-head .sec-sub { margin: 16px auto 0; max-width: 56ch; }

/* agent logos row */
.agent-logos {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(22px, 5vw, 56px); flex-wrap: wrap;
  margin: 0 auto clamp(26px, 4vw, 40px);
}
.agent-logo {
  width: clamp(62px, 12vw, 88px); aspect-ratio: 1; border-radius: 20px;
  background: #fff; border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  padding: clamp(10px, 1.7vw, 16px);
  box-shadow: 0 4px 14px rgba(23,20,13,.06);
}
/* white tiles keep the (often black) marks legible in dark mode too */
.agent-logo img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 12%; }
.agent-logo.ph { border-radius: 20px; } /* placeholder look until a logo is dropped in */

/* the one-prompt card */
.prompt-card {
  display: flex; align-items: center; gap: 14px;
  max-width: 620px; margin: 0 auto; text-align: left;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 16px; padding: 15px 16px;
  box-shadow: 0 12px 34px rgba(23,20,13,.08);
}
.prompt-spark { flex: 0 0 auto; color: var(--imsg-blue, #007AFF); font-size: 18px; line-height: 1; }
.prompt-text { flex: 1; margin: 0; color: var(--ink); font-size: clamp(.95rem, 1.5vw, 1.06rem); line-height: 1.5; word-break: break-word; }
.prompt-send {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  background: var(--imsg-blue, #007AFF); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.prompt-send svg { width: 16px; height: 16px; }
/* the API contract under the prompt: copy + terminal */
.impl-contract {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 44px);
  align-items: start; text-align: left; margin-top: clamp(40px, 6vw, 64px);
}
.contract-copy h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 600; letter-spacing: -.02em; margin: 0 0 8px; color: var(--ink); }
.contract-copy .sec-sub { font-size: 1rem; }
.contract-list { margin: 22px 0 0; display: grid; gap: 12px; }
.contract-list > div { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: baseline; }
.contract-list dt { margin: 0; }
.contract-list dd { margin: 0; font-size: .95rem; color: var(--ink-2); line-height: 1.5; }
.contract-list code, .contract-list dd code {
  font-family: var(--mono); font-size: .86em; color: var(--ink);
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 6px; padding: 2px 6px;
}
.contract-list dt code { color: var(--imsg-blue, #007AFF); }
.imsg-code {
  background: #141210; border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r-lg, 14px); overflow: hidden; box-shadow: 0 20px 50px rgba(23,20,13,.20);
}
.imsg-code .code-bar {
  display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.imsg-code .code-bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3833; display: block; }
.imsg-code pre {
  margin: 0; padding: 20px 22px; overflow-x: auto;
  font-family: var(--mono); font-size: 13.5px; line-height: 1.75; color: #E7E4DC;
}
.imsg-code .c-com { color: #8B867A; }
.imsg-code .c-cmd { color: #57A882; }
.imsg-code .c-str { color: #E8C98B; }
.imsg-code .c-key { color: #B9D8FF; }

/* ============================================================
   Pricing
   ============================================================ */
.imsg-pricing { padding: clamp(44px, 6vw, 84px) 0; }
.imsg-pricing .sec-head { text-align: center; margin: 0 auto clamp(28px, 4vw, 48px); }
.imsg-price-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2vw, 24px);
  max-width: 780px; margin: 0 auto;
}
.imsg-price {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-xl, 20px); padding: 32px 30px; display: flex; flex-direction: column;
}
.imsg-price.featured { border-color: var(--green); box-shadow: 0 16px 40px rgba(46,122,87,.12); }
.imsg-price .plan { font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 0 0 10px; }
.imsg-price .amount { font-size: clamp(2.2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -.03em; color: var(--ink); line-height: 1; }
.imsg-price .amount span { font-size: 1rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.imsg-price .meta { font-size: .98rem; color: var(--ink-2); margin: 12px 0 0; line-height: 1.5; }
.imsg-price .perks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 9px; text-align: left; }
.imsg-price .perks li {
  position: relative; padding-left: 24px; font-size: .98rem; color: var(--ink-2); line-height: 1.45;
}
.imsg-price .perks li::before {
  content: ""; position: absolute; left: 0; top: .42em; width: 14px; height: 14px; border-radius: 50%;
  background: var(--imsg-blue, #007AFF);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M3.5 8.5l3 3 6-6" fill="none" stroke="black" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M3.5 8.5l3 3 6-6" fill="none" stroke="black" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></svg>') center / contain no-repeat;
}
.imsg-price .perks { margin-bottom: 24px; }
.imsg-price .btn { margin-top: auto; justify-content: center; }

/* ============================================================
   Closing band
   ============================================================ */
.imsg-cta { padding: clamp(52px, 8vw, 104px) 0; }
.imsg-cta .imsg-container {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: clamp(20px, 2vw, 32px); padding: clamp(36px, 5vw, 64px);
  text-align: center;
}
.imsg-cta h2 { margin: 0 auto 14px; }
.imsg-cta .sec-sub { margin: 0 auto 28px; }
.imsg-cta .cta-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* waiting-list form */
.imsg-cta { scroll-margin-top: 90px; } /* clear the fixed nav when scrolled to via #waitlist */
.waitlist-form {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  max-width: 460px; margin: 0 auto;
}
.waitlist-form input[type="email"] {
  flex: 1 1 240px; min-width: 0;
  padding: 14px 16px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--canvas);
  border: 1px solid var(--hairline-2); border-radius: var(--r-pill, 999px);
}
.waitlist-form input[type="email"]::placeholder { color: var(--ink-3); }
.waitlist-form input[type="email"]:focus { outline: none; border-color: var(--imsg-blue, #007AFF); box-shadow: 0 0 0 3px rgba(0,122,255,.15); }
.waitlist-form .btn { flex: 0 0 auto; }
/* honeypot: keep it out of sight and off the tab order */
.waitlist-form input[name="_gotcha"] { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-msg { margin: 16px auto 0; font-size: 15px; font-weight: 500; }
.form-msg.ok { color: var(--green); }
.form-msg.err { color: var(--red, #d23b2f); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .imsg-hero { padding-top: clamp(68px, 16vw, 92px); }
  .imsg-hero .imsg-container { grid-template-columns: 1fr; text-align: center; }
  .imsg-hero .hero-sub { max-width: 34ch; margin-left: auto; margin-right: auto; }
  .imsg-hero .cta-row { justify-content: center; }
  .imsg-hero .waitlist-form { justify-content: center; margin-left: auto; margin-right: auto; }
  .imsg-phone.hero-phone { width: min(300px, 74vw); order: 2; margin-top: 20px; }
  .imsg-features .sec-head { text-align: center; margin-left: auto; margin-right: auto; }
  .imsg-impl .imsg-container { grid-template-columns: 1fr; }
  .imsg-impl .impl-copy { text-align: center; }
  .imsg-impl .impl-copy .sec-sub { margin-left: auto; margin-right: auto; }
  .impl-contract { grid-template-columns: 1fr; }
  .imsg-grid { grid-template-columns: 1fr; max-width: 460px; margin-left: auto; margin-right: auto; }
  .imsg-price-grid { grid-template-columns: 1fr; max-width: 460px; }
}
@media (max-width: 560px) {
  .imsg h2 { font-size: clamp(1.7rem, 7.5vw, 2.2rem); }
  .imsg-hero h1 { font-size: clamp(2.1rem, 10vw, 3rem); }
  .imsg-features, .imsg-impl, .imsg-pricing { padding: clamp(36px, 10vw, 56px) 0; }
  .imsg .btn { width: 100%; justify-content: center; }
  .imsg-hero .cta-row { width: 100%; }
  .imsg-code pre { font-size: 12px; padding: 16px; }
  .imsg-cta .imsg-container { padding: 28px 20px; }
}
