/* ==========================================================================
   X-SEEK — base stylesheet
   Reset, typography, layout primitives, nav, footer, buttons, shared
   utilities. Per-app pages layer their own stylesheet on top of this one.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--fs-6);
  line-height: 1.6;
  background: var(--ink-950);
  color: var(--text-on-dark);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: var(--sp-4);
  z-index: 1000;
  background: var(--paper-100);
  color: var(--text-on-light);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--sp-4); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Layout primitives -------------------------------------------------*/

.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
}

.section { padding-block: var(--section-pad); position: relative; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--fs-4);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 1.5em;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.measure { max-width: var(--measure); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.9rem 1.6rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--fs-5);
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
  min-height: 48px;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-1);
}
.btn-primary:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }

.btn-ghost-dark {
  border: 1px solid var(--ink-line-strong);
  color: var(--text-on-dark);
  background: rgba(255,255,255,0.02);
}
.btn-ghost-dark:hover { border-color: var(--text-on-dark-muted); background: rgba(255,255,255,0.06); }

.btn-ghost-light {
  border: 1px solid var(--paper-line-strong);
  color: var(--text-on-light);
}
.btn-ghost-light:hover { border-color: var(--text-on-light-muted); background: rgba(0,0,0,0.03); }

.btn-store {
  background: var(--text-on-dark);
  color: var(--ink-950);
  padding: 0.85rem 1.5rem;
}
.btn-store:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn-store__glyph { width: 18px; height: 18px; flex: none; }
.btn-store__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.btn-store__text small { font-size: 0.6875rem; font-weight: 500; opacity: 0.7; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

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

.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: var(--sp-3) 0;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), padding var(--dur-fast) var(--ease-out);
  border-bottom: 1px solid transparent;
}
.site-nav.is-scrolled {
  background: color-mix(in srgb, var(--ink-950) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--ink-line);
  padding-block: var(--sp-2);
}
body.theme-light .site-nav.is-scrolled {
  background: color-mix(in srgb, var(--paper-100) 90%, transparent);
  border-bottom-color: var(--paper-line);
}

.nav-inner {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--page-pad);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-right: auto;
  white-space: nowrap;
  flex: none;
}
.nav-brand__mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--text-on-dark);
  color: var(--ink-950);
  font-family: var(--font-display);
  font-weight: 700;
  flex: none;
}
body.theme-light .nav-brand__mark { background: var(--ink-950); color: var(--paper-100); }
.nav-brand__app-icon { width: 30px; height: 30px; border-radius: 9px; flex: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  font-size: var(--fs-5);
  font-weight: 500;
}
.nav-links a { position: relative; padding: 0.35rem 0; color: var(--text-on-dark-muted); transition: color var(--dur-fast); }
body.theme-light .nav-links a { color: var(--text-on-light-muted); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text-on-dark); }
body.theme-light .nav-links a:hover, body.theme-light .nav-links a[aria-current="page"] { color: var(--text-on-light); }
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -4px;
  height: 2px; border-radius: 2px;
  background: var(--accent);
}

.nav-cta { display: flex; align-items: center; gap: var(--sp-2); }

.nav-menu-btn {
  display: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  place-items: center;
  gap: 5px;
  flex-direction: column;
  border: 1px solid var(--ink-line-strong);
}
body.theme-light .nav-menu-btn { border-color: var(--paper-line-strong); }
.nav-menu-btn span { width: 18px; height: 1.5px; background: currentColor; border-radius: 2px; transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out); }
.nav-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-backdrop {
  position: fixed; inset: 0;
  background: rgba(10,10,12,0.5);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out);
  z-index: 210;
}
.nav-backdrop.is-open { opacity: 1; pointer-events: auto; }

.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(88vw, 380px);
  background: var(--ink-900);
  color: var(--text-on-dark);
  z-index: 220;
  padding: var(--sp-4);
  transform: translateX(100%);
  transition: transform var(--dur-med) var(--ease-out);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-menu.is-open { transform: translateX(0); }
