/* SkyyCast Tools hub (/tools/).
 *
 * Loaded by that page only, after assets/sc-public.css. It holds only `th-*`
 * components, all scoped under `.pub-site` and built from the `--pub-*`
 * tokens: no new colours, no new fonts, nothing on :root/html/body. The hero
 * reuses the existing `.pub-night` panel remap (same mechanism as the
 * homepage night sections) instead of introducing a second dark palette.
 * Motion is a restrained lift/tilt and is switched off under
 * prefers-reduced-motion. To add a tool later, add one <li> with a `th-card`
 * to the grid in tools/index.html. */

.pub-site .th-hero {
  text-align: center;
  max-width: 900px;
  margin: 0 auto 3rem;
  padding: clamp(2.25rem, 5vw, 3.5rem) clamp(1.25rem, 5vw, 3rem);
  border-radius: var(--pub-radius-xl);
  border: 1px solid var(--pub-night-border);
  box-shadow: var(--pub-glow-night);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.pub-site .th-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 90% at 18% -10%, rgba(47, 91, 255, .35), transparent 60%),
    radial-gradient(55% 80% at 100% 110%, rgba(44, 204, 228, .22), transparent 60%);
}
.pub-site .th-hero-eyebrow {
  background: rgba(44, 204, 228, .14);
  color: var(--pub-night-text);
  border-color: var(--pub-night-border);
}
.pub-site .th-hero .sc-eyebrow { margin-bottom: 1.1rem; }
.pub-site .th-hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.5rem);
  line-height: 1.05;
  margin: 0 0 1rem;
  text-wrap: balance;
  color: var(--pub-night-text);
}
.pub-site .th-hero-lede { margin: 0 auto; max-width: 56ch; text-align: center; color: var(--pub-night-text-secondary); }
.pub-site .th-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}
.pub-site .th-hero .th-chips li {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 32px;
  padding: .25rem .8rem;
  border: 1px solid var(--pub-night-border);
  border-radius: var(--pub-radius-pill);
  background: rgba(238, 242, 255, .06);
  color: var(--pub-night-text-secondary);
  font-size: .875rem;
  font-weight: 600;
}
.pub-site .th-hero .th-chips li::before { content: "\2713"; color: var(--pub-accent-secondary); font-weight: 800; }

/* ---- Category ---- */
.pub-site .th-category { max-width: 1100px; margin: 0 auto 2.75rem; }
.pub-site .th-category:last-of-type { margin-bottom: 0; }
.pub-site .th-cat-title {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: 0 0 .5rem;
  font-size: .8125rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--pub-accent-strong);
}
.pub-site .th-cat-title::after { content: ""; flex: 1; height: 1px; background: var(--pub-border); }
.pub-site .th-cat-intro { margin: 0 0 1.25rem; color: var(--pub-text-secondary); font-size: 1rem; line-height: 1.6; text-align: left; }

/* ---- Cards ----
 * A dense, self-wrapping grid: cards hold to a natural width (don't stretch
 * to fill a half-empty row), so a category with one tool reads as a
 * normal-sized card rather than a stretched island, while a category with
 * several tools naturally packs more per row as the viewport grows. */
.pub-site .th-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
.pub-site .th-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "icon body" "go go";
  gap: .75rem 1rem;
  align-items: start;
  height: 100%;
  box-sizing: border-box;
  padding: 1.5rem;
  border: 1px solid var(--pub-border);
  border-radius: var(--pub-radius-lg);
  background: var(--pub-surface);
  box-shadow: var(--pub-shadow-sm);
  color: var(--pub-text);
  text-decoration: none;
  transform: translateZ(0);
  transition: transform var(--pub-dur) var(--pub-ease), box-shadow var(--pub-dur) var(--pub-ease), border-color var(--pub-dur) var(--pub-ease);
}
.pub-site .th-card:hover,
.pub-site .th-card:focus-visible {
  transform: translateY(-6px);
  border-color: var(--pub-accent);
  box-shadow: var(--pub-glow), var(--pub-shadow-lg);
}
.pub-site .th-card:focus-visible { outline: none; box-shadow: var(--pub-ring), var(--pub-glow), var(--pub-shadow-lg); }
/* ---- Icon tiles ----
 * Each tool gets its own custom SVG mark (built in tools/index.html, not an
 * icon font/library) and its own accent pair, so the five read as distinct
 * product marks rather than one glyph recolored five times. The tile itself
 * stays one shared shape/depth language (--th-ic-a/--th-ic-b per card set
 * the tint and glow; everything else -- radius, highlight, shadow curve --
 * is identical across tools) so the family still reads as one system. */
