/* ============================================================
   RONIN SAIGON FAUCET
   Developer console for the Ronin testnet.
   ============================================================ */

:root {
  --ink:        #070B12;
  --ink-2:      #0D131D;
  --ink-3:      #131B27;
  --ink-edge:   #1B2636;
  --ink-edge-2: #243245;

  --bone:       #EAF2FB;
  --bone-soft:  #B5C7DF;
  --bone-dim:   #7C92AE;
  --bone-faint: #44566F;

  --accent:     #1273EA;
  --accent-2:   #3DA5FF;
  --accent-deep:#0A4FAA;
  --accent-soft:rgba(18,115,234,0.12);

  --moss:       #22C58B;
  --gold:       #FFC85B;
  --crimson:    #FF6464;

  --sans:    "DM Sans", system-ui, sans-serif;
  --display: "DM Sans", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  --gut: clamp(20px, 4vw, 56px);
  --grain-opacity: 0.08;
  --vignette:
    radial-gradient(120% 80% at 80% -10%, rgba(18,115,234,0.16), transparent 55%),
    radial-gradient(100% 70% at -10% 100%, rgba(61,165,255,0.08), transparent 55%);

  --shadow-card:
    0 1px 0 rgba(255,255,255,0.03) inset,
    0 24px 60px -20px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Sticky-footer layout — body is a flex column that fills the viewport so the
   footer sits at the bottom of the screen even when content is short. main
   grows to fill remaining space; footer doesn't shrink. */
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 63px, rgba(255,255,255,0.018) 63px 64px),
    repeating-linear-gradient(90deg, transparent 0 63px, rgba(255,255,255,0.018) 63px 64px);
}

::selection { background: var(--accent); color: white; }

a { color: inherit; text-decoration: none; }

/* ---- Atmospheric layers ------------------------------------ */

.vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: var(--vignette);
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  mix-blend-mode: overlay; opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.55 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
}

.chevron-watermark {
  position: absolute;
  right: -40px;
  bottom: -80px;
  width: 380px;
  height: auto;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

/* ---- Reveal animations ------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.95s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.95s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal[data-stagger="1"] { transition-delay: 0.06s; }
.reveal[data-stagger="2"] { transition-delay: 0.12s; }
.reveal[data-stagger="3"] { transition-delay: 0.18s; }
.reveal[data-stagger="4"] { transition-delay: 0.24s; }
.reveal[data-stagger="5"] { transition-delay: 0.30s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---- Topbar ------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--gut);
  background: rgba(7,11,18,0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink-edge);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 26px;
  height: auto;
  flex-shrink: 0;
  display: block;
  /* Lift the neon glow slightly so it reads on the dark topbar */
  filter: drop-shadow(0 0 6px rgba(61, 165, 255, 0.35));
}

.topbar-wordmark {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--bone);
}

.testnet-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  border: 1px solid var(--ink-edge-2);
  padding: 3px 8px;
  border-radius: 2px;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--bone-soft);
  text-transform: uppercase;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--moss);
  box-shadow: 0 0 0 0 rgba(34, 197, 139, 0.7);
  animation: pulse 2.4s ease-out infinite;
}
.status-dot.warn { background: var(--gold); box-shadow-color: rgba(255,200,91,0.7); animation-name: pulseWarn; }
.status-dot.empty { background: var(--crimson); animation-name: pulseEmpty; }
.status-dot.live { background: var(--accent-2); animation-name: pulseAccent; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,139,0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(34,197,139,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,139,0); }
}
@keyframes pulseWarn {
  0%   { box-shadow: 0 0 0 0 rgba(255,200,91,0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(255,200,91,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,200,91,0); }
}
@keyframes pulseEmpty {
  0%   { box-shadow: 0 0 0 0 rgba(255,100,100,0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(255,100,100,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,100,100,0); }
}
@keyframes pulseAccent {
  0%   { box-shadow: 0 0 0 0 rgba(61,165,255,0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(61,165,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,165,255,0); }
}

.explorer-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
  text-transform: uppercase;
  transition: color 0.18s;
}
.explorer-link:hover { color: var(--accent-2); }

/* ---- Shell layout ------------------------------------------ */

main {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 80px) var(--gut) 64px;
  flex: 1 0 auto;
}

section + section {
  margin-top: clamp(56px, 6vw, 88px);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
}

/* ---- Hero -------------------------------------------------- */

.hero {
  position: relative;
  padding-bottom: 32px;
}

.hero-copy { position: relative; z-index: 2; }

.hero-eyebrow {
  margin-bottom: 24px;
  color: var(--accent-2);
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(40px, 6.5vw, 84px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 0 0 28px;
  color: var(--bone);
}

.hero-em {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sublede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--bone-soft);
  max-width: 580px;
  margin: 0 0 28px;
}

.hero-sublede strong {
  color: var(--bone);
  font-weight: 500;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--bone-dim);
  text-transform: uppercase;
}

