* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color: var(--ink); background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; font: 400 14px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; }
button, input, select, .drop { border-radius: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, .drop:focus-visible, a:focus-visible {
  outline: 1px solid var(--ink); outline-offset: 3px;
}
h1, h2, h3, p { margin-top: 0; }

.site-shell { width: min(1180px, calc(100% - 64px)); margin: 0 auto; }
.home-header { min-height: 300px; padding: 48px 0 64px; display: flex; align-items: flex-end; }
.intro { width: 100%; }
.intro h1 { margin-bottom: 0; font-size: clamp(42px, 6vw, 76px); line-height: .96; font-weight: 400; letter-spacing: -.035em; }
.tool-category { padding: 64px 0 32px; }
.category-heading { margin-bottom: 28px; }
.tool-tags, .tool-action { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.category-heading p { color: var(--muted-ink); }
.category-heading h2 { margin-bottom: 5px; font-size: 28px; line-height: 1; font-weight: 400; }
.category-heading p { max-width: 52em; margin-bottom: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool-card {
  display: flex; flex-direction: column; min-height: 220px; padding: 22px;
  border: 1px solid var(--soft-rule); text-decoration: none; text-align: left;
  font: inherit; color: inherit; background: none;
  transition: border-color .15s, background .15s;
}
button.tool-card { width: 100%; cursor: pointer; }
a.tool-card:hover, button.tool-card:hover { border-color: var(--ink); }
a.tool-card:hover .tool-name, button.tool-card:hover .tool-name { font-style: italic; }
.tool-card .tool-name { margin-top: 20px; font-size: 22px; line-height: 1.05; letter-spacing: -.01em; }
.tool-card .tool-description { margin-top: 10px; color: var(--muted-ink); }
.tool-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tool-tags i { padding: 3px 6px 2px; border: 1px solid var(--soft-rule); font-style: normal; letter-spacing: 0; }
.tool-card .tool-action { margin-top: auto; padding-top: 24px; color: var(--muted-ink); }
.upcoming { background: #fafafa; color: var(--muted-ink); }
.upcoming .tool-name { color: var(--muted-ink); }

.source-dialog {
  width: min(560px, calc(100% - 32px)); padding: 0;
  border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
}
.source-dialog::backdrop { background: rgba(0, 0, 0, .35); }
.source-dialog-form { padding: 22px; }
.source-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.source-dialog-head h2 { margin: 0; font-size: 22px; line-height: 1.05; font-weight: 400; letter-spacing: -.01em; }
.source-dialog-close { min-height: 0; padding: 0 2px; border: 0; background: none; color: var(--muted-ink); font-size: 22px; line-height: 1; cursor: pointer; }
.source-dialog-close:hover { color: var(--ink); }
.source-dialog-tool { margin: 8px 0 0; font-size: 14px; }
.source-dialog-hint { margin: 20px 0 10px; color: var(--muted-ink); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.source-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.source-option {
  display: flex; flex-direction: column; gap: 8px; padding: 16px;
  border: 1px solid var(--soft-rule); background: var(--paper); color: var(--ink);
  text-align: left; cursor: pointer; transition: border-color .15s, background .15s;
}
.source-option:hover { border-color: var(--ink); background: #fafafa; }
.source-option-name { font-size: 16px; }
.source-option-desc { color: var(--muted-ink); font-size: 12px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
  .site-shell { width: min(100% - 32px, 1180px); }
  .home-header { min-height: 260px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .home-header { padding-top: 32px; }
  .intro h1 { font-size: 42px; }
  .tool-category { padding-top: 48px; }
  .tool-grid { grid-template-columns: 1fr; }
  .source-options { grid-template-columns: 1fr; }
}
