/* MomentJot — shared design tokens & components.
   Dark, on-brand: matches the desktop client (dark surfaces, blue accent,
   time-of-day color). Loaded by both the landing page and the dashboard so
   the two read as one system. */

:root {
  /* surfaces */
  --bg:        #14141b;
  --bg-2:      #1a1a24;
  --surface:   #1e1e29;
  --surface-2: #24242f;
  --border:    rgba(255, 255, 255, 0.08);
  --border-2:  rgba(255, 255, 255, 0.14);

  /* text */
  --text:  #e8e8ef;
  --muted: #9a9aab;
  --faint: #858595;

  /* brand */
  --accent:    #3b82f6;
  --accent-2:  #60a5fa;
  --accent-dim:#2563eb;
  --red:     #f0616e;
  --green:   #5fd68a;
  --warn:    #c89030;

  /* time-of-day accent — set live by JS (colorAtMinute). Falls back to a warm
     dawn tone so the page still looks intentional before JS runs. */
  --tod: #ff9a76;

  --radius:   14px;
  --radius-sm: 9px;
  --shadow:   0 18px 50px rgba(0, 0, 0, 0.45);
  --font: -apple-system, "Segoe UI", "Microsoft YaHei", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.hidden { display: none !important; }

/* ---- buttons ---- */
button, .btn {
  font-family: inherit;
  font-size: 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  transition: background .15s ease, border-color .15s ease, transform .05s ease, opacity .15s ease;
  line-height: 1.2;
}
button:active, .btn:active { transform: translateY(1px); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #ffffff;
  font-weight: 600;
  border: none;
}
.btn-accent:hover { background: linear-gradient(135deg, #7db5fb, var(--accent-2)); }
.btn-accent:disabled { opacity: .5; cursor: not-allowed; }

.btn-ghost { background: rgba(255, 255, 255, 0.05); border-color: var(--border); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--border-2); }

.btn-link { background: none; color: var(--muted); padding: 6px 10px; }
.btn-link:hover { color: var(--text); }

input, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}
input[type="date"] { color-scheme: dark; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---- the breathing capsule (shared motif, matches the desktop client) ----
   A solid time-colored pill with a white breathing dot (灯芯) centered inside.
   Every capsule on the site — nav, header, hero — uses this so they read as the
   same object. Size via width/height; the core scales with --core. */
.capsule {
  --c: var(--tod);
  --core: 6px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--c);
  box-shadow: 0 0 20px 1px color-mix(in srgb, var(--c) 45%, transparent);
  transition: background 0.6s linear, box-shadow 0.6s linear;
}
.capsule .core {
  width: var(--core); height: var(--core); border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 calc(var(--core) * 1.6) rgba(255, 255, 255, 0.75);
  animation: pulse var(--breath-dur, 2.6s) ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.65; }
  50%      { transform: scale(1.2); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .capsule .core { animation: none; }
}
