/* ---------------------------------------------------------------------------
   spacefield.co — the marketing site IS a Spacefield desktop.

   Tokens, window chrome and dock are lifted from the application's own
   globals.css / Window.tsx / Dock.tsx so this looks like the real thing
   rather than an impression of it.

   Progressive enhancement: without JavaScript, or on a phone, every
   "window" is just a section on a normal scrolling page. desk.js promotes
   them to draggable windows when there's room.
--------------------------------------------------------------------------- */

:root {
  --bg: #0a0a0a;
  --text: #f5f5f7;
  --text-secondary: rgba(255, 255, 255, 0.82);
  --text-muted: rgba(255, 255, 255, 0.64);
  --text-faint: rgba(255, 255, 255, 0.46);
  --accent: #7c3aed;
  --accent-bg: rgba(124, 58, 237, 0.14);
  --border: rgba(255, 255, 255, 0.12);

  /* chrome — from the app */
  --chrome-solid: #1a1a1f;
  --chrome-solid-strong: #1f1f25;
  --chrome-titlebar-solid: rgba(255, 255, 255, 0.06);
  --chrome-border: rgba(255, 255, 255, 0.18);
  --chrome-highlight: rgba(255, 255, 255, 0.22);
  --chrome-shadow: 0 22px 70px rgba(0, 0, 0, 0.48), 0 8px 24px rgba(0, 0, 0, 0.34);
  --chrome-glass-strong: linear-gradient(135deg, rgba(36, 36, 42, 0.82), rgba(10, 10, 12, 0.68));
  --chrome-hover: rgba(255, 255, 255, 0.06);

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] {
  --bg: #f1f2f4;
  --text: #0a0a0a;
  --text-secondary: rgba(15, 23, 42, 0.82);
  --text-muted: rgba(15, 23, 42, 0.64);
  --text-faint: rgba(15, 23, 42, 0.46);
  --border: rgba(15, 23, 42, 0.16);
  --chrome-solid: #f7f8fa;
  --chrome-solid-strong: #ffffff;
  --chrome-titlebar-solid: rgba(15, 23, 42, 0.04);
  --chrome-border: rgba(15, 23, 42, 0.16);
  --chrome-highlight: rgba(255, 255, 255, 0.92);
  --chrome-shadow: 0 24px 70px rgba(15, 23, 42, 0.16), 0 8px 28px rgba(15, 23, 42, 0.10);
  --chrome-glass-strong: linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(240, 243, 248, 0.70));
  --chrome-hover: rgba(15, 23, 42, 0.04);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ─── the page as it reads WITHOUT JavaScript (and for crawlers) ─────── */
.shell { max-width: 860px; margin: 0 auto; padding: 40px 22px 80px; }
.masthead { text-align: center; margin-bottom: 40px; }
.masthead h1 { font-size: clamp(1.9rem, 6vw, 2.6rem); letter-spacing: -.035em; line-height: 1.08; margin: 14px 0 12px; font-weight: 600; }
.masthead p { color: var(--text-muted); max-width: 46ch; margin: 0 auto 22px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px;
  letter-spacing: .04em; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 13px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: #3f9e63; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer;
  font-size: 14px; font-weight: 500; padding: 11px 18px; border-radius: 11px;
  border: 1px solid transparent; transition: .16s; font-family: inherit;
}
.btn-1 { background: var(--text); color: var(--bg); }
.btn-1:hover { opacity: .9; transform: translateY(-1px); }
.btn-2 { border-color: var(--chrome-border); background: var(--chrome-solid); color: var(--text); }
.btn-2:hover { border-color: var(--text-faint); }

.pane { border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 16px; background: var(--chrome-solid); }
.pane > h2 { margin: 0 0 12px; font-size: 1.15rem; letter-spacing: -.02em; font-weight: 600; }

