/* ==========================================================================
   Quelmint — site chrome and shared components
   header · mobile menu · canvas · section heads · coin marks · market table ·
   chips · tabs · accordion · footer · toast · reveal
   ========================================================================== */

/* --- header: floats over the top canvas on every page -------------------- */
.header {
  position: absolute; z-index: 40;
  top: var(--inset); left: var(--inset); right: var(--inset);
}
.header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  min-height: 5.25rem;
}
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); }
.brand__mark { width: 2.35rem; height: 2.35rem; border-radius: .7rem; object-fit: cover; box-shadow: 0 0 0 1px rgb(74 222 128 / .35); }
.brand__word { font: 500 1.25rem/1.1 var(--f-display); letter-spacing: -.04em; }
.brand__word em { font-style: normal; color: var(--lime-deep); }
.brand--light { color: var(--paper); }
.brand--light .brand__word em { color: var(--lime); }

.nav { display: flex; align-items: center; gap: .25rem; }
.nav a {
  padding: .45rem .9rem; border-radius: var(--r-pill); border: 1px solid transparent;
  font: 400 var(--t-sm)/1.2 var(--f-display); color: var(--ink);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.nav a:hover { background: rgb(255 255 255 / .55); }
.nav a[aria-current="page"] { border-color: var(--ink); background: rgb(255 255 255 / .35); }
.nav a[aria-current="page"]::before {
  content: ""; display: inline-block; width: .35rem; height: .35rem; margin-right: .45rem;
  vertical-align: middle; border-radius: 50%; background: var(--ink); transform: translateY(-1px);
}
.nav__cta { display: none; }

.header__tools { display: flex; align-items: center; gap: .85rem 1.15rem; }
.header__login { font: 400 var(--t-sm)/1 var(--f-display); padding: .5rem .25rem; }
.header__login:hover { text-decoration: underline; text-underline-offset: 4px; }
.header__cta { min-height: 2.75rem; padding-inline: 1.4rem; font-size: var(--t-sm); }

.burger { display: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--paper); box-shadow: var(--shadow-card); position: relative; }
.burger span { position: absolute; left: 50%; width: 1.1rem; height: 2px; margin-left: -.55rem; background: var(--ink); border-radius: 2px; transition: transform var(--dur) var(--ease); }
.burger span:first-child { top: calc(50% - 4px); }
.burger span:last-child { top: calc(50% + 2px); width: .75rem; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { width: 1.1rem; transform: translateY(-3px) rotate(-45deg); }

@media (max-width: 960px) {
  .header__login, .header__cta { display: none; }
  .burger { display: block; }
  .nav {
    position: absolute; top: calc(100% + .25rem); left: var(--gutter); right: var(--gutter);
    flex-direction: column; align-items: stretch; gap: .15rem;
    padding: .75rem; border-radius: var(--r-lg);
    background: var(--paper); box-shadow: var(--shadow-float);
    opacity: 0; transform: translateY(-8px); visibility: hidden;
    /* stepped visibility so focus() works in the same tick the menu opens */
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s var(--dur);
  }
  .nav.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s 0s; }
  .nav a { padding: .85rem 1rem; font-size: var(--t-base); border-radius: var(--r-md); }
  .nav a[aria-current="page"] { background: var(--soft); border-color: transparent; }
  .nav__cta { display: block; margin-top: .4rem; text-align: center; background: var(--ink); color: var(--paper) !important; }
  .nav__cta:hover { background: #2A2536 !important; }
}

/* --- canvas: the inset mesh panel every page opens with ----------------- */
.canvas {
  position: relative;
  margin: var(--inset);
  border-radius: var(--r-xl);
  background: var(--mesh);
  overflow: hidden;
  padding-top: 5.75rem;   /* clears the floating header */
  isolation: isolate;
}
.canvas::after {           /* fine grain keeps the gradient from banding */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .35; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.pill-note {
  display: inline-block; max-width: 100%;
  padding: .45rem 1rem; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: rgb(255 255 255 / .5);
  font-size: var(--t-sm); color: var(--ink);
}
.pill-note::before { content: ""; display: inline-block; width: .4rem; height: .4rem; margin-right: .55rem; vertical-align: middle; border-radius: 50%; background: var(--ink); transform: translateY(-1px); }
.pill-note a { text-decoration: underline; text-underline-offset: 3px; }

/* page heads inside a canvas (inner pages) */
.phead { padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem) clamp(2.75rem, 2rem + 3vw, 4.25rem); text-align: center; }
.phead h1 { font-size: var(--t-2xl); margin-top: 1.15rem; }
.phead p.lede { max-width: 38rem; margin: 1.15rem auto 0; color: var(--ink-2); font-size: var(--t-md); line-height: 1.65; }
.phead .hero__ctas { margin-top: 1.75rem; }
.crumbs { display: flex; justify-content: center; gap: .5rem; font-size: var(--t-sm); color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--line-2); }

