@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   Design tokens — mirrored from the DayAssist desktop app
   (dark glass theme; muted near-white accents, no blue accent)
   ============================================================ */
:root {
  --bg-base: #16161c;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-soft: rgba(255, 255, 255, 0.028);
  --glass-border: rgba(255, 255, 255, 0.075);
  --glass-border-soft: rgba(255, 255, 255, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.07);
  --glass-blur: blur(30px) saturate(1.28);

  --text-primary: #f0f0f0;
  --text-secondary: rgba(255, 255, 255, 0.55);
  --text-tertiary: rgba(255, 255, 255, 0.32);
  --text-faint: rgba(255, 255, 255, 0.18);

  --success: #4ade80;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', ui-monospace, monospace;

  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.5);
  --t-fast: 140ms ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  animation: page-in 240ms ease-out;
}
body.leaving {
  animation: page-out 180ms ease-in forwards;
}
/* Landing shell: never scrolls — nav / stage / footer fit one viewport.
   Height is pinned by JS to the real window.innerHeight (--app-h) so it matches
   exactly what's visible on first paint regardless of the mobile address bar;
   100dvh is the no-JS fallback. html must ALSO be locked — on iOS, overflow:hidden
   on body alone doesn't stop the document from scrolling. */
html.locked-html { height: 100%; overflow: hidden; }
body.locked {
  height: 100vh;
  height: var(--app-h, 100dvh);
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
@keyframes page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes page-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  body, body.leaving { animation: none; }
}

/* Cross-document view transitions (modern Chromium / Safari) */
@view-transition { navigation: auto; }

/* Layered atmospheric background — matches .app gradient stack */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 70% at 50% -8%, rgba(140, 170, 230, 0.16), transparent 60%),
    radial-gradient(circle at 12% 6%, rgba(255, 255, 255, 0.08), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(140, 170, 230, 0.09), transparent 36%),
    linear-gradient(160deg, rgba(28, 28, 36, 0.5), rgba(36, 36, 44, 0.25)),
    var(--bg-base);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.6;
}

::selection { background: rgba(255, 255, 255, 0.16); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

.page {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Full-viewport shell — nav / stage / footer, no scroll */
#main-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: var(--app-h, 100dvh);
}
.stage {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  overflow: hidden;
}

/* ---- Nav ---- */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 18px 0;
  display: flex;
  justify-content: center;
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 6px 8px 6px 12px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: 100px;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.2px;
  text-decoration: none; color: var(--text-primary);
  padding-right: 12px; border-right: 1px solid var(--glass-border-soft);
}
.logo img { width: 20px; height: 20px; border-radius: 5px; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  font-size: 12.5px; color: var(--text-tertiary); text-decoration: none;
  padding: 5px 12px; border-radius: 100px; transition: all var(--t-fast);
}
.nav-links a:hover { color: var(--text-primary); background: var(--glass-hover); }
.nav-links a.active { color: var(--text-primary); background: var(--glass-hover); }

/* ---- Hero ---- */
.hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
  width: 100%;
  max-width: 440px;
  padding: 36px 0 4px;
}
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: 100px;
  font-size: 11.5px; font-weight: 500; letter-spacing: 0.2px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.65);
}
.hero-logo {
  width: 54px; height: 54px; margin-bottom: 20px;
  border-radius: 13px;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}
