/* ── URL Aggregator Styles ────────────────────────────────────────────── */
/* Extends the site design system tokens */

.agg-hero {
  width: min(780px, calc(100% - 48px));
  margin: 0 auto;
  padding: 80px 0 60px;
}

.agg-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 540;
}

.agg-deck {
  margin: 0 0 40px;
  color: #aeb9c7;
  font-size: 17px;
  line-height: 1.7;
  max-width: 650px;
}

/* ── Panel ────────────────────────────────────────────────────────────── */

.agg-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 14, 26, .4);
}

.agg-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.agg-tab {
  flex: 1;
  padding: 14px 20px;
  background: none;
  border: none;
  color: var(--muted);
  font: 600 12px/1 "Geist Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s, background .2s;
}

.agg-tab:hover {
  color: var(--paper);
}

.agg-tab.active {
  color: var(--blue-bright);
  background: rgba(105, 168, 255, .06);
  border-bottom: 2px solid var(--blue);
}

.agg-form-panel {
  display: none;
  padding: 28px 24px 32px;
}

.agg-form-panel.active {
  display: block;
}

.agg-form-panel label {
  display: block;
  margin-bottom: 10px;
  color: var(--paper);
  font: 600 12px/1 "Geist Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

textarea, input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--paper);
  font-family: "Geist Mono", monospace;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}

textarea:focus, input[type="text"]:focus {
  border-color: var(--blue);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.agg-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.agg-status {
  font-size: 13px;
  color: var(--muted);
}

.agg-status.error {
  color: #f48787;
}

/* ── Result ────────────────────────────────────────────────────────────── */

.agg-result {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.agg-result label {
  display: block;
  margin-bottom: 10px;
  color: var(--acid);
  font: 600 12px/1 "Geist Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.agg-copy-row {
  display: flex;
  gap: 10px;
}

.agg-copy-row input {
  flex: 1;
}

.agg-copy-row .button {
  min-width: auto;
  padding: 12px 20px;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */

.agg-cards-section {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 20px 0 80px;
}

.agg-cards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.agg-cards-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 540;
  color: var(--muted);
  letter-spacing: -.02em;
}

.agg-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.agg-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  background: rgba(7, 14, 26, .3);
  transition: border-color .2s, background .2s;
  display: flex;
  flex-direction: column;
}

.agg-card:hover {
  background: rgba(105, 168, 255, .03);
}

.agg-card-index {
  font: 600 10px/1 "Geist Mono", monospace;
  color: var(--blue);
  letter-spacing: .1em;
  margin-bottom: 10px;
}

.agg-card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  word-break: break-word;
}

.agg-card-title a {
  color: var(--paper);
  text-decoration: none;
  transition: color .2s;
}

.agg-card-title a:hover {
  color: var(--blue-bright);
}

.agg-card-url {
  font: 500 11px/1.4 "Geist Mono", monospace;
  color: var(--muted);
  word-break: break-all;
  margin-top: auto;
}

.agg-loading {
  color: var(--muted);
  font-size: 14px;
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
}

.agg-card-skeleton {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  background: rgba(7, 14, 26, .3);
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.agg-card-skeleton .spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.agg-card-skeleton span {
  font: 600 10px/1 "Geist Mono", monospace;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .agg-hero, .agg-cards-section {
    width: min(100% - 32px, 1180px);
  }
  .agg-cards {
    grid-template-columns: 1fr;
  }
  .agg-copy-row {
    flex-direction: column;
  }
  .agg-cards-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}