/* --- sections --------------------------------------------------------- */
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * .6); }
.shead { display: grid; gap: .85rem; justify-items: center; text-align: center; max-width: 46rem; margin: 0 auto clamp(2.25rem, 1.6rem + 2.2vw, 3.75rem); }
.shead h2 { font-size: var(--t-2xl); }
.shead p { color: var(--ink-2); font-size: var(--t-md); line-height: 1.65; max-width: 40rem; }
.shead--left { justify-items: start; text-align: left; margin-inline: 0; }
.tag {
  display: inline-block; padding: .3rem .8rem; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--paper);
  font: 400 var(--t-xs)/1.4 var(--f-display); color: var(--ink-2);
}

/* --- coin marks, change, sparkline ------------------------------------ */
.coin {
  flex: none; display: inline-grid; place-items: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  font: 600 .95rem/1 var(--f-display);
}
.coin--ink { background: var(--ink); color: var(--paper); }
.coin--peri { background: var(--peri); color: var(--ink); }
.coin--lilac { background: var(--lilac); color: var(--ink); }
.coin--mist { background: var(--mist); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.coin--lg { width: 3rem; height: 3rem; font-size: 1.2rem; }
.coin--xl { width: 4rem; height: 4rem; font-size: 1.6rem; }

.chg { display: inline-block; padding: .2rem .5rem; border-radius: var(--r-pill); font: 700 var(--t-sm)/1.2 var(--f-mono); white-space: nowrap; }
.chg--up { color: var(--up); background: var(--up-soft); }
.chg--down { color: var(--down); background: var(--down-soft); }

.spark { width: 100%; height: 2rem; overflow: visible; }
.spark path { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.spark--up path { stroke: var(--up); }
.spark--down path { stroke: var(--down); }

/* --- market table ----------------------------------------------------- */
.mtable-wrap { position: relative; overflow-x: auto; border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--line); }
.mt { min-width: 640px; font-size: var(--t-sm); }
.mt th, .mt td { padding: .95rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.mt tbody tr:last-child > * { border-bottom: 0; }
.mt thead th { font: 700 var(--t-xs)/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: var(--soft); }
.mt .num { text-align: right; }
.mt thead th.num { text-align: right; }
.mt tbody tr { transition: background-color var(--dur) var(--ease); }
.mt tbody tr:hover { background: var(--soft); }
.mt__spark { width: 120px; }
.mt__spark .spark { width: 110px; }
.mt__go { text-align: right; width: 1%; }
.mt__rank { color: var(--ink-3); width: 1%; }
.mt__star { width: 1%; padding-right: 0 !important; }
.mt__price { font-weight: 700; }

.asset { display: inline-flex; align-items: center; gap: .75rem; font-weight: 500; }
.asset__name { font: 500 var(--t-base)/1.2 var(--f-display); letter-spacing: -.02em; }
.asset__sym { font: 400 var(--t-xs)/1 var(--f-mono); color: var(--ink-3); }
.asset:hover .asset__name { text-decoration: underline; text-underline-offset: 3px; }

.star { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 50%; color: var(--ink-3); }
.star svg { width: 1.1rem; height: 1.1rem; }
.star:hover { background: var(--soft-2); color: var(--ink); }
.star[aria-pressed="true"] { color: var(--orchid); }
.star[aria-pressed="true"] svg { fill: currentColor; }

/* price tick flash (home table, hero cards) */
.tick-up { animation: tickUp 900ms var(--ease); }
.tick-down { animation: tickDown 900ms var(--ease); }
@keyframes tickUp { from { background: var(--up-soft); } }
@keyframes tickDown { from { background: var(--down-soft); } }

/* --- chips + tabs ----------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  min-height: 2.5rem; padding: .5rem 1rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--paper);
  font: 400 var(--t-sm)/1 var(--f-display);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.seg { display: inline-flex; padding: .3rem; gap: .2rem; border-radius: var(--r-pill); background: var(--soft); }
.seg > button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-card); }
.seg > button { min-height: 2.25rem; padding: .4rem 1rem; border-radius: var(--r-pill); font: 400 var(--t-sm)/1 var(--f-display); color: var(--ink-2); }
.seg [role="tab"] { min-height: 2.25rem; padding: .4rem 1rem; border-radius: var(--r-pill); font: 400 var(--t-sm)/1 var(--f-display); color: var(--ink-2); }
.seg [role="tab"]:hover { color: var(--ink); }
.seg [role="tab"][aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-card); }

/* --- accordion -------------------------------------------------------- */
.acc { border-top: 1px solid var(--line); }
.acc__item { border-bottom: 1px solid var(--line); }
.acc__btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.25rem 0; text-align: left; font: 500 var(--t-md)/1.35 var(--f-display); letter-spacing: -.02em;
}
.acc__btn::after {
  content: ""; flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--soft) no-repeat center / 1rem
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E0C15' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.acc__btn[aria-expanded="true"]::after { transform: rotate(45deg); background-color: var(--mist); }
.acc__panel { padding: 0 3rem 1.4rem 0; color: var(--ink-2); }

/* --- footer ----------------------------------------------------------- */
.footer { background: var(--ink); color: #C9D4C4; margin: var(--inset); border-radius: var(--r-xl); padding-block: clamp(3rem, 2rem + 4vw, 5rem) 1.5rem; position: relative; overflow: hidden; isolation: isolate; }
.footer::before {
  content: ""; position: absolute; z-index: -1; right: -10%; bottom: -60%; width: 60%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(74 222 128 / .28), rgb(74 222 128 / 0));
}
.footer a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 3px; }
.footer__top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr); gap: clamp(2rem, 1rem + 4vw, 5rem); }
.footer__sub { margin: 1.25rem 0 1.25rem; max-width: 26rem; }
.subscribe { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; max-width: 28rem; }
.subscribe input { min-height: 3rem; padding: .75rem 1rem; border-radius: var(--r-md); border: 1px solid #2A3226; background: #161814; color: var(--paper); }
.subscribe input::placeholder { color: #7A8574; }
.subscribe input:focus { outline: none; border-color: var(--lime); }
.subscribe .form-note { grid-column: 1 / -1; font-size: var(--t-sm); min-height: 1.3em; }
.footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.footer__h { color: #7A8574; margin-bottom: 1rem; }
.footer__cols li + li { margin-top: .6rem; }
.footer address { font-style: normal; line-height: 1.9; }
.footer__risk { margin-top: clamp(2.5rem, 2rem + 2vw, 4rem); padding-top: 1.5rem; border-top: 1px solid #2A3226; font-size: var(--t-sm); color: #8A9484; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; margin-top: 1.25rem; font-size: var(--t-sm); color: #8A9484; }
.footer__bottom a { text-decoration: underline; text-underline-offset: 3px; }
.builtby {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .45rem .75rem;
  margin: .75rem var(--inset) var(--inset); padding: 1rem 1.35rem;
  border-radius: var(--r-lg); background: var(--soft); border: 1px solid var(--line);
  font: 500 var(--t-sm)/1.4 var(--f-display); color: var(--ink-2); text-align: center;
}
.builtby a { color: var(--lime-ink); text-decoration: underline; text-underline-offset: 3px; }
.builtby a:hover { color: var(--ink); }

/* --- floating WhatsApp ----------------------------------------------- */
.wa {
  position: fixed; z-index: 80;
  right: max(1rem, var(--inset));
  bottom: max(1rem, var(--inset));
  display: grid; justify-items: end; gap: .65rem;
}
.wa__panel {
  width: min(17.5rem, calc(100vw - 2rem));
  padding: .85rem;
  border-radius: var(--r-lg);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  display: grid; gap: .45rem;
}
.wa__panel[hidden] { display: none !important; }
.wa__label {
  font: 500 var(--t-xs)/1.3 var(--f-display);
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-3); padding: .15rem .35rem .35rem;
}
.wa__link {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .8rem; border-radius: var(--r-md);
  background: var(--soft); color: var(--ink);
  font: 500 var(--t-sm)/1.25 var(--f-display);
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.wa__link:hover { background: #E8F8EE; transform: translateY(-1px); }
.wa__link small { display: block; font: 400 var(--t-xs)/1.3 var(--f-body); color: var(--ink-3); margin-top: .15rem; }
.wa__ico {
  flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  display: grid; place-items: center; background: #25D366; color: #fff;
}
.wa__ico svg { width: 1.15rem; height: 1.15rem; }
.wa__fab {
  width: 3.5rem; height: 3.5rem; border-radius: 50%;
  display: grid; place-items: center;
  background: #25D366; color: #fff;
  box-shadow: 0 10px 28px -8px rgb(37 211 102 / .65);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.wa__fab:hover { transform: scale(1.05); box-shadow: 0 14px 32px -8px rgb(37 211 102 / .75); }
.wa__fab:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.wa__fab svg { width: 1.65rem; height: 1.65rem; }
.wa.is-open .wa__fab { background: var(--ink); }
@media (max-width: 520px) {
  .wa { right: .85rem; bottom: .85rem; }
}

@media (max-width: 860px) {
  .footer__top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__cols > :last-child { grid-column: 1 / -1; }
  .subscribe { grid-template-columns: minmax(0, 1fr); }
}

/* --- toast ------------------------------------------------------------ */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  max-width: calc(100vw - 2rem); padding: .9rem 1.25rem; border-radius: var(--r-md);
  background: var(--ink); color: var(--paper); box-shadow: var(--shadow-float); font-size: var(--t-sm);
  animation: toastIn 260ms var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

.form-note { font-size: var(--t-sm); }
.form-note.is-ok { color: var(--up); }
.form-note.is-err { color: var(--down); }
.footer .form-note.is-ok { color: #8FE0BD; }
.footer .form-note.is-err { color: #FF9EB1; }

/* --- reveal ----------------------------------------------------------- */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* Grids with no explicit columns size their implicit track to content min-width
   and overflow their parent — pin every stacked grid to the available width. */
.swapbox, .ticket, .calc__form, .calc__out, .cform, .step__ui--stack, .wcard, .field,
.shead, .hero__copy, .cta__inner, .nf__inner, .secsplit__copy, .swap__copy, .channels, .aview__side {
  grid-template-columns: minmax(0, 1fr);
}
