:root {
  --accent: #8b5cf6;
  --accent-2: #b392ff;
  --accent-strong: #6d38f2;
  --accent-soft: rgba(139,92,246,.18);
  --bg: #05030b;
  --bg-2: #0a0712;
  --bg-3: #120d1f;
  --panel: rgba(255,255,255,.03);
  --panel-2: rgba(255,255,255,.05);
  --border: rgba(179,146,255,.16);
  --border-strong: rgba(179,146,255,.28);
  --text: #ece8f7;
  --muted: #9d94b3;
  --line: rgba(255,255,255,.06);
  --shadow: 0 20px 80px rgba(0,0,0,.45);
  --radius: 18px;
  --maxw: 1120px;
  --sidew: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(900px 520px at 82% 5%, rgba(124,58,237,.18), transparent 60%),
    radial-gradient(720px 420px at 10% 0%, rgba(139,92,246,.10), transparent 55%),
    var(--bg);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-left: var(--sidew);
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 100% 32px, 32px 100%;
  opacity: .32;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent 18%, transparent 82%, rgba(255,255,255,.02));
  mix-blend-mode: soft-light;
  opacity: .45;
}
a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .95em; }
.accent { color: var(--accent-2); }
.muted { color: var(--muted); }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-2);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.text-link:hover { color: var(--text); }

.site-header {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidew);
  z-index: 50;
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: linear-gradient(180deg, rgba(10,7,18,.82), rgba(5,3,11,.92));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.5rem;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(139,92,246,.2), rgba(139,92,246,.04));
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand-logo.fallback::after { content: ">_"; font: 700 .95rem/1 ui-monospace, monospace; color: var(--accent-2); }
.brand-text { letter-spacing: .01em; }

.main-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.nav-group-label {
  font: 700 .78rem/1.4 ui-monospace, monospace;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 4px;
}
.main-nav > a,
.nav-dropbtn {
  color: var(--muted);
  background: none;
  border: 0;
  padding: 5px 0;
  font: 500 1.02rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  cursor: pointer;
  position: relative;
}
.main-nav > a:hover,
.nav-dropbtn:hover,
.main-nav > a.active,
.nav-dropbtn[aria-expanded="true"] {
  color: var(--text);
}
.main-nav > a.active::before,
.nav-dropbtn[aria-expanded="true"]::before {
  content: ">";
  position: absolute;
  left: -14px;
  color: var(--accent);
}
.nav-dropdown { position: relative; }
.nav-dropbtn .caret { font-size: .7em; opacity: .75; }
.nav-dropmenu {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding-left: 14px;
}
.nav-dropdown.open .nav-dropmenu { display: flex; }
.nav-dropmenu a {
  color: var(--muted);
  font: 500 .94rem/1.4 ui-monospace, monospace;
}
.nav-dropmenu a:hover { color: var(--text); }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.06); }
.menu-toggle { display: none; }

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px clamp(22px, 4vw, 56px) 80px;
}
.view { animation: viewIn .32s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
::view-transition-old(root) { animation: vtOut .22s ease both; }
::view-transition-new(root) { animation: vtIn .30s ease both; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; } }

.hero-console {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 40px;
  align-items: center;
  padding: 38px 0 24px;
  min-height: 440px;
}
.hero-copy { min-width: 0; }
.eyebrow,
.shell-label,
.section-terminal-head,
.art-caption {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.eyebrow {
  color: var(--accent-2);
  font-size: .88rem;
  letter-spacing: .05em;
  text-transform: lowercase;
}
.eyebrow span { color: var(--muted); }
.hero-title {
  margin: 18px 0 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px;
  font-size: clamp(3.6rem, 9vw, 6.2rem);
  font-weight: 900;
  line-height: .92;
  letter-spacing: -.04em;
}
.title-slot {
  display: inline-block;
  width: 8ch;
  min-height: 1em;
}
.morph-word {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.morph-word.glitch { animation: glitchShift .18s steps(2) 0s 3; }
.morph-word.glitch::before,
.morph-word.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  pointer-events: none;
}
.morph-word.glitch::before { color: #ff5a8d; transform: translate(-2px,-1px); mix-blend-mode: screen; }
.morph-word.glitch::after { color: #53d9ff; transform: translate(2px,1px); mix-blend-mode: screen; }
.morph-word .dud { color: var(--accent); opacity: .95; }
@keyframes glitchShift {
  0% { transform: translate(0,0); }
  25% { transform: translate(-2px,1px) skewX(-3deg); }
  50% { transform: translate(2px,-1px); }
  75% { transform: translate(-1px,1px) skewX(2deg); }
  100% { transform: translate(0,0); }
}
.twinkle {
  color: var(--accent);
  font-size: .32em;
  vertical-align: super;
  animation: twinkle 2.4s ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: .4; transform: scale(.9) rotate(0); } 50% { opacity: 1; transform: scale(1.12) rotate(16deg); } }
.hero-sub {
  max-width: 44rem;
  color: var(--muted);
  font-size: 1.06rem;
}
.terminal-search { margin-top: 28px; max-width: 700px; }
.shell-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: .84rem;
}
.search-inline,
.search { position: relative; }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 0 14px;
  min-height: 56px;
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.03) inset;
}
.search-box:focus-within { border-color: var(--border-strong); box-shadow: 0 0 0 4px rgba(139,92,246,.12); }
.search-box .mag {
  color: var(--accent-2);
  font: 700 1rem/1 ui-monospace, monospace;
}
.search-box input {
  flex: 1;
  width: 100%;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font: 500 1rem/1.4 ui-monospace, monospace;
}
.search-box input::placeholder { color: rgba(157,148,179,.85); }
.search-go {
  align-self: stretch;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--accent-2);
  font: 700 .92rem/1 ui-monospace, monospace;
  padding: 0 18px;
  cursor: pointer;
}
.search-go:hover { color: var(--text); background: rgba(255,255,255,.03); }
.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  display: none;
  background: rgba(10,7,18,.96);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 25;
}
.search-results.show { display: block; }
.search-results a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.search-results a + a { border-top: 1px solid var(--line); }
.search-results a:hover { background: rgba(255,255,255,.03); }
.search-results .ricon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--accent-2);
}
.search-results .rname { font-weight: 700; }
.search-results .rdesc { color: var(--muted); font-size: .92rem; }

