/* NextMsg website. Palette and type match the apps: neutral greys, one indigo accent. */

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f6f6f7;
  --card: #ffffff;
  --text: #1b1c1f;
  --text-2: #4a4e55;
  --text-3: #6e727a;
  --card-text: #3c3f45;
  --border: rgba(0, 0, 0, 0.07);
  --border-strong: rgba(0, 0, 0, 0.12);
  --accent: #5b63d3;
  --accent-text: #5b63d3;
  --accent-soft: #ecedfb;
  --btn-bg: #1b1c1f;
  --btn-fg: #ffffff;
  --badge-border: transparent;
  --chip: rgba(0, 0, 0, 0.06);
  --bezel: #f2f2f4;
  --bezel-border: rgba(0, 0, 0, 0.08);
  --screen: #ffffff;
  --device-shadow: 0 40px 100px rgba(17, 19, 23, 0.12);
  --banner: rgba(255, 255, 255, 0.95);
  --banner-shadow: 0 12px 32px rgba(17, 19, 23, 0.16);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --code-bg: #f6f6f7;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e0f11;
    --surface: #16171a;
    --card: #16171a;
    --text: #ededef;
    --text-2: #a6aab2;
    --text-3: #7a7f87;
    --card-text: #c9cbd0;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --accent-text: #8f96f0;
    --accent-soft: #1e2040;
    --btn-bg: #ededef;
    --btn-fg: #0e0f11;
    --badge-border: rgba(255, 255, 255, 0.28);
    --chip: rgba(255, 255, 255, 0.08);
    --bezel: #1a1b1f;
    --bezel-border: rgba(255, 255, 255, 0.1);
    --screen: #0e0f11;
    --device-shadow: 0 40px 100px rgba(91, 99, 211, 0.16);
    --banner: rgba(38, 40, 45, 0.94);
    --banner-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    --card-shadow: none;
    --code-bg: #16171a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0f11;
  --surface: #16171a;
  --card: #16171a;
  --text: #ededef;
  --text-2: #a6aab2;
  --text-3: #7a7f87;
  --card-text: #c9cbd0;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --accent-text: #8f96f0;
  --accent-soft: #1e2040;
  --btn-bg: #ededef;
  --btn-fg: #0e0f11;
  --badge-border: rgba(255, 255, 255, 0.28);
  --chip: rgba(255, 255, 255, 0.08);
  --bezel: #1a1b1f;
  --bezel-border: rgba(255, 255, 255, 0.1);
  --screen: #0e0f11;
  --device-shadow: 0 40px 100px rgba(91, 99, 211, 0.16);
  --banner: rgba(38, 40, 45, 0.94);
  --banner-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --card-shadow: none;
  --code-bg: #16171a;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
code, pre, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* Nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; display: block; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; color: var(--text-2); flex-wrap: wrap; }
.nav-links a:hover { color: var(--text); }
.icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--border-strong); background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn svg { width: 17px; height: 17px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 8px; font-weight: 500; font-size: 14px; cursor: pointer; border: 0;
}
.btn-dark { background: var(--btn-bg); color: var(--btn-fg); }
.theme-dark-only, .theme-light-only { display: none; }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } }

