:root {
  --bg:          #0d0612;
  --bg-panel:    #130a1e;
  --bg-card:     #1a0f2a;
  --bg-input:    #0a0410;
  --bg-output:   #080310;
  --amber:       #ffc55a;
  --amber-dim:   #d4860f;
  --amber-pale:  #ffe8b0;
  --text-bright: #ffffff;
  --text-mid:    #e0d4c8;
  --text-dim:    #a89880;
  --chrome:      #f0e8e0;
  --chrome-dim:  #c8b8a8;
  --border:      rgba(255,197,90,0.3);
  --border-hi:   rgba(255,197,90,0.7);
  --shadow:      rgba(255,170,0,0.15);
}

[data-theme="light"] {
  --bg:          #fafaf8;
  --bg-panel:    #ffffff;
  --bg-card:     #ffffff;
  --bg-input:    #f5f5f3;
  --bg-output:   #f0f0ee;
  --amber:       #1a1a1a;
  --amber-dim:   #8b5a00;
  --amber-pale:  #111111;
  --text-bright: #111111;
  --text-mid:    #333330;
  --text-dim:    #666660;
  --chrome:      #222220;
  --chrome-dim:  #555550;
  --border:      rgba(0,0,0,0.15);
  --border-hi:   rgba(0,0,0,0.35);
  --shadow:      rgba(0,0,0,0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--amber);
  font-family: 'JetBrains Mono', monospace;
  overflow-x: hidden;
  transition: background 0.25s, color 0.25s;
}

/* AMBIENT BACKGROUNDS */
.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s;
}

.ambient-1 {
  width: 500px;
  height: 500px;
  background: rgba(255,170,0,0.06);
  top: -150px;
  left: -80px;
}

.ambient-2 {
  width: 500px;
  height: 500px;
  background: rgba(90,20,140,0.09);
  bottom: -150px;
  right: -80px;
}

[data-theme="light"] .ambient {
  opacity: 0;
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-header {
  background: rgba(10,4,16,0.96);
  backdrop-filter: blur(12px);
}

.header-r1 {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 1.25rem;
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-text {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.02em;
  text-shadow: 0 0 14px rgba(255,197,90,0.6);
}

[data-theme="light"] .logo-text {
  color: #1a1a1a;
  text-shadow: none;
}

.logo-text .dot-com {
  color: var(--amber-dim);
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--amber);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1.1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* SEARCH BOX */
.search-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--chrome-dim);
  font-size: 13px;
}

.search-box {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 12px 6px 30px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-bright);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box::placeholder {
  color: var(--chrome-dim);
}

.search-box:focus {
  border-color: var(--border-hi);
  box-shadow: 0 0 12px var(--shadow);
}

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-hi);
  border-radius: 5px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 300;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

.search-results.open {
  display: block;
}

.sr-item {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.sr-item:last-child {
  border-bottom: none;
}

.sr-item:hover {
  background: var(--bg-card);
}

.sr-name {
  font-size: 12px;
  color: var(--amber-pale);
  font-weight: 500;
}

.sr-cat {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 1px;
}

.sr-none {
  padding: 1rem;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

/* TOGGLE BUTTON */
.header-r1-right {
  display: flex;
  justify-content: flex-end;
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #2d1f48;
  border: 1.5px solid rgba(255,197,90,0.35);
  border-radius: 20px;
  padding: 4px 12px 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--chrome);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.toggle-btn:hover {
  border-color: var(--amber);
  background: var(--bg-card);
  color: var(--amber);
}

.toggle-icon {
  font-size: 14px;
  color: var(--amber);
}

[data-theme="light"] .toggle-btn {
  background: #e8e4dc;
  border-color: rgba(0,0,0,0.25);
  color: #1a1a1a;
}

[data-theme="light"] .toggle-icon {
  color: #8b5a00;
}

/* NAVIGATION */
.header-r2 {
  display: flex;
  flex-wrap: wrap;
  padding: 0 0.75rem;
  min-height: 34px;
  align-items: center;
}

.nav-cat {
  padding: 0.45rem 0.7rem;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
  text-decoration: none;
  display: inline-block;
}

.nav-cat:hover,
.nav-cat.active {
  color: var(--amber);
  border-bottom-color: var(--amber);
}

[data-theme="light"] .nav-cat.active,
[data-theme="light"] .nav-cat:hover {
  color: #8b5a00;
  border-bottom-color: #8b5a00;
}

/* HERO SECTION */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 2rem 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.12) 2px,
    rgba(0,0,0,0.12) 4px
  );
}

