/* ==========================================================================
   UnWrap - Unified Design System & Aesthetics (style.css)
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --well: #F1F5F9;
  --line: #E2E8F0;
  --line-subtle: #EDF2F7;
  --ink: #0F172A;
  --ink-secondary: #334155;
  --muted: #64748B;
  --faint: #94A3B8;

  /* Tool & Status Accents */
  --h: #0284C7;        /* Deep Cyan */
  --p: #0284C7;        /* Electric Cyan Payload/Primary */
  --s: #0D9488;        /* Signature Teal */
  --ok: #10B981;       /* Success Emerald */
  --bad: #EF4444;      /* Error Crimson */
  --warn: #F59E0B;     /* Warning Amber */
  --info: #0284C7;     /* Info Blue */

  --j-str: #15803D;
  --j-num: #C2410C;
  --tint: 8%;

  /* Radii & Shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 0 35px -5px rgba(2, 132, 199, 0.18);

  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080C14;
  --surface: #0F1523;
  --surface-raised: #151F33;
  --well: #0B101C;
  --line: #1E293B;
  --line-subtle: #141E2F;
  --ink: #F8FAFC;
  --ink-secondary: #CBD5E1;
  --muted: #94A3B8;
  --faint: #64748B;

  --h: #38BDF8;
  --p: #38BDF8;
  --s: #14B8A6;
  --ok: #34D399;
  --bad: #F87171;
  --warn: #FBBF24;
  --info: #38BDF8;

  --j-str: #86EFAC;
  --j-num: #7DD3FC;
  --tint: 14%;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 45px -5px rgba(56, 189, 248, 0.22);
}

/* Base Reset & Typography */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-subtle);
  transition: border-color 0.2s, background-color 0.2s;
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-icon {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

.brand-icon path, .brand-icon rect {
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.brand-link:hover .brand-icon { transform: scale(1.08); transition: transform 0.3s ease; }

.brand-un { color: var(--muted); font-weight: 500; }
.brand-wrap {
  color: var(--p);
  font-weight: 700;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--ok);
  box-shadow: 0 0 8px var(--ok);
  animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
  background: var(--well);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-subtle);
}

.nav-link {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.nav-link.active {
  color: var(--ink);
  background: var(--surface);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.search-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--well);
  border: 1px solid var(--line);
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-trigger-btn:hover {
  border-color: var(--p);
  color: var(--ink);
  background: var(--surface);
}

.kbd-shortcut {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  color: var(--faint);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--muted);
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.mobile-menu-btn span {
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.mobile-drawer {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 1rem 1.5rem 1.5rem;
}

.mobile-nav-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.mobile-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  background: var(--well);
  font-size: 0.88rem;
  color: var(--ink-secondary);
}

.mobile-link.active {
  background: var(--p);
  color: #fff;
  font-weight: 600;
}

/* ==========================================================================
   Tool Workspace Layout (jwt.html, json.html, etc.)
   ========================================================================== */

.tool-header-banner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
}

.tool-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.tool-breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }

.tool-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.tool-badge-icon {
  font-size: 1.8rem;
  width: 3.2rem;
  height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.tool-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tool-tagline {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.tool-quick-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.work-layout {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.work-layout.single-col {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1100px;
}

.sticky-panel {
  position: sticky;
  top: 5rem;
}

/* ==========================================================================
   Panels & Cards
   ========================================================================== */

.panel {
  --c: var(--line);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0 1.35rem 1.35rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.panel:hover {
  box-shadow: var(--shadow-md);
}

.panel.h { --c: var(--h); }
.panel.p { --c: var(--p); }
.panel.s { --c: var(--s); }
.panel.s[data-state="ok"] { --c: var(--ok); }
.panel.s[data-state="bad"] { --c: var(--bad); }

.panel + .panel { margin-top: 1.25rem; }

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin: 0 -1.35rem 1.15rem;
  padding: 0.75rem 1.35rem;
  min-height: 3.3rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--well) 60%, var(--surface));
}

.panel.h .panel-bar, .panel.p .panel-bar, .panel.s .panel-bar {
  background: color-mix(in srgb, var(--c) var(--tint), var(--surface));
  box-shadow: inset 0 3px 0 var(--c);
  border-bottom-color: color-mix(in srgb, var(--c) 25%, var(--line));
}

.panel-bar h2, .panel-bar h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel.h .panel-bar h2, .panel.p .panel-bar h2, .panel.s .panel-bar h2 { color: var(--c); }
.panel-bar h2 span { font-weight: 400; color: var(--muted); font-size: 0.88rem; }

.panel.h:hover, .panel.h:focus-within,
.panel.p:hover, .panel.p:focus-within,
.panel.s:hover, .panel.s:focus-within {
  border-color: color-mix(in srgb, var(--c) 55%, var(--line));
}

/* ==========================================================================
   Inputs, Textareas, Controls, Buttons
   ========================================================================== */

textarea, pre.code, select, input.in {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--well);
  padding: 0.8rem 0.95rem;
  margin: 0;
  font: 13.5px/1.65 var(--mono);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

textarea {
  resize: vertical;
  display: block;
}

textarea::placeholder, input.in::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

textarea:focus, select:focus, input.in:focus {
  border-color: var(--p);
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--p) 20%, transparent);
}

