/* focus-home.css - the student's task-first home and the simpler student navigation (focus-home.js).
   Uses the app's own tokens (theme.css, delight.css), so the Explorer look (Years 3-6), the Studio look and dark mode
   all follow. Card and button proportions after shadcn/ui; shine border, spotlight and number ticker after Magic UI;
   blur-in greeting after React Bits. Motion is off under prefers-reduced-motion. */

/* ---------- navigation: five places, then "More" */
body.fh-student .st-nav { display: flex; flex-direction: column; gap: 2px; }
body.fh-student .st-nav .fh-extra { display: none; }
body.fh-student .st-nav.fh-more-open .fh-extra:not([hidden]) { display: flex; font-size: .88rem; padding-top: 8px; padding-bottom: 8px; }
.fh-more-btn { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 12px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; font: inherit; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.fh-more-btn[hidden] { display: none !important; }
.fh-more-btn:hover { color: var(--ink); }
.fh-more-btn .fh-chev { width: 15px; height: 15px; margin-left: auto; transition: transform .2s; }
.st-nav.fh-more-open .fh-more-btn .fh-chev { transform: rotate(180deg); }
body:not(.fh-student) .fh-more-btn { display: none !important; }
/* the home has its own greeting: no second page title, and fewer chips at the top */
body.fh-student.fh-on-home .st-heading { visibility: hidden; }
body.fh-student .dl-status .dl-gems { display: none; }

/* ---------- the home */
.fh-home { --fh-r: var(--r-lg, 14px); display: grid; gap: 20px; max-width: 880px; margin: 0 auto; padding-bottom: 32px; }
.fh-loading { display: flex; gap: 8px; justify-content: center; padding: 80px 0; }
.fh-loading span { width: 9px; height: 9px; border-radius: 50%; background: var(--violet); opacity: .35; animation: fh-dot 1s infinite ease-in-out; }
.fh-loading span:nth-child(2) { animation-delay: .15s; } .fh-loading span:nth-child(3) { animation-delay: .3s; }
@keyframes fh-dot { 50% { opacity: 1; transform: translateY(-4px); } }

.fh-hello { display: flex; align-items: center; gap: 16px; margin-top: -8px; }
.fh-coach { flex: none; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.fh-coach:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.fh-greet { margin: 0; font-family: var(--font-display); font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.1rem); line-height: 1.15; color: var(--ink); }
.fh-greet span { display: inline-block; }
.fh-lead { margin: 4px 0 0; color: var(--ink-soft); font-size: 1.05rem; }
.fh-pill { margin-top: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--violet); font: inherit; font-size: .85rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; }

/* the one next step */
.fh-hero { position: relative; padding: 28px 28px 26px; border-radius: calc(var(--fh-r) + 4px); background: var(--paper); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 28px rgba(31, 58, 104, .08); overflow: hidden; }
.fh-hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--violet); }
.fh-hero.is-late::before { background: var(--coral); }
.fh-hero.is-done::before { background: var(--go); }
.fh-kicker { margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--violet); }
.fh-hero.is-late .fh-kicker { color: var(--coral); }
.fh-hero.is-done .fh-kicker { color: var(--go); }
.fh-hero h2 { margin: 0; font-family: var(--font-display); font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); line-height: 1.2; color: var(--ink); }
.fh-sub { margin: 8px 0 0; color: var(--ink-soft); font-size: 1rem; max-width: 60ch; }
.fh-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: 22px; }
/* Magic UI "shine border": a slow light running round the edge of the card */
.fh-shine { position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background-image: radial-gradient(transparent, transparent, var(--violet), var(--sea, #2b6cb0), transparent, transparent); background-size: 300% 300%; opacity: .55;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#fff 0 0) content-box exclude, linear-gradient(#fff 0 0); }
.is-animated .fh-shine { animation: fh-shine 14s linear infinite; }
@keyframes fh-shine { 0% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } 100% { background-position: 0% 0%; } }

/* buttons (shadcn proportions: 48px tall, 12px radius, clear focus ring) */
.fh-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 26px; border: 0; border-radius: 12px; background: var(--violet); color: #fff; font: inherit; font-size: 1.08rem; font-weight: 650; cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .12), inset 0 1px 0 rgba(255, 255, 255, .12); transition: background-color .15s, transform .12s, box-shadow .15s; }
.fh-btn:hover { background: var(--violet-deep); box-shadow: 0 6px 18px rgba(31, 58, 104, .22); }
.fh-btn:active { transform: translateY(1px); }
.fh-btn:focus-visible, .fh-tile:focus-visible, .fh-goal:focus-visible, .fh-link:focus-visible, .fh-fold summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--violet) 55%, transparent); outline-offset: 3px; }
.fh-hero.is-late .fh-btn { background: var(--coral); }
.fh-btn-ic { width: 20px; height: 20px; transition: transform .15s; }
.fh-btn:hover .fh-btn-ic { transform: translateX(3px); }
.fh-btn-sm { min-height: 38px; padding: 0 14px; font-size: .9rem; border-radius: 10px; }
.fh-link { border: 0; background: none; padding: 4px 2px; font: inherit; font-size: .95rem; font-weight: 600; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); cursor: pointer; }
.fh-link:hover { color: var(--violet); text-decoration-color: currentColor; }

