/* ===========================================================================
   PipePeek — marketing site styles
   Brand: pipe-blue #123C8C · signal-blue #2E6BF0 · sky #4C8DFF
          pass #2CC66B · running #F5A623 · fail #F14E37
   =========================================================================== */

/* ---- Design tokens -------------------------------------------------------- */
:root {
  /* Brand (constant across themes) */
  --pipe-blue: #123C8C;
  --signal-blue: #2E6BF0;
  --sky: #4C8DFF;
  --pass: #2CC66B;
  --running: #F5A623;
  --fail: #F14E37;

  --brand-gradient: linear-gradient(135deg, #4C8DFF 0%, #2E6BF0 45%, #123C8C 100%);

  /* Light theme surfaces */
  --bg: #F5F8FD;
  --bg-elev: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #EDF2FB;
  --text: #0E1E3D;
  --text-muted: #56688C;
  --border: rgba(18, 60, 140, 0.12);
  --shadow-sm: 0 1px 2px rgba(10, 27, 60, 0.06), 0 2px 8px rgba(10, 27, 60, 0.05);
  --shadow-md: 0 10px 30px rgba(10, 27, 60, 0.12);
  --shadow-lg: 0 30px 60px rgba(10, 27, 60, 0.18);
  --header-bg: rgba(255, 255, 255, 0.72);
  --ring: rgba(46, 107, 240, 0.10);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --maxw: 1120px;
  --radius: 16px;
  --radius-lg: 24px;
  --gap: clamp(1rem, 2vw, 1.5rem);
}

/* Dark theme tokens (shared block, applied two ways below) */
[data-theme="dark"] {
  --bg: #080E1D;
  --bg-elev: #0F1830;
  --surface: #121C36;
  --surface-2: #1A2648;
  --text: #EAF0FB;
  --text-muted: #9AABCC;
  --border: rgba(255, 255, 255, 0.10);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 60px rgba(0, 0, 0, 0.55);
  --header-bg: rgba(12, 20, 40, 0.72);
  --ring: rgba(76, 141, 255, 0.14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080E1D;
    --bg-elev: #0F1830;
    --surface: #121C36;
    --surface-2: #1A2648;
    --text: #EAF0FB;
    --text-muted: #9AABCC;
    --border: rgba(255, 255, 255, 0.10);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 30px 60px rgba(0, 0, 0, 0.55);
    --header-bg: rgba(12, 20, 40, 0.72);
    --ring: rgba(76, 141, 255, 0.14);
  }
}

/* ---- Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: var(--signal-blue); text-decoration: none; }
a:hover { color: var(--sky); }
img { max-width: 100%; display: block; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section__head { max-width: 640px; margin: 0 auto clamp(2rem, 5vw, 3.25rem); text-align: center; }
.section__eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--signal-blue); margin-bottom: 0.75rem;
}
.section__title { font-size: clamp(1.75rem, 4vw, 2.6rem); }
.section__sub { margin-top: 0.9rem; color: var(--text-muted); font-size: clamp(1rem, 1.6vw, 1.15rem); }

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  --btn-fg: #fff;
  display: inline-flex; align-items: center; gap: 0.55rem; justify-content: center;
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1;
  padding: 0.9rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--brand-gradient); color: var(--btn-fg); box-shadow: var(--shadow-md); }
.btn--primary:hover { box-shadow: var(--shadow-lg); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { color: var(--text); border-color: var(--signal-blue); }
.btn--lg { padding: 1.05rem 1.9rem; font-size: 1.05rem; }
.btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.85; }
.btn[aria-disabled="true"]:hover { transform: none; }

.btn__badge {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.2rem 0.5rem; border-radius: 999px; background: rgba(255, 255, 255, 0.22);
}
.btn--ghost .btn__badge { background: var(--surface-2); color: var(--text-muted); }

/* ---- Header --------------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav__links { display: flex; gap: 1.5rem; }
.nav__links a { color: var(--text-muted); font-weight: 550; font-size: 0.95rem; }
.nav__links a:hover { color: var(--text); }
.nav__cta { font-size: 0.9rem; padding: 0.6rem 1.1rem; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; display: grid; place-items: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover { border-color: var(--signal-blue); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

@media (max-width: 720px) {
  .nav__links, .nav__cta { display: none; }
}

/* ---- Hero ----------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(3.5rem, 9vw, 7rem); }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 130%;
  background:
    radial-gradient(closest-side, var(--ring), transparent) center/62% 62% no-repeat,
    radial-gradient(closest-side, var(--ring), transparent) center/44% 44% no-repeat,
    radial-gradient(closest-side, var(--ring), transparent) center/26% 26% no-repeat;
  z-index: 0; pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; display: grid; gap: clamp(2rem, 5vw, 3.5rem); text-align: center; }
.hero__icon { width: clamp(96px, 16vw, 148px); height: auto; margin: 0 auto; filter: drop-shadow(0 20px 40px rgba(18, 60, 140, 0.35)); }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); max-width: 16ch; margin-inline: auto; }
.hero__accent { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__sub { color: var(--text-muted); font-size: clamp(1.05rem, 2vw, 1.35rem); max-width: 52ch; margin: 0 auto; }
.hero__cta { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.hero__note { font-size: 0.9rem; color: var(--text-muted); }

/* Menu-bar mockup */
.menubar {
  display: inline-flex; align-items: center; gap: 1rem; margin: 0 auto;
  background: #0d1526; color: #e9eefb; border-radius: 12px;
  padding: 0.5rem 0.9rem; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}
.menubar__spacer { flex: 1; min-width: 90px; }
.menubar__tray { display: inline-flex; align-items: center; gap: 0.85rem; }
.tray-icon { width: 18px; height: 18px; filter: invert(1); opacity: 0.92; }
.menubar__clock { font-variant-numeric: tabular-nums; opacity: 0.85; }

/* ---- Features ------------------------------------------------------------- */
.features__grid {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(46, 107, 240, 0.35); }
.feature__icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--signal-blue); margin-bottom: 1rem;
}
.feature__icon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.feature p { color: var(--text-muted); font-size: 0.96rem; }