pre.code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 3.2rem;
  color: var(--ink);
}

select {
  width: auto;
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  background: var(--surface);
  cursor: pointer;
}

input.in.num { width: 6.5rem; padding: 0.4rem 0.65rem; }
textarea[wrap=off] { font-size: 12.5px; }
input[type=range] { width: 100%; accent-color: var(--p); cursor: pointer; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-secondary);
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.85rem;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn:hover {
  border-color: var(--muted);
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 80%, var(--well));
  transform: translateY(-0.5px);
}

.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
  font-weight: 600;
}

.btn.primary:hover {
  opacity: 0.92;
  box-shadow: var(--shadow-sm);
}

.btn.accent-p {
  background: var(--p);
  border-color: var(--p);
  color: #fff;
  font-weight: 600;
}

.btn.accent-p:hover { opacity: 0.92; }

.btn.copied {
  background: var(--ok) !important;
  border-color: var(--ok) !important;
  color: #fff !important;
}

.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.opts { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; margin-top: 0.85rem; font-size: 0.88rem; color: var(--muted); }
.opts label { display: inline-flex; gap: 0.45rem; align-items: center; cursor: pointer; user-select: none; }
.opts input { accent-color: var(--p); }
.field { display: block; font-size: 0.88rem; font-weight: 600; margin: 1rem 0 0.45rem; color: var(--ink-secondary); }
.note { color: var(--muted); font-size: 0.84rem; margin: 0.75rem 0 0; }

/* Status message & Pills */
.msg { margin-top: 0.9rem; font-size: 0.9rem; min-height: 1.4em; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.38rem 0.85rem; border-radius: 999px; font-weight: 600; font-size: 0.86rem; }
.pill.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.pill.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); }
.pill.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.pill.info { background: color-mix(in srgb, var(--info) 14%, transparent); color: var(--info); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); }
.pill.ok::before { content: '✓'; } .pill.bad::before { content: '✕'; } .pill.warn::before { content: '!'; }

/* ==========================================================================
   JWT Token Highlighter & Visual Segment Bar
   ========================================================================== */

.tok { position: relative; background: var(--well); border-radius: var(--radius-md); }
.tok pre, .tok textarea {
  font: 17px/1.7 var(--mono);
  padding: 1.1rem 1.25rem;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  min-height: 14rem;
}

.tok pre { position: absolute; inset: 0; pointer-events: none; border-color: transparent; overflow: hidden; }
.tok textarea { position: relative; background: transparent; color: transparent; caret-color: var(--ink); resize: none; overflow: hidden; }
.tok textarea::selection { background: color-mix(in srgb, var(--p) 25%, transparent); color: transparent; }

.seg-h { color: var(--h); font-weight: 600; }
.seg-p { color: var(--p); font-weight: 600; }
.seg-s { color: var(--s); font-weight: 600; }
.dot { color: var(--ink); font-weight: 700; opacity: 0.7; }

body[data-focus="h"] .tok pre span:not(.seg-h),
body[data-focus="p"] .tok pre span:not(.seg-p),
body[data-focus="s"] .tok pre span:not(.seg-s) { opacity: 0.22; }