/* today's three small goals */
.fh-today { display: grid; gap: 10px; }
.fh-today-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.fh-today-head h3 { margin: 0; font-size: .82rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.fh-today-head p { margin: 0; font-size: .9rem; color: var(--muted); }
.fh-today-head b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fh-goals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.fh-goal { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--fh-r); background: var(--paper); font: inherit; text-align: left; color: var(--ink); cursor: pointer; transition: border-color .15s, background-color .15s; }
.fh-goal:hover { border-color: color-mix(in srgb, var(--violet) 40%, var(--line)); }
.fh-goal strong { display: block; font-size: .95rem; font-weight: 600; }
.fh-goal small { display: block; font-size: .82rem; color: var(--muted); }
.fh-goal.is-done { background: color-mix(in srgb, var(--go-soft) 60%, var(--paper)); border-color: color-mix(in srgb, var(--go) 25%, var(--line)); }
.fh-ring { position: relative; flex: none; width: 34px; height: 34px; display: grid; place-items: center; }
.fh-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.fh-ring circle { fill: none; stroke-width: 4; }
.fh-ring-bg { stroke: var(--line); }
.fh-ring-fg { stroke: var(--violet); stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset .8s ease; }
.fh-ring.is-done .fh-ring-fg { stroke: var(--go); }
.fh-ring.is-empty .fh-ring-fg { opacity: 0; }
.fh-ring-ic { position: relative; width: 16px; height: 16px; color: var(--go); }

/* big doors */
.fh-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.fh-tiles.is-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fh-tile { --tone: var(--violet); --tone-soft: var(--violet-soft); position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; min-height: 92px; padding: 18px; border: 1px solid var(--line); border-radius: calc(var(--fh-r) + 2px); background: var(--paper); font: inherit; text-align: left; color: var(--ink); cursor: pointer; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: border-color .15s, box-shadow .2s, transform .2s; }
.fh-tile.is-games { --tone: var(--go); --tone-soft: var(--go-soft); }
.fh-tile.is-quest { --tone: var(--sun); --tone-soft: var(--sun-soft); }
.fh-tile.is-bites { --tone: var(--sea, #2b6cb0); --tone-soft: var(--sea-soft, #e8f1fa); }
/* Magic UI "magic card": a soft spotlight that follows the pointer */
.fh-tile::before { content: ""; position: absolute; inset: 0; background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--tone) 12%, transparent), transparent 70%); opacity: 0; transition: opacity .25s; pointer-events: none; }
.fh-tile:hover { border-color: color-mix(in srgb, var(--tone) 35%, var(--line)); box-shadow: 0 8px 24px rgba(16, 24, 40, .08); }
.fh-tile:hover::before { opacity: 1; }
.is-animated .fh-tile:hover { transform: translateY(-2px); }
.fh-tile-ic { position: relative; flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--tone-soft); color: var(--tone); }
.fh-tile-ic .fh-ic { width: 26px; height: 26px; }
.fh-tile-txt { position: relative; min-width: 0; }
.fh-tile strong { display: block; font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; }
.fh-tile small { display: block; margin-top: 2px; font-size: .88rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* quiet fold-outs */
.fh-folds { display: grid; gap: 8px; }
.fh-folds:not(:has(.fh-fold:not([hidden]))) { display: none; }
.fh-fold { border: 1px solid var(--line); border-radius: var(--fh-r); background: var(--paper); }
.fh-fold[hidden] { display: none; }
.fh-fold summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; font-weight: 600; color: var(--ink); border-radius: var(--fh-r); }
.fh-fold summary::-webkit-details-marker { display: none; }
.fh-fold summary .fh-chev { width: 18px; height: 18px; margin-left: auto; color: var(--muted); transition: transform .2s; }
.fh-fold[open] summary .fh-chev { transform: rotate(180deg); }
.fh-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--violet-soft); color: var(--violet); font-size: .75rem; display: inline-grid; place-items: center; }
.fh-fold-body { padding: 0 16px 16px; }
/* cards from other modules sit flat inside a fold: no second box, no second heading */
.fh-fold-body .st-card { border: 0; box-shadow: none; padding: 0; background: none; }
.fh-fold-body .st-card-head h2 { display: none; }
.fh-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fh-rows li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.fh-rows li:first-child { border-top: 0; }
.fh-rows li > span { flex: 1; min-width: 0; }
.fh-rows strong { display: block; font-size: .95rem; }
.fh-rows small { display: block; font-size: .82rem; color: var(--muted); }

