/* ── Hero (dark gradient) ───────────────────────── */
.ti-tools-layout {
  --ti-accent: #fe391f;
  --ti-accent-soft: rgba(254,57,31,.12);
  display: flex;
  flex-direction: column;
}
.ti-tools-layout > .ti-hero { order: 1; }
.ti-tools-layout > .ti-category-nav { order: 2; }
.ti-tools-layout > .ti-categories { order: 3; }
.ti-tools-layout > .ti-workflows { order: 4; }
.ti-tools-layout > .ti-intro { order: 5; }
.ti-hero { padding: 0; }
.ti-hero-box {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  align-items: stretch; gap: 32px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 24px;
  background: #1c1c1c;
  box-shadow: 0 24px 70px rgba(43, 43, 43,.16);
  padding: 28px 30px;
}
.ti-hero-box::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle at 85% 12%, rgba(254,57,31,.12), transparent 34%);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, #000, transparent 86%);
}
.ti-hero-copy { position: relative; z-index: 1; align-self: center; }
.ti-hero-box .std-kicker { width: fit-content; margin: 0 0 16px; position: relative; z-index: 1; }
.ti-hero h1 {
  max-width: 720px; font-size: clamp(34px, 3.8vw, 52px); font-weight: 900;
  line-height: .98; letter-spacing: -2.6px; color: #fff; margin: 0 0 18px;
  position: relative; z-index: 1;
}
.ti-hero p {
  font-size: 16px; color: #c8c8c8; max-width: 680px;
  margin: 0; line-height: 1.65; position: relative; z-index: 1;
}

/* Stats row */
.ti-stats { display: flex; gap: 20px; margin-top: 20px; position: relative; z-index: 1; }
.ti-stat { min-width: 92px; padding-right: 20px; border-right: 1px solid rgba(255,255,255,.14); }
.ti-stat:last-child { border-right: none; }
.ti-stat b { display: block; font-size: 22px; font-weight: 900; color: #fff; letter-spacing: -.7px; line-height: 1; }
.ti-stat span { display: block; font-size: 10px; color: #b3b3b3; text-transform: uppercase; letter-spacing: .08em; font-family: var(--mono); margin-top: 4px; }

/* Task finder */
.ti-hero-panel {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 18px;
  background: rgba(255,255,255,.055); padding: 16px;
}
.ti-hero-panel-label { color: #fff; font-size: 13px; font-weight: 800; }
.ti-hero-panel-note { color: #9e9e9e; font-size: 12px; line-height: 1.45; margin-top: -5px; }
.ti-search-bar {
  min-height: 52px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px;
  background: #fff; box-shadow: 0 14px 34px rgba(0,0,0,.2);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
}
.ti-search-icon { color: #626262; flex-shrink: 0; }
.ti-search-input {
  flex: 1; border: none; background: none; outline: none;
  min-width: 0; min-height: 0 !important; border: 0 !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important;
  font-size: 15px; color: #171717 !important; font-family: var(--font);
}
.ti-search-input:focus { border: 0 !important; box-shadow: none !important; }
[data-theme="dark"] .ti-hero-panel .ti-search-input { background: transparent !important; color: #171717 !important; box-shadow: none !important; }
.ti-search-input::placeholder { color: #757575; }
.ti-search-count { font-size: 11px; font-family: var(--mono); color: #626262; white-space: nowrap; }
.ti-quick-links { display: grid; grid-template-columns: 1fr; gap: 7px; }
.ti-quick-link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 38px; padding: 0 12px; border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; color: #efefef; font-size: 12px; font-weight: 750;
  background: rgba(0,0,0,.12); transition: border-color .16s, background .16s;
}
.ti-quick-link::after { content: '→'; color: #ff654f; font-size: 15px; }
.ti-quick-link:hover { border-color: rgba(255,101,79,.5); background: rgba(255,101,79,.08); }

/* Compact category navigation */
.ti-category-nav {
  display: flex; align-items: center; gap: 8px; overflow-x: auto;
  position: sticky; top: 72px; z-index: 8;
  margin: 18px 0 34px; padding: 10px 8px;
  border: 1px solid var(--border); border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  box-shadow: 0 12px 32px rgba(0,0,0,.08);
  backdrop-filter: blur(16px); scrollbar-width: thin;
}
.ti-category-nav a {
  display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto;
  min-height: 36px; padding: 0 12px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); color: var(--text);
  font-size: 12px; font-weight: 750;
}
.ti-category-nav a:hover { border-color: rgba(254,57,31,.38); color: var(--accent2); }
.ti-category-nav a[aria-current="true"] {
  border-color: rgba(254,57,31,.48);
  background: var(--ti-accent-soft);
  color: var(--accent2);
}

.ti-tools-layout.is-searching .ti-hero-box {
  grid-template-columns: 1fr;
  padding: 20px;
}
.ti-tools-layout.is-searching .ti-hero-copy,
.ti-tools-layout.is-searching .ti-quick-links,
.ti-tools-layout.is-searching .ti-hero-panel-note,
.ti-tools-layout.is-searching .ti-category-nav,
.ti-tools-layout.is-searching .ti-workflows,
.ti-tools-layout.is-searching .ti-intro { display: none; }
.ti-tools-layout.is-searching .ti-hero-panel {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
}
.ti-tools-layout.is-searching .ti-categories { padding-top: 20px; }

/* Intro copy */
.ti-intro {
  max-width: 980px;
  margin: 0 auto 54px;
  display: grid;
  gap: 14px;
}
.ti-intro p {
  font-size: 17px;
  line-height: 1.8;
  color: var(--muted);
  margin: 0;
}
.ti-intro a,
.tool-context-link {
  color: var(--accent2);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Workflow shortcuts */
.ti-workflows {
  margin: 0 0 56px;
}
.ti-workflows-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}
.ti-workflows-title {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 850;
}
.ti-workflows-note {
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.ti-workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.ti-workflow-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 18px;
}
.ti-workflow-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
}
.ti-workflow-card h2 {
  font-size: 16px;
  line-height: 1.35;
  margin: 0 0 8px;
}
.ti-workflow-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
}
.ti-workflow-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.ti-workflow-links a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--accent2);
  font-size: 12px;
  font-weight: 750;
  padding: 0 10px;
}

/* Category blocks */
.ti-categories { padding-bottom: 64px; display: flex; flex-direction: column; gap: 42px; }
.ti-category-section { scroll-margin-top: 154px; }
.ti-cat-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.ti-cat-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: rgba(254,57,31,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.ti-cat-name { font-size: 18px; line-height: 1.25; font-weight: 800; margin: 0; }
.ti-cat-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ti-cat-count { margin-left: auto; color: var(--muted); font: 11px var(--mono); }

/* Tool cards — same style as homepage */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; transition: border-color .2s, transform .2s, box-shadow .2s; position: relative; overflow: hidden;
  display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; column-gap: 12px;
}
.tool-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--accent); opacity: 0; transition: opacity .2s;
}
.tool-card.coming { opacity: .48; cursor: default; }
.tool-card.coming:hover { transform: none; box-shadow: none; border-color: var(--border); }
.tool-card.coming:hover::before { opacity: 0; }
.tool-icon {
  grid-column: 1; grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 10px; background: var(--surface2);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  flex-shrink: 0;
}
.tool-title { grid-column: 2; font-size: 15px; font-weight: 800; margin: 2px 0 5px; }
.tool-desc { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); line-height: 1.6; margin-top: 14px; }
.tool-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.tool-link {
  font-size: 12.5px; font-weight: 600; color: var(--accent2);
  display: flex; align-items: center; gap: 4px; transition: gap .15s;
}
.tool-card:hover .tool-link { gap: 8px; }
.tool-tag {
  font-size: 10px; font-family: var(--mono); padding: 2px 7px; border-radius: 3px;
  background: rgba(16,185,129,.12); color: var(--green);
}
.tool-tag.soon { background: rgba(120, 120, 120,.1); color: var(--muted); }