body[data-focus="h"] .map span:not(#m-h),
body[data-focus="p"] .map span:not(#m-p),
body[data-focus="s"] .map span:not(#m-s) { opacity: 0.22; }

.map { display: flex; height: 7px; border-radius: 4px; overflow: hidden; margin-top: 1rem; gap: 3px; }
.map span { min-width: 4px; flex-grow: 0; border-radius: 4px; transition: flex-grow 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font-size: 0.86rem; color: var(--muted); margin-top: 0.65rem; }
.legend b { font-weight: 600; }

/* Submode switcher (Decode / Encode) */
.submode-bar {
  max-width: 1360px;
  margin: 1.25rem auto 0;
  padding: 0 1.5rem;
  display: flex;
}

.submode-tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  gap: 0.25rem;
}

.submode-tabs button {
  border: 0;
  background: none;
  padding: 0.45rem 1.2rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted);
  transition: all 0.15s ease;
}

.submode-tabs button:hover { color: var(--ink); }
.submode-tabs button[aria-pressed="true"] { background: var(--ink); color: var(--surface); font-weight: 600; }

/* ==========================================================================
   Claims Table & Tables
   ========================================================================== */

table.claims { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.88rem; }
.claims th, .claims td { text-align: left; vertical-align: top; padding: 0.6rem 0.6rem; border-top: 1px solid var(--line); }
.claims th { font: 600 0.85rem var(--mono); color: var(--p); white-space: nowrap; width: 1%; }
.claims td.desc { color: var(--muted); }
.claims .when { display: block; color: var(--ink); font-size: 0.83rem; margin-top: 0.15rem; }
.claims .late { color: var(--bad); font-weight: 600; }

table.hashes { width: 100%; border-collapse: collapse; }
table.hashes td { font: 13px/1.55 var(--mono); overflow-wrap: anywhere; vertical-align: middle; }
table.hashes td:last-child { width: 1%; text-align: right; }

/* JSON Tree Viewer */
.jl { position: relative; padding-left: calc(var(--g, 1) * 1ch + 2.8ch); }
.jl::before { content: attr(data-n); position: absolute; left: 0; width: calc(var(--g, 1) * 1ch); text-align: right; color: var(--muted); opacity: 0.6; }
.tg { position: absolute; left: calc(var(--g, 1) * 1ch + 0.5ch); width: 2ch; padding: 0; border: 0; background: none; cursor: pointer; color: var(--muted); line-height: inherit; }
.tg:hover { color: var(--ink); }
.tg::before { content: '▾'; }
.jn.closed > .jl > .tg::before { content: '▸'; }
.jn.closed > :not(:first-child) { display: none; }
.jn.closed > .jl::after { content: attr(data-sum); color: var(--muted); }
.j-key { color: var(--ink); font-weight: 600; }
.j-str { color: var(--j-str); }
.j-num { color: var(--j-num); }
.j-lit { color: var(--p); font-weight: 500; }

/* ==========================================================================
   Dazzling Homepage Showcase (index.html)
   ========================================================================== */

.hero-section {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 1.5rem 3.5rem;
  text-align: center;
}

.hero-glow-bg {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 480px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--p) 20%, transparent) 0%, color-mix(in srgb, var(--h) 10%, transparent) 40%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-secondary);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.hero-badge .shield-icon { color: var(--ok); }

.hero-title {
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin: 0 0 1.25rem;
  color: var(--ink);
}

.hero-gradient-text {
  background: linear-gradient(135deg, #0284C7 0%, #2563EB 60%, #4F46E5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

:root[data-theme="dark"] .hero-gradient-text {
  background: linear-gradient(135deg, #38BDF8 0%, #60A5FA 50%, #93C5FD 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--muted);
  max-width: 760px;
  margin: 0 auto 2.2rem;
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.8rem;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, var(--ink) 0%, color-mix(in srgb, var(--ink) 80%, var(--p)) 100%);
  color: var(--surface);
  border: 1px solid var(--ink);
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  opacity: 0.95;
}

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-hero-secondary:hover {
  border-color: var(--p);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Live Quick Detector Playground on Hero */
.hero-playground {
  max-width: 900px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  text-align: left;
}

.playground-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.playground-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.playground-title .sparkle { color: var(--warn); }

.playground-input-wrap {
  position: relative;
}

.playground-textarea {
  width: 100%;
  min-height: 95px;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--ink);
  resize: vertical;
}

.playground-result {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--well);
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.playground-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.type-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.type-indicator.jwt { background: color-mix(in srgb, var(--p) 15%, transparent); color: var(--p); }
.type-indicator.json { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.type-indicator.base64 { background: color-mix(in srgb, var(--s) 15%, transparent); color: var(--s); }
.type-indicator.url { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.type-indicator.uuid { background: color-mix(in srgb, var(--h) 15%, transparent); color: var(--h); }
.type-indicator.time { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.type-indicator.text { background: color-mix(in srgb, var(--muted) 15%, transparent); color: var(--muted); }

.playground-preview-text {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--ink-secondary);
  max-width: 500px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hero Stats */
.hero-stats-bar {
  max-width: 1100px;
  margin: 3.5rem auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat-item {
  text-align: center;
  padding: 0.5rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.stat-label {
  font-size: 0.84rem;
  color: var(--muted);
  margin-top: 0.25rem;
  font-weight: 500;
}

/* ==========================================================================
   Bento Grid of All 8 Tools (Homepage)
   ========================================================================== */

.section-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-head {
  text-align: center;
  max-width: 740px;
  margin: 0 auto 3rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--p);
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 0.85rem;
  color: var(--ink);
}

.section-desc {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.bento-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s, border-color 0.25s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent, var(--p)) 50%, var(--line));
}

.bento-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent, var(--p));
  opacity: 0.85;
}

.bento-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.bento-icon-wrap {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent, var(--p)) 12%, var(--surface));
  color: var(--accent, var(--p));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  border: 1px solid color-mix(in srgb, var(--accent, var(--p)) 25%, transparent);
}