[data-theme="light"] .hero::before {
  background: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.4) 100%);
}

[data-theme="light"] .hero::after {
  background: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.55rem;
}

.hero-eyebrow span {
  color: var(--amber-dim);
}

.hero-title {
  font-size: clamp(1.35rem, 3.5vw, 2.3rem);
  font-weight: 700;
  color: var(--amber);
  line-height: 1.2;
  margin-bottom: 0.6rem;
  text-shadow: 0 0 28px rgba(255,170,0,0.45);
  transition: color 0.25s;
}

[data-theme="light"] .hero-title {
  color: #111;
  text-shadow: none;
}

.hero-title .hi {
  color: var(--amber-dim);
  font-weight: 300;
}

[data-theme="light"] .hero-title .hi {
  color: #8b5a00;
}

.hero-sub {
  font-size: 12px;
  color: var(--text-mid);
  max-width: 500px;
  margin: 0 auto 1.4rem;
  line-height: 2;
}

.hero-sub .line {
  display: block;
}

.hero-sub .line-last {
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 0.04em;
}

[data-theme="light"] .hero-sub .line-last {
  color: #8b5a00;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--amber);
  display: block;
  text-shadow: 0 0 12px rgba(255,170,0,0.55);
  transition: color 0.25s;
}

[data-theme="light"] .stat-num {
  color: #8b5a00;
  text-shadow: none;
}

.stat-label {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* AD SLOTS */
.ad-slot {
  border: 1px dashed var(--border);
  border-radius: 4px;
  transition: border-color 0.25s;
}

.ad-slot--leader {
  height: 90px;
  margin: 1.25rem auto;
}

/* MAIN GRID */
.main {
  position: relative;
  max-width: 1380px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* CATEGORY SECTIONS */
.cat-section {
  margin-bottom: 2rem;
}

.cat-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

.cat-icon {
  font-size: 14px;
}

.cat-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--amber);
}

.cat-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
}

.cat-count {
  font-size: 9.5px;
  color: var(--text-dim);
}

/* TOOL GRID */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 7px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,197,90,0.05), transparent 60%);
  opacity: 0;
  transition: opacity 0.15s;
}

.tool-card:hover {
  background: var(--bg-card);
  border-color: var(--border-hi);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px var(--shadow);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-icon {
  font-size: 15px;
  margin-bottom: 5px;
  display: block;
  color: var(--amber);
  transition: color 0.25s;
}

[data-theme="light"] .tool-card-icon {
  color: #8b5a00;
}

.tool-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--amber-pale);
  margin-bottom: 3px;
  line-height: 1.3;
}

[data-theme="light"] .tool-card-name {
  color: #111;
}

.tool-card-desc {
  font-size: 10.5px;
  color: var(--text-mid);
  line-height: 1.5;
}

.tool-card-tag {
  position: absolute;
  top: 7px;
  right: 7px;
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
}

.tag-hot {
  background: rgba(255,80,80,0.15);
  color: #ff8080;
  border: 1px solid rgba(255,80,80,0.25);
}

.tag-new {
  background: rgba(57,255,20,0.1);
  color: #6fff50;
  border: 1px solid rgba(57,255,20,0.2);
}

/* FOOTER */
.footer {
  position: relative;
  border-top: 1px solid var(--border);
  padding: 1.25rem;
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

.footer span {
  color: var(--amber-dim);
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-hi);
  border-radius: 3px;
}

