/* Free tools hub. Scoped to .fth-page. A library catalogue: one ruled row per
   resource, its meta on the left like the spine of a file, the work in the middle. */

.fth-page {
  --fth-paper: #f5f0e4;
  --fth-paper-2: #ebe4d2;
  --fth-ink: #1b1d20;
  --fth-muted: #5a5850;
  --fth-rule: #d0c8b4;
  --fth-teal: #1f5666;
  --fth-teal-soft: #d5e4e8;
  --fth-night: #182329;
  --fth-night-line: #374852;
  --fth-brass: #bd964c;
  --fth-ease: cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--fth-ink);
  background: var(--fth-paper);
  font-family: "DM Sans Variable", "DM Sans", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: clip;
}
.fth-page *,
.fth-page *::before,
.fth-page *::after { box-sizing: border-box; }
.fth-page ::selection { color: #fff; background: var(--fth-teal); }
.fth-page a { text-underline-offset: 0.25em; }
.fth-page a:focus-visible,
.fth-page summary:focus-visible { outline: 2px solid var(--fth-teal); outline-offset: 3px; }
.fth-page [id] { scroll-margin-top: 112px; }
:where(.fth-page) :is(h1, h2, h3, p, ol, ul, dl, dd) { margin: 0; }
.fth-page h1,
.fth-page h2,
.fth-page h3 { font-family: "Cormorant Garamond Variable", Georgia, serif; font-weight: 500; text-wrap: balance; }
.fth-wrap { width: min(100%, 1280px); margin-inline: auto; padding-inline: clamp(20px, 5vw, 64px); }
.fth-split { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(28px, 6vw, 96px); align-items: start; }

.fth-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 28px; }
.fth-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: 10px; background: var(--fth-ink); color: #fff; font-weight: 600; text-decoration: none; transition: background 0.25s var(--fth-ease); }
.fth-btn svg { width: 18px; height: 18px; transition: transform 0.25s var(--fth-ease); }
.fth-btn:hover { background: var(--fth-teal); }
.fth-btn:hover svg { transform: translateX(3px); }
.fth-quiet { color: var(--fth-ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--fth-brass); text-decoration-thickness: 2px; }
.fth-quiet:hover { color: var(--fth-teal); }

/* Hero */
.fth-hero { padding: 112px 0 clamp(40px, 5vw, 64px); }
.fth-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(32px, 5vw, 80px); align-items: end; }
.fth-hero h1 { font-size: clamp(2.4rem, 4.4vw, 4rem); line-height: 1.04; letter-spacing: -0.02em; max-width: 16ch; }
.fth-lede { margin-top: 20px; max-width: 58ch; font-size: 1.125rem; color: #38362f; }
.fth-spec { border-top: 2px solid var(--fth-ink); }
.fth-spec > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--fth-rule); }
.fth-spec dt { font-weight: 700; }
.fth-spec dd { color: var(--fth-muted); }

/* Index */
.fth-index { border-block: 1px solid var(--fth-rule); background: var(--fth-paper-2); }
.fth-index ol { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.fth-index li + li { border-left: 1px solid var(--fth-rule); }
.fth-index a { display: grid; gap: 2px; padding: 16px clamp(10px, 1.6vw, 22px); color: var(--fth-ink); font-weight: 600; line-height: 1.3; text-decoration: none; transition: background 0.25s var(--fth-ease); }
.fth-index a:hover { background: var(--fth-teal-soft); }
.fth-index small { font-weight: 400; font-size: 0.8125rem; color: var(--fth-muted); }

/* Steps */
.fth-steps { padding: clamp(48px, 7vw, 88px) 0; border-bottom: 1px solid var(--fth-rule); }
.fth-steps h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.07; }
.fth-steps .fth-split > div > p { margin-top: 14px; color: var(--fth-muted); max-width: 52ch; }
.fth-steps ol { list-style: none; padding: 0; counter-reset: s; border-top: 2px solid var(--fth-ink); }
.fth-steps li { counter-increment: s; position: relative; padding: 16px 0 16px 3.2rem; border-bottom: 1px solid var(--fth-rule); }
.fth-steps li::before { content: counter(s); position: absolute; left: 0; top: 16px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--fth-ink); color: #fff; font-weight: 700; }
.fth-steps h3 { font-size: 1.7rem; line-height: 1.1; }
.fth-steps li p { margin-top: 2px; color: var(--fth-muted); }

/* Catalogue */
.fth-group { padding: clamp(40px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); border-bottom: 1px solid var(--fth-rule); }
.fth-group-head { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(20px, 5vw, 80px); align-items: end; margin-bottom: 22px; }
.fth-group-head h2 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.04; letter-spacing: -0.015em; }
.fth-group-head p { color: var(--fth-muted); max-width: 52ch; }
.fth-rows { list-style: none; padding: 0; border-top: 2px solid var(--fth-ink); }
.fth-rows > li { border-bottom: 1px solid var(--fth-rule); }
.fth-rows > li > a { display: grid; grid-template-columns: 11rem minmax(0, 1fr) auto; gap: clamp(16px, 3vw, 40px); align-items: start; padding: 22px 0; color: inherit; text-decoration: none; transition: padding 0.3s var(--fth-ease), background 0.3s var(--fth-ease); }
.fth-rows > li > a:hover { padding-inline: 14px; background: var(--fth-paper-2); }
.fth-meta { display: grid; gap: 1px; align-content: start; }
.fth-meta b { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fth-teal); }
.fth-meta small { font-size: 0.8125rem; color: var(--fth-muted); line-height: 1.45; }
.fth-main h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.08; }
.fth-main p { margin-top: 6px; color: #38362f; max-width: 62ch; }
.fth-main ul { list-style: none; padding: 0; margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 28px; max-width: 70ch; }
.fth-main li { position: relative; padding-left: 1.2rem; font-size: 0.9375rem; color: var(--fth-muted); line-height: 1.45; }
.fth-main li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; border: 2px solid var(--fth-teal); border-radius: 2px; }
.fth-go { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--fth-teal); white-space: nowrap; }
.fth-go svg { width: 18px; height: 18px; transition: transform 0.3s var(--fth-ease); }
.fth-rows > li > a:hover .fth-go svg { transform: translateX(4px); }

