@import "./tokens.css";

/* ===== hub homepage — built on the shared Readout tokens ===== */
body {
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem 6rem;
  max-width: 50rem;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.075rem;
  line-height: var(--lh-body);
  font-feature-settings: "kern" 1, "liga" 1, "cv01" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html[data-theme="dark"] body { background: var(--bg); }

.masthead {
  border-bottom: 2px solid var(--signal);
  padding-bottom: 0.7rem;
  margin-bottom: clamp(1.8rem, 4vw, 2.6rem);
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.75rem 1.25rem; flex-wrap: wrap;
  font-family: var(--font-text); font-size: 0.8rem; font-weight: 500;
  letter-spacing: 0.01em; color: var(--muted);
}
.masthead > span:first-child { font-family: var(--font-display); font-weight: 700; color: var(--ink); letter-spacing: -0.01em; }

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.0rem, 1.45rem + 2.4vw, 2.95rem);
  line-height: 1.08; font-weight: 700; letter-spacing: -0.022em;
  margin: 0 0 0.5rem; text-wrap: balance;
}
.subtitle {
  font-family: var(--font-text); font-weight: 400; color: var(--muted);
  font-size: 1.2rem; line-height: 1.4; margin: 0 0 clamp(2rem, 4vw, 2.8rem); text-wrap: pretty;
}

.sec-label {
  font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin: 2.8rem 0 1rem;
  display: flex; align-items: baseline; justify-content: space-between;
}
.sec-label .count { opacity: 0.7; }

/* featured course card */
.featured {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--surface); position: relative;
  transition: border-color .18s var(--ease);
}
.featured::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--signal); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease); z-index: 1;
}
.featured:hover { border-color: color-mix(in oklch, var(--signal) 40%, var(--line)); }
.featured:hover::before { transform: scaleX(1); }
.featured .art {
  background: color-mix(in oklch, var(--signal) 8%, var(--bg));
  border-bottom: 1px solid var(--line); padding: 1.5rem 1.5rem 1.2rem;
  display: flex; justify-content: center;
}
.featured .art object { width: 100%; max-width: 520px; height: auto; max-height: 250px; pointer-events: none; }
.featured .body { padding: 1.5rem 1.7rem 1.7rem; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--signal-ink); display: flex; align-items: center; gap: 0.5rem;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; flex: none; }
.featured h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 1.85rem; letter-spacing: -0.022em;
  margin: 0.55rem 0 0.45rem; line-height: 1.08;
}
.featured .lede { font-size: 1rem; color: var(--muted); margin: 0 0 1.15rem; line-height: 1.5; max-width: 42ch; }
.meta { display: flex; flex-wrap: wrap; gap: 0.45rem 0.5rem; margin: 0 0 1.35rem; }
.meta span {
  font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.7rem;
}
.cta-row { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.btn-primary {
  font-family: var(--font-display); font-weight: 650; font-size: 0.96rem; text-decoration: none;
  color: var(--bg); background: var(--ink); border-radius: 10px; padding: 0.66rem 1.2rem;
  display: inline-flex; align-items: center; gap: 0.45rem; transition: background .15s var(--ease);
}
.btn-primary:hover { background: var(--accent-strong); }
/* stretched-link: the primary button covers the whole card (valid HTML, one wrapping link) */
.btn-primary::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.sublinks { font-size: 0.86rem; color: var(--muted); position: relative; z-index: 1; }
.sublinks a { color: var(--accent); text-decoration: none; }
.sublinks a:hover { color: var(--accent-strong); text-decoration: underline; }

/* future-course placeholder */
.soon {
  display: block; border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.15rem; background: var(--surface); margin-top: 1rem; opacity: 0.6;
}
.soon .n { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.soon .t { font-family: var(--font-display); font-weight: 650; letter-spacing: -0.01em; margin: 0.25rem 0 0.2rem; }
.soon .d { font-size: 0.88rem; color: var(--muted); line-height: 1.45; }

.aside { font-size: 0.92rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0.95rem 1.15rem; margin: 1.8rem 0; }
.aside a { color: var(--accent); text-decoration: none; }
.aside a:hover { color: var(--accent-strong); text-decoration: underline; }

@media (max-width: 640px) { .featured .body { padding: 1.25rem 1.2rem 1.4rem; } }