.hero h1 {
  font-size: 48px; font-weight: 700; letter-spacing: -1.8px;
  line-height: 1.04; margin-bottom: 14px;
  background: linear-gradient(180deg, #ffffff 30%, rgba(255, 255, 255, 0.62));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.sub {
  font-size: 16px; color: var(--text-secondary);
  line-height: 1.55; margin-bottom: 30px;
  max-width: 100%;
}

.install {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.install-box {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 14px 12px 18px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: 13.5px; color: var(--text-primary);
  cursor: pointer; transition: all var(--t-fast);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}
.install-box:hover { background: rgba(0, 0, 0, 0.36); border-color: rgba(255, 255, 255, 0.14); }
.install-box .d { color: var(--text-faint); user-select: none; }
.install-box .cmd { user-select: all; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500;
  color: var(--text-tertiary);
  padding: 4px 9px; margin-left: 2px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border-soft);
  border-radius: 6px;
  user-select: none;
  transition: all var(--t-fast);
}
.install-box:hover .copy-btn { color: var(--text-secondary); }
.copy-btn.copied { color: var(--success); border-color: rgba(74, 222, 128, 0.3); background: rgba(74, 222, 128, 0.08); }
.install-sub { font-size: 12.5px; color: var(--text-faint); }
.install-sub strong { color: var(--text-secondary); font-weight: 600; }

.platforms {
  display: flex; align-items: center; gap: 8px;
  margin-top: 18px;
}
.platform {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: 100px;
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
}
.platform svg { width: 13px; height: 13px; opacity: 0.8; }
.platform-soon { opacity: 0.55; }

/* ---- App dock — the real bottom dock, lifted straight from the app ---- */
.dock-showcase {
  position: relative;
  margin-top: 30px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}
.dock-glow {
  position: absolute; inset: -44px -34px;
  background: radial-gradient(ellipse at 50% 50%, rgba(120, 150, 220, 0.16), transparent 70%);
  filter: blur(22px);
  pointer-events: none;
}
.dock {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: rgba(20, 20, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  backdrop-filter: blur(36px) saturate(170%);
  -webkit-backdrop-filter: blur(36px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 48px rgba(0, 0, 0, 0.5);
}
.dock-logo {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  margin-right: 2px;
}
.dock-logo img { width: 28px; height: 28px; border-radius: 7px; }
.dock-app {
  position: relative;
  width: 38px; height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(235, 235, 240, 0.92);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.dock-app:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.12); }
.dock-app svg { width: 18px; height: 18px; }
.dock-status {
  position: absolute; bottom: 3px; right: 3px;
  width: 6px; height: 6px; border-radius: 50%;
  border: 1.5px solid rgba(20, 20, 24, 0.95);
  background: var(--success);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
}

/* ---- Footer ---- */
footer {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  height: 52px;
  padding: 0 24px;
  border-top: 1px solid var(--glass-border-soft);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
}
.foot-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  white-space: nowrap;
}
.foot-brand img { width: 18px; height: 18px; border-radius: 5px; }
.foot-tag { font-size: 12px; font-weight: 500; color: var(--text-faint); }
.foot-tag::before { content: "·"; margin-right: 8px; color: var(--text-faint); }
.foot-links { display: flex; gap: 18px; }
.foot-links a { font-size: 12.5px; color: var(--text-tertiary); text-decoration: none; transition: color var(--t-fast); }
.foot-links a:hover { color: var(--text-primary); }

/* ---- Legal pages ---- */
.legal { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; padding: 40px 24px 80px; }
.legal-card {
  padding: 36px 40px;
  background: var(--glass-soft);
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-card);
}
.legal h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.6px; margin-bottom: 8px; }
.legal h3 { font-size: 15px; font-weight: 600; margin: 26px 0 8px; color: var(--text-primary); }
.legal p, .legal li { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 12px; }
.legal ul { padding-left: 20px; margin-bottom: 12px; }
.legal .back {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 28px; font-size: 13px; color: var(--text-tertiary); text-decoration: none;
  padding: 7px 14px; border-radius: 100px;
  background: var(--glass-soft); border: 1px solid var(--glass-border-soft);
  transition: all var(--t-fast);
}
.legal .back:hover { color: var(--text-primary); background: var(--glass-hover); }
.legal a { color: rgba(255, 255, 255, 0.7); }
.legal code {
  background: rgba(255, 255, 255, 0.08); padding: 1px 6px; border-radius: 4px;
  font-family: var(--mono); font-size: 12.5px;
}
.legal .updated { color: var(--text-faint); font-size: 13px; }

@media (max-width: 760px) {
  /* Mobile: top-align the hero so it sits just under the nav (the JS-pinned
     --app-h height handles fitting it to the visible screen). */
  .stage { justify-content: flex-start; overflow: hidden; padding-bottom: 20px; }

  .hero { padding: 16px 0 0; }
  .hero-logo { width: 46px; height: 46px; margin-bottom: 14px; }
  .badge { margin-bottom: 18px; }
  .hero h1 { font-size: 32px; letter-spacing: -1.2px; margin-bottom: 12px; }
  .hero p.sub { font-size: 14.5px; margin-bottom: 22px; }
  .platforms { margin-top: 14px; }
  .dock-showcase { margin-top: 26px; }
  .dock { gap: 6px; padding: 6px 8px; }
  .dock-logo { width: 34px; height: 34px; }
  .dock-logo img { width: 25px; height: 25px; }
  .dock-app { width: 34px; height: 34px; border-radius: 9px; }
  .dock-app svg { width: 16px; height: 16px; }
  .legal-card { padding: 26px 22px; }
}
@media (max-width: 460px) {
  .install-box { font-size: 12px; }
  .foot-links { gap: 12px; }
}