.hero-art {
  position: relative;
  min-height: 380px;
  display: grid;
  place-items: center;
}
.aura-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-hat {
  position: relative;
  z-index: 2;
  max-width: 82%;
  max-height: 320px;
  filter: drop-shadow(0 28px 60px rgba(0,0,0,.55));
  animation: floaty 6s ease-in-out infinite;
}
.art-caption {
  position: absolute;
  left: 0;
  bottom: 10px;
  color: var(--muted);
  font-size: .78rem;
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.inline-section,
.page-head,
.tool-view,
.placeholder { max-width: 100%; }
.section-terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 8px;
}
.prompt { color: var(--accent-2); }
.tool-list { display: flex; flex-direction: column; }
.tool-line {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.tool-line:hover { color: var(--accent-2); }
.tool-line-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.tool-line-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--accent-2);
}
.tool-icon-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.tool-icon-image + .tool-icon-fallback { display: none; }
.tool-icon-image.is-hidden + .tool-icon-fallback { display: inline; }
.tool-line-name {
  display: block;
  font-weight: 700;
  font-size: 1.04rem;
}
.tool-line-desc {
  display: block;
  color: var(--muted);
  font-size: .94rem;
}
.tool-line-run {
  color: var(--muted);
  font: 500 .9rem/1 ui-monospace, monospace;
}
.page-head { margin-bottom: 24px; }
.page-head h1,
.placeholder h1 { margin: 10px 0 8px; font-size: clamp(2.3rem, 5vw, 3.8rem); letter-spacing: -.03em; }
.cat-label {
  margin: 30px 0 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  font: 700 .78rem/1 ui-monospace, monospace;
}
.back { margin-bottom: 20px; }
.tool-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.tool-header .ticon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent-2);
  background: linear-gradient(180deg, rgba(139,92,246,.18), rgba(139,92,246,.05));
  border: 1px solid var(--border);
  font-size: 1.4rem;
}
.tool-header .ticon .tool-icon-image { width: 40px; height: 40px; }
.tool-header h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); }

.terminal-panel {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(12,9,20,.88), rgba(7,5,12,.92));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.02);
}
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff6b81; }
.dot.amber { background: #ffd166; }
.dot.green { background: #2ed573; }
.panel-title {
  margin-left: 8px;
  color: var(--muted);
  font: 500 .85rem/1 ui-monospace, monospace;
}
.panel { padding: 0; }
#tool-root { padding: 24px; }

label {
  display: block;
  margin: 14px 0 8px;
  color: var(--muted);
  font: 500 .92rem/1.4 ui-monospace, monospace;
}
input[type=text], input[type=number], textarea, select, .file-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,.02);
  color: var(--text);
  font: 500 .98rem/1.4 ui-monospace, monospace;
}
select { color-scheme: dark; }
select option {
  background-color: var(--bg-3);
  color: var(--text);
}
textarea { min-height: 160px; resize: vertical; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 220px; }
.checkbox-inline { width: auto; margin-right: 8px; }
button.action,
.panel button {
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(139,92,246,.2), rgba(139,92,246,.08));
  color: var(--text);
  padding: 12px 18px;
  font: 700 .95rem/1 ui-monospace, monospace;
  cursor: pointer;
}
button.action:hover,
.panel button:hover { border-color: var(--border-strong); background: linear-gradient(180deg, rgba(139,92,246,.28), rgba(139,92,246,.12)); }
button.action:disabled,
.panel button:disabled { opacity: .55; cursor: not-allowed; }
.result {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.result.ok { border-color: rgba(74,222,128,.35); }
.result.err { border-color: rgba(248,113,113,.38); color: #ff8a8a; }
.progress {
  height: 10px;
  margin-top: 14px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-strong));
  transition: width .2s;
}
.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}
.dl-btn:hover { border-color: var(--border-strong); }
.is-hidden { display: none !important; }

.placeholder {
  text-align: center;
  padding: 80px 18px;
}
.placeholder .big { font-size: 2.4rem; }
.site-footer {
  margin-top: 46px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 500 .88rem/1.4 ui-monospace, monospace;
}

@media (max-width: 980px) {
  body { padding-left: 0; }
  .site-header {
    left: 12px;
    top: 12px;
    bottom: auto;
    width: calc(100% - 24px);
    flex-direction: row;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
  }
  .brand { padding-bottom: 0; border-bottom: 0; }
  .main-nav { display: none; }
  .menu-toggle { display: grid; margin-left: auto; }
  .main-nav.mobile-open {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    display: flex;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(8,6,14,.95);
    backdrop-filter: blur(16px);
  }
  main { padding-top: 92px; }
  .hero-console { grid-template-columns: 1fr; gap: 28px; }
  .hero-art { min-height: 280px; }
}
@media (max-width: 640px) {
  .hero-title { font-size: clamp(3rem, 17vw, 4.8rem); }
  .title-slot { width: 7.5ch; }
  .tool-line,
  .section-terminal-head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
