/* HYPagotchi shared styles */
:root {
  --bg: #FDF5F0;
  --bg-alt: #FBE9DD;
  --ink: #1A202C;
  --ink-soft: #4A5568;
  --ink-mute: #718096;
  --teal: #4FD1C5;
  --teal-deep: #319795;
  --coral: #FF6B6B;
  --coral-deep: #E85555;
  --mint: #B2F5EA;
  --lavender: #E9D8FD;
  --yellow: #FFE66D;
  --peach: #FED7AA;
  --sky: #BEE3F8;
  --pink: #FBCFE8;
  --gold: #F6AD55;
  --orange: #FB923C;
  --purple: #B794F4;
  --blue: #63B3ED;
  --green: #68D391;
  --green-soft: #C6F6D5;
  --hyper: #05c48a;
  --hyper-soft: #97FCE4;
  --hyper-deep: #00956c;

  --card: #FFFFFF;
  --border: #1A202C;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);

  --font-display: 'Poppins', system-ui, sans-serif;
  --font-body: 'Poppins', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--teal); color: var(--ink); }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; color: var(--ink); }
p { margin: 0; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
.container-wide { max-width: 1480px; margin: 0 auto; padding: 0 28px; }
.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px; letter-spacing: 0.01em;
  background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(1px, 1px) scale(0.98); box-shadow: 2px 2px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--teal-deep); outline-offset: 3px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:disabled:hover { transform: none; box-shadow: var(--shadow-sm); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid var(--teal-deep); outline-offset: 2px; border-radius: 8px; }
.btn-coral   { background: var(--coral);   color: white; }
.btn-yellow  { background: var(--yellow);  color: var(--ink); }
.btn-teal    { background: var(--teal);    color: var(--ink); }
.btn-mint    { background: var(--mint);    color: var(--ink); }
.btn-ink     { background: var(--ink);     color: var(--bg); }
.btn-outline { background: transparent;    color: var(--ink); }
.btn-sm { padding: 10px 18px; font-size: 13px; }
.btn-lg { padding: 18px 32px; font-size: 17px; }

.card {
  background: var(--card); border: 2px solid var(--ink);
  border-radius: 24px; box-shadow: var(--shadow);
  padding: 28px;
  transition: transform .2s ease-out, box-shadow .2s ease-out;
}
.card-hover:hover { transform: translate(-2px, -3px); box-shadow: 8px 9px 0 var(--ink); }
.card-soft { background: var(--card); border: 2px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow-sm); padding: 22px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border: 2px solid var(--ink);
  border-radius: 999px; background: white;
  font-weight: 700; font-size: 13px; box-shadow: var(--shadow-sm);
}
.chip-flat { box-shadow: none; padding: 5px 10px; font-size: 12px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 16px;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--coral); }

.section-title { font-size: clamp(40px, 5.5vw, 64px); letter-spacing: -0.025em; }
.section-sub { font-size: 18px; color: var(--ink-soft); max-width: 640px; line-height: 1.55; }
.text-teal { color: var(--teal-deep); }
.text-coral { color: var(--coral); }
.text-green { color: #2F855A; }
.text-red { color: var(--coral-deep); }

/* HyperCore Live Strip */
.hyper-strip {
  background: linear-gradient(90deg, #00382a 0%, #003c2c 50%, #00382a 100%);
  color: var(--hyper-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--ink);
  padding: 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  overflow: hidden;
  position: relative;
}
.hyper-strip .pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--hyper);
  box-shadow: 0 0 8px var(--hyper), 0 0 0 0 var(--hyper);
  animation: hyperPulse 1.4s ease-out infinite;
  display: inline-block;
}
@keyframes hyperPulse {
  0% { box-shadow: 0 0 8px var(--hyper), 0 0 0 0 rgba(5,196,138,.7); }
  70% { box-shadow: 0 0 8px var(--hyper), 0 0 0 8px rgba(5,196,138,0); }
  100% { box-shadow: 0 0 8px var(--hyper), 0 0 0 0 rgba(5,196,138,0); }
}
.hyper-strip .sep { opacity: 0.45; }
.hyper-strip .hl { color: #fff; font-weight: 700; }
@media (max-width: 760px) {
  .hyper-strip { font-size: 10px; gap: 10px; padding: 5px 12px; }
  .hyper-strip .hide-sm { display: none; }
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 2px solid var(--ink); }
.site-header .inner {
  max-width: 1480px; margin: 0 auto; padding: 0 28px;
  height: 76px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.brand .mark { width: 38px; height: 38px; border: 2px solid var(--ink); border-radius: 12px; background: var(--teal); display: inline-flex; align-items: center; justify-content: center; box-shadow: 2px 2px 0 var(--ink); }
.brand strong { color: var(--ink); }
.brand em { color: var(--coral); font-style: normal; }

.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-block; padding: 10px 13px; border-radius: 999px;
  font-weight: 600; font-size: 14px; color: var(--ink);
  transition: background .12s;
}
.nav-links a:hover { background: white; }
.nav-links a.active { background: var(--ink); color: white; }

.nav-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink); border-radius: 12px; background: white;
  color: var(--ink); box-shadow: 2px 2px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.icon-btn:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }

