/* Tool discovery directory - DMW black/parchment/brass ledger styling */

.tool-directory {
  padding-block: 38px 36px;
}

.tool-directory__header {
  margin-bottom: 28px;
}

.tool-directory__jump {
  display: none;
}

.tool-directory__eyebrow {
  margin-bottom: 12px;
}

.tool-directory__title {
  font-family: 'Almendra', Georgia, serif;
  font-size: clamp(38px, 4.4vw, 54px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  margin: 0;
}

.tool-directory__intro {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(18px, 1.8vw, 21px);
  line-height: 1.45;
  color: #cdc2b0;
  max-width: 640px;
  margin-top: 14px;
}

/* 3-column ledger grid */
.tool-directory__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

/* Group ledger container */
.tool-group {
  display: flex;
  flex-direction: column;
  background: #161410;
  border: 1px solid var(--line);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
  position: relative;
}

.tool-group::before {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(146, 115, 66, 0.12);
}

/* Subtly primary group for alerts: fine brass accent, generous whitespace, warm hierarchy, no gradients */
.tool-group--primary {
  border-color: #8c7042;
  border-top: 2px solid var(--gold);
  background: #181510;
  box-shadow: inset 0 0 0 1px rgba(231, 191, 112, 0.1), 0 14px 32px rgba(0, 0, 0, 0.38);
}

.tool-group--primary::before {
  border-color: rgba(231, 191, 112, 0.2);
}

/* Group header */
.tool-group__header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.tool-group--primary .tool-group__header {
  padding-top: 22px;
  background: rgba(231, 191, 112, 0.03);
}

.tool-group__kicker {
  display: block;
  font: 600 10px/1.4 'Cinzel', serif;
  letter-spacing: 1.3px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.tool-group__heading {
  font-family: 'Almendra', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin: 0;
}

.tool-group--primary .tool-group__heading {
  color: #fff4d9;
}

/* Ledger of distinct row links */
.tool-group__rows {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool-group__rows li {
  display: flex;
  flex: 1;
  border-bottom: 1px solid var(--softline);
}

.tool-group__rows li:last-child {
  border-bottom: none;
}

/* Individual tool row link (>=44px touch target) */
.tool-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  color: var(--text);
  text-decoration: none;
  background: transparent;
  transition: background 0.18s ease, color 0.18s ease;
  position: relative;
}

.tool-row:hover {
  background: #231e16;
  color: var(--gold);
}

.tool-group--primary .tool-row:hover {
  background: #262016;
}

.tool-row:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
  z-index: 2;
}

.tool-row__main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.tool-row__title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-row__name {
  font-family: 'Almendra', Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  transition: color 0.18s ease;
}

.tool-row:hover .tool-row__name {
  color: var(--gold);
}

.tool-row__desc {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--muted);
}

.tool-row__arrow {
  color: var(--gold);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  transition: transform 0.18s ease;
  padding-left: 4px;
}

.tool-row:hover .tool-row__arrow {
  transform: translateX(3px);
}

/* Small helpful lower strip */
.tool-directory__strip {
  margin-top: 22px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  background: #14120e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

.tool-directory__strip-text {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 16px;
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.tool-directory__strip-link {
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  white-space: nowrap;
}

.tool-directory__strip-link:hover {
  color: #fff2c7;
}

.tool-directory__strip-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* Clean separation before historical demonstration section */
.hero {
  border-top: 1px solid var(--line);
  padding-block: 46px 64px;
}

.hero .hero-copy h2 {
  font-family: 'Almendra', Georgia, serif;
  font-size: clamp(36px, 3.8vw, 49px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

/* Responsive breakpoints */
@media (max-width: 850px) {
  .tool-directory__jump {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-block: -8px 22px;
  }

  .tool-directory__jump a {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    color: var(--gold);
    font-size: 16px;
  }

  .tool-directory__jump a:hover {
    background: var(--panel);
  }

  .tool-directory__grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .tool-group {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  }

  .tool-row {
    min-height: 48px;
    padding: 13px 18px;
  }
}

@media (max-width: 700px) {
  .tool-directory {
    padding-block: 24px 28px;
  }

  .tool-directory__title {
    font-size: 34px;
  }

  .tool-directory__intro {
    font-size: 18px;
  }

  .tool-group__heading {
    font-size: 22px;
  }

  .tool-row {
    padding: 12px 14px;
  }

  .tool-row__name {
    font-size: 18px;
  }

  .tool-row__desc {
    font-size: 14px;
  }

  .tool-directory__strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
  }

  .tool-directory__strip-link {
    white-space: normal;
  }
}

/* Responsive down to 320px */
@media (max-width: 360px) {
  .tool-directory__title {
    font-size: 29px;
  }

  .tool-row {
    padding-inline: 10px;
  }

  .tool-group__header {
    padding-inline: 14px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .tool-row,
  .tool-row__arrow {
    transition: none !important;
    transform: none !important;
  }
}