.pub-site .th-icon {
  --th-ic-a: var(--pub-accent);
  --th-ic-b: var(--pub-accent-secondary);
  grid-area: icon;
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 15px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--th-ic-a) 16%, #fff) 0%, color-mix(in srgb, var(--th-ic-b) 14%, #fff) 100%);
  color: var(--th-ic-a);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .8),
    inset 0 -8px 12px -8px color-mix(in srgb, var(--th-ic-a) 35%, transparent),
    0 8px 16px -9px color-mix(in srgb, var(--th-ic-a) 55%, transparent);
  transition: transform var(--pub-dur) var(--pub-ease), box-shadow var(--pub-dur) var(--pub-ease);
}
.pub-site .th-icon svg { width: 40px; height: 40px; position: relative; overflow: visible; }
.pub-site .th-icon .th-ic-badge { transition: transform var(--pub-dur) var(--pub-ease); transform-box: fill-box; transform-origin: center; }
.pub-site .th-card[href="/tools/bluesky-image-size-checker"] .th-icon { --th-ic-a: #3B6CFF; --th-ic-b: #2CCCE4; }
.pub-site .th-card[href="/tools/bluesky-post-validator"] .th-icon { --th-ic-a: #6150E8; --th-ic-b: #9B6BF2; }
.pub-site .th-card[href="/tools/bluesky-video-upload-checker"] .th-icon { --th-ic-a: #2E8FF0; --th-ic-b: #38BDF8; }
.pub-site .th-card[href="/tools/image-compressor"] .th-icon { --th-ic-a: #9A33E0; --th-ic-b: #E14FD0; }
.pub-site .th-card[href="/tools/utm-builder"] .th-icon { --th-ic-a: #0E9E8E; --th-ic-b: #16C784; }
.pub-site .th-card:hover .th-icon,
.pub-site .th-card:focus-visible .th-icon {
  transform: translateY(-5px) rotate(-2.5deg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -8px 12px -8px color-mix(in srgb, var(--th-ic-a) 42%, transparent),
    0 16px 26px -11px color-mix(in srgb, var(--th-ic-a) 65%, transparent);
}
.pub-site .th-card:hover .th-icon .th-ic-badge,
.pub-site .th-card:focus-visible .th-icon .th-ic-badge {
  transform: translate(0, -2px);
}
.pub-site .th-card-body { grid-area: body; min-width: 0; }
.pub-site .th-card-title { margin: 0 0 .35rem; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; color: var(--pub-text); }
.pub-site .th-card-desc { margin: 0; font-size: .9375rem; line-height: 1.55; color: var(--pub-text-secondary); text-align: left; }
.pub-site .th-go {
  grid-area: go;
  align-self: end;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .9375rem;
  font-weight: 700;
  color: var(--pub-accent-strong);
}
.pub-site .th-arrow { display: inline-block; transition: transform var(--pub-dur) var(--pub-ease); }
.pub-site .th-card:hover .th-arrow, .pub-site .th-card:focus-visible .th-arrow { transform: translateX(4px); }

/* From 640px: cards sit in a column-oriented layout (icon stacked above
   body) and the grid self-wraps to a natural card width instead of three
   fixed tracks, so the row density follows how many tools a category has. */
@media (min-width: 640px) {
  .pub-site .th-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 320px)); gap: 1.25rem; }
  .pub-site .th-card { grid-template-columns: minmax(0, 1fr); grid-template-areas: "icon" "body" "go"; gap: 1rem; }
  .pub-site .th-go { align-self: end; }
}

/* ---- About ---- */
.pub-site .th-about { max-width: 780px; margin: 3.5rem auto 0; }
.pub-site .th-about h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 0 0 .75rem; }
.pub-site .th-about p { color: var(--pub-text-secondary); line-height: 1.7; margin: 0 0 1rem; text-align: left; }

@media (prefers-reduced-motion: reduce) {
  .pub-site .th-card, .pub-site .th-arrow, .pub-site .th-icon, .pub-site .th-ic-badge { transition: none; }
  .pub-site .th-card:hover, .pub-site .th-card:focus-visible { transform: none; }
  .pub-site .th-card:hover .th-icon, .pub-site .th-card:focus-visible .th-icon { transform: none; }
  .pub-site .th-card:hover .th-icon .th-ic-badge, .pub-site .th-card:focus-visible .th-icon .th-ic-badge { transform: none; }
  .pub-site .th-card:hover .th-arrow, .pub-site .th-card:focus-visible .th-arrow { transform: none; }
}