/* shared content styling, used both in the page and inside windows */
.pane h3, .win-body h3 { font-size: 14px; font-weight: 600; margin: 18px 0 6px; }
.pane p, .win-body p { color: var(--text-secondary); margin: 0 0 12px; font-size: 14.5px; }
.muted { color: var(--text-muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 14px 0; }
.stat { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-family: var(--mono); font-size: 21px; letter-spacing: -.02em; font-weight: 500; }
.stat span { font-size: 12px; color: var(--text-muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chip { font-size: 12.5px; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
pre {
  margin: 0; background: rgba(0,0,0,.3); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.8; color: var(--text);
}
:root[data-theme="light"] pre { background: rgba(15,23,42,.05); }
.c { color: var(--text-faint); }
code { font-family: var(--mono); font-size: .92em; }
.codewrap { position: relative; }
.copy {
  position: absolute; top: 10px; right: 10px; font-family: var(--mono); font-size: 11px;
  color: var(--text-muted); background: var(--chrome-solid); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px; cursor: pointer; transition: .15s;
}
.copy:hover { color: var(--text); border-color: var(--text-faint); }
.copy.is-done { color: #3f9e63; border-color: #3f9e63; }
.qa { border-top: 1px solid var(--border); padding: 12px 0; }
.qa:first-of-type { border-top: 0; }
.qa b { display: block; font-size: 14px; margin-bottom: 4px; }
.qa p { margin: 0; font-size: 14px; color: var(--text-muted); }

.sitefoot { text-align: center; color: var(--text-muted); font-size: 13px; padding: 26px 0 0; }
.sitefoot a { color: var(--text-muted); }

/* ─── desktop mode (added by desk.js) ────────────────────────────────── */
body.desk { overflow: hidden; height: 100dvh; }
body.desk .shell { display: none; }

.desktop { position: fixed; inset: 0; display: none; }
body.desk .desktop { display: block; }

.wall { position: absolute; inset: 0; background-size: cover; background-position: center; }
.wall::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.28), rgba(0,0,0,.05) 40%, rgba(0,0,0,.34)); }

/* menu bar — .sf-glass-bar in the app */
.menubar {
  position: absolute; top: 0; left: 0; right: 0; height: 30px; z-index: 60;
  display: flex; align-items: center; gap: 2px; padding: 0 12px;
  background: var(--chrome-glass-strong);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--chrome-border);
  box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 10px 30px rgba(0,0,0,.16);
  font-size: 12.5px;
}
.menubar .mb-brand { display: flex; align-items: center; gap: 7px; font-weight: 600; padding: 0 10px 0 2px; }
.menubar button {
  background: none; border: 0; color: var(--text-secondary); font: inherit; cursor: pointer;
  padding: 3px 9px; border-radius: 6px;
}
.menubar button:hover { background: var(--chrome-hover); color: var(--text); }
.menubar .mb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-family: var(--mono); font-size: 11.5px; }

/* widgets */
.widget {
  position: absolute; z-index: 10; width: 232px; border-radius: 16px; padding: 15px 16px;
  background: var(--chrome-solid-strong); border: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow);
}
.widget .wlabel { font-size: 9.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .18em; color: var(--text-muted); }
.widget .wbig { font-size: 1.85rem; font-weight: 600; letter-spacing: -.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.widget .wsub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.widget .wgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.widget .wcell { border: 1px solid var(--border); border-radius: 9px; padding: 7px 8px; }
.widget .wcell i { font-style: normal; display: block; font-size: 9px; letter-spacing: .13em; text-transform: uppercase; color: var(--text-muted); }
.widget .wcell b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* windows — sf-glass-window + sf-glass-titlebar in the app */
.win {
  position: absolute; z-index: 20; display: flex; flex-direction: column;
  border-radius: 12px; overflow: hidden;
  background: var(--chrome-solid-strong);
  border: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow), inset 0 1px 0 var(--chrome-highlight);
}
.win[hidden] { display: none; }
.win-bar {
  height: 36px; flex: 0 0 36px; display: flex; align-items: center; gap: 8px; padding: 0 12px;
  background: var(--chrome-titlebar-solid); border-bottom: 1px solid var(--chrome-border);
  box-shadow: inset 0 1px 0 var(--chrome-highlight); cursor: grab; user-select: none;
}
.win-bar:active { cursor: grabbing; }
.lights { display: flex; gap: 6px; }
.lights button { width: 12px; height: 12px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; }
.lt-close { background: #ff5f57; } .lt-min { background: #febc2e; } .lt-zoom { background: #28c840; }
.win-title { flex: 1; text-align: center; font-size: 12px; font-weight: 500; color: var(--text); }
.win-body { flex: 1; overflow-y: auto; padding: 20px 22px 24px; }
.win-body .pane { border: 0; padding: 0; margin: 0; background: none; }
.win-body > :first-child { margin-top: 0; }

/* dock */
.dock {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 50;
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px; border-radius: 18px;
  background: var(--chrome-glass-strong);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--chrome-border); box-shadow: var(--chrome-shadow);
}
.dock button {
  position: relative; width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--chrome-border);
  background: var(--chrome-solid); color: var(--text-secondary); cursor: pointer;
  display: grid; place-items: center; transition: transform .16s, background .16s, color .16s;
}
.dock button:hover { transform: translateY(-6px); color: var(--text); background: var(--chrome-solid-strong); }
.dock button svg { width: 21px; height: 21px; }
.dock button::after {
  content: attr(data-label); position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  font-size: 11.5px; white-space: nowrap; padding: 4px 9px; border-radius: 7px;
  background: var(--chrome-glass-strong); border: 1px solid var(--chrome-border); color: var(--text);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  opacity: 0; pointer-events: none; transition: opacity .14s;
}
.dock button:hover::after { opacity: 1; }
.dock .open-dot { position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); width: 3.5px; height: 3.5px; border-radius: 50%; background: var(--text-muted); }
.dock .sep { width: 1px; align-self: stretch; margin: 6px 3px; background: var(--chrome-border); }

