/* Reusable pieces: logo, buttons, eyebrow, payment card, wallet, dialog sheet. */

/* Logo: the original artwork used as a mask, so it can take any brand colour */
ginga-logo {
  --logo-mark: var(--purple);
  --logo-word: var(--paper);
  --logo-h: 30px;
  display: inline-flex;
  align-items: center;
  gap: calc(var(--logo-h) * .2);
  height: var(--logo-h);
  vertical-align: middle;
}
.logo__mark, .logo__word {
  display: block;
  height: 100%;
  -webkit-mask: var(--mask) center / contain no-repeat;
  mask: var(--mask) center / contain no-repeat;
}
.logo__mark { --mask: var(--ginga-mark); aspect-ratio: 372 / 365; background: var(--logo-mark); }
.logo__word { --mask: var(--ginga-word); aspect-ratio: 879 / 328; height: 88%; margin-top: 3%; background: var(--logo-word); }

/* Eyebrow */
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--purple);
}
.eyebrow--paper { color: var(--paper); }
.eyebrow--lime { color: var(--lime); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font: 600 14px/1 var(--font);
  letter-spacing: -.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .3s var(--ease), background-color .25s, color .25s, box-shadow .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--lg { min-height: 60px; padding: 0 34px; font-size: 17px; }
.btn--lime { background: var(--lime); color: var(--black); }
.btn--lime:hover { box-shadow: 0 12px 34px -10px rgba(198, 255, 52, .55); }
.btn--paper { background: var(--paper); color: var(--black); }
.btn--paper:hover { background: var(--lime); }
.btn--black { background: var(--black); color: var(--paper); }
.btn--black:hover { background: var(--purple); }
.btn--ghost { background: rgba(240, 240, 240, .1); color: var(--paper); }
.btn--ghost:hover { background: var(--lime); color: var(--black); }

/* Payment card: sized entirely from its own width */
ginga-card {
  display: block;
  aspect-ratio: 1.586;
  container-type: inline-size;
  border-radius: 5.2cqw;
  color: var(--paper);
}
.gcard {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 5.200cqw;
  box-shadow: var(--shadow-object);
}
.gcard::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(240, 240, 240, .16), inset 0 1px 0 rgba(240, 240, 240, .22);
  pointer-events: none;
}
.gcard__arc {
  position: absolute;
  right: -24cqw;
  bottom: -46cqw;
  width: 92cqw;
  height: 92cqw;
  border-radius: 50%;
  border: .3cqw solid currentColor;
  opacity: .22;
}
.gcard__arc::before {
  content: "";
  position: absolute;
  inset: -7cqw;
  border-radius: 50%;
  border: .3cqw solid currentColor;
}
.gcard ginga-logo { position: absolute; top: 6.800cqw; left: 6.800cqw; --logo-h: 9.400cqw; }
.gcard__chip {
  position: absolute;
  top: 7.400cqw;
  right: 7cqw;
  width: 12.500cqw;
  height: 9.400cqw;
  border-radius: 1.800cqw;
  background:
    linear-gradient(90deg, transparent 32%, rgba(0, 0, 0, .28) 32% 33.500%, transparent 33.500% 66%, rgba(0, 0, 0, .28) 66% 67.500%, transparent 67.500%),
    linear-gradient(transparent 48%, rgba(0, 0, 0, .28) 48% 52%, transparent 52%),
    linear-gradient(135deg, var(--paper), rgba(240, 240, 240, .62));
}
.gcard__waves { position: absolute; left: 7cqw; top: 29cqw; width: 7cqw; height: 9cqw; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.gcard__foot {
  position: absolute;
  left: 7cqw;
  right: 7cqw;
  bottom: 6.400cqw;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 2.900cqw;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.gcard__foot span:first-child { opacity: .78; }

.gcard--purple {
  background:
    radial-gradient(90% 120% at 12% 0%, rgba(240, 240, 240, .2), transparent 58%),
    linear-gradient(150deg, transparent 30%, rgba(0, 0, 0, .4) 100%),
    var(--purple);
}
.gcard--purple ginga-logo { --logo-mark: var(--paper); }

.gcard--black {
  background: radial-gradient(90% 130% at 100% 110%, rgba(126, 59, 237, .5), transparent 62%), var(--black);
}
.gcard--black .gcard__arc { color: var(--purple); opacity: .75; }
.gcard--black .gcard__waves { stroke: var(--purple); }
.gcard--black .gcard__foot span:first-child { color: var(--purple); opacity: 1; filter: brightness(1.35); }

.gcard--lime {
  color: var(--black);
  background: radial-gradient(100% 130% at 10% 0%, rgba(240, 240, 240, .5), transparent 55%), var(--lime);
}
.gcard--lime::after { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), inset 0 1px 0 rgba(240, 240, 240, .6); }
.gcard--lime ginga-logo { --logo-mark: var(--black); --logo-word: var(--black); }
.gcard--lime .gcard__chip {
  background:
    linear-gradient(90deg, transparent 32%, rgba(198, 255, 52, .5) 32% 33.500%, transparent 33.500% 66%, rgba(198, 255, 52, .5) 66% 67.500%, transparent 67.500%),
    linear-gradient(transparent 48%, rgba(198, 255, 52, .5) 48% 52%, transparent 52%),
    var(--black);
}

/* Wallet preview: phone body sized from its own width */
ginga-wallet {
  display: block;
  aspect-ratio: 1 / 2.04;
  container-type: inline-size;
}
.wallet {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 2.800cqw;
  border-radius: 15cqw;
  background: var(--black);
  box-shadow: var(--shadow-object), inset 0 0 0 .6cqw rgba(240, 240, 240, .22), inset 0 0 0 1.400cqw var(--black);
}
.wallet__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 16cqw 6.500cqw 5cqw;
  border-radius: 12.400cqw;
  background: radial-gradient(120% 60% at 80% 0%, rgba(126, 59, 237, .62), transparent 70%), var(--black);
  color: var(--paper);
}
.wallet__island {
  position: absolute;
  top: 4.200cqw;
  left: 50%;
  width: 28cqw;
  height: 7.500cqw;
  border-radius: 99cqw;
  background: var(--black);
  transform: translateX(-50%);
}
.wallet__top { display: flex; align-items: center; justify-content: space-between; }
.wallet__top ginga-logo { --logo-h: 7.500cqw; }
.wallet__tag {
  padding: 1.200cqw 3cqw;
  border-radius: 99cqw;
  background: rgba(240, 240, 240, .12);
  font-size: 3.400cqw;
  font-weight: 600;
}
.wallet__label { margin-top: 8cqw; font-size: 4.200cqw; color: var(--paper-muted); }
.wallet__amount { margin-top: .6cqw; font-size: 12.400cqw; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; }
.wallet__actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.800cqw; margin-top: 7cqw; }
.wallet__actions[hidden] { display: none; }
.wallet__action { display: grid; justify-items: center; gap: 1.600cqw; font-size: 3.500cqw; font-weight: 500; }
.wallet__action i {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1.15;
  border-radius: 6cqw;
  background: rgba(240, 240, 240, .1);
}
.wallet__action svg { width: 6.500cqw; height: 6.500cqw; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wallet__action.is-active i { background: var(--lime); color: var(--black); }
.wallet__title { margin-top: 8cqw; font-size: 4.600cqw; font-weight: 600; }
.wallet__rows { display: grid; gap: 1cqw; margin-top: 2.500cqw; }
.wallet__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 2cqw;
  padding: 2.400cqw 0;
  border-bottom: 1px solid var(--paper-line);
  font-size: 3.900cqw;
}
.wallet__row:last-child { border-bottom: 0; }
.wallet__row small { display: block; font-size: 3.200cqw; color: var(--paper-muted); }
.wallet__row b { font-weight: 600; }
.wallet__row b.is-in { color: var(--lime); }
.wallet__note { margin-top: auto; font-size: max(10px, 3cqw); text-align: center; white-space: nowrap; color: var(--paper-muted); }