/* No results */
.ti-no-results {
  display: none; text-align: center; padding: 80px 24px;
  color: var(--muted); font-size: 15px; line-height: 1.7;
}
.ti-no-results b { display: block; font-size: 20px; color: var(--text); margin-bottom: 8px; }
.ti-no-results span { display: block; }
.ti-no-results button {
  min-height: 40px; margin-top: 18px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface2); color: var(--text); font: 750 13px var(--font);
  cursor: pointer;
}

/* SEO context blocks */
.tool-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.tool-context-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 22px;
}
.tool-context-card h3 {
  font-size: 18px;
  line-height: 1.35;
  margin: 0 0 10px;
}
.tool-context-card p {
  font-size: 15px;
  line-height: 1.75;
  margin: 0;
}
.tool-context-card .tool-context-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tool-context-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent2);
  font-size: 12px;
  font-weight: 700;
}

.tool-content-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.tool-content-wrap > .tool-content-section { margin: 0; }
.tool-content-wrap > .tool-content-section:nth-child(n+3) { grid-column: 1 / -1; }

:where(.ti-quick-link, .ti-category-nav a, .tool-card, .ti-workflow-links a, .tool-context-chip, .ti-no-results button):focus-visible {
  outline: 3px solid rgba(254,57,31,.34);
  outline-offset: 3px;
}

@media (hover: hover) {
  .tool-card:hover { border-color: rgba(254,57,31,.3); transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0,0,0,.3); }
  .tool-card:hover::before { opacity: 1; }
  .tool-card:hover .tool-icon { background: rgba(254,57,31,.12); }
}

@media (prefers-reduced-motion: reduce) {
  .tool-card,
  .tool-card::before,
  .tool-link,
  .ti-quick-link { transition: none; }
  .tool-card:hover { transform: none; }
}

@media (max-width: 900px) {
  .ti-hero-box { grid-template-columns: 1fr; }
  .ti-hero-panel { display: grid; grid-template-columns: 1fr 1fr; align-content: center; }
  .ti-hero-panel-label,
  .ti-hero-panel-note,
  .ti-search-bar { grid-column: 1 / -1; }
  .ti-workflow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .tools-grid { grid-template-columns: 1fr; }
  .ti-hero-box { grid-template-columns: 1fr; gap: 24px; padding: 26px 18px; border-radius: 18px; }
  .ti-hero h1 { letter-spacing: -1.6px; }
  .ti-stats { gap: 12px; }
  .ti-stat { min-width: 0; padding-right: 12px; }
  .ti-hero-panel { display: flex; padding: 14px; }
  .ti-category-nav { top: 62px; margin-bottom: 28px; border-radius: 12px; }
  .ti-category-section { scroll-margin-top: 142px; }
  .ti-intro { margin-bottom: 44px; }
  .ti-intro p { font-size: 16px; }
  .ti-workflows-head { display: block; }
  .ti-workflows-note { margin-top: 8px; }
  .ti-workflow-grid { grid-template-columns: 1fr; }
  .tool-context-grid { grid-template-columns: 1fr; }
  .tool-content-wrap { grid-template-columns: 1fr; }
  .tool-content-wrap > .tool-content-section { grid-column: 1; }
  .ti-cat-header { align-items: flex-start; }
  .ti-cat-count { padding-top: 6px; }
}
