/* ============================================================
   TokenVesting dApp — slate & rose "time-release" theme
   Layout v3 (distinct from v1 header-grid and v2 sidebar-tabs):
   compact top bar · centered vesting donut with live countdown ·
   releasable/schedule stage row · owner tools · horizontal
   scrollable event cards.
   ============================================================ */

:root {
  --bg: #0b0e14;
  --bg-2: #10141d;
  --card: rgba(18, 22, 32, 0.82);
  --card-border: rgba(148, 163, 184, 0.14);
  --text: #eef2f8;
  --muted: #93a1b8;
  --accent-1: #fb7185;  /* rose */
  --accent-2: #e2e8f0;  /* ice */
  --accent-grad: linear-gradient(135deg, #fb7185 0%, #e2e8f0 100%);
  --danger: #fb7185;
  --success: #34d399;
  --warning: #fbbf24;
  --radius: 16px;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", var(--font-ui);
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(560px 400px at 50% 8%, rgba(251, 113, 133, 0.13), transparent 65%),
    radial-gradient(700px 480px at 12% 80%, rgba(226, 232, 240, 0.06), transparent 60%),
    radial-gradient(700px 480px at 88% 80%, rgba(251, 113, 133, 0.07), transparent 60%),
    var(--bg);
  animation: glowDrift 20s ease-in-out infinite alternate;
}
@keyframes glowDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(0, 18px, 0) scale(1.04); }
}

/* falling hourglass sands */
.sands { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sands i {
  position: absolute;
  top: -12px;
  width: 3px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent-1);
  opacity: 0;
  animation: sandFall var(--d, 9s) linear infinite;
}
.sands i:nth-child(even) { background: var(--accent-2); }
@keyframes sandFall {
  0%   { transform: translateY(-12px) rotate(0deg); opacity: 0; }
  8%   { opacity: 0.7; }
  85%  { opacity: 0.4; }
  100% { transform: translateY(108vh) rotate(360deg); opacity: 0; }
}

.muted { color: var(--muted); }
.accent { color: var(--accent-1); }
.mono { font-family: var(--font-mono); font-size: 12px; }
.center { text-align: center; }
.grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ===================== TOP BAR ===================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 26px;
  background: rgba(11, 14, 20, 0.8);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  background: rgba(251, 113, 133, 0.14);
  border: 1px solid rgba(251, 113, 133, 0.4);
  animation: markBreathe 3s ease-in-out infinite;
}
@keyframes markBreathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 113, 133, 0.3); }
  50% { box-shadow: 0 0 16px 3px rgba(251, 113, 133, 0.18); }
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; }
.brand-sub { font-size: 11px; color: var(--muted); }
@media (max-width: 640px) { .brand-sub { display: none; } }

.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.chain-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--muted);
}
.chain-badge.ok { color: var(--success); border-color: rgba(52, 211, 153, 0.35); }

/* ===================== STAGE ===================== */

.stage {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ===================== BUTTONS & FORMS ===================== */

.btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.2s ease;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:not(:disabled):active { transform: translateY(0); }

.btn-primary { background: var(--accent-grad); color: #1a0d10; box-shadow: 0 6px 18px rgba(251, 113, 133, 0.28); }
.btn-ghost { background: rgba(148, 163, 184, 0.1); border: 1px solid var(--card-border); color: var(--text); }
.btn-ghost:hover { background: rgba(148, 163, 184, 0.18); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.btn-claim { position: relative; width: 100%; margin-top: 16px; }
.btn-claim::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  background: rgba(251, 113, 133, 0.3);
  z-index: -1;
  animation: claimPulse 2.6s ease-in-out infinite;
}
@keyframes claimPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent-1);
  cursor: pointer;
  font-size: 12.5px;
  font-family: var(--font-ui);
}
.link-btn:hover { text-decoration: underline; }

input, select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text);
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus { border-color: var(--accent-1); box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.12); }

label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.stack-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

/* ===================== BANNER / SETTINGS ===================== */

.banner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 22px;
}
.banner-icon { font-size: 26px; }
.banner h3 { font-family: var(--font-display); margin-bottom: 4px; }
.banner p { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.banner code, .settings-panel code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(148, 163, 184, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--accent-1);
}

.settings-panel { margin-top: 22px; }
.settings-panel h3 { font-family: var(--font-display); margin-bottom: 14px; }
.settings-panel .row { margin-top: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(10px);
}

/* ===================== HERO STAGE ===================== */

.hero-stage {
  margin-top: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* the donut */
.ring-wrap { position: relative; width: 230px; height: 230px; margin-bottom: 26px; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(148, 163, 184, 0.13); stroke-width: 14; }
.ring-fill {
  fill: none;
  stroke-width: 14;
  transition: stroke-dashoffset 0.9s cubic-bezier(0.3, 0.8, 0.4, 1);
  filter: drop-shadow(0 0 8px rgba(251, 113, 133, 0.5));
}
.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.ring-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); }
.ring-pct { font-family: var(--font-display); font-size: 40px; font-weight: 700; }
.ring-count {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent-1);
  transition: opacity 0.4s ease;
}

.hero-title { font-family: var(--font-display); font-size: 38px; letter-spacing: -0.5px; }
.hero-sub { font-size: 14.5px; color: var(--muted); margin-top: 10px; max-width: 58ch; }