.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta-dot { color: var(--accent-2); }

/* Network specsheet — the differentiating card */

.specsheet {
  background: var(--ink-2);
  border: 1px solid var(--ink-edge);
  box-shadow: var(--shadow-card);
  padding: clamp(22px, 3vw, 28px);
  position: relative;
  z-index: 2;
}

.specsheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink-edge);
}

.specsheet-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

.specsheet-status {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--moss);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.spec-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--ink-edge);
}

.spec-row {
  display: grid;
  grid-template-columns: 96px 1fr 28px;
  gap: 16px;
  align-items: center;
  padding: 11px 0;
  background: var(--ink-2);
  transition: background 0.4s;
}

.spec-row.flash { background: var(--accent-soft); }

.spec-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

.spec-value {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--bone);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.spec-action {
  background: transparent;
  border: none;
  color: var(--bone-dim);
  cursor: pointer;
  padding: 4px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
  transition: color 0.18s, transform 0.18s;
}
.spec-action:hover { color: var(--accent-2); transform: translateY(-1px); }
.spec-action.copied { color: var(--moss); }

/* ---- Main grid (claim card + recent feed) ------------------ */

.main-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(20px, 3vw, 32px);
  align-items: start;
}

.card {
  background: var(--ink-2);
  border: 1px solid var(--ink-edge);
  box-shadow: var(--shadow-card);
  padding: clamp(22px, 3vw, 32px);
  position: relative;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink-edge);
}

.card-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

.card-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--bone-faint);
  text-transform: uppercase;
}

/* Claim card --------------------------------------------------*/

.token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 28px;
}

.token-select {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ink-3);
  border: 1px solid var(--ink-edge);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--bone);
  cursor: not-allowed;
  user-select: none;
  width: fit-content;
}

.token-mark {
  width: 24px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 4px rgba(61, 165, 255, 0.4));
}

.token-select-chev {
  color: var(--bone-faint);
  font-size: 10px;
}

.amount-readout {
  text-align: right;
  font-family: var(--mono);
}
.amount-readout-value {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--bone);
  line-height: 1;
}
.amount-readout-unit {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-top: 4px;
}

.input-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-dim);
  margin-bottom: 10px;
}

.input-wrap {
  position: relative;
  margin-bottom: 12px;
}

.address-input {
  width: 100%;
  height: 56px;
  background: var(--ink);
  border: 1px solid var(--ink-edge);
  padding: 0 48px 0 14px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--bone);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  border-radius: 0;
}
.address-input::placeholder { color: var(--bone-faint); }
.address-input:focus { border-color: var(--accent); }

.input-wrap[data-state="typing"] .address-input { border-color: var(--accent); }
.input-wrap[data-state="valid"]  .address-input { border-color: var(--moss); }
.input-wrap[data-state="invalid"] .address-input { border-color: var(--crimson); }

