/* ============================================================
   Layout — topbar, sections, footer, overlays
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med), box-shadow var(--t-med);
}
.topbar.is-stuck { border-bottom-color: var(--border); box-shadow: 0 6px 22px rgba(11,42,27,.06); }

.topbar__in {
  display: flex; align-items: center; gap: var(--sp-5);
  min-height: 68px; padding-block: var(--sp-2);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--primary-700); }
.brand:hover { color: var(--primary); }
.brand__mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  box-shadow: var(--sh-btn);
}
.brand__mark .ic { width: 21px; height: 21px; stroke-width: 2; }
.brand__t { display: flex; flex-direction: column; line-height: 1.15; }
.brand__t b { font-family: var(--f-head); font-size: 1.06rem; letter-spacing: -.02em; }
.brand__t span { font-size: .68rem; color: var(--fg-3); letter-spacing: .04em; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 13px; border-radius: var(--r-pill);
  color: var(--fg-2); font-size: .93rem; font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.nav a:hover { background: var(--primary-050); color: var(--primary-700); transform: translateY(-1px); }
.nav a.is-active { background: var(--primary-100); color: var(--primary-700); font-weight: 600; }

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

.section { padding-block: var(--sp-8); }
.section--tight { padding-block: var(--sp-7); }
.section--alt { background: var(--surface); border-block: 1px solid var(--border-2); }

.sec-head { max-width: 62ch; margin-bottom: var(--sp-6); }
.sec-head p { font-size: 1.03rem; margin-top: var(--sp-3); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .74rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--primary-600);
  background: var(--primary-050); border: 1px solid var(--primary-100);
  padding: 5px 12px; border-radius: var(--r-pill);
}

.page-head { background: var(--surface); border-bottom: 1px solid var(--border-2); padding-block: var(--sp-6) var(--sp-5); }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--fg-3); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.crumbs a { color: var(--fg-3); }
.crumbs a:hover { color: var(--primary); }
.crumbs .ic { width: 13px; height: 13px; }

/* ---------------- footer ---------------- */
.footer { background: var(--primary-700); color: #CFE9DB; margin-top: var(--sp-7); }
.footer__in {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--sp-6); padding-block: var(--sp-7) var(--sp-6);
}
.footer .brand, .footer .brand:hover { color: #fff; }
.footer .brand__t span { color: #9CCBB4; }
.footer h4 { color: #fff; font-size: .95rem; margin-bottom: var(--sp-3); }
.footer a { display: block; color: #B6DCC9; font-size: .9rem; padding-block: 4px; }
.footer a:hover { color: #fff; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.14); padding-block: var(--sp-4);
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  font-size: .82rem; color: #A6D1BB;
}
@media (max-width: 900px) { .footer__in { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__in { grid-template-columns: 1fr; } }

/* ---------------- overlay (drawer / modal) ---------------- */
.ov {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6,30,18,.5); backdrop-filter: blur(3px);
  display: flex; opacity: 0; transition: opacity var(--t-med);
}
.ov--in { opacity: 1; }
.ov--right { justify-content: flex-end; }
.ov--center { align-items: center; justify-content: center; padding: var(--sp-4); }

.panel {
  background: var(--surface); width: min(440px, 100%); height: 100%;
  display: flex; flex-direction: column; box-shadow: var(--sh-3);
  transform: translateX(18px); transition: transform var(--t-med);
}
.ov--in .panel { transform: none; }
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border-2);
}
.panel__head h3 { font-size: 1.1rem; }
.panel__body { flex: 1; overflow-y: auto; padding: var(--sp-5); }
.panel__foot { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border-2); background: var(--surface-2); }

.dialog {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3);
  width: min(720px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  transform: scale(.97); transition: transform var(--t-med);
}
.ov--in .dialog { transform: none; }
@media (max-width: 560px) {
  .dialog { max-height: 94vh; }
  .panel { width: 100%; }
}

/* ---------------- toast ---------------- */
.toast-wrap {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: center;
  pointer-events: none; width: min(420px, calc(100% - 2rem));
}
.toast {
  background: var(--fg); color: #fff; padding: 12px 16px; border-radius: var(--r-md);
  box-shadow: var(--sh-3); font-size: .92rem; display: flex; align-items: center; gap: 10px;
  animation: toastIn 240ms cubic-bezier(.2,.9,.3,1.3); width: 100%;
}
.toast--ok { background: var(--primary-600); }
.toast--err { background: var(--danger); }
.toast--info { background: var(--accent-600); }
.toast.out { animation: toastOut 200ms ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }

.to-top {
  position: fixed; right: 20px; bottom: 22px; z-index: 70;
  width: 46px; height: 46px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--primary); color: #fff; display: grid; place-items: center;
  box-shadow: var(--sh-2); opacity: 0; visibility: hidden;
  transition: opacity var(--t-med), visibility var(--t-med), transform var(--t-fast);
}
.to-top.show { opacity: 1; visibility: visible; }
.to-top:hover { transform: translateY(-3px); background: var(--primary-600); }

/* ---------------- animations ---------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp 560ms cubic-bezier(.2,.7,.3,1) both; }
.d1 { animation-delay: 80ms; } .d2 { animation-delay: 160ms; }
.d3 { animation-delay: 240ms; } .d4 { animation-delay: 320ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