/* Screen changes: content lifts in while the phone and its status stay put */
.wallet__screen > :not(.wallet__island, .wallet__top, .wallet__note) { transition: opacity .28s, transform .5s var(--ease); }
.wallet__screen.is-swapping > :not(.wallet__island, .wallet__top, .wallet__note) { opacity: 0; transform: translateY(3cqw); }
.wallet__action i { transition: background-color .3s, color .3s; }

/* Try-it keypad: shares the wallet's phone body */
ginga-keypad {
  display: block;
  aspect-ratio: 1 / 2.04;
  container-type: inline-size;
}
.keypad { align-items: stretch; text-align: center; }
.keypad button { font-family: var(--font); color: inherit; cursor: pointer; }
.keypad button:focus-visible { outline: 2px solid var(--lime); outline-offset: 1px; }
.keypad__mode { display: grid; grid-template-columns: 1fr 1fr; gap: 1cqw; padding: 1cqw; border-radius: 99cqw; background: rgba(240, 240, 240, .1); }
.keypad__mode button {
  min-height: max(44px, 10cqw);
  border: 0;
  border-radius: 99cqw;
  background: transparent;
  font-size: 3.900cqw;
  font-weight: 600;
  transition: background-color .2s, color .2s;
}
.keypad__mode button[aria-pressed="true"] { background: var(--paper); color: var(--black); }
.keypad__to { margin-top: 6cqw; font-size: 4.200cqw; color: var(--paper-muted); }
.keypad__amount { margin-top: 1cqw; font-size: 21cqw; font-weight: 700; line-height: 1.1; letter-spacing: -.05em; white-space: nowrap; }
.keypad__amount.is-long { font-size: 15cqw; line-height: 1.53; }
.keypad__keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1cqw; margin-top: auto; }
.keypad__keys button {
  min-height: max(44px, 15cqw);
  border: 0;
  border-radius: 6cqw;
  background: transparent;
  font-size: 7cqw;
  font-weight: 600;
  transition: background-color .15s;
}
.keypad__keys button:hover { background: rgba(240, 240, 240, .1); }
.keypad__keys button:active { background: rgba(240, 240, 240, .2); }
.keypad__send {
  min-height: max(44px, 15cqw);
  margin-top: 3cqw;
  border: 0;
  border-radius: 99cqw;
  background: var(--lime);
  color: var(--black) !important;
  font-size: 5.200cqw;
  font-weight: 700;
  transition: opacity .2s;
}
.keypad__send:disabled { opacity: .35; cursor: not-allowed; }
.keypad__note { min-height: 9cqw; margin-top: 3cqw; font-size: max(12px, 3.400cqw); line-height: 1.3; color: var(--paper-muted); }

/* Arrow affordance on main calls to action */
.btn--arrow::after { content: "\2192"; margin-left: 10px; transition: transform .3s var(--ease); }
.btn--arrow:hover::after { transform: translateX(3px); }

/* Dialog sheet */
.sheet {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: clamp(28px, 4vw, 44px);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--black);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .6);
  overflow: auto;
}
.sheet[open] { animation: sheet-in .45s var(--ease); }
.sheet::backdrop { background: rgba(0, 0, 0, .66); }
.sheet h2 { margin-top: 12px; font-size: clamp(30px, 4vw, 40px); font-weight: 700; line-height: 1.08; letter-spacing: -.035em; }
.sheet .lede { margin-top: 16px; color: var(--ink-muted); }
.sheet__close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .07);
  color: var(--black);
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.sheet__close:hover { background: var(--black); color: var(--paper); }
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
}