.menu-toggle { display: none; }
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; align-items: stretch; position: absolute; top: 76px; left: 0; right: 0; background: var(--bg); padding: 16px; gap: 6px; border-bottom: 2px solid var(--ink); }
  .menu-toggle { display: inline-flex; }
}

/* Footer */
.site-footer { background: var(--ink); color: var(--bg); padding: 64px 0 28px; margin-top: 80px; }
.site-footer .grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 48px; margin-bottom: 48px; }
.site-footer .col-title { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(253,245,240,0.5); margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer ul li { margin-bottom: 10px; }
.site-footer ul a { color: var(--bg); opacity: 0.85; font-size: 14px; }
.site-footer ul a:hover { color: var(--teal); opacity: 1; }
.site-footer .bottom { padding-top: 24px; border-top: 1px solid rgba(253,245,240,0.15); display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; font-size: 12px; color: rgba(253,245,240,0.55); }
.site-footer .brand { color: var(--bg); }
.site-footer .brand strong { color: var(--bg); }
.site-footer .brand .mark { background: var(--teal); }
.site-footer .brand em { color: var(--coral); }
@media (max-width: 760px) { .site-footer .grid { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 480px) { .site-footer .grid { grid-template-columns: 1fr; } }

/* Reveal */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Backgrounds */
.bg-mint { background: var(--mint); }
.bg-lavender { background: var(--lavender); }
.bg-peach { background: var(--peach); }
.bg-yellow { background: var(--yellow); }
.bg-sky { background: var(--sky); }
.bg-pink { background: var(--pink); }
.bordered-section { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }

/* Status dots */
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 5px; margin-right: 6px; }
.status-dot.live { background: #2F855A; box-shadow: 0 0 0 0 rgba(47,133,90,0.6); animation: pulse 1.6s infinite; }
.status-dot.wait { background: #D69E2E; }
.status-dot.pause { background: #A0AEC0; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47,133,90,0.6); }
  70% { box-shadow: 0 0 0 8px rgba(47,133,90,0); }
  100% { box-shadow: 0 0 0 0 rgba(47,133,90,0); }
}

/* Idle creature breathing */
@keyframes breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.015); }
}
.creature-idle { animation: breathe 2.6s ease-in-out infinite; transition: transform .25s ease-out; will-change: transform; }
.creature-tilt { transform: var(--tilt, none); animation: none; }
@keyframes wobble {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(1.5deg); }
}
.creature-wobble { animation: wobble 2.2s ease-in-out infinite; transform-origin: 50% 80%; }

/* Spinner */
@keyframes hyp-spin { to { transform: rotate(360deg); } }
.hyp-spinner { width: 18px; height: 18px; border: 3px solid rgba(26,32,44,0.18); border-top-color: var(--ink); border-radius: 50%; display: inline-block; animation: hyp-spin .8s linear infinite; }
.hyp-spinner.lg { width: 32px; height: 32px; border-width: 4px; }

/* Success pulse (e.g. trade exec) */
@keyframes successPulse {
  0% { box-shadow: 0 0 0 0 rgba(47,133,90,.55), var(--shadow-sm); }
  70% { box-shadow: 0 0 0 16px rgba(47,133,90,0), var(--shadow-sm); }
  100% { box-shadow: 0 0 0 0 rgba(47,133,90,0), var(--shadow-sm); }
}
.success-pulse { animation: successPulse 1.2s ease-out 1; }

/* Reveal fade-up */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .16s; }
.reveal.delay-3 { transition-delay: .24s; }
.reveal.delay-4 { transition-delay: .32s; }
.reveal.delay-5 { transition-delay: .4s; }
.reveal.delay-6 { transition-delay: .48s; }

/* Skeleton loaders */
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
.skel { background: linear-gradient(90deg, #EDF2F7 0%, #F7FAFC 50%, #EDF2F7 100%); background-size: 800px 100%; animation: shimmer 1.4s linear infinite; border-radius: 10px; }
.skel-card { background: white; border: 2px solid var(--ink); border-radius: 24px; box-shadow: var(--shadow-sm); padding: 22px; }

/* Particle field bg (homepage) */
.particle-field { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.particle-field canvas { display: block; width: 100%; height: 100%; }

/* Glassmorphism (modal upgrade) */
.hyp-modal-backdrop { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); background: rgba(26,32,44,0.32); }

/* Hero gradient overlay */
.hero-gradient { position: relative; }
.hero-gradient::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 50% at 25% 30%, rgba(178,245,234,.45), transparent 60%),
              radial-gradient(40% 35% at 80% 70%, rgba(255,230,109,.35), transparent 60%);
}
.hero-gradient > *:not(.particle-field) { position: relative; z-index: 1; }

