/* Dictation Tools hub — Quiet Practice Desk (distinct from Teaching Games) */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --ink: #1c2b33;
  --ink-soft: #4a5c66;
  --accent: #2f6f68;
  --accent-deep: #1f524d;
  --accent-soft: #d7ebe7;
  --mist: #e7f0ee;
  --wash: #d5e3e8;
  --paper: rgba(252, 253, 252, 0.92);
  --line: rgba(47, 111, 104, 0.22);
  --shadow: 0 10px 28px rgba(28, 43, 51, 0.08);
  --radius: 14px;
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', serif;
  --font-ui: 'Figtree', 'Segoe UI', sans-serif;
}

body.hub-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-weight: 500;
  color: var(--ink);
  background: var(--mist);
  padding: clamp(1.25rem, 4vw, 2.75rem);
  position: relative;
  overflow-x: hidden;
}

.hub-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 55% at 12% 8%, rgba(167, 204, 196, 0.55), transparent 58%),
    radial-gradient(ellipse 70% 50% at 88% 18%, rgba(176, 198, 212, 0.5), transparent 55%),
    linear-gradient(165deg, #eaf3f1 0%, #e2ebe8 42%, #d8e4ea 100%);
}

.hub-atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: repeating-linear-gradient(
    transparent 0,
    transparent 27px,
    rgba(47, 111, 104, 0.05) 27px,
    rgba(47, 111, 104, 0.05) 28px
  );
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
}

.hub-updated {
  position: fixed;
  top: 0.45rem;
  right: 0.7rem;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 500;
  color: #7a8b94;
  letter-spacing: 0.02em;
  opacity: 0.7;
  pointer-events: none;
  user-select: none;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
}

.hub-hero {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto clamp(1.75rem, 5vw, 2.75rem);
  animation: hub-rise 0.7s ease-out both;
}

.hub-page h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: clamp(2.75rem, 8.5vw, 3.9rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 0.85rem;
  color: var(--ink);
}

.hub-lead {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 2.8vw, 1.4rem);
  color: var(--accent-deep);
  line-height: 1.35;
}

.hub-page .sub {
  margin: 0;
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.5;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  margin: 0 auto clamp(1.5rem, 3.5vw, 2.25rem);
  padding: 0.3rem;
  background: rgba(252, 253, 252, 0.75);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(28, 43, 51, 0.04);
  animation: hub-rise 0.75s ease-out 0.08s both;
  width: fit-content;
  max-width: 100%;
}

.filter-btn {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  padding: 0.55rem 1.1rem;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.filter-btn:hover,
.filter-btn:focus-visible {
  color: var(--ink);
  background: rgba(47, 111, 104, 0.08);
  outline: none;
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent-deep);
  color: #fff;
}

.category {
  margin-bottom: clamp(1.75rem, 5vw, 2.75rem);
  animation: hub-rise 0.8s ease-out 0.14s both;
}

.category[hidden] {
  display: none !important;
}

.category:last-of-type {
  margin-bottom: 0;
}

.category-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(1rem, 3vw, 1.35rem);
}

.practice-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  text-decoration: none;
  color: inherit;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.15rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.practice-card:hover,
.practice-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(28, 43, 51, 0.12);
  border-color: rgba(47, 111, 104, 0.45);
  outline: none;
}

.practice-card:active {
  transform: translateY(-1px);
}

.practice-card.is-placeholder {
  border-style: dashed;
  opacity: 0.85;
  cursor: default;
}

.thumb-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 0 0.85rem;
  border-radius: 10px;
  overflow: hidden;
  background: var(--wash);
  border: 1px solid rgba(47, 111, 104, 0.12);
}

.practice-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.practice-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
  color: var(--ink);
}

.practice-card p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.4;
  flex: 1;
}

.skill-tag {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.75rem;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.skill-tag[data-skill='dictation'] {
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-color: rgba(47, 111, 104, 0.25);
}

.hint {
  margin-top: 2.25rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.45;
  animation: hub-rise 0.85s ease-out 0.2s both;
}

@keyframes hub-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-hero,
  .filter-bar,
  .category,
  .hint,
  .practice-card {
    animation: none;
    transition: none;
  }
}
