/* Mochi UI shell — LOSFER-like platform chrome */
:root {
  --bg: #070b14;
  --bg-elevated: #0e1524;
  --panel: rgba(18, 26, 42, 0.88);
  --panel-solid: #121a2a;
  --line: rgba(255, 255, 255, 0.09);
  --line-hover: rgba(255, 143, 171, 0.35);
  --text: #f2f5fc;
  --muted: #93a0b8;
  --peach: #ff8fab;
  --peach-deep: #ff5c8a;
  --mint: #5ecfba;
  --danger: #ff6b81;
  --code-bg: #060a12;
  --radius: 14px;
  --nav-h: 56px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "DM Sans", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --display: "Syne", "DM Sans", "PingFang SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body.mochi-app {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-top: var(--nav-h);
}

body.mochi-app::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 55% at 15% -5%, rgba(255, 92, 138, 0.2), transparent 55%),
    radial-gradient(ellipse 55% 45% at 95% 5%, rgba(94, 207, 186, 0.1), transparent 50%),
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(255, 143, 171, 0.06), transparent 55%);
  animation: glow-drift 18s ease-in-out infinite alternate;
}

@keyframes glow-drift {
  from { opacity: 0.85; transform: scale(1); }
  to { opacity: 1; transform: scale(1.04); }
}

.mochi-app > *:not(.topnav) {
  position: relative;
  z-index: 1;
}

a {
  color: var(--peach);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

a:hover {
  color: #ffc0d0;
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

/* —— Fixed nav —— */
.topnav {
  position: fixed;
  inset: 0 0 auto;
  height: var(--nav-h);
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 20, 0.82);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.topnav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.logo span {
  color: var(--peach);
}

.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--peach), var(--peach-deep));
  box-shadow: 0 0 20px rgba(255, 92, 138, 0.35);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-cta {
  margin-left: 0.35rem;
  padding: 0.45rem 0.95rem !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, var(--peach), var(--peach-deep)) !important;
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(255, 92, 138, 0.28);
}

.nav-cta:hover {
  filter: brightness(1.06);
  color: #fff !important;
}

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    background: rgba(7, 11, 20, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
  }
  .nav-links.is-open {
    display: flex;
  }
  .nav-links a {
    padding: 0.75rem 1rem;
  }
  .nav-cta {
    margin: 0.35rem 0 0 !important;
    text-align: center;
    justify-content: center;
  }
}

/* —— Buttons / inputs —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), filter 0.2s var(--ease);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn:disabled,
.btn.is-busy {
  opacity: 0.65;
  pointer-events: none;
  transform: none;
  filter: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--peach), var(--peach-deep));
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 92, 138, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--line-hover);
  background: rgba(255, 143, 171, 0.08);
}

.btn-sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--code-bg);
  color: var(--text);
  padding: 0.75rem 0.9rem;
  font: inherit;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

input:focus,
textarea:focus {
  border-color: rgba(255, 143, 171, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 143, 171, 0.15);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.75rem 0;
}

.field-row > input,
.field-row > select {
  flex: 1 1 180px;
  min-width: 0;
  width: auto;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  outline: none;
}

.field-row > select {
  cursor: pointer;
}

/* —— Cards / code —— */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.25rem;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
}

.card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.card .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--mint);
  margin-bottom: 0.55rem;
}

.card p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.code-wrap {
  position: relative;
}

.code {
  margin: 0;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.55;
  color: #d5def2;
  white-space: pre;
}

.copy-mini {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  font-size: 0.7rem;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.copy-mini:hover {
  color: var(--text);
  background: rgba(255, 143, 171, 0.12);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.pill {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.hint.is-error,
.msg-error {
  color: var(--danger);
}

.notice {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 143, 171, 0.22);
  background: rgba(255, 143, 171, 0.07);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* —— Motion —— */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  body.mochi-app::before { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card { transition: none; }
}

/* Shared tabs */
.seg {
  display: inline-flex;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  gap: 0.2rem;
}

.seg button {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.seg button.is-active {
  background: linear-gradient(135deg, var(--peach), var(--peach-deep));
  color: #fff;
}
