/* Home page and subject pages: a list of subjects, each with its topic cards. */
:root {
  --bg: #fff8ec;
  --card: #ffffff;
  --ink: #26303a;
  --muted: #6d7a72;
  --accent: #ff7a59;
  --yellow: #ffd166;
  --line: #eadfcb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Comic Sans MS", system-ui, sans-serif;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }

.hero { text-align: center; padding: 34px 16px 10px; }
.hero .logo { font-size: 72px; line-height: 1; }
.hero h1 { font-size: clamp(30px, 6vw, 52px); margin: 8px 0 4px; line-height: 1.1; }
.hero p { margin: 0; color: var(--muted); font-weight: 700; font-size: clamp(16px, 2.4vw, 21px); }
.hero .up {
  display: inline-block; margin-bottom: 14px; padding: 8px 18px; border-radius: 999px; text-decoration: none;
  font-weight: 800; color: var(--muted); border: 2px solid var(--line); background: #fff;
}
.hero .up:hover { border-color: var(--accent); }

main { width: min(1100px, 100%); margin: 0 auto; padding: 10px 16px 60px; display: flex; flex-direction: column; gap: 30px; }

.subject h2 {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: clamp(22px, 3.6vw, 32px); margin: 0 0 12px; padding-left: 14px; border-left: 8px solid var(--c);
}
.subject h2 a { text-decoration: none; display: inline-flex; align-items: center; gap: .35em; min-height: 40px; }
.subject h2 a:hover { color: var(--c); }
.subject h2 small { font-size: .5em; font-weight: 800; color: #fff; background: var(--c); border-radius: 999px; padding: 3px 12px; }

.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.tcard {
  display: flex; gap: 16px; align-items: flex-start; text-decoration: none; min-height: 132px;
  background: var(--card); border: 3px solid var(--line); border-radius: 24px; padding: 16px 18px;
  box-shadow: 0 6px 0 var(--line); transition: transform .08s, box-shadow .08s, border-color .15s;
}
.tcard:hover, .tcard:focus-visible { border-color: var(--c); outline: none; transform: translateY(-2px); box-shadow: 0 8px 0 var(--line); }
.tcard:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }
.temoji {
  flex: none; font-size: 44px; line-height: 1; width: 76px; height: 76px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 14%, #fff);
}
.ttext { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ttext b { font-size: 21px; line-height: 1.2; }
.sum { color: var(--muted); font-size: 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.meta span { font-size: 13px; font-weight: 800; color: var(--muted); background: #f6efe0; border-radius: 999px; padding: 3px 11px; }
.meta .prog { background: var(--yellow); color: var(--ink); }
.meta .prog.full { background: #22a06b; color: #fff; }

@media (max-width: 480px) {
  main { padding: 6px 12px 40px; gap: 24px; }
  .topics { grid-template-columns: 1fr; }
  .tcard { padding: 14px; gap: 12px; }
  .temoji { width: 60px; height: 60px; font-size: 36px; border-radius: 16px; }
  .ttext b { font-size: 19px; }
}