.hint {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 40;
  font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,.72);
  background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.14);
  padding: 5px 12px; border-radius: 999px; backdrop-filter: blur(10px);
  transition: opacity .5s;
}
:root[data-theme="light"] .hint { color: rgba(255,255,255,.92); background: rgba(0,0,0,.42); }


/* ─── phones: the application's own mobile shell ─────────────────────────
   Taken from MobileShell.tsx — a status bar, a 4-column home screen of app
   icons, page dots, and a rounded dock; tapping an icon opens it full
   screen. Same content, the presentation the product itself uses. */
.homescreen { display: none; }

@media (max-width: 860px) {
  .menubar, .widget, .dock, .hint { display: none !important; }

  /* status bar — .sf-glass-bar in the app */
  .statusbar {
    position: absolute; inset-inline: 0; top: 0; z-index: 30; height: 40px;
    display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
    background: var(--chrome-glass-strong);
    backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid var(--chrome-border); color: var(--text);
  }
  .statusbar .sb-time { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .statusbar .sb-name { font-size: 13px; font-weight: 600; }
  .statusbar .sb-right { display: flex; align-items: center; gap: 9px; color: var(--text-muted); }
  .statusbar svg { width: 15px; height: 15px; }

  .homescreen {
    display: block; position: absolute; inset: 40px 0 0; z-index: 10; overflow: hidden;
  }
  .hs-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); align-content: start;
    row-gap: 20px; padding: 22px 20px 0;
  }
  .hs-app { background: none; border: 0; padding: 0; cursor: pointer; display: grid; justify-items: center; gap: 7px; }
  .hs-tile {
    width: 62px; height: 62px; border-radius: 15px;      /* cornerPct 24 of 64 */
    display: grid; place-items: center;
    background: var(--chrome-solid-strong); border: 1px solid var(--chrome-border);
    box-shadow: 0 6px 18px rgba(0,0,0,.28);
    color: var(--text);
  }
  .hs-tile svg { width: 27px; height: 27px; }
  .hs-app span {
    font-size: 11.5px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.65);
    max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .hs-dots { position: absolute; inset-inline: 0; bottom: 96px; display: flex; justify-content: center; gap: 6px; }
  .hs-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.55); }
  .hs-dots i.on { background: #fff; }

  /* dock — sf-glass-strong, rounded-[28px], max-w-md */
  .mdock {
    position: absolute; inset-inline: 0; bottom: 0; z-index: 20;
    display: flex; justify-content: center;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mdock-inner {
    margin: 0 12px 16px; width: 100%; max-width: 28rem;
    display: flex; align-items: center; justify-content: space-around; gap: 8px;
    border-radius: 28px; padding: 8px 12px;
    background: var(--chrome-glass-strong);
    backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid var(--chrome-border); box-shadow: var(--chrome-shadow);
  }
  .mdock button {
    width: 46px; height: 46px; border-radius: 13px; border: 1px solid var(--chrome-border);
    background: var(--chrome-solid); color: var(--text); display: grid; place-items: center; cursor: pointer;
  }
  .mdock button svg { width: 21px; height: 21px; }

  /* an opened "app" fills the screen below the status bar, as MobileAppHost does */
  .win {
    left: 0 !important; right: 0; top: 40px !important; bottom: 0;
    width: 100% !important; height: auto !important; max-height: none;
    border-radius: 0; border: 0; border-top: 1px solid var(--chrome-border);
    z-index: 40 !important; box-shadow: none;
  }
  .win-bar { height: 48px; flex-basis: 48px; cursor: default; padding: 0 10px; }
  .win-bar .lights { order: 0; }
  .lt-min, .lt-zoom { display: none; }
  .lt-close {
    width: 30px !important; height: 30px !important; border-radius: 9px !important;
    background: var(--chrome-solid) !important; border: 1px solid var(--chrome-border) !important;
    position: relative;
  }
  .lt-close::before, .lt-close::after {
    content: ""; position: absolute; left: 9px; top: 14px; width: 11px; height: 1.6px;
    background: var(--text); border-radius: 2px;
  }
  .lt-close::before { transform: rotate(45deg); }
  .lt-close::after { transform: rotate(-45deg); }
  .win-title { font-size: 15px; font-weight: 600; }
  .win-body { padding: 18px 18px calc(28px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 380px) {
  .hs-tile { width: 56px; height: 56px; border-radius: 14px; }
  .hs-app span { font-size: 11px; }
}
