/* ==========================================================================
   Ucosystem design system v2 — BLACK + GOLD, square-bordered buttons,
   glass + gold glow, Three.js hero. Matches pay.u.cash / u.onl originals.
   Dark is the brand default; light toggle mirrors u.onl's light tokens.
   ========================================================================== */

:root {
  /* Dark (brand default) */
  --bg:        #000000;
  --bg-1:      #060606;
  --bg-2:      #0d0d0d;
  --bg-3:      #141414;
  --panel:     rgba(255,255,255,.035);
  --panel-2:   rgba(255,255,255,.06);
  --gold:      #cc9933;
  --gold-2:    #e6b347;   /* light  */
  --gold-3:    #b38829;   /* deep   */
  --gold-glow: rgba(204,153,51,.35);
  --line:      rgba(255,255,255,.09);
  --line-gold: rgba(204,153,51,.22);
  --text:      #ffffff;
  --text-2:    rgba(255,255,255,.74);
  --text-3:    rgba(255,255,255,.46);
  --positive:  #6fcf7a;
  --glow:      0 0 38px rgba(204,153,51,.20);
  --shadow:    0 24px 60px -24px rgba(0,0,0,.85);
  --radius:    0;          /* fully square — every bordered item */
  --radius-lg: 0;
  --ease:      cubic-bezier(.4,0,.2,1);
  --container: 1180px;
  --font:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-theme="light"] {
  --bg:        #ffffff;
  --bg-1:      #faf7f2;
  --bg-2:      #f4efe6;
  --bg-3:      #ece4d6;
  --panel:     rgba(0,0,0,.025);
  --panel-2:   rgba(0,0,0,.04);
  --gold:      #997226;
  --gold-2:    #b38829;
  --gold-3:    #7a5e1f;
  --gold-glow: rgba(153,114,38,.25);
  --line:      rgba(0,0,0,.10);
  --line-gold: rgba(153,114,38,.28);
  --text:      #0a0a0a;
  --text-2:    rgba(0,0,0,.72);
  --text-3:    rgba(0,0,0,.48);
  --glow:      0 0 30px rgba(153,114,38,.15);
  --shadow:    0 24px 50px -28px rgba(0,0,0,.30);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
::selection { background: var(--gold); color: #000; }

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.section { padding-block: clamp(72px, 10vw, 130px); position: relative; }
.section-head { max-width: 700px; margin-bottom: 60px; }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-2); padding: 7px 14px; border: 1px solid var(--line-gold);
  border-radius: var(--radius); background: var(--panel); margin-bottom: 22px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 0; background: var(--gold); box-shadow: 0 0 10px var(--gold); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

h1, h2, h3 { line-height: 1.08; letter-spacing: -.01em; font-weight: 700; }
h2 { font-family: var(--font-display); font-size: clamp(30px, 4.2vw, 50px); font-weight: 700; }
h3 { font-size: 21px; letter-spacing: -.01em; }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--text-2); line-height: 1.6; max-width: 60ch; }
.section-head.center .lead { margin-inline: auto; }
.muted { color: var(--text-2); }
.mono { font-family: var(--font-mono); }
.gold { color: var(--gold-2); }
.grad-gold {
  background: linear-gradient(100deg, var(--gold-3), var(--gold-2) 45%, #fff6e0 70%, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="light"] .grad-gold {
  background-image: linear-gradient(100deg, var(--gold-3), var(--gold-2) 45%, var(--gold-3) 70%, var(--gold-2));
}

/* ---- Buttons (SQUARE, gold border) ---- */
.btn {
  --b: var(--gold);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font); font-weight: 600; font-size: 13.5px; letter-spacing: .12em; text-transform: uppercase;
  padding: 15px 28px; border-radius: var(--radius);
  border: 1px solid var(--b); background: transparent; color: var(--b);
  cursor: pointer; transition: all .25s var(--ease); white-space: nowrap; position: relative;
}
.btn::after { content:""; position:absolute; inset:0; box-shadow: var(--glow); opacity:0; transition: opacity .25s var(--ease); pointer-events:none; }
.btn:hover { background: var(--gold); color: #000; }
.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold); color: #000; }
.btn-primary:hover { background: var(--gold-2); }
[data-theme="light"] .btn-primary { background:#cc9933; }
[data-theme="light"] .btn-primary:hover { background:#e6b347; }
.btn-ghost { --b: var(--line); color: var(--text-2); }
.btn-ghost:hover { --b: var(--gold); color: var(--gold-2); background: transparent; }
.btn-lg { padding: 17px 34px; font-size: 14px; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---- Nav ---- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand .mark { width: 32px; height: 32px; border: 1px solid var(--gold); border-radius: var(--radius); display: grid; place-items: center; background: var(--panel); color: var(--gold-2); font-weight: 800; }
.brand-logo { height: 30px; width: auto; flex: none; display: none; }
.brand-logo.bl-dark { display: block; }
[data-theme="light"] .brand-logo.bl-dark { display: none; }
[data-theme="light"] .brand-logo.bl-light { display: block; }
.brand-icon { height: 48px; width: auto; flex: none; display: none; }
@media (max-width: 575px) {
  .brand-logo { display: none !important; }
  .brand-icon.bi-dark { display: block; }
  [data-theme="light"] .brand-icon.bi-dark { display: none; }
  [data-theme="light"] .brand-icon.bi-light { display: block; }
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 9px 14px; font-size: 13.5px; font-weight: 500; letter-spacing: .03em; color: var(--text-2); border-radius: var(--radius); }
.nav-links a:hover { color: var(--gold-2); }
.nav-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text-2); cursor: pointer; display: grid; place-items: center; transition: all .2s var(--ease); }
.theme-toggle:hover { color: var(--gold-2); border-color: var(--gold); }
.nav-links .theme-toggle { display: none; }
.nav-toggle { display: none; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text-2); cursor: pointer; transition: color .2s var(--ease), border-color .2s var(--ease); }
.nav-toggle span { display: block; width: 18px; height: 2px; background: currentColor; transition: transform .25s var(--ease), opacity .25s var(--ease); }
.nav-toggle:hover { color: var(--gold-2); border-color: var(--gold); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }

/* ---- Hero + Three.js canvas ---- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding-top: 90px; padding-bottom: 70px; overflow: hidden; }
#bg-canvas { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; }
.hero::after { content:""; position:absolute; inset:0; z-index:-1; background:
  radial-gradient(70% 60% at 50% 30%, transparent, var(--bg) 92%),
  linear-gradient(to bottom, transparent, var(--bg) 96%); }
.hero-inner { text-align: center; max-width: 900px; margin-inline: auto; }
.hero h1 { font-family: var(--font-display); font-size: clamp(44px, 7vw, 88px); line-height: 1.02; letter-spacing: -.02em; }
.hero .lead { margin: 26px auto 0; text-align: center; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 36px; }
.hero-note { margin-top: 28px; font-size: 13px; letter-spacing: .04em; color: var(--text-3); text-align: center; }
.hero-note .sep { color: var(--gold-3); margin: 0 8px; }

/* trust strip */
.trust { display:flex; flex-wrap: wrap; gap: 10px 26px; justify-content:center; margin-top: 44px; }
.trust span { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); display:inline-flex; align-items:center; gap:8px; }
.trust span::before { content:""; width:5px; height:5px; background: var(--gold); border-radius: 0; box-shadow: 0 0 8px var(--gold); }

/* ---- Product grid (glass cards) ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  border: 1px solid var(--line-gold); border-radius: var(--radius);
  padding: 30px; backdrop-filter: blur(8px); position: relative; overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.card::before { content:""; position:absolute; top:0; left:0; right:0; height:1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity:.5; }
.card:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: var(--glow), var(--shadow); }
.card .ico { width: 48px; height: 48px; border: 1px solid var(--line-gold); border-radius: var(--radius); display:grid; place-items:center; color: var(--gold-2); margin-bottom: 20px; }
.card h3 { margin-bottom: 9px; }
.card p { color: var(--text-2); font-size: 15px; }
.card .link { display:inline-flex; align-items:center; gap:7px; margin-top: 18px; color: var(--gold-2); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.tag-row { display:flex; flex-wrap:wrap; gap:7px; margin-top: 16px; }
.tag { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line); padding: 4px 9px; border-radius: var(--radius); }

/* ---- Steps ---- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.step { border-top: 1px solid var(--line-gold); padding-top: 22px; }
.step .num { font-family: var(--font-mono); font-size: 13px; color: var(--gold-2); letter-spacing: .1em; }
.step h3 { margin: 12px 0 9px; }
.step p { color: var(--text-2); }

/* ---- Ecosystem band ---- */
.eco {
  position: relative; border: 1px solid var(--line-gold); border-radius: var(--radius-lg);
  padding: clamp(38px, 5vw, 70px); overflow: hidden;
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(204,153,51,.16), transparent 60%),
    radial-gradient(80% 120% at 100% 100%, rgba(204,153,51,.10), transparent 60%),
    var(--panel);
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center;
}
.eco h2 { max-width: 18ch; }
.eco p { color: var(--text-2); margin-top: 16px; }
.eco .brands { display: grid; gap: 12px; }
.eco .brand-chip { border: 1px solid var(--line-gold); border-radius: var(--radius); background: var(--panel-2); padding: 16px 18px; display:flex; align-items:center; justify-content:space-between; }
.eco .brand-chip b { font-size: 18px; }
.eco .brand-chip span { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; }

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--line); padding-block: 70px 40px; }
.footer-grid { display: grid; grid-template-columns: 1.7fr repeat(4, 1fr); gap: 36px; }
.footer h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--gold-2); margin-bottom: 18px; }
.footer li { margin-bottom: 11px; }
.footer a { color: var(--text-2); font-size: 15px; transition: color .2s; }
.footer a:hover { color: var(--gold-2); }
.footer-bottom { display:flex; justify-content: space-between; align-items: center; margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 13.5px; }