.fh-count.is-new { background: var(--go); color: #fff; padding: 0 10px; }

/* ---------- questions (exam-player.js), students only: bigger words, fewer counters.
   Streak and points still show as banners and at the end of the set (delight.js). */
body.fh-student #screenTest .ex-hud { display: none; }
body.fh-student #screenTest .ex-prompt { font-size: 1.2rem; line-height: 1.5; }
body.fh-student.st-primary #screenTest .ex-prompt { font-size: 1.3rem; }
body.fh-student #screenTest .ex-opt { min-height: 54px; font-size: 1.05rem; }

/* the cheers banner keeps its own look; give it room */
.fh-home .dl-cheers { margin: 0; }

/* ---------- entrance (React Bits "blur text", Magic UI "blur fade") */
.is-animated .fh-greet span { animation: fh-blur .6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 70ms); }
.is-animated .fh-hero, .is-animated .fh-today, .is-animated .fh-tiles, .is-animated .fh-folds { animation: fh-rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.is-animated .fh-hero { animation-delay: .12s; } .is-animated .fh-today { animation-delay: .2s; } .is-animated .fh-tiles { animation-delay: .28s; } .is-animated .fh-folds { animation-delay: .34s; }
@keyframes fh-blur { from { opacity: 0; filter: blur(8px); transform: translateY(6px); } to { opacity: 1; filter: none; transform: none; } }
@keyframes fh-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .fh-greet span, .fh-hero, .fh-today, .fh-tiles, .fh-folds, .fh-shine, .fh-loading span { animation: none !important; }
  .fh-tile, .fh-btn, .fh-btn-ic, .fh-ring-fg { transition: none !important; }
}

/* ---------- phones */
@media (max-width: 640px) {
  .fh-home { gap: 16px; }
  .fh-hello { gap: 12px; margin-top: -4px; }
  .fh-hello .dl-coach.is-md { transform: scale(.85); }
  .fh-hero { padding: 22px 18px 20px 22px; }
  .fh-hero-actions { gap: 12px; }
  .fh-btn { width: 100%; justify-content: center; }
  .fh-goals { grid-template-columns: 1fr; gap: 8px; }
  .fh-goal { padding: 10px 12px; }
  .fh-tiles, .fh-tiles.is-four { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fh-tile:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .fh-tile { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 0; padding: 14px; }
  .fh-tile-ic { width: 42px; height: 42px; border-radius: 12px; }
  .fh-tile strong { font-size: 1rem; }
  .fh-tile small { font-size: .8rem; }
}

/* ---------- dark mode */
body.dl-dark .fh-hero, body.dl-dark .fh-goal, body.dl-dark .fh-tile, body.dl-dark .fh-fold, body.dl-dark .fh-pill { background: var(--dl-surface, var(--paper)); }
body.dl-dark .fh-hero { box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
body.dl-dark .fh-goal.is-done { background: var(--go-soft); }
