:root {
  --bg: #08080a;
  --bg-sidebar: #0c0c0f;
  --bg-card: #131317;
  --bg-card-hover: #18181d;
  --border: #232329;
  --text: #e7e7ea;
  --text-dim: #9b9ba3;
  --text-faint: #6a6a73;
  --accent: #6366f1;
  --accent-hover: #7c7ef5;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --green: #34d399;
  --amber: #f5a524;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- LOAD ANIMATIONS ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
/* Home page only: tool cards fade in (tool pages have no entrance animation) */
.tool-grid { animation: fadeIn 0.4s ease both; }
.tool-card { animation: fadeIn 0.55s ease both; }   /* opacity only, so hover-lift still works */
.tool-card:nth-child(1) { animation-delay: 0.05s; }
.tool-card:nth-child(2) { animation-delay: 0.12s; }
.tool-card:nth-child(3) { animation-delay: 0.19s; }
.tool-card:nth-child(4) { animation-delay: 0.26s; }
.tool-card:nth-child(5) { animation-delay: 0.33s; }
.tool-card:nth-child(6) { animation-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  width: 248px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  padding: 6px 8px 18px;
  color: var(--text);
  text-decoration: none;
}
.brand .accent { color: var(--accent); }

.nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  padding: 14px 10px 7px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: var(--bg-card-hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-hover); }
.nav-item.active svg { stroke: var(--accent-hover); }
.nav-item svg { width: 18px; height: 18px; stroke: currentColor; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.nav-item.soon { cursor: not-allowed; opacity: 0.55; }

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  font-size: 11px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}

/* ---------- TOP-RIGHT SOCIALS ---------- */
.socials {
  position: fixed;
  top: 22px;
  right: 28px;
  display: flex;
  gap: 14px;
  z-index: 50;
}
.socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: #fff;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s, color 0.15s;
}
.socials a:hover {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  color: var(--accent-hover);
}
.socials svg { width: 20px; height: 20px; display: block; }

/* ---------- MAIN ---------- */
.main {
  flex: 1;
  padding: 40px 48px;
  overflow-y: auto;
}
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.3px; }
.page-head p { color: var(--text-dim); font-size: 14px; margin-top: 6px; max-width: 560px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 560px;
}

label.fld {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
}
input.txt {
  width: 100%;
  background: #0a0a0d;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  letter-spacing: 1px;
  transition: border 0.12s;
}
input.txt:focus { outline: none; border-color: var(--accent); }
input.txt::placeholder { color: var(--text-faint); letter-spacing: 0.5px; }
.hint { font-size: 12px; color: var(--text-faint); margin-top: 8px; }

/* code display */
.code-wrap {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: none;
}
.code-wrap.show { display: block; }
.code-row { display: flex; align-items: center; gap: 16px; }
.code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #fff;
  user-select: all;
}
.copy-btn {
  margin-left: auto;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.copy-btn:hover { background: rgba(99,102,241,0.25); }
.copy-btn.copied { color: var(--green); }

.timer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.timer-bar {
  flex: 1;
  height: 6px;
  background: #1d1d22;
  border-radius: 99px;
  overflow: hidden;
}
.timer-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 1s linear, background 0.3s;
}
.timer-txt { font-size: 13px; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }

.err { color: #f87171; font-size: 13px; margin-top: 12px; min-height: 16px; }

/* ---------- HOME / TOOL GRID ---------- */
.home-head { text-align: center; margin: 12px 0 38px; }
.home-title {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.home-title .ltr {
  display: inline-block;
  animation: letterIn 0.4s cubic-bezier(.21,.61,.35,1) both;
}
@keyframes letterIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.home-sub {
  color: var(--text-dim);
  font-size: 14px;
  margin: 12px auto 0;
  max-width: 460px;
  animation: fadeIn 0.6s ease 0.4s both;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}
.tool-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}
.tool-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.tool-card .tc-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.tool-card .tc-icon svg { width: 20px; height: 20px; stroke: var(--accent-hover); }
.tool-card .tc-title {
  font-size: 15px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.tool-card .tc-title .badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.4px;
  padding: 2px 6px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent-hover);
}
.tool-card .tc-desc {
  font-size: 13px; color: var(--text-dim); margin-top: 7px; line-height: 1.45;
}

@media (max-width: 720px) {
  .sidebar { display: none; }
  .main { padding: 28px 20px; }
  .code { font-size: 34px; }
}