/* ---- Stats ---- */
.stats { display:grid; grid-template-columns:repeat(4,1fr); border:1px solid var(--line); }
.stat { padding:30px 26px; border-right:1px solid var(--line); }
.stat:last-child { border-right:0; }
.stat .big { font-family:var(--font-display); font-size:clamp(28px,3vw,42px); line-height:1; color:var(--gold-2); }
.stat .lbl { margin-bottom:12px; font-size:12.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--text-3); }

/* ---- Coins / networks ---- */
.coins { display:grid; grid-template-columns:repeat(6,1fr); gap:14px; }
.coin-badge { border:1px solid var(--line); padding:18px 10px; text-align:center; transition:transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.coin-badge:hover { transform:translateY(-3px); border-color:var(--gold); box-shadow:var(--glow); }
.coin-badge .sym { width:40px; height:40px; margin:0 auto 10px; border:1px solid var(--line-gold); display:grid; place-items:center; font-weight:700; color:var(--gold-2); }
.coin-badge .tk { font-family:var(--font-mono); font-size:12px; color:var(--text-2); letter-spacing:.04em; }
.coin-badge img { display:block; margin:0 auto 10px; }
.coin-badge.more { display:grid; place-items:center; color:var(--text-3); font-family:var(--font-mono); font-size:13px; }

/* ---- Split (text + code) ---- */
.split { display:grid; grid-template-columns:1fr 1fr; gap:44px; align-items:center; }
.code { background:#070707; border:1px solid var(--line-gold); padding:22px 24px; overflow-x:auto; font-family:var(--font-mono); font-size:13px; line-height:1.75; color:var(--text-2); position:relative; }
.code::before { content:""; position:absolute; top:0; left:0; right:0; height:1px; background:linear-gradient(90deg,transparent,var(--gold),transparent); }
.code .k { color:var(--gold-2); } .code .s { color:#a9dca0; } .code .c { color:var(--text-3); } .code .u { color:#9ec5ff; }
.code .bar { display:flex; gap:6px; margin-bottom:16px; } .code .bar i { width:10px; height:10px; border:1px solid var(--line-gold); }
[data-theme="light"] .code { background:#f4f4f5; }
[data-theme="light"] .code .s { color:#2e7d32; }
[data-theme="light"] .code .u { color:#2563eb; }

/* ---- Use cases ---- */
.usecases { display:grid; grid-template-columns:repeat(4,1fr); gap:18px; }
.uc { border:1px solid var(--line); background:var(--panel); padding:26px; transition:border-color .25s, box-shadow .25s; }
.uc:hover { border-color:var(--gold); box-shadow:var(--glow); }
.uc .ico { width:44px; height:44px; border:1px solid var(--line-gold); display:grid; place-items:center; color:var(--gold-2); margin-bottom:16px; }
.uc h3 { font-size:17px; margin-bottom:7px; } .uc p { font-size:14.5px; color:var(--text-2); }

/* ---- FAQ ---- */
.faq-wrap { max-width:840px; margin-inline:auto; }
.faq { border-top:1px solid var(--line); }
.faq details { border-bottom:1px solid var(--line); }
.faq summary { cursor:pointer; list-style:none; padding:22px 0; display:flex; justify-content:space-between; align-items:center; gap:16px; font-weight:600; font-size:17px; }
.faq summary::-webkit-details-marker { display:none; }
.faq summary::after { content:"+"; color:var(--gold-2); font-size:22px; line-height:1; }
.faq details[open] summary::after { content:"\2013"; }
.faq .a { padding:0 28px 24px 0; color:var(--text-2); }

/* ---- CTA band ---- */
.cta-band { border:1px solid var(--line-gold); padding:clamp(44px,6vw,84px); text-align:center; }
.cta-band h2 { margin-bottom:14px; } .cta-band p { color:var(--text-2); max-width:54ch; margin:0 auto 30px; }

/* ---- UCASH: contracts / chains ---- */
.contracts { display:grid; grid-template-columns:1fr 1fr; gap:44px; align-items:start; }
.chain-row { display:flex; flex-direction:column; gap:10px; }
.chain-item { display:flex; align-items:center; gap:14px; border:1px solid var(--line); background:var(--panel); padding:14px 16px; transition:border-color .2s; }
.chain-item:hover { border-color:var(--line-gold); }
.chain-badge { font-family:var(--font-mono); font-size:11px; font-weight:600; padding:5px 9px; border:1px solid; letter-spacing:.05em; flex-shrink:0; min-width:76px; text-align:center; }
.cb-eth { color:#9ec5ff; border-color:rgba(110,126,234,.5); }
.cb-poly { color:#c4a8ff; border-color:rgba(130,71,229,.5); }
.cb-base { color:#7aa2ff; border-color:rgba(0,82,255,.5); }
.cb-urc { color:var(--gold-2); border-color:var(--line-gold); }
.chain-addr { font-family:var(--font-mono); font-size:12.5px; color:var(--text-2); word-break:break-all; }
.chain-addr:hover { color:var(--gold-2); }

/* ---- grid-4 + live price ---- */
.grid-4 { display:grid; grid-template-columns:repeat(4,1fr); gap:18px; }
.price-card { display:flex; justify-content:center; }
.price-card .frame { border:1px solid var(--line-gold); background:#0b0b0b; padding:6px; max-width:100%; }
.price-card iframe { display:block; border:0; width:380px; max-width:100%; height:200px; }
@media (max-width:920px){ .grid-4{grid-template-columns:1fr 1fr;} }
@media (max-width:560px){ .grid-4{grid-template-columns:1fr;} }

/* ---- Reveal anim ---- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---- Responsive ---- */
@media (max-width: 920px) {
  .grid-3, .steps { grid-template-columns: 1fr; }
  .eco { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-actions .btn-ghost { display: none; }
  .nav-toggle { display: flex; }
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid var(--line); padding: 6px 24px 12px; display: none; }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: 13px 6px; border-bottom: 1px solid var(--line); }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-actions .theme-toggle { display: none; }
  .nav-links .theme-toggle { display: flex; align-items: center; gap: 12px; width: 100%; height: auto; padding: 13px 6px; border: 0; border-radius: 0; background: transparent; color: var(--text-2); font-family: var(--font); font-size: 13.5px; font-weight: 500; letter-spacing: .03em; cursor: pointer; justify-content: flex-start; }
  .nav-links .theme-toggle:hover { color: var(--gold-2); }
  .nav-links .theme-toggle svg { flex: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: 0; }
  .stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 920px) {
  .coins { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}
@media (max-width: 560px) {
  .coins { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .coin-badge { padding: 14px 6px; }
  .coin-badge img { width: 22px; height: 22px; }
  .coin-badge .tk { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  #bg-canvas { display: none; }
}