.feature--wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 2rem; }
.feature--wide .feature__body { max-width: 46ch; }
@media (max-width: 640px) { .feature--wide { grid-template-columns: 1fr; } }

.status-row { display: flex; gap: 1.25rem; margin-top: 1rem; flex-wrap: wrap; }
.status-chip { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.92rem; }
.status-dot { width: 12px; height: 12px; border-radius: 999px; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }
.status-chip.is-pass { color: var(--pass); } .status-chip.is-pass .status-dot { background: var(--pass); }
.status-chip.is-run { color: var(--running); } .status-chip.is-run .status-dot { background: var(--running); }
.status-chip.is-fail { color: var(--fail); } .status-chip.is-fail .status-dot { background: var(--fail); }

/* animated tray demo inside wide feature */
.tray-demo {
  display: flex; align-items: center; justify-content: center;
  background: #0d1526; border-radius: var(--radius); padding: 2rem; min-height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.tray-demo__pill {
  display: inline-flex; align-items: center; gap: 0.75rem;
  background: rgba(255, 255, 255, 0.06); border-radius: 10px; padding: 0.5rem 0.9rem; color: #e9eefb; font-size: 0.85rem;
}
.tray-demo__pill .tray-icon { width: 22px; height: 22px; }

/* ---- Screenshots ---------------------------------------------------------- */
.shots { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.shots__row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.25rem, 3vw, 2rem); align-items: start; }
.shots__row--single { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
@media (max-width: 680px) { .shots__row { grid-template-columns: 1fr; } }

.window {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.window:hover { box-shadow: var(--shadow-lg); }
.window__bar { display: flex; align-items: center; gap: 0.4rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.window__dot { width: 11px; height: 11px; border-radius: 999px; }
.window__dot.r { background: #ff5f57; } .window__dot.y { background: #febc2e; } .window__dot.g { background: #28c840; }
.window__label { margin-left: 0.6rem; font-size: 0.82rem; color: var(--text-muted); font-weight: 550; }
.window__body { padding: 1.25rem; display: grid; place-items: center; background: var(--surface-2); }
.window__body img { border-radius: 10px; box-shadow: var(--shadow-sm); width: 100%; height: auto; }
.window__body.is-narrow img { max-width: 300px; }
.window__caption { text-align: center; margin-top: 0.75rem; color: var(--text-muted); font-size: 0.9rem; }

/* ---- Testimonials --------------------------------------------------------- */
.quotes { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.quote {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 1.1rem;
}
.quote__stars { color: var(--running); letter-spacing: 0.15em; font-size: 0.95rem; }
.quote__text { font-size: 1.02rem; }
.quote__who { display: flex; align-items: center; gap: 0.75rem; margin-top: auto; }
.quote__avatar {
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center;
  background: var(--brand-gradient); color: #fff; font-weight: 700; font-size: 0.95rem; flex: none;
}
.quote__name { font-weight: 650; font-size: 0.95rem; }
.quote__role { color: var(--text-muted); font-size: 0.85rem; }

/* ---- Get / install -------------------------------------------------------- */
.get { background: var(--bg-elev); }
.get__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
@media (max-width: 820px) { .get__grid { grid-template-columns: 1fr; } }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1.1rem; }
.steps li { position: relative; padding-left: 3.25rem; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 999px;
  background: var(--brand-gradient); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 0.95rem;
}
.steps h3 { font-size: 1.05rem; margin-bottom: 0.2rem; }
.steps p { color: var(--text-muted); font-size: 0.96rem; }
code, kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.86em;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.1rem 0.4rem;
}
.codeblock {
  display: block; margin-top: 0.5rem; padding: 0.75rem 0.9rem; overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; white-space: pre;
}

.buycard {
  position: sticky; top: 88px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2rem; box-shadow: var(--shadow-md);
}
.buycard img { width: 84px; margin: 0 auto 1rem; }
.buycard h3 { font-size: 1.4rem; margin-bottom: 0.4rem; }
.buycard p { color: var(--text-muted); margin-bottom: 1.4rem; }
.buycard .btn { width: 100%; }
.buycard__note { margin-top: 1rem; font-size: 0.82rem; }

.callout {
  display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 1.5rem;
  background: color-mix(in srgb, var(--pass) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--pass) 30%, transparent);
  border-radius: 12px; padding: 0.9rem 1.1rem; font-size: 0.94rem;
}
.callout svg { flex: none; width: 20px; height: 20px; color: var(--pass); margin-top: 2px; }

/* ---- Footer --------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding-block: 2.5rem; background: var(--bg); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer .brand { font-size: 1rem; }
.footer__links { display: flex; gap: 1.25rem; }
.footer__links a { color: var(--text-muted); font-size: 0.9rem; }
.footer__links a:hover { color: var(--text); }
.footer__copy { color: var(--text-muted); font-size: 0.85rem; }

/* ---- Reveal-on-scroll ----------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
