/* ─── Gefyra brand tokens ───────────────────────────────────────────────── */
:root {
  --gefyra-red: #c0392b;
  --gefyra-dark: #333333;
  --gefyra-muted: #666666;
  --card-radius: 0.75rem;
  --transition: 0.2s ease;
}

/* ─── Pico overrides ────────────────────────────────────────────────────── */
[data-theme="light"],
:root:not([data-theme="dark"]) {
  --pico-primary: var(--gefyra-red);
  --pico-primary-hover: #a93226;
  --pico-primary-focus: rgba(192, 57, 43, 0.25);
  --pico-primary-inverse: #fff;
}

[data-theme="dark"] {
  --pico-primary: #e74c3c;
  --pico-primary-hover: #c0392b;
  --pico-primary-focus: rgba(231, 76, 60, 0.25);
  --pico-primary-inverse: #fff;
}

/* ─── Layout ────────────────────────────────────────────────────────────── */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main.container {
  flex: 1;
}

/* ─── Header ────────────────────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--pico-muted-border-color);
  padding: 0.75rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.logo {
  height: 2.25rem;
  width: auto;
}

.header-tagline {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gefyra-red);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.theme-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: border-color var(--transition), background var(--transition);
}

.theme-toggle:hover {
  background: var(--pico-muted-background-color);
}

.theme-icon {
  font-size: 1rem;
  line-height: 1;
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 3.5rem 1rem 2rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--pico-muted-color);
  max-width: 480px;
  margin: 0 auto;
}

/* ─── Tools section ─────────────────────────────────────────────────────── */
.tools-section {
  padding-bottom: 4rem;
}

.tools-section h2 {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pico-muted-color);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.loading-placeholder {
  color: var(--pico-muted-color);
  font-style: italic;
}

/* ─── Tool card ─────────────────────────────────────────────────────────── */
.tool-card {
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  background: var(--pico-card-background-color);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
}

.tool-card:hover {
  border-color: var(--gefyra-red);
  box-shadow: 0 4px 20px rgba(192, 57, 43, 0.12);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.tool-card.unavailable {
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.card-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--pico-primary-focus);
  color: var(--pico-primary);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
  align-self: flex-start;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.card-description {
  font-size: 0.9rem;
  color: var(--pico-muted-color);
  line-height: 1.5;
  flex: 1;
}

.card-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pico-primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-cta::after {
  content: "→";
  transition: transform var(--transition);
}

.tool-card:hover .card-cta::after {
  transform: translateX(3px);
}

/* ─── Footer ────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--pico-muted-border-color);
  padding: 1.25rem 0;
  text-align: center;
}

.site-footer p {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  margin: 0;
}

.site-footer a {
  color: var(--pico-muted-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--pico-primary);
}

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 2rem 0.5rem 1.5rem;
  }
}