/* FAQ */
.fth-faq { padding: clamp(56px, 8vw, 104px) 0; background: var(--fth-paper-2); border-bottom: 1px solid var(--fth-rule); }
.fth-faq h2 { font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1.05; position: sticky; top: 112px; }
.fth-faq details { border-bottom: 1px solid #bdb59f; }
.fth-faq details:first-of-type { border-top: 1px solid #bdb59f; }
.fth-faq summary { list-style: none; display: flex; justify-content: space-between; gap: 20px; padding: 20px 0; font-weight: 600; cursor: pointer; }
.fth-faq summary::-webkit-details-marker { display: none; }
.fth-faq summary::after { content: "+"; flex: none; font-size: 1.5rem; line-height: 1; color: var(--fth-teal); transition: transform 0.25s var(--fth-ease); }
.fth-faq details[open] summary::after { transform: rotate(45deg); }
.fth-faq details p { padding: 0 0 22px; max-width: 64ch; color: #38362f; }
.fth-caveat { margin-top: 22px; max-width: 64ch; font-size: 0.9375rem; color: var(--fth-muted); }

/* Close */
.fth-close { padding: clamp(56px, 8vw, 96px) 0; background: var(--fth-night); color: #eef0ee; }
.fth-close-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) auto; gap: clamp(24px, 5vw, 80px); align-items: center; }
.fth-close h2 { font-size: clamp(2.1rem, 4.2vw, 3.4rem); line-height: 1.04; }
.fth-close p { margin-top: 16px; max-width: 56ch; color: #c8d0d3; }
.fth-close .fth-btn { background: #e6cd96; color: var(--fth-ink); }
.fth-close .fth-btn:hover { background: #fff; }
.fth-close a:focus-visible { outline-color: #e6cd96; }
.fth-crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; padding-block: 22px 34px; font-size: 0.9rem; color: var(--fth-muted); }
.fth-crumbs a { color: var(--fth-teal); }

@media (max-width: 1000px) {
  .fth-hero-grid, .fth-split, .fth-group-head, .fth-close-grid { grid-template-columns: 1fr; }
  .fth-faq h2 { position: static; }
  .fth-index ol { grid-template-columns: repeat(3, 1fr); }
  .fth-index li:nth-child(4) { border-left: 0; }
  .fth-index li:nth-child(n+4) { border-top: 1px solid var(--fth-rule); }
  .fth-rows > li > a { grid-template-columns: 1fr; gap: 10px; }
  .fth-meta { grid-auto-flow: column; justify-content: start; gap: 4px 14px; align-items: baseline; flex-wrap: wrap; }
  .fth-rows > li > a:hover { padding-inline: 0; background: transparent; }
}
@media (max-width: 640px) {
  .fth-hero { padding-top: 96px; }
  .fth-hero h1 { font-size: 2.2rem; }
  .fth-lede { margin-top: 14px; font-size: 1rem; line-height: 1.55; }
  .fth-actions { margin-top: 18px; }
  .fth-spec > div { grid-template-columns: 1fr; gap: 2px; }
  .fth-index ol { grid-template-columns: 1fr 1fr; }
  .fth-index li:nth-child(odd) { border-left: 0; }
  .fth-index li:nth-child(even) { border-left: 1px solid var(--fth-rule); }
  .fth-index li:nth-child(n+3) { border-top: 1px solid var(--fth-rule); }
  .fth-main ul { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .fth-page * { transition-duration: 0.01ms !important; }
}

/* The retained diagnostic tools now share this catalogue with the worksheets. */
.fth-diagnostics { padding-block: clamp(42px, 6vw, 88px); }
.fth-diagnostics h2 { font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.1; }
.fth-diagnostics h3 { font-size: 1.6rem; line-height: 1.2; }
.fth-diagnostics p { margin-top: 12px; max-width: 68ch; color: var(--fth-muted); }
.fth-diagnostics p a { color: var(--fth-teal); text-decoration: underline; }
.fth-calculator { padding: clamp(20px, 3vw, 32px); background: var(--fth-teal-soft); }
.fth-calculator .fth-quiet { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.fth-diagnostics svg { width: 18px; height: 18px; flex: 0 0 auto; }
.fth-diagnostic-list { list-style: none; padding: 0; margin-top: 36px; border-top: 2px solid var(--fth-ink); }
.fth-diagnostic-list > li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto; gap: 28px; align-items: start; padding-block: 28px; border-bottom: 1px solid var(--fth-rule); }
.fth-diagnostic-list > li > p { margin-top: 0; }
.fth-diagnostic-list h3 a { color: var(--fth-ink); text-decoration: none; }
.fth-diagnostic-list h3 a:hover { color: var(--fth-teal); text-decoration: underline; }
.fth-diagnostic-list .fth-quiet { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.fth-tool-limits { max-width: 74ch; margin-top: 36px; }
@media (max-width: 800px) {
  .fth-diagnostic-list > li { grid-template-columns: 1fr; gap: 12px; }
  .fth-diagnostic-list .fth-quiet { justify-self: start; }
}
