/* Sigilify — dark liquid glass, Zcash gold */

@font-face { font-family: "Noto Sans Ethiopic"; font-display: swap; src: url("fonts/ethiopic.ttf") format("truetype"); }
@font-face { font-family: "Noto Sans Canadian Aboriginal"; font-display: swap; src: url("fonts/canadian.ttf") format("truetype"); }

@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

:root {
  --bg: #070605;
  --ink: #f6f1e6;
  --muted: rgba(246, 241, 230, 0.52);
  --faint: rgba(246, 241, 230, 0.28);
  --gold: #f4b728;
  --gold-hi: #ffe7a3;
  --gold-lo: #a8791a;
  --glass: rgba(255, 255, 255, 0.035);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sigil: "Noto Sans Ethiopic", "Noto Sans Canadian Aboriginal", "Noto Sans Vai", "Noto Sans Bamum",
    "Noto Sans Tifinagh", "Noto Sans Runic", "Ebrima", "Nirmala UI", "Euphemia UCAS", "Kefa",
    "Segoe UI Historic", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
::selection { background: rgba(244, 183, 40, 0.35); color: #fff; }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(60% 45% at 50% 18%, rgba(244, 183, 40, 0.13), transparent 70%),
    radial-gradient(80% 60% at 50% 120%, rgba(244, 183, 40, 0.07), transparent 70%),
    var(--bg);
}
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.22; will-change: transform; }
.b1 { width: 46vmax; height: 46vmax; left: -14vmax; top: -10vmax; background: #8a5a0a; animation: drift1 26s var(--ease) infinite alternate; }
.b2 { width: 38vmax; height: 38vmax; right: -12vmax; top: 30vh; background: #f4b728; opacity: 0.1; animation: drift2 32s var(--ease) infinite alternate; }
.b3 { width: 30vmax; height: 30vmax; left: 30vw; bottom: -18vmax; background: #6b4a12; animation: drift1 38s var(--ease) infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate3d(8vw, 6vh, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(-10vw, -8vh, 0) scale(0.92); } }
.grain { position: absolute; inset: -50%; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- layout ---------- */
.stage {
  position: relative; z-index: 1;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 18px 36px;
}

/* ---------- 3D logo ---------- */
.logo {
  position: relative;
  width: 240px; height: 210px;
  margin-bottom: -6px;
  opacity: 0; transform: translateY(8px) scale(0.96);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.logo.ready { opacity: 1; transform: none; }
.logo.no-webgl { display: none; }
.logo canvas { position: relative; z-index: 1; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.logo.grabbing canvas { cursor: grabbing; }
.logo-shadow {
  position: absolute; left: 50%; bottom: 6px; width: 120px; height: 18px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(244, 183, 40, 0.35), transparent);
  filter: blur(6px);
}

.title {
  margin: 0;
  font-size: clamp(42px, 8vw, 64px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #fff9ea 0%, var(--gold-hi) 35%, var(--gold) 70%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 30px rgba(244, 183, 40, 0.18));
}
.tag { margin: 10px 0 30px; color: var(--muted); font-size: 15.5px; text-align: center; text-wrap: balance; }

/* ---------- the box ---------- */
.box {
  position: relative;
  width: min(640px, 100%);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 30px 80px -24px rgba(0, 0, 0, 0.85),
    0 0 70px -18px rgba(244, 183, 40, 0.22);
  transition: box-shadow 0.5s var(--ease), transform 0.5s var(--ease);
}
.box::before { /* animated gold outline */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--a),
    var(--gold) 0%, var(--gold-hi) 9%, var(--gold-lo) 22%, var(--gold) 38%,
    #fff3cf 52%, var(--gold-lo) 68%, var(--gold) 84%, var(--gold-hi) 93%, var(--gold) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: spin 9s linear infinite;
  opacity: 0.85;
  transition: opacity 0.4s var(--ease);
}
@keyframes spin { to { --a: 360deg; } }
.box:focus-within {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 30px 80px -24px rgba(0, 0, 0, 0.85),
    0 0 90px -10px rgba(244, 183, 40, 0.34);
}
.box:focus-within::before { opacity: 1; }

textarea {
  display: block; width: 100%;
  min-height: 64px; max-height: 38vh;
  padding: 22px 24px 16px;
  resize: none; border: 0; outline: 0; background: transparent;
  color: var(--ink);
  font: 18px/1.5 var(--ui), var(--sigil);
  caret-color: var(--gold);
}
textarea::placeholder { color: var(--faint); }

.sep { height: 1px; margin: 0 22px; background: linear-gradient(90deg, transparent, rgba(244, 183, 40, 0.35), transparent); }

.out { padding: 14px 24px 6px; }
.out-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.label { font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.meta { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.meta.warn { color: #ffb4a3; }

.output {
  min-height: 52px; max-height: 34vh; overflow: auto;
  font: 26px/1.55 var(--sigil);
  color: #fff4d6;
  word-break: break-all; overflow-wrap: anywhere;
  text-shadow: 0 0 22px rgba(244, 183, 40, 0.25);
  transition: color 0.3s var(--ease), opacity 0.3s var(--ease);
  scrollbar-width: thin; scrollbar-color: rgba(244, 183, 40, 0.35) transparent;
}
.output.long { font-size: 20px; }
.output.is-empty { font: 16px/1.55 var(--ui); color: var(--faint); text-shadow: none; padding-top: 12px; }
.output.is-text { font: 18px/1.55 var(--ui), var(--sigil); color: var(--ink); text-shadow: none; word-break: normal; white-space: pre-wrap; }
.output.is-hex { font: 15px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink); text-shadow: none; }
.output.pop { animation: pop 0.45s var(--ease); }
@keyframes pop { from { opacity: 0; filter: blur(6px); transform: translateY(4px); } to { opacity: 1; filter: none; transform: none; } }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px 14px 24px; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13.5px; color: var(--muted); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.track { position: relative; width: 36px; height: 21px; border-radius: 99px; background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); transition: background 0.35s var(--ease); }
.thumb { position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #d9d2c3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); transition: transform 0.35s var(--ease), background 0.35s var(--ease); }
.switch input:checked + .track { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.switch input:checked + .track .thumb { transform: translateX(15px); background: #1a1406; }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }
.switch-text .dim { color: var(--faint); }

/* copy button */
.copy {
  position: relative; display: inline-grid; place-items: center;
  min-width: 112px; height: 42px; padding: 0 22px;
  border: 0; border-radius: 99px; cursor: pointer;
  font: 600 14.5px var(--ui); color: #1b1404;
  background: linear-gradient(180deg, #ffe9a8 0%, var(--gold) 55%, #d99a12 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 24px -8px rgba(244, 183, 40, 0.6);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease), opacity 0.25s var(--ease);
}
.copy > span { grid-area: 1 / 1; transition: opacity 0.25s var(--ease), transform 0.35s var(--ease); }
.copy-done { opacity: 0; transform: translateY(6px); }
.copy.done .copy-idle { opacity: 0; transform: translateY(-6px); }
.copy.done .copy-done { opacity: 1; transform: none; }
.copy:hover:not(:disabled) { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 12px 30px -8px rgba(244, 183, 40, 0.75); }
.copy:active:not(:disabled) { transform: scale(0.97); }
.copy:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.copy:disabled { opacity: 0.35; cursor: default; filter: saturate(0.6); box-shadow: none; }

/* footer */
.foot { margin-top: 26px; text-align: center; color: var(--faint); font-size: 12.5px; }
.foot a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.foot a:hover { color: var(--gold); }
.foot .dot { margin: 0 8px; }
.foot .fine { margin-top: 6px; font-size: 11.5px; opacity: 0.8; }

@media (max-width: 560px) {
  .logo { width: 190px; height: 170px; }
  .tag { font-size: 14px; margin-bottom: 22px; }
  textarea { padding: 18px 18px 12px; font-size: 17px; }
  .out { padding: 12px 18px 4px; }
  .output { font-size: 22px; }
  .output.long { font-size: 18px; }
  .bar { padding: 10px 10px 12px 18px; }
  .copy { min-width: 96px; height: 40px; padding: 0 18px; }
  .switch-text .dim { display: none; }
  .foot .dot { display: none; }
  .foot > span, .foot > a { display: block; margin-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .blob, .box::before { animation: none; }
  .output.pop { animation: none; }
}
