/* Shared stylesheet for plainviewsocial.com. Tokens named after the app
 * theme -- the colors (--background, --text, --text-secondary,
 * --text-faint, --error) and the control geometry (--pill-radius,
 * --control-padding-vertical) -- are GENERATED into css/tokens.css at
 * build time from frontend/src/theme/index.ts (see src/_data/theme.js):
 * the app theme is the single source of truth. Only tokens with no theme
 * counterpart are defined here, sourced from the Instagram palette
 * recorded in that theme file's comments ("IG ramp"). */

:root {
  --line: #dbdbdb; /* IG ramp: separator (grey-2) */
  --soft: #f5f5f5; /* IG ramp: grey-0 */
  --ok: #58c322; /* IG ramp: ig-success */
  --radius: 16px;
  /* The sticky header's height. A token because html's scroll-padding
   * must stay correlated with it -- see the html rule */
  --header-height: 64px;
}

/* Dark surfaces sit a ramp step above the IG dark values (#262626 /
 * #1a1a1a): at those, the pill, the step cards, and their borders were
 * near-invisible against the near-black page background. Light mode
 * keeps the true ramp */
@media (prefers-color-scheme: dark) {
  :root {
    --line: #32363b;
    --soft: #1f2226;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* scroll-padding-top keeps anchor targets clear of the sticky header:
 * without it a deep link (/faq#whats-the-recommended-setup, linked from
 * the landing page and /support) scrolls its heading to viewport top,
 * where the header covers the heading and the answer's first line. Set
 * on the scroll container so every anchor is covered at once, rather
 * than scroll-margin-top on each heading */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  font-family:
    ui-sans-serif,
    -apple-system,
    'SF Pro Text',
    'Segoe UI',
    Helvetica,
    Arial,
    sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Nav ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--background) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  font-weight: 750;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--text);
  color: var(--background);
  text-decoration: none;
  padding: var(--control-padding-vertical) 1.6rem;
  border-radius: var(--pill-radius);
  font-weight: 600;
  font-size: 1.05rem;
}

.coming-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--line);
  background: var(--soft);
  padding: var(--control-padding-vertical) 1.6rem;
  border-radius: var(--pill-radius);
}

/* ---------- Landing ---------- */

.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.hero h1 em {
  font-style: italic;
}

/* Copy reads in --text; --text-secondary is reserved for the genuinely
 * secondary layer (nav links, step blurbs, the coming-soon pill, footer) */
.hero p.sub {
  margin: 1.25rem auto 0;
  font-size: 1.2rem;
  color: var(--text);
  max-width: 40rem;
}

.cta-row {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Framed device screenshots (static/screens, from the compositor's
 * web-export stage): the feed and stories-grid pair under the hero CTA,
 * staggered so they don't read as rigid twins. Explicit width/height
 * attributes on the imgs reserve the space before the image arrives;
 * light/dark variants swap via <source media>, matching the page theme
 * around them */
.hero-shots {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.hero-shots picture {
  display: block;
  width: min(15.5rem, 42vw);
  position: relative;
  isolation: isolate;
}

.hero-shots picture:last-child {
  margin-top: 2.5rem;
}

/* The settings device sits under the Yes/No cards, by the
 * customization line that describes it */
.compare-settings {
  display: block;
  width: min(15.5rem, 42vw);
  margin: 2.5rem auto 0;
  position: relative;
  isolation: isolate;
}

/* The backdrop is box-shadow on a device-shaped pseudo-element, NOT
 * filter: drop-shadow -- WebKit intermittently clips filter rasters on
 * replaced elements, which cut the halo off harshly on iOS. box-shadow
 * is ordinary painted geometry, and on a rounded rect it hugs the
 * device silhouette exactly as the filter did (a radial-gradient
 * backdrop was tried between the two: an ellipse pokes out irregularly
 * around a tall rectangular device). The border-radius percentages
 * mirror the frame's outer corner (166px of 1372x2920). isolation on
 * the parents keeps z-index: -1 inside the picture's own stacking
 * context. The two modes need different physics: light gets a cast
 * shadow; on a near-black page a shadow has nowhere darker to go, so
 * dark gets an ambient glow -- a tight core plus a wide wash */
.hero-shots picture::before,
.compare-settings::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 12.1% / 5.7%;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}

@media (prefers-color-scheme: dark) {
  .hero-shots picture::before,
  .compare-settings::before {
    box-shadow:
      0 0 18px rgba(255, 255, 255, 0.2),
      0 0 56px rgba(255, 255, 255, 0.16);
  }
}

/* display: block: an inline img leaves a baseline descender gap below
 * it inside the picture, and the ::before (inset: 0) would overhang
 * the device bottom by that gap -- its shadow then peeks out as a
 * bar under the phone */
.hero-shots img,
.compare-settings img {
  display: block;
  width: 100%;
  height: auto;
}

section {
  padding: 2.5rem 0;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  text-align: center;
}

.section-sub {
  text-align: center;
  color: var(--text);
  font-size: 1.1rem;
  margin: 0.75rem auto 0;
  max-width: 46rem;
}

.section-sub a {
  color: var(--text);
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

.card {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}

.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.card ul {
  list-style: none;
  margin-top: 1.25rem;
  display: grid;
  gap: 0.8rem;
}

.card li {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
}

.card li::before {
  font-weight: 700;
  flex-shrink: 0;
}

.card.gone li::before {
  content: '×';
  color: var(--error);
}

.card.stay li::before {
  content: '✓';
  color: var(--ok);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.step {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.step .num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--background);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.step h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.step p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.final {
  text-align: center;
  padding-bottom: 5.5rem;
}

/* ---------- Content pages (markdown-rendered) ---------- */

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4.5rem;
}

.page h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.page h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-top: 2.25rem;
}

.page p,
.page ul,
.page ol {
  margin-top: 0.9rem;
  color: var(--text);
}

/* Deliberate divergence from the app tokens, dark mode only: light-on-dark
 * text glows (halation), fattening every stroke until inline bold leads
 * stop reading as bold. The fix is dimming the long-form body a step so
 * strong keeps full brightness -- not out-bolding the glow. IG ramp
 * grey-2; the app has no long-form prose, so no app counterpart. The
 * strong rule is what keeps the leads at --text: without it they'd
 * inherit the dimmed paragraph color and the whole change would be a
 * uniform dim */
@media (prefers-color-scheme: dark) {
  .page p,
  .page ul,
  .page ol {
    color: #dbdbdb;
  }

  .page strong {
    color: var(--text);
  }
}

.page ul,
.page ol {
  padding-left: 1.4rem;
}

.page a {
  color: var(--text);
}

.page strong {
  font-weight: 800;
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.foot p {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.foot .disclaimer {
  display: block;
  margin-bottom: 0.75rem;
}

.foot a {
  color: var(--text-secondary);
  text-decoration: none;
}

.foot a:hover {
  color: var(--text);
}

.foot-links a {
  margin-left: 1.25rem;
}

.foot-links a:first-child {
  margin-left: 0;
}

@media (max-width: 820px) {
  .compare,
  .steps {
    grid-template-columns: 1fr;
  }

  /* The 40rem cap never binds at phone width, leaving the hero
   * paragraph running to the wrap edge */
  .hero p.sub {
    padding: 0 1rem;
  }
}
