/* =========================================================================
   xapplab: shared design system
   The shell (nav/footer) is the light skin of the studio. 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;

  /* Shell: constant across the studio pages */
  --shell-bg: #ffffff;
  --shell-bg-raised: #ffffff;
  --shell-header: rgba(255, 255, 255, 0.82);
  --shell-text: #111318;
  --shell-text-dim: rgba(17, 19, 24, 0.64);
  --shell-text-faint: rgba(17, 19, 24, 0.44);
  --shell-border: rgba(17, 19, 24, 0.09);
  --shell-border-strong: rgba(17, 19, 24, 0.18);
  --shell-accent: #2e44ff;
  --shell-accent-ink: #ffffff;

  /* Page theme: default (lab/home), clean white with a cobalt accent */
  --bg: #ffffff;
  --bg-soft: #f4f5f7;
  --bg-elevated: #ffffff;
  --text: #111318;
  --text-dim: rgba(17, 19, 24, 0.66);
  --text-faint: rgba(17, 19, 24, 0.46);
  --border: rgba(17, 19, 24, 0.09);
  --border-strong: rgba(17, 19, 24, 0.18);
  --accent: #2e44ff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(46, 68, 255, 0.1);

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

  --font-display: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Geist", -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"] {
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --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);
}

/* Sabbaha product page: deep emerald and gold, matches the app's own theme */
:root[data-theme="sabbaha"] {
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #03120f;
  --bg-soft: #061d18;
  --bg-elevated: #0a2a24;
  --text: #f6efdc;
  --text-dim: rgba(204, 224, 217, 0.74);
  --text-faint: rgba(204, 224, 217, 0.48);
  --border: rgba(222, 186, 115, 0.14);
  --border-strong: rgba(222, 186, 115, 0.3);
  --accent: #deba73;
  --accent-ink: #082621;
  --accent-soft: rgba(222, 186, 115, 0.12);
  color-scheme: dark;
  --shell-bg: #03120f;
  --shell-bg-raised: #0a2a24;
  --shell-header: rgba(3, 18, 15, 0.6);
  --shell-text: #f6efdc;
  --shell-text-dim: rgba(204, 224, 217, 0.7);
  --shell-text-faint: rgba(204, 224, 217, 0.45);
  --shell-border: rgba(222, 186, 115, 0.1);
  --shell-border-strong: rgba(222, 186, 115, 0.25);
}

* {
  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.025em;
}

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: var(--shell-header);
  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;
}

/* The mark: five app tiles in an X, the centre one in the accent. */
.logo-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  fill: var(--shell-text);
}

.logo-mark .lm-core { fill: var(--shell-accent); }

.logo-word {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.logo-word span { font-weight: 500; color: var(--shell-text-dim); }

.logo:hover .logo-mark rect { transform: scale(0.86); }
.logo-mark rect { transform-box: fill-box; transform-origin: center; transition: transform 0.4s var(--ease); }
.logo-mark rect:nth-child(2), .logo-mark rect:nth-child(4) { transition-delay: 0.04s; }
.logo-mark rect:nth-child(5) { transition-delay: 0.08s; }
.logo:hover .logo-mark .lm-core { transform: scale(1.1) rotate(45deg); }

.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 h3 {
  font-size: 16px;
  margin-top: 24px;
  margin-bottom: 10px;
}

.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); }
