/*
 * devtoken.tools — homepage styles (index.html only)
 * Builds on style.css tokens.
 */

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--accent);
  color: #06240f;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 14px;
}
.skip-link:focus { top: 12px; text-decoration: none; }

.home .wrap { padding-top: 24px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 16px;
}

/* ── Header ── */

.home-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.home-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-family: var(--mono);
  font-size: 14px;
}

.home-nav > a {
  color: var(--text-2);
  padding: 10px 0;
}
.home-nav > a:hover { color: var(--accent); text-decoration: none; }

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 260px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: var(--bg2);
  color: var(--muted);
  cursor: text;
}
.search-box[hidden] { display: none; }
.search-box:focus-within { border-color: var(--accent); }

.search-box input[type="search"] {
  flex: 1;
  min-width: 0;
  width: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  caret-color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  line-height: 1;
  color-scheme: dark; /* light clear (×) button on the dark field */
}
.search-box input[type="search"]::placeholder { color: var(--muted); opacity: 0.8; }
.search-box input[type="search"]:focus { border: none; }
.search-box input[type="search"]:focus-visible { outline: none; }

.search-box kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--muted);
}

/* ── Hero ── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
  padding: 80px 0 88px;
}

.hero h1 {
  font-size: 50px;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 24px;
}
.hero h1 span { color: var(--muted); }

.hero-sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 540px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  transition: border-color 0.15s, background 0.15s;
}
.btn-link:hover { border-color: var(--accent); text-decoration: none; }

.btn-link-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #06240f;
  font-weight: 600;
}
.btn-link-primary:hover { background: #86efac; }

.hero-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}

/* ── Example panel ── */

.example-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.example-head,
.example-panel figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.example-head { border-bottom: 1px solid var(--border); }
.example-panel figcaption { border-top: 1px solid var(--border); letter-spacing: 0; }

.example-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.example-token {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
  word-break: break-all;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.example-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 13px;
}
.example-label { font-size: 11px; letter-spacing: 0.08em; }
.example-box .str { color: #86efac; }
.example-box .num { color: #93c5fd; }
.example-box .dim { color: var(--muted); }

.example-audit {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}
.example-audit li {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
}
.example-audit li > span {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 12px;
  min-width: 34px;
  padding-top: 2px;
}
/* The text sits in a <p> so inline <code> flows with it */
.example-audit li > p { margin: 0; line-height: 1.5; min-width: 0; }
.example-audit .fail { background: rgba(239, 68, 68, 0.1); }
.example-audit .fail > span { color: #fca5a5; }
.example-audit .fix { background: rgba(74, 222, 128, 0.06); }
.example-audit .fix > span { color: var(--local); }
.example-audit code { overflow-wrap: anywhere; color: var(--text); background: rgba(255, 255, 255, 0.06); padding: 0 4px; border-radius: 3px; }
.example-audit .warn { background: rgba(251, 191, 36, 0.08); }
.example-audit .warn > span { color: var(--shared); }
.example-audit .ok { background: rgba(74, 222, 128, 0.08); }
.example-audit .ok > span { color: var(--local); }
.example-audit code { font-family: var(--mono); }

.example-caption { font-size: 14px; color: var(--text-2); margin: 0; }
.example-code {
  margin: 0;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.example-code .k { color: #c4b5fd; }
.example-code .str { color: #86efac; }

.hero-facts a { color: var(--accent); }
.hero-sub a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── Featured tools ("start from the problem") ── */

.featured-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.featured-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg2);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.featured-card:hover { border-color: var(--accent); background: var(--bg3); text-decoration: none; }
.featured-q { font-size: 21px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.featured-tool { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.featured-name { font-family: var(--mono); font-size: 14px; color: var(--accent); }
.featured-desc { font-size: 15px; line-height: 1.5; color: var(--text-2); }

/* ── Sections ── */

.home-section {
  padding: 88px 0;
  border-top: 1px solid var(--border);
}

.section-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px 48px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.section-intro h2 {
  font-family: var(--mono);
  font-size: 36px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.03em;
  max-width: 680px;
}
.section-intro > p {
  max-width: 420px;
  font-size: 17px;
  color: var(--text-2);
}

/* ── Privacy cards ── */

.privacy-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.privacy-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.privacy-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.privacy-card-count { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.privacy-card h3 { font-size: 24px; font-weight: 600; }
.privacy-card ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-2);
}

.flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--border2);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 13px;
}
.flow-box {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}
.flow-arrow { color: var(--muted); }
.flow-local { border-color: var(--accent); color: var(--local); }
.flow-none { margin-left: auto; color: var(--muted); text-decoration: line-through; }
.flow-shared, .flow-step { color: var(--shared); }
.flow-shared-box { border-color: #fbbf24; color: var(--shared); }

/* ── Tool list ── */

.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chips[hidden] { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
}
.chip .chip-count { color: var(--muted); }
.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--local-bg);
  color: var(--text);
}
.chip[aria-pressed="true"] .chip-count { color: var(--local); }
.chip:hover { opacity: 1; border-color: var(--accent); }

.tool-group { margin-bottom: 32px; }
.tool-group[hidden] { display: none; }

.tool-group-title {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 14px;
}

.tool-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tool-item[hidden] { display: none; }

.tool-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 18px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.tool-row:hover { border-color: var(--accent); background: var(--bg3); text-decoration: none; }

.tool-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.tool-row-name { font-size: 18px; font-weight: 600; }
.tool-row-desc { font-size: 15px; line-height: 1.5; color: var(--text-2); }
.tool-row-path { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tool-row-match {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.tool-row-match[hidden] { display: none; }

.no-results {
  padding: 24px;
  border: 1px dashed var(--border2);
  border-radius: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
  margin-bottom: 32px;
}

/* ── Responsive ── */

@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 56px 0 64px; }
  .hero h1 { font-size: 40px; }
  .privacy-cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .home-header { flex-direction: column; align-items: stretch; }
  .home-nav { flex-wrap: wrap; gap: 8px 20px; }
  .search-box { width: 100%; order: 3; }
  .tool-list { grid-template-columns: minmax(0, 1fr); }
  .featured-list { grid-template-columns: minmax(0, 1fr); }
  .featured-q { font-size: 19px; }
  .section-intro h2 { font-size: 26px; }
  .home-section { padding: 56px 0; }
}

@media (max-width: 600px) {
  .wrap.wrap-wide { padding-left: 16px; padding-right: 16px; }
  .hero h1 { font-size: 32px; }
  .hero-sub { font-size: 17px; }
  .hero-actions { flex-direction: column; }
  .btn-link { justify-content: center; }
  .example-grid { grid-template-columns: minmax(0, 1fr); }
  .example-token { font-size: 13px; }
  .example-code { font-size: 11px; padding: 10px 12px; }
  .featured-card { padding: 18px; }
  .privacy-card { padding: 20px; }
  .flow-none { margin-left: 0; }
  .chip { width: auto; }
}

/* Shown when a retired tool redirects here (#retired=<id>) */
.retired-notice {
  padding: 14px 16px;
  margin-bottom: 28px;
  border: 1px solid #4a3a12;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.07);
  color: var(--text-2);
  font-size: 15px;
}
.retired-notice[hidden] { display: none; }
.retired-notice strong { color: var(--text); }
