/* =========================================================================
   xapplab — shared design system
   Shell (nav/footer) is always the dark "lab" skin. Page content switches
   theme per product via [data-theme] on <html>, so each app can carry its
   own palette while staying inside one consistent factory.
   ========================================================================= */

:root {
  color-scheme: light dark;

  /* Shell — constant across every page */
  --shell-bg: #0a0a0b;
  --shell-bg-raised: #131316;
  --shell-text: #f5f5f7;
  --shell-text-dim: rgba(245, 245, 247, 0.64);
  --shell-text-faint: rgba(245, 245, 247, 0.4);
  --shell-border: rgba(255, 255, 255, 0.1);
  --shell-border-strong: rgba(255, 255, 255, 0.18);
  --shell-accent: #3d63ff;
  --shell-accent-ink: #ffffff;

  /* Page theme — default (lab/home): dark, same family as shell */
  --bg: #0a0a0b;
  --bg-soft: #0f0f11;
  --bg-elevated: #151517;
  --text: #f5f5f7;
  --text-dim: rgba(245, 245, 247, 0.64);
  --text-faint: rgba(245, 245, 247, 0.4);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --accent: #3d63ff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(61, 99, 255, 0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --container: 1120px;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* NoteCast product page — warm cream, matches the app's own design system */
:root[data-theme="notecast"] {
  --bg: #faf6ef;
  --bg-soft: #f3ecdf;
  --bg-elevated: #ffffff;
  --text: #241a10;
  --text-dim: rgba(36, 26, 16, 0.66);
  --text-faint: rgba(36, 26, 16, 0.44);
  --border: rgba(36, 26, 16, 0.1);
  --border-strong: rgba(36, 26, 16, 0.18);
  --accent: #f5dfba;
  --accent-ink: #33281a;
  --accent-soft: rgba(245, 223, 187, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 720px) {
  .container { padding: 0 40px; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.eyebrow::before {
  content: "";
  width: 14px;
  height: 2px;
  background: var(--accent);
}

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

.btn {
  --btn-pad-y: 13px;
  --btn-pad-x: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), opacity 0.2s var(--ease);
  white-space: nowrap;
}

.btn:active {
  opacity: 0.85;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, black);
}

.btn-ghost {
  background: transparent;
  color: var(--shell-text);
  border-color: var(--shell-border-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-sm {
  --btn-pad-y: 9px;
  --btn-pad-x: 16px;
  font-size: 13.5px;
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--shell-border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  color: var(--shell-text);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--shell-text);
  letter-spacing: -0.01em;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--shell-accent);
  display: grid;
  place-items: center;
  color: var(--shell-accent-ink);
  font-weight: 800;
  font-family: var(--font-body);
  font-size: 14px;
  flex-shrink: 0;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 32px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--shell-text-dim);
}

.nav-links a {
  transition: color 0.2s var(--ease);
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-crumb {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--shell-text-faint);
}

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

.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--shell-border-strong);
  background: transparent;
  color: var(--shell-text);
}

@media (min-width: 860px) {
  .nav-links { display: flex; }
  .nav-crumb { display: flex; }
  .nav-toggle { display: none; }
}

.mobile-menu {
  display: none;
  border-bottom: 1px solid var(--shell-border);
  background: var(--shell-bg);
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu .container {
  padding-top: 8px;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu a {
  padding: 12px 4px;
  color: var(--shell-text-dim);
  border-bottom: 1px solid var(--shell-border);
  font-size: 15px;
}

.mobile-menu a:last-child { border-bottom: none; }

@media (min-width: 860px) {
  .mobile-menu { display: none !important; }
}

/* ---------------------------------------------------------------------- */
/* Sections / general layout                                              */
/* ---------------------------------------------------------------------- */

.section {
  padding: 88px 0;
}

.section-tight {
  padding: 56px 0;
}

@media (max-width: 720px) {
  .section { padding: 64px 0; }
}

.section-head {
  max-width: 640px;
  margin: 0 0 48px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-top: 14px;
}

.section-head p {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 17px;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

hr.rule {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 0;
}

/* ---------------------------------------------------------------------- */
/* Reveal-on-scroll                                                        */
/* ---------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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

.site-footer {
  background: var(--shell-bg);
  color: var(--shell-text-dim);
  border-top: 1px solid var(--shell-border);
  padding: 64px 0 32px;
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-bottom: 40px;
}

@media (min-width: 720px) {
  .footer-top {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-brand p {
  margin-top: 12px;
  max-width: 320px;
  font-size: 14.5px;
  color: var(--shell-text-faint);
}

.footer-cols {
  display: flex;
  gap: 56px;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--shell-text-faint);
  margin-bottom: 14px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14.5px;
}

.footer-col a:hover {
  color: var(--shell-text);
}

.footer-bottom {
  border-top: 1px solid var(--shell-border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  color: var(--shell-text-faint);
}

@media (min-width: 720px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ---------------------------------------------------------------------- */
/* Legal / prose pages                                                    */
/* ---------------------------------------------------------------------- */

.legal-hero {
  padding: 64px 0 24px;
  border-bottom: 1px solid var(--border);
}

.legal-hero .eyebrow { margin-bottom: 14px; }

.legal-hero h1 {
  font-size: clamp(30px, 5vw, 44px);
}

.legal-hero p {
  margin-top: 14px;
  color: var(--text-faint);
  font-size: 14.5px;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
}

.prose h2 {
  font-size: 22px;
  margin-top: 44px;
  margin-bottom: 14px;
}

.prose h2:first-child { margin-top: 0; }

.prose p {
  color: var(--text-dim);
  font-size: 15.5px;
  margin-bottom: 14px;
}

.prose ul {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prose li {
  color: var(--text-dim);
  font-size: 15.5px;
  padding-left: 20px;
  position: relative;
}

.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

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

.prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }

:root:not([data-theme="notecast"]) .prose a { color: var(--accent); }
