/* Tools page — fully theme-aware. Section backgrounds swap with the theme
   (tool-*.png for dark, tool-*-light.png for light); titles/labels are HTML
   overlaid on the imagery so the text stays editable. */

/* ---------- Hero ---------- */

.tools-hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(420px, 42vw, 600px);
  display: flex;
  align-items: flex-start;
  padding: clamp(7rem, 10vw, 9rem) var(--page-edge) 3.5rem;
  isolation: isolate;
  background: var(--ink) !important;
  background-image: none !important;
  background-repeat: no-repeat !important;
}
.tools-hero::after {
  content: none !important;
  background: none !important;
  background-image: none !important;
}
.tools-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  background-image:
    linear-gradient(90deg, rgba(var(--scrim-rgb), .92) 0%, rgba(var(--scrim-rgb), .72) 30%, rgba(var(--scrim-rgb), .25) 46%, transparent 62%),
    url('assets/tools-hero.webp');
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}
[data-theme="light"] .tools-hero::before {
  background-image:
    linear-gradient(90deg, rgba(var(--scrim-rgb), .92) 0%, rgba(var(--scrim-rgb), .72) 30%, rgba(var(--scrim-rgb), .25) 46%, transparent 62%),
    url('assets/tools-hero.webp');
}

.tools-hero-copy { position: relative; z-index: 1; width: 560px; max-width: 100%; }
.tools-hero-copy .section-kicker { color: var(--orange); }
.tools-hero-copy h1 {
  margin: .6rem 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 3.6vw, 3rem);
  line-height: 1.12;
  color: var(--cream);
  text-shadow: 0 2px 14px rgba(var(--scrim-rgb), .45);
}
.tools-hero-rule { display: block; width: 2.6rem; height: 3px; margin: 1.4rem 0 1.1rem; background: var(--orange); }
.tools-hero-body {
  margin: 0;
  max-width: 34rem;
  font-size: .95rem;
  line-height: 1.65;
  color: var(--cream);
  text-shadow: 0 1px 10px rgba(var(--scrim-rgb), .45);
}

/* ---------- Tool cards ---------- */

.tools-list { width: 100%; margin: 0; padding: 0 var(--page-edge) 1rem; }

.tool-card {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  padding: clamp(2rem, 4vw, 3rem) clamp(.5rem, 1.5vw, 1rem);
  border-top: 1px solid var(--hairline);
}
.tool-card:first-child { border-top: 0; }
.tool-card-flip { grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); }

.tool-media {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  min-height: 250px;
  align-self: stretch;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: color-mix(in srgb, var(--ink), var(--cream) 6%);
}
.tool-media-bsf { background-image: url('assets/tool-bsf.png'); }
.tool-media-bbw { background-image: url('assets/tool-bbw.png'); aspect-ratio: 351 / 195; align-self: center; min-height: 0; }
.tool-media-linm { background-image: url('assets/tool-img-linm.png'); aspect-ratio: 296 / 172; align-self: center; min-height: 0; }
.tool-media-slg { background-image: url('assets/tool-img-slg.png'); aspect-ratio: 352 / 156; align-self: center; min-height: 0; }
[data-theme="light"] .tool-media-bsf { background-image: url('assets/tool-bsf-light.png'); }
[data-theme="light"] .tool-media-bbw { background-image: url('assets/tool-bbw-light.png'); }
[data-theme="light"] .tool-media-linm { background-image: url('assets/tool-img-linm-light.png'); }
[data-theme="light"] .tool-media-slg { background-image: url('assets/tool-img-slg-light.png'); }

/* Overlaid titles: hidden in dark (the dark artwork carries its own lettering),
   shown in light where the backgrounds are text-free. */
.tool-media-overlay { display: none; position: absolute; margin: 0; }
[data-theme="light"] .tool-media-overlay { display: block; }

.overlay-bsf {
  top: 1.1rem; left: 1.2rem;
  color: #17130e;
  font-weight: 800;
  font-size: clamp(.95rem, 1.4vw, 1.15rem);
  line-height: 1.28;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.overlay-linm { inset: auto auto 0 0; padding: 2rem 2.4rem 1.2rem 1.2rem; background: radial-gradient(120% 120% at 0% 100%, rgba(0,0,0,.62) 0%, rgba(0,0,0,.35) 60%, transparent 100%); }
.overlay-linm-title {
  margin: 0 0 .6rem;
  color: #f7f5f0;
  font-weight: 800;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.22;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 2px 12px rgba(0,0,0,.6);
}
.overlay-linm-title em { font-style: normal; color: #ff6a1f; }
.overlay-linm-byline {
  margin: 0;
  padding-top: .45rem;
  border-top: 2px solid var(--orange);
  display: inline-block;
  color: #f7f5f0;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0,0,0,.55);
}
[data-theme="light"] .overlay-slg { display: flex; }
.overlay-slg {
  inset: auto 1rem .85rem 1rem;
  justify-content: space-between;
  color: #17130e;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tool-copy { display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; padding-top: .5rem; }
.tool-chip {
  margin: 0;
  padding: .38rem .8rem;
  border: 1px solid var(--orange);
  border-radius: 4px;
  color: var(--orange);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.tool-title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(1.55rem, 2.4vw, 2.1rem); line-height: 1.2; color: var(--cream); }
.tool-desc { margin: 0; max-width: 42rem; color: var(--muted); font-size: .95rem; line-height: 1.65; }


/* ---------- Closing invitation ---------- */

.tools-closing {
  padding: clamp(3rem, 6vw, 5.5rem) var(--page-edge);
  border-top: 1px solid var(--hairline);
}

.tools-closing-inner {
  width: min(760px, 100%);
  margin: 0 auto;
  text-align: center;
}

.tools-closing .section-kicker { margin-bottom: .85rem; }

.tools-closing h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.1;
  color: var(--cream);
}

.tools-closing p:not(.section-kicker) {
  max-width: 640px;
  margin: 1.2rem auto 0;
  color: var(--muted);
  font-size: clamp(.95rem, 1.4vw, 1.08rem);
  line-height: 1.7;
}

.tools-closing .button { margin-top: 1.8rem; }
.tools-closing .button span { margin-left: .4rem; }

/* ---------- Responsive ---------- */

@media (max-width: 1050px) {
  .tools-hero::before { background-position: 72% center; }
  .tools-hero-copy h1, .tools-hero-body { text-shadow: 0 2px 16px rgba(var(--scrim-rgb), .7); }

  .tool-card { grid-template-columns: minmax(240px, 38%) minmax(0, 1fr); }
  .tool-card-flip { grid-template-columns: minmax(0, 1fr) minmax(240px, 38%); }
  .tool-card .tool-media { min-height: 220px; }
}

@media (max-width: 780px) {
  .tool-card, .tool-card-flip {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
  }
  .tool-card-flip .tool-media { order: -1; }
  .tool-copy { padding-top: 0; }

  .tool-media {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .tool-card .tool-media-bbw,
  .tool-card .tool-media-linm,
  .tool-card .tool-media-slg {
    min-height: 0;
    background-size: contain;
  }
}