/* info chips */
.chip-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 16px;
  min-width: 92px;
  animation: chipIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.chip:nth-child(2) { animation-delay: 60ms; }
.chip:nth-child(3) { animation-delay: 120ms; }
.chip:nth-child(4) { animation-delay: 180ms; }
.chip:nth-child(5) { animation-delay: 240ms; }
.chip:nth-child(6) { animation-delay: 300ms; }
@keyframes chipIn {
  from { opacity: 0; transform: translateY(16px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.chip b { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
.chip .mono { font-size: 12px; }
.chip #chip-status { font-size: 11.5px; font-weight: 700; }
.st-active { color: var(--success); }
.st-cliff { color: var(--warning); }
.st-revoked { color: var(--danger); }

/* ===================== STAGE ROW ===================== */

.stage-row {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
  margin-top: 30px;
}
@media (max-width: 720px) { .stage-row { grid-template-columns: 1fr; } }

.card-kicker {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}

.release-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  animation: riseIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.release-amount {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 600;
  color: var(--accent-1);
  margin: 10px 0 2px;
  text-shadow: 0 0 18px rgba(251, 113, 133, 0.4);
  word-break: break-all;
}
.release-sub { font-size: 12.5px; color: var(--muted); }
.release-card .link { margin-top: 12px; color: var(--accent-1); text-decoration: none; }
.release-card .link:hover { text-decoration: underline; }

.schedule-card { animation: riseIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) 80ms both; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* schedule bar */
.sched-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.13);
  margin: 18px 0 8px;
  overflow: visible;
}
.sched-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--accent-grad);
  width: var(--vested-w, 0%);
  transition: width 0.9s cubic-bezier(0.3, 0.8, 0.4, 1);
}
.sched-marker {
  position: absolute;
  top: 50%;
  left: var(--now-p, 0%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--accent-1);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(251, 113, 133, 0.7);
  transition: left 0.9s cubic-bezier(0.3, 0.8, 0.4, 1);
  animation: markerPulse 2s ease-in-out infinite;
}
@keyframes markerPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(251, 113, 133, 0.5); }
  50% { box-shadow: 0 0 16px 4px rgba(251, 113, 133, 0.55); }
}
.sched-cliff {
  position: absolute;
  top: -5px;
  left: var(--cliff-p, 0%);
  width: 2px;
  height: 20px;
  background: var(--warning);
  border-radius: 2px;
  transform: translateX(-50%);
}
.sched-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.sched-legend { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.dot-vested { background: var(--accent-grad); }
.dot-cliff { background: var(--warning); }
.sched-note { margin-top: 12px; font-size: 13px; }

/* ===================== OWNER ===================== */

.owner-card { margin-top: 16px; animation: riseIn 0.5s ease both; }
.owner-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 14px; }
@media (max-width: 640px) { .owner-grid { grid-template-columns: 1fr; } }
.owner-grid h3 { font-family: var(--font-display); font-size: 15.5px; }
.owner-grid p { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ===================== ACTIVITY STRIP ===================== */

.activity { margin-top: 44px; }
.section-title { font-family: var(--font-display); font-size: 20px; margin: 0; }

.event-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 16px 2px 8px;
  margin-top: 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(251, 113, 133, 0.4) transparent;
}
.event-strip::-webkit-scrollbar { height: 6px; }
.event-strip::-webkit-scrollbar-thumb { background: rgba(251, 113, 133, 0.35); border-radius: 999px; }

.ev-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.15s ease, transform 0.2s ease;
  animation: cardSlide 0.45s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.ev-card:hover { border-color: rgba(251, 113, 133, 0.35); transform: translateY(-3px); }
@keyframes cardSlide {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
.ev-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-ico { font-size: 16px; }
.ev-block { font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); margin-left: auto; }
.ev-detail { font-size: 13px; margin-top: 8px; }
.ev-detail .mono { font-size: 12px; }
.ev-tx { display: inline-block; margin-top: 8px; font-family: var(--font-mono); font-size: 11.5px; color: var(--accent-1); text-decoration: none; }
.ev-tx:hover { text-decoration: underline; }

.ev-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}
.ev-ScheduleCreated { background: rgba(251, 113, 133, 0.16); color: #fda4af; }
.ev-Claimed { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.ev-ScheduleRevoked { background: rgba(251, 191, 36, 0.16); color: #fcd34d; }

/* ===================== FOOTER ===================== */

.site-footer {
  margin-top: 54px;
  padding: 20px 0 26px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}
.site-footer a { color: var(--accent-1); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
#footer-address { font-family: var(--font-mono); }

/* ===================== TOASTS ===================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  width: max-content;
}

.toast {
  background: rgba(18, 22, 32, 0.97);
  border: 1px solid var(--card-border);
  border-top: 3px solid var(--accent-1);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  word-break: break-word;
}
.toast.success { border-top-color: var(--success); }
.toast.error { border-top-color: var(--danger); }
.toast.info { border-top-color: var(--accent-1); }
.toast a { color: #fda4af; }
.toast.out { opacity: 0; transform: translateY(-10px); transition: all 0.25s ease; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===================== MISC ===================== */

[hidden] { display: none !important; }

.spin {
  display: inline-block;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

::selection { background: rgba(251, 113, 133, 0.4); }
