@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&display=swap');

/* ─── tokens ──────────────────────────────────── */
:root {
  --bg:          #06060f;
  --surface:     rgba(255,255,255,0.03);
  --surface-2:   rgba(255,255,255,0.055);
  --border:      rgba(255,255,255,0.07);
  --border-hi:   rgba(108,99,255,0.45);
  --text:        #d4d4e8;
  --text-muted:  #3e3e58;
  --text-dim:    #7070a0;
  --accent:      #6c63ff;
  --accent-soft: rgba(108,99,255,0.12);
  --accent-glow: 0 0 20px rgba(108,99,255,0.25);
  --green:       #00c9a7;
  --green-soft:  rgba(0,201,167,0.10);
  --green-glow:  0 0 20px rgba(0,201,167,0.2);
  --red:         #ff5f6d;
  --red-soft:    rgba(255,95,109,0.10);
  --mono:        'JetBrains Mono', 'Courier New', monospace;
}

/* ─── reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

code {
  color: var(--green);
  background: var(--green-soft);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ─── aurora ──────────────────────────────────── */
.aurora {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  will-change: transform;
}
.aurora-blob-a {
  width: 65vw; height: 65vw;
  background: radial-gradient(circle, rgba(108,99,255,0.18), transparent 70%);
  top: -25%; left: -20%;
  animation: driftA 38s ease-in-out infinite alternate;
}
.aurora-blob-b {
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, rgba(0,201,167,0.13), transparent 70%);
  bottom: -15%; right: -5%;
  animation: driftB 48s ease-in-out infinite alternate;
}
.aurora-blob-c {
  width: 42vw; height: 42vw;
  background: radial-gradient(circle, rgba(177,99,255,0.12), transparent 70%);
  top: 45%; left: 50%;
  animation: driftC 55s ease-in-out infinite alternate;
}
@keyframes driftA {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(8vw,12vh) scale(1.1); }
}
@keyframes driftB {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(-10vw,-8vh) scale(0.92); }
}
@keyframes driftC {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(-6vw,10vh) scale(1.12); }
}

/* grain */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.025;
  pointer-events: none;
  z-index: 1;
}

/* ─── app shell ───────────────────────────────── */
.app {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
  padding: 52px 32px 100px;
}

/* ─── header ──────────────────────────────────── */
.header {
  margin-bottom: 40px;
}
.header-logo {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}
.header-logo span {
  background: linear-gradient(120deg, #6c63ff, #00c9a7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}
.header-note {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-top: 5px;
  font-weight: 300;
}

/* ─── tabs ────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: fit-content;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 7px;
  padding: 7px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.tab:hover { color: var(--text-dim); }
.tab.active {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.05);
}

/* ─── panels ──────────────────────────────────── */
.panel { display: none; }
.panel.active { display: block; }

.panel-desc {
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.8;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: 8px;
  border-left: 2px solid var(--border-hi);
}

/* ─── labels ──────────────────────────────────── */
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.copyable-hint {
  text-transform: none;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 0.5;
  font-weight: 300;
}

/* ─── inputs ──────────────────────────────────── */
.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 400;
  padding: 11px 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.65;
}
.input::placeholder { color: var(--text-muted); font-weight: 300; }
.input:focus {
  border-color: rgba(108,99,255,0.4);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.07), var(--accent-glow);
}
.input-single {
  resize: none;
  height: 42px;
  padding: 10px 14px;
}

/* ─── options row ─────────────────────────────── */
.row-options {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 18px 0;
  align-items: center;
}
.option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 5px 10px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.select:focus { border-color: rgba(108,99,255,0.45); }

/* ─── hash results ────────────────────────────── */
.hash-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 18px;
}
.hash-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.hash-row:first-child { border-radius: 8px 8px 0 0; }
.hash-row:last-child  { border-radius: 0 0 8px 8px; }
.hash-row:only-child  { border-radius: 8px; }
.hash-row:hover { background: var(--surface-2); border-color: rgba(255,255,255,0.1); }
.hash-row.copied { background: var(--green-soft); border-color: rgba(0,201,167,0.2); }

.hash-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: rgba(0,0,0,0.2);
  border-right: 1px solid var(--border);
  padding: 11px 12px;
  display: flex;
  align-items: center;
  user-select: none;
}
.hash-value {
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--green);
  padding: 11px 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s;
}
.hash-row.copied .hash-value { color: var(--green); }

/* ─── output ──────────────────────────────────── */
.output {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 400;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--green);
  min-height: 46px;
  line-height: 1.65;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  user-select: all;
  position: relative;
}
.output::after {
  content: 'click to copy';
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s;
  user-select: none;
  pointer-events: none;
}
.output:hover::after { opacity: 1; }
.output:hover {
  border-color: rgba(0,201,167,0.2);
  background: var(--surface-2);
  box-shadow: var(--green-glow);
}
.output.copied {
  background: var(--green-soft);
  border-color: rgba(0,201,167,0.3);
  box-shadow: var(--green-glow);
}
.output.error {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(255,95,109,0.2);
}

/* ─── action row ──────────────────────────────── */
.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

/* ─── buttons ─────────────────────────────────── */
.btn {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(108,99,255,0.25);
  border-radius: 7px;
  padding: 9px 22px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover {
  background: rgba(108,99,255,0.2);
  border-color: rgba(108,99,255,0.5);
  box-shadow: var(--accent-glow);
}
.btn:active { transform: scale(0.97); }

.btn-icon {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-dim);
  padding: 7px 11px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.btn-icon:hover { border-color: rgba(108,99,255,0.35); }

.mode-toggle {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  padding: 2px 9px;
  cursor: pointer;
  transition: all 0.15s;
}
.mode-toggle:hover {
  color: var(--accent);
  border-color: rgba(108,99,255,0.35);
}

/* ─── passphrase row ──────────────────────────── */
.passphrase-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.passphrase-wrap .input { flex: 1; }

/* ─── aes status ──────────────────────────────── */
.aes-status {
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--text-muted);
  transition: color 0.2s;
}
.aes-status.ok  { color: var(--green); }
.aes-status.err { color: var(--red); }

/* ─── base64 error ────────────────────────────── */
.b64-error {
  font-size: 0.7rem;
  color: var(--red);
  margin-top: 8px;
  min-height: 18px;
  font-weight: 300;
}

/* ─── random meta ─────────────────────────────── */
.random-meta {
  font-size: 0.68rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-top: 10px;
  letter-spacing: 0.06em;
}

/* ─── divider util ────────────────────────────── */
.mt  { margin-top: 16px; }
.mt2 { margin-top: 20px; }
.output.wrap { word-break: break-all; }

/* ─── footer ──────────────────────────────────── */
.footer {
  position: fixed;
  bottom: 22px;
  right: 28px;
  z-index: 2;
}
.year {
  font-size: 0.62rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.18em;
  opacity: 0.35;
}

/* ─── copy toast ──────────────────────────────── */
.copy-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--green);
  color: #000;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  padding: 8px 22px;
  border-radius: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 999;
}
.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── scrollbar ───────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108,99,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(108,99,255,0.4); }

/* ─── selection ───────────────────────────────── */
::selection { background: rgba(108,99,255,0.3); color: #fff; }

/* ─── responsive ──────────────────────────────── */
@media (max-width: 560px) {
  .app { padding: 28px 18px 90px; }
  .header-note { display: none; }
  .tabs { width: 100%; }
  .hash-row { grid-template-columns: 64px 1fr; }
  .hash-label { padding: 10px 8px; font-size: 0.6rem; }
  .hash-value { font-size: 0.68rem; padding: 10px 10px; }
}