.mobile-menu__head { display: flex; justify-content: flex-end; margin-bottom: var(--sp-5); }
.mobile-menu__close {
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--ink-line-strong);
  display: grid; place-items: center;
}
.mobile-menu nav { display: flex; flex-direction: column; gap: var(--sp-1); }
.mobile-menu a {
  padding: 0.9rem 0.25rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  border-bottom: 1px solid var(--ink-line);
}
.mobile-menu__apps { display: flex; flex-direction: column; }
.mobile-menu__section-label {
  font-size: var(--fs-4);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-on-dark-faint);
  margin: var(--sp-4) 0 var(--sp-1);
}
.mobile-menu .store-buttons { margin-top: var(--sp-5); }

@media (max-width: 880px) {
  .nav-links, .nav-cta { display: none; }
  .nav-menu-btn { display: flex; }
}

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

.site-footer {
  background: var(--ink-950);
  color: var(--text-on-dark);
  border-top: 1px solid var(--ink-line);
  padding-block: var(--sp-7) var(--sp-5);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--ink-line);
}
.footer-brand { display: flex; flex-direction: column; gap: var(--sp-3); max-width: 320px; }
.footer-brand__mark { display: flex; align-items: center; gap: 0.65rem; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.footer-brand__mark .nav-brand__mark { background: var(--text-on-dark); color: var(--ink-950); }
.footer-brand p { color: var(--text-on-dark-muted); font-size: var(--fs-5); line-height: 1.6; }

.footer-col h4 { font-family: var(--font-text); font-size: var(--fs-4); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-on-dark-faint); margin-bottom: var(--sp-3); font-weight: 600; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.65rem; }
.footer-col a { color: var(--text-on-dark-muted); font-size: var(--fs-5); transition: color var(--dur-fast); }
.footer-col a:hover { color: var(--text-on-dark); }

.footer-bottom {
  padding-top: var(--sp-4);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--sp-3);
  font-size: var(--fs-4); color: var(--text-on-dark-faint);
}
.footer-disclaimer { max-width: 640px; }

@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---- App switcher (bottom of every app page) ----------------------- */

.switcher { background: var(--ink-950); color: var(--text-on-dark); padding-block: var(--sp-7); }
.switcher-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.switcher-head h2 { font-size: var(--fs-9); }
.switcher-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
.switcher-card {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--ink-line);
  background: var(--ink-900);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.switcher-card:hover { transform: translateY(-4px); border-color: var(--ink-line-strong); background: var(--ink-800); }
.switcher-card.is-current { opacity: 0.5; pointer-events: none; }
.switcher-card__top { display: flex; align-items: center; gap: 0.75rem; }
.switcher-card__icon { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.switcher-card__name { font-family: var(--font-display); font-size: 1.05rem; }
.switcher-card__desc { font-size: var(--fs-4); color: var(--text-on-dark-muted); line-height: 1.5; }

@media (max-width: 880px) {
  .switcher-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .switcher-grid { grid-template-columns: 1fr; }
}

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

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-stagger > * { transition-delay: calc(var(--i, 0) * 90ms); }

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

/* ---- Device frame (shared shell for phone screenshots) --------------- */

.device-frame {
  position: relative;
  border-radius: 34px;
  padding: 10px;
  background: linear-gradient(155deg, #3a3c44, #121318 70%);
  box-shadow: var(--shadow-2);
  aspect-ratio: 1178 / 2556;
  overflow: hidden;
}
.device-frame::after {
  content: "";
  position: absolute; top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 34%; height: 18px;
  background: #121318;
  border-radius: 0 0 14px 14px;
  z-index: 2;
}
.device-frame__screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 24px;
  overflow: hidden;
}
.device-frame__screen img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Misc utilities --------------------------------------------------*/

.visually-hide-on-touch { }
@media (hover: none) { .hover-only { display: none !important; } }

.stat-row { display: flex; gap: var(--sp-6); flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 0.2rem; }
.stat b { font-family: var(--font-display); font-size: var(--fs-9); }
.stat span { font-size: var(--fs-4); color: var(--text-on-dark-muted); text-transform: uppercase; letter-spacing: 0.08em; }

.pill {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.4em 0.9em;
  border-radius: var(--radius-pill);
  font-size: var(--fs-4);
  font-weight: 600;
  border: 1px solid var(--ink-line-strong);
  color: var(--text-on-dark-muted);
}

.concept-note {
  font-size: var(--fs-4);
  color: var(--text-on-dark-faint);
}