/* Hero */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding: 56px 0 64px; }
.hero-copy { flex: 999 1 500px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.eyebrow {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px;
  border-radius: 15px; border: 1px solid var(--border-strong); font-size: 13px; color: var(--text-2);
}
.dot { width: 6px; height: 6px; border-radius: 3px; background: var(--accent); flex: none; }
h1 { margin: 0; font-size: clamp(2.5rem, 5.2vw, 4.25rem); line-height: 1.06; font-weight: 600; letter-spacing: -0.035em; }
h1 span { display: block; }
.rotator { color: var(--accent-text); }
.lead { margin: 0; max-width: 540px; font-size: 18px; line-height: 28px; color: var(--text-2); }
.badges { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.badge {
  height: 52px; padding: 0 18px 0 14px; border-radius: 11px; background: #000; color: #fff;
  border: 1px solid var(--badge-border); display: inline-flex; align-items: center; gap: 10px; position: relative;
}
.badge svg { width: 24px; height: 24px; fill: #fff; }
.badge small { display: block; font-size: 11px; font-weight: 500; line-height: 1.1; }
.badge strong { display: block; font-size: 19px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.soon { font-size: 13px; color: var(--text-3); }
.curl-line {
  align-self: flex-start; max-width: 100%; overflow-x: auto; white-space: nowrap; padding: 10px 14px;
  border-radius: 8px; background: var(--code-bg); border: 1px solid var(--border); font-size: 13px; color: var(--text-2);
}
.curl-line .prompt { color: var(--text-3); }

/* Phone */
.hero-visual { flex: 1 1 340px; min-width: 0; display: flex; justify-content: center; }
.device { position: relative; width: 100%; max-width: 360px; height: 560px; }
.bezel {
  position: absolute; top: 36px; left: 0; right: 0; bottom: 0; padding: 8px; border-radius: 46px 46px 0 0;
  background: var(--bezel); border: 1px solid var(--bezel-border); border-bottom: 0; box-shadow: var(--device-shadow);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
.screen { height: 100%; border-radius: 38px 38px 0 0; background: var(--screen); overflow: hidden; display: flex; flex-direction: column; }
.screen-head { display: flex; align-items: center; justify-content: space-between; padding: 26px 18px 8px 20px; }
.screen-head b { font-size: 18px; font-weight: 600; }
.screen-head span { display: flex; gap: 14px; color: var(--text-2); }
.screen-head svg { width: 17px; height: 17px; }
.tabs { display: flex; gap: 4px; padding: 0 12px 8px; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; color: var(--text-3); }
.tabs span { padding: 5px 9px; border-radius: 6px; }
.tabs .active { background: var(--chip); color: var(--text); }
.tabs .active em { font-style: normal; font-weight: 400; color: var(--text-3); }
.rule { height: 1px; background: var(--border); }
.day { padding: 14px 20px 4px; font-size: 11px; font-weight: 500; color: var(--text-3); }
.rows-clip { overflow: hidden; flex: 1; }
.row { height: 62px; display: flex; gap: 10px; padding: 11px 20px; border-bottom: 1px solid var(--border); }
.row .d { width: 6px; padding-top: 7px; flex: none; }
.row .d i { display: block; width: 6px; height: 6px; border-radius: 3px; background: var(--accent); }
.row .d.read i { background: transparent; }
.row p { margin: 0; font-size: 14px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--card-text); }
.row.unread p { color: var(--text); }
.row small { display: block; font-size: 11px; color: var(--text-3); margin-top: 3px; }
.banner {
  position: absolute; top: 0; left: 18px; right: 18px; display: flex; gap: 11px; padding: 12px; border-radius: 18px;
  background: var(--banner); border: 1px solid var(--bezel-border); box-shadow: var(--banner-shadow);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.banner img { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.banner .top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.banner .top b { font-weight: 600; }
.banner .top span { color: var(--text-3); }
.banner p { margin: 2px 0 0; font-size: 14px; line-height: 19px; color: var(--card-text); }

@keyframes wordA { from { opacity: 0; transform: translateY(0.35em); } to { opacity: 1; transform: none; } }
@keyframes wordB { from { opacity: 0; transform: translateY(0.35em); } to { opacity: 1; transform: none; } }
@keyframes bannerA { 0% { opacity: 0; transform: translateY(-18px) scale(.97); } 14% { opacity: 1; transform: none; } 58% { opacity: 1; transform: none; } 78%, 100% { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes bannerB { 0% { opacity: 0; transform: translateY(-18px) scale(.97); } 14% { opacity: 1; transform: none; } 58% { opacity: 1; transform: none; } 78%, 100% { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes listA { from { transform: translateY(-62px); } to { transform: none; } }
@keyframes listB { from { transform: translateY(-62px); } to { transform: none; } }
@keyframes rowA { from { opacity: 0; } to { opacity: 1; } }
@keyframes rowB { from { opacity: 0; } to { opacity: 1; } }
.reduce .banner { display: none; }

/* Sections */
section { padding: 64px 0; }
.section-head { max-width: 640px; margin-bottom: 32px; }
.section-head h2 { margin: 0 0 10px; font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.section-head p { margin: 0; color: var(--text-2); font-size: 17px; line-height: 26px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { padding: 22px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.card p { margin: 0; font-size: 14px; line-height: 21px; color: var(--text-2); }
.card .num { display: inline-flex; width: 26px; height: 26px; border-radius: 13px; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text); font-size: 13px; font-weight: 600; margin-bottom: 12px; }

/* Code tabs */
.code-tabs { border-radius: 14px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.code-tabs [role="tablist"] { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.code-tabs [role="tab"] {
  font: inherit; font-size: 13px; font-weight: 500; padding: 7px 11px; border-radius: 7px; border: 0;
  background: transparent; color: var(--text-3); cursor: pointer; white-space: nowrap;
}
.code-tabs [role="tab"][aria-selected="true"] { background: var(--chip); color: var(--text); }
.code-tabs pre { margin: 0; padding: 18px 20px; overflow-x: auto; font-size: 13px; line-height: 21px; color: var(--text); }
.code-tabs .note { padding: 0 20px 16px; font-size: 13px; color: var(--text-3); }
.code-tabs .note code { font-size: 12px; }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; max-width: 780px; }
.plan { padding: 26px; border-radius: 16px; border: 1px solid var(--border); background: var(--card); box-shadow: var(--card-shadow); }
.plan.pro { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.plan h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-2); }
.price { margin: 10px 0 4px; font-size: 40px; font-weight: 600; letter-spacing: -0.03em; }
.price small { font-size: 15px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }
.plan .sub { margin: 0 0 18px; font-size: 14px; color: var(--text-3); }
.plan ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; color: var(--text-2); }
.plan li { display: flex; gap: 10px; }
.plan li::before { content: ""; width: 6px; height: 6px; margin-top: 8px; border-radius: 3px; background: var(--accent); flex: none; }

/* FAQ */
.faq { max-width: 760px; display: grid; gap: 10px; }
.faq details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-3); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--text-2); font-size: 15px; line-height: 23px; }

/* Footer */
footer { padding: 40px 0 56px; border-top: 1px solid var(--border); margin-top: 32px; color: var(--text-3); font-size: 14px; }
footer .container { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer a:hover { color: var(--text); }

/* Long-form pages (privacy) */
.prose { max-width: 720px; padding: 32px 0 64px; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin-bottom: 8px; }
.prose h2 { font-size: 20px; margin: 36px 0 10px; font-weight: 600; }
.prose p, .prose li { color: var(--text-2); font-size: 16px; line-height: 26px; }
.prose ul { padding-left: 20px; }
.prose .updated { color: var(--text-3); font-size: 14px; margin: 0 0 24px; }

/* Theme toggle icon: sun while dark (switches to light), moon while light */
.is-dark .theme-dark-only { display: block; }
html:not(.is-dark) .theme-light-only { display: block; }

/* Code highlighting (hand-marked spans) and copy buttons */
:root { --hl-c: #8c929c; --hl-s: #2f7d4f; --hl-v: #a35d00; --hl-k: #5b63d3; --hl-p: #1b1c1f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hl-c: #6e737b; --hl-s: #7ec699; --hl-v: #e5b567; --hl-k: #9aa1f5; --hl-p: #ededef; } }
:root[data-theme="dark"] { --hl-c: #6e737b; --hl-s: #7ec699; --hl-v: #e5b567; --hl-k: #9aa1f5; --hl-p: #ededef; }
.code-tabs pre .c { color: var(--hl-c); }
.code-tabs pre .s { color: var(--hl-s); }
.code-tabs pre .v { color: var(--hl-v); }
.code-tabs pre .k { color: var(--hl-k); }
.code-tabs pre .p { color: var(--hl-p); font-weight: 500; }
.code-tabs [role="tabpanel"] { position: relative; }
.copy-btn {
  position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
}
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn:hover { color: var(--text); }
.copy-btn.copied { color: var(--hl-s); border-color: currentColor; }
.code-tabs pre { padding-right: 96px; }

/* Rotating word: the old word lifts and dissolves while the new one rises in letter by letter */
.rotator { display: grid !important; }
.rotator > .w { grid-area: 1 / 1; }
.rotator .word { display: inline-block; white-space: nowrap; }
.rotator .ch { display: inline-block; }
.rotator .w-in .ch { animation: chIn .55s cubic-bezier(.2, .7, .2, 1) both; }
.rotator .w-out { animation: wOut .32s ease-in both; pointer-events: none; }
@keyframes chIn {
  from { opacity: 0; transform: translateY(.45em); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes wOut {
  to { opacity: 0; transform: translateY(-.3em); filter: blur(6px); }
}
/* Reduce motion: dissolve instead of moving */
.reduce-motion .rotator .w-in .ch { animation: fadeIn .5s ease both; animation-delay: 0s !important; }
.reduce-motion .rotator .w-out { animation: fadeOut .35s ease both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes bannerFadeA { 0% { opacity: 0; } 14%, 58% { opacity: 1; } 78%, 100% { opacity: 0; } }
@keyframes bannerFadeB { 0% { opacity: 0; } 14%, 58% { opacity: 1; } 78%, 100% { opacity: 0; } }
.reduce .banner { display: flex; }