.bento-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--well);
  color: var(--muted);
  border: 1px solid var(--line);
}

.bento-title {
  font-size: 1.28rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.bento-desc {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
  line-height: 1.55;
}

.bento-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.bento-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bento-features li::before {
  content: '✓';
  color: var(--accent, var(--p));
  font-weight: 700;
}

.bento-footer {
  margin-top: auto;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bento-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--accent, var(--p));
  transition: gap 0.15s ease;
}

.bento-card:hover .bento-action-link {
  gap: 0.65rem;
}

/* Featured Large Bento Card (e.g. JWT) */
.bento-card.featured {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--surface) 60%, color-mix(in srgb, var(--p) 6%, var(--surface)) 100%);
}

/* ==========================================================================
   Why UnWrap / Privacy Pillars
   ========================================================================== */

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.pillar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
}

.pillar-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: inline-block;
}

.pillar-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.6rem;
}

.pillar-text {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

/* Comparison Table */
.comparison-wrap {
  margin-top: 3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.comp-table th, .comp-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.comp-table th {
  background: var(--well);
  font-weight: 600;
}

.comp-table th:first-child { width: 40%; }
.comp-table td:nth-child(2) { color: var(--ok); font-weight: 600; background: color-mix(in srgb, var(--ok) 4%, transparent); }
.comp-table td:nth-child(3) { color: var(--bad); }

/* ==========================================================================
   Standards Matrix Section
   ========================================================================== */

.standards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.standard-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.standard-box h3 {
  margin: 0 0 0.8rem;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.standard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.standard-table th, .standard-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line-subtle);
  text-align: left;
}

.standard-table th { font-family: var(--mono); color: var(--p); width: 45%; }
.standard-table td { color: var(--muted); }

/* ==========================================================================
   Command Palette Modal
   ========================================================================== */

.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(12, 16, 29, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1rem 2rem;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.cmd-palette-modal {
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  overflow: hidden;
  animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-15px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cmd-search-bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--line);
}

.cmd-search-bar input {
  flex: 1;
  background: transparent;
  border: 0;
  font-size: 1.1rem;
  font-family: var(--sans);
  color: var(--ink);
  outline: none;
  padding: 0;
}

.cmd-esc-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: var(--well);
  border: 1px solid var(--line);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  color: var(--muted);
}

.cmd-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--ink);
  transition: all 0.12s ease;
  text-decoration: none;
}

.cmd-item:hover, .cmd-item.selected {
  background: var(--well);
}

.cmd-item-icon {
  font-size: 1.4rem;
  width: 2.2rem;
  height: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.cmd-item-info {
  flex: 1;
  min-width: 0;
}

.cmd-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cmd-badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--p) 12%, transparent);
  color: var(--p);
}

.cmd-item-desc {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.cmd-enter-icon {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--faint);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.cmd-item.selected .cmd-enter-icon { opacity: 1; }

.cmd-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.cmd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.4rem;
  background: var(--well);
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}

.cmd-footer kbd {
  font-family: var(--mono);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  color: var(--ink-secondary);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 4rem 1.5rem 2.5rem;
  margin-top: 5rem;
}

.footer-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 2fr;
  gap: 3.5rem;
  margin-bottom: 3.5rem;
}

.footer-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 440px;
  margin: 1rem 0 1.25rem;
}

.footer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.f-chip {
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--well);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  font-weight: 500;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.footer-col h4 {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin: 0 0 1.1rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-col a {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--p);
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1360px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--line-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-kbd-hint kbd {
  font-family: var(--mono);
  background: var(--well);
  border: 1px solid var(--line);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1080px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
  .bento-card.featured { grid-column: span 2; }
  .pillars-grid { grid-template-columns: 1fr; }
  .standards-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 2.5rem; }
}

@media (max-width: 900px) {
  .work-layout { grid-template-columns: minmax(0, 1fr); }
  .sticky-panel { position: static; }
  .main-nav { display: none; }
  .search-label { display: none; }
  .mobile-menu-btn { display: flex; }
  .hero-stats-bar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-card.featured { grid-column: span 1; }
  .hero-stats-bar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 0.6rem 1rem; }
  .tool-header-banner { padding: 1.5rem 1rem 0.5rem; }
  .work-layout { padding: 1rem 1rem 3rem; }
  .tok pre, .tok textarea { font-size: 14.5px; }
}

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