/* MOBILE RESPONSIVE */
@media (max-width: 600px) {
  .header-r1 {
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
  }

  .toggle-btn .tgl-label {
    display: none;
  }

  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .logo-text {
    font-size: 12px;
  }

  .hero {
    padding: 1.5rem 1rem 1.25rem;
  }

  .hero-title {
    font-size: clamp(1rem, 2.5vw, 1.8rem);
  }

  .hero-sub {
    font-size: 11px;
    line-height: 1.8;
    margin-bottom: 1rem;
  }

  .hero-stats {
    gap: 1rem;
  }

  .stat-num {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 8px;
  }

  .cat-header {
    gap: 0.4rem;
    margin-bottom: 0.6rem;
  }

  .cat-name {
    font-size: 10px;
  }

  .cat-count {
    font-size: 8.5px;
  }

  .tool-card {
    padding: 0.65rem 0.75rem;
  }

  .tool-card-icon {
    font-size: 13px;
  }

  .tool-card-name {
    font-size: 11px;
  }

  .tool-card-desc {
    font-size: 9.5px;
  }

  .main {
    padding: 1rem 1rem 3rem;
  }
}

/* UTILITY CLASSES */
.rel-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 2px;
}

[data-theme="light"] .rel-name {
  color: #111;
}

/* TOOL PAGE SPECIFIC */
.tool-wrap {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 1.4rem 1.25rem 3rem;
}

.breadcrumb {
  font-size: 10.5px;
  color: var(--chrome-dim);
  margin-bottom: 1rem;
  display: flex;
  gap: 0.4rem;
}

.breadcrumb a {
  color: var(--amber-dim);
  text-decoration: none;
}

.tool-header {
  margin-bottom: 0.5rem;
}

.tool-header-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.3rem;
}

.tool-header-icon {
  font-size: 20px;
  color: var(--amber);
}

.tool-title {
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  font-weight: 700;
  color: var(--text-bright);
}

[data-theme="light"] .tool-title {
  color: #111;
}

.tool-desc {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.65;
}

/* TOOL INTERFACE */
.tool-interface {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.tool-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 10.5px;
  color: var(--chrome);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: auto;
  font-weight: 700;
}

textarea.tool-input {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  background: var(--bg-input);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-bright);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  padding: 0.85rem 1rem;
  caret-color: var(--amber);
}

textarea.tool-input::placeholder {
  color: var(--chrome-dim);
}

.tool-options {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.85rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.opt-label {
  font-size: 10.5px;
  color: var(--chrome);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.opt-group {
  display: flex;
  gap: 3px;
}

.opt-btn {
  background: #ffffff;
  color: #222222;
  border: 1px solid #999;
  padding: 3px 9px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
}

.opt-btn.active {
  background: #ffc55a;
  color: #ffffff;
  border-color: #ffc55a;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  min-height: 28px;
}

.status-neutral {
  color: var(--chrome);
  font-weight: 600;
}

.status-ok {
  color: #7fff60;
  background: rgba(57,255,20,0.12);
  padding: 1px 7px;
  border-radius: 3px;
  font-weight: 700;
}

.status-err {
  color: #ff9090;
  background: rgba(255,144,144,0.12);
  padding: 1px 7px;
  border-radius: 3px;
  font-weight: 700;
}

.output-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.output-label {
  font-size: 10.5px;
  color: var(--chrome);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-right: auto;
  font-weight: 700;
}

.copy-confirm {
  font-size: 10px;
  color: #7fff60;
  opacity: 0;
  transition: opacity 0.3s;
  font-weight: 700;
}

.copy-confirm.show {
  opacity: 1;
}

pre.tool-output {
  min-height: 140px;
  padding: 0.85rem 1rem;
  background: var(--bg-output);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-mid);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}

pre.tool-output.empty {
  color: var(--chrome-dim);
}

/* RELATED TOOLS */
.related {
  margin-top: 2rem;
}

.related-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--chrome);
  margin-bottom: 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 7px;
}

.rel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  text-decoration: none;
  display: block;
  transition: all 0.15s;
}

.rel-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-1px);
}

.rel-desc {
  font-size: 10.5px;
  color: var(--chrome-dim);
}