/* Modal */
.hyp-modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; }
.hyp-modal.open .hyp-modal-backdrop { opacity: 1; }
.hyp-modal.open .hyp-modal-card { transform: translateY(0); opacity: 1; }
.hyp-modal-backdrop { position: absolute; inset: 0; background: rgba(26,32,44,0.45); opacity: 0; transition: opacity .2s ease; }
.hyp-modal-card {
  position: relative; width: 100%; max-width: 460px;
  background: var(--bg); border: 2px solid var(--ink); border-radius: 24px;
  padding: 32px; box-shadow: var(--shadow);
  transform: translateY(20px); opacity: 0;
  transition: transform .25s cubic-bezier(.17,.67,.42,1.27), opacity .25s ease;
}
.hyp-modal-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--ink); background: white; font-size: 22px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; box-shadow: 2px 2px 0 var(--ink); }

/* Toast */
.hyp-toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.hyp-toast {
  padding: 12px 18px; border: 2px solid var(--ink); border-radius: 14px;
  background: white; box-shadow: var(--shadow-sm);
  font-size: 14px; font-weight: 600;
  transform: translateX(120%); opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  pointer-events: auto;
}
.hyp-toast.in { transform: translateX(0); opacity: 1; }

/* Sparkline */
.sparkline { height: 36px; width: 100%; }

/* Mobile polish */
html, body { overflow-x: hidden; max-width: 100%; }
img, canvas, svg, video { max-width: 100%; }

@media (max-width: 760px) {
  .section { padding: 56px 0; }
  .section-tight { padding: 44px 0; }
  .container, .container-wide { padding: 0 18px; }
  .card { padding: 22px; border-radius: 18px; box-shadow: 4px 4px 0 var(--ink); }
  .card-soft { padding: 18px; border-radius: 16px; }
  .btn { padding: 13px 20px; min-height: 44px; font-size: 14px; }
  .btn-sm { min-height: 40px; padding: 9px 16px; }
  .btn-lg { padding: 16px 24px; font-size: 16px; min-height: 52px; }
  .icon-btn { width: 44px; height: 44px; }
  .section-title { font-size: clamp(28px, 7vw, 40px) !important; }
  h1 { font-size: clamp(34px, 9vw, 52px) !important; line-height: 1.05 !important; }
  h2 { font-size: clamp(26px, 6vw, 36px) !important; }
  h3 { font-size: clamp(18px, 4.5vw, 22px) !important; }
  p, .section-sub { font-size: 15px; }
  .hyp-modal-card { padding: 24px; border-radius: 18px; }
  .nav-links a { padding: 14px 16px; min-height: 44px; display: flex; align-items: center; font-size: 16px; }
  .site-footer { padding: 48px 0 24px; }
  .site-footer .grid { gap: 32px; margin-bottom: 32px; }
  .eyebrow { font-size: 11px; }
  .chip { font-size: 12px; padding: 5px 12px; }
  /* Mobile hero strip becomes marquee */
  .hyper-strip-mob-marquee { white-space: nowrap; overflow: hidden; padding: 5px 0; }
  .hyper-strip-mob-marquee > div { display: inline-flex; animation: hyperMarquee 22s linear infinite; }
  @keyframes hyperMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
  /* Responsive grid auto-stacks */
  .resp-stack { grid-template-columns: 1fr !important; gap: 20px !important; }
  .resp-2col { grid-template-columns: 1fr 1fr !important; }
  /* CTA buttons full width */
  .btn-full-mob { width: 100%; }
  /* Tables: horizontal scroll wrapper */
  .table-scroll-mob { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Dashboard / leaderboard tables hide secondary cols */
  table.responsive-trades th.opt, table.responsive-trades td.opt { display: none; }
}

@media (max-width: 480px) {
  .container, .container-wide { padding: 0 14px; }
  .section { padding: 44px 0; }
  .card { padding: 18px; border-radius: 16px; }
  .btn { font-size: 13.5px; padding: 12px 18px; }
  .btn-lg { font-size: 15px; padding: 14px 20px; }
  h1 { font-size: clamp(30px, 9vw, 44px) !important; }
  body { font-size: 15px; }
  .nav-right { gap: 6px; }
  .icon-btn { width: 40px; height: 40px; }
  .brand { font-size: 18px; }
  .brand .mark { width: 32px; height: 32px; }
  .site-header .inner { padding: 0 14px; height: 64px; }
  .hyp-toast-wrap { bottom: 14px; right: 14px; left: 14px; }
  .hyp-toast { padding: 10px 14px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