.input-indicator {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.input-indicator .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-edge-2);
}
.input-wrap[data-state="typing"] .input-indicator .dot,
.input-wrap[data-state="valid"]  .input-indicator .dot,
.input-wrap[data-state="invalid"] .input-indicator .dot {
  display: none;
}
.input-indicator .spinner,
.input-indicator .check,
.input-indicator .cross {
  display: none;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
}
.input-wrap[data-state="typing"] .input-indicator .spinner {
  display: inline-flex;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
}
.input-wrap[data-state="valid"]   .input-indicator .check { display: inline; color: var(--moss); }
.input-wrap[data-state="invalid"] .input-indicator .cross { display: inline; color: var(--crimson); }

@keyframes spin { to { transform: rotate(360deg); } }

.input-helper {
  font-size: 13px;
  color: var(--bone-dim);
  min-height: 20px;
  transition: color 0.2s;
}
.input-wrap[data-state="valid"]   + .input-helper { color: var(--moss); }
.input-wrap[data-state="invalid"] + .input-helper { color: var(--crimson); }

.quota-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 7px 12px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: opacity 0.25s, transform 0.25s;
}
.quota-chip[hidden] { display: none; }
.quota-chip.warn   { border-color: var(--gold);    color: var(--gold);    background: rgba(255,200,91,0.08); }
.quota-chip.empty  { border-color: var(--crimson); color: var(--crimson); background: rgba(255,100,100,0.08); }

.quota-chip .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
}

.submit-button {
  width: 100%;
  height: 56px;
  margin-top: 24px;
  background: var(--accent);
  border: none;
  color: white;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 0;
}
.submit-button:hover:not(:disabled) {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -8px rgba(18,115,234,0.55);
}
.submit-button:active:not(:disabled) { transform: translateY(0); }
.submit-button:disabled {
  background: var(--ink-edge);
  color: var(--bone-faint);
  cursor: not-allowed;
  box-shadow: none;
}

.submit-button .arrow { font-size: 15px; line-height: 1; }
.submit-button .dots { display: none; }
.submit-button.loading .label, .submit-button.loading .arrow { display: none; }
.submit-button.loading .dots { display: inline-flex; gap: 6px; }
.submit-button.loading .dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.85);
  animation: bounce 1.2s infinite ease-in-out both;
}
.submit-button.loading .dots span:nth-child(1) { animation-delay: -0.32s; }
.submit-button.loading .dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

.result-strip {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--ink-edge);
  background: var(--ink-3);
  font-family: var(--mono);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}
.result-strip[hidden] { display: none; }
.result-strip.success { border-color: var(--moss); background: rgba(34,197,139,0.06); }
.result-strip.error   { border-color: var(--crimson); background: rgba(255,100,100,0.06); }
.result-strip .label  { color: var(--bone-soft); }
.result-strip .hash {
  color: var(--bone);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-strip a { color: var(--accent-2); }
.result-strip a:hover { text-decoration: underline; }

.faucet-empty-banner {
  margin-top: 20px;
  padding: 14px 18px;
  border: 1px solid var(--crimson);
  background: rgba(255,100,100,0.08);
  color: var(--crimson);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.faucet-empty-banner[hidden] { display: none; }

/* ---- Footer ------------------------------------------------ */

footer {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  margin-top: auto;
  padding: 24px var(--gut);
  border-top: 1px solid var(--ink-edge);
  text-align: center;
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-dim);
}
.footer-links a { transition: color 0.18s; }
.footer-links a:hover { color: var(--accent-2); }
.footer-sep { color: var(--bone-faint); }

/* ---- Toast (success copy confirm) -------------------------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink-2);
  border: 1px solid var(--accent);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 12px 18px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  text-transform: uppercase;
}
.toast.in { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Responsive -------------------------------------------- */

@media (max-width: 980px) {
  .main-grid { grid-template-columns: 1fr; }
  .chevron-watermark { width: 280px; opacity: 0.05; }
}

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .testnet-badge { display: none; }
  .topbar-right { gap: 12px; }
  .explorer-link { font-size: 10px; }
  .token-row { grid-template-columns: 1fr; }
  .amount-readout { text-align: left; }
  .amount-readout-value { font-size: 28px; }
  .spec-row { grid-template-columns: 78px 1fr 24px; gap: 10px; }
}
