/* Home page design: a dark-teal hero with a drawn test screen, quick cards, a gallery of the five kinds of topics,
 * calm motion. Loaded last (after comfort.css); everything sits under .hm so the test screens are untouched. */

.hm { --hero-1: #0d2b45; --hero-2: #17604f; --gold: #f2b441; --tone-a: #2e7a70; --tone-b: #2d6aa8; --tone-c: #c9862b; --tone-d: #b4546a; --tone-e: #6b5bb0; }

/* ---------- hero ---------- */
.hm .hm-hero { position: relative; overflow: hidden; color: #fff; background:
  radial-gradient(900px 420px at 88% -10%, rgba(242, 180, 65, 0.22), transparent 60%),
  radial-gradient(700px 500px at 0% 110%, rgba(110, 200, 180, 0.2), transparent 60%),
  linear-gradient(135deg, var(--hero-1), var(--hero-2)); }
.hm .hm-hero::before { content: ''; position: absolute; inset: 0; opacity: 0.5; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: linear-gradient(180deg, #000, transparent 85%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); }
.hm .hm-hero-in { position: relative; max-width: 1120px; margin: 0 auto; padding: 56px 24px 64px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 36px; align-items: center; box-sizing: border-box; }
.hm .hm-hero .hm-eyebrow { display: inline-block; margin: 0 0 16px; padding: 5px 16px; font-size: 14px; font-weight: 600; color: #d6f2ea; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 999px; }
.hm .hm-hero h1 { margin: 0 0 14px; font-size: 44px; line-height: 1.3; font-weight: 800; color: #fff; }
.hm .hm-hero h1 span { color: #8fe3d0; }
.hm .hm-hero .hm-lead { margin: 0 0 24px; max-width: 540px; font-size: 18.5px; line-height: 1.85; color: #d3e3ec; }
.hm .hm-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-bottom: 26px; }
.hm .hm-cta button { font-family: inherit; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.hm .hm-cta-main { min-height: 54px; padding: 0 28px; font-size: 18px; font-weight: 700; color: #1b2a14; background: var(--gold); border: 0; border-radius: 999px; box-shadow: 0 10px 24px -8px rgba(242, 180, 65, 0.7); }
.hm .hm-cta-main:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(242, 180, 65, 0.85); background: #f7c25c; }
.hm .hm-cta-alt { min-height: 54px; padding: 0 24px; font-size: 17px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1.5px solid rgba(255, 255, 255, 0.45); border-radius: 999px; }
.hm .hm-cta-alt:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }
.hm .hm-cta-link { min-height: 44px; padding: 0 6px; font-size: 16px; color: #cfe6ee; background: none; border: 0; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, 0.4); }
.hm .hm-cta-link:hover { color: #fff; }
.hm .hm-cta button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.hm .hm-chips { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0; padding: 0; list-style: none; }
.hm .hm-chips li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; font-size: 14px; line-height: 1.5; color: #e6f1f5; background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 999px; }
.hm .hm-chips .ic { width: 18px; height: 18px; color: #8fe3d0; }
.hm .hm-hero-art { position: relative; justify-self: end; width: 100%; max-width: 540px; animation: hm-float 6s ease-in-out infinite; }
.hm .hm-hero-art svg { display: block; width: 100%; height: auto; }
@keyframes hm-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- page ---------- */
.hm .hm-main { padding-top: 6px; }
.hm .hm-wrap { max-width: 1120px; }
.hm .hm-cols > section, .hm .hm-topics { border-radius: 20px; box-shadow: var(--shadow); border-color: transparent; }
.hm .hm-cols { margin-top: -34px; position: relative; z-index: 2; align-items: start; }
.hm .hm-cols h2, .hm .hm-topics h2 { border-bottom: 0; padding-bottom: 0; }
.hm .hm-btn { transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s; }
.hm .hm-btn-main:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px var(--teal); }
.hm .hm-resume { margin-top: 18px; border-radius: 16px; }
.hm .hm-empty { padding: 14px 16px; margin: 6px 0 0; font-size: 15.5px; line-height: 1.8; color: var(--ink-2); background: var(--surface-2); border-radius: 12px; border: 1px dashed var(--line-2); }

/* ---------- the five kinds of topics ---------- */
.hm .hm-gallery { margin: 30px 0 6px; }
.hm .hm-gal-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 14px; }
.hm .hm-gal-h h2 { margin: 0; font-size: 24px; border: 0; padding: 0; }
.hm .hm-gal-h p { margin: 0; font-size: 15px; color: var(--ink-3); }
.hm .hm-gal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.hm .hm-kind { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px 18px 16px; min-height: 164px; text-align: left; font-family: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); cursor: pointer; transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s; }
.hm .hm-kind::after { content: '→'; position: absolute; right: 16px; top: 16px; font-size: 18px; color: var(--ink-3); transition: transform 0.18s, color 0.18s; }
.hm .hm-kind:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--tc); }
.hm .hm-kind:hover::after { transform: translateX(4px); color: var(--tc); }
.hm .hm-kind-ic { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 8px; color: #fff; background: var(--tc); border-radius: 14px; }
.hm .hm-kind-ic .ic { width: 24px; height: 24px; }
.hm .hm-kind b { font-size: 17px; line-height: 1.5; }
.hm .hm-kind-d { font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.hm .hm-kind-n { margin-top: auto; padding-top: 8px; font-size: 13px; font-weight: 600; color: var(--tc); }
.hm .tone-a { --tc: var(--tone-a); } .hm .tone-b { --tc: var(--tone-b); } .hm .tone-c { --tc: var(--tone-c); } .hm .tone-d { --tc: var(--tone-d); } .hm .tone-e { --tc: var(--tone-e); }

/* ---------- lists ---------- */
.hm .hm-unit { transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s; }
.hm .hm-unit:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.hm .hm-tab { transition: background 0.15s, color 0.15s, border-color 0.15s; }
.hm .hm-fold { border-radius: 16px; }

/* ---------- opening a topic that is still being fetched ---------- */
body.is-loading::before { content: ''; position: fixed; inset: 0; z-index: 80; background: rgba(246, 247, 244, 0.7); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
body.is-loading::after { content: ''; position: fixed; left: 50%; top: 50%; z-index: 81; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 5px solid #cfe3de; border-top-color: var(--teal, #2e7a70); border-radius: 50%; animation: hm-spin 0.8s linear infinite; }
@keyframes hm-spin { to { transform: rotate(360deg); } }

/* ---------- entrance ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hm .hm-hero-t > * { animation: hm-up 0.6s both; }
  .hm .hm-hero-t > :nth-child(2) { animation-delay: 0.06s; } .hm .hm-hero-t > :nth-child(3) { animation-delay: 0.12s; }
  .hm .hm-hero-t > :nth-child(4) { animation-delay: 0.18s; } .hm .hm-hero-t > :nth-child(5) { animation-delay: 0.24s; }
  .hm .hm-gal-grid > * { animation: hm-up 0.5s both; }
  .hm .hm-gal-grid > :nth-child(2) { animation-delay: 0.05s; } .hm .hm-gal-grid > :nth-child(3) { animation-delay: 0.1s; }
  .hm .hm-gal-grid > :nth-child(4) { animation-delay: 0.15s; } .hm .hm-gal-grid > :nth-child(5) { animation-delay: 0.2s; }
}
@keyframes hm-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hm .hm-hero-art { animation: none; } .hm *, body.is-loading::after { transition: none !important; } }

/* ---------- phones and small windows ---------- */
@media (max-width: 900px) {
  .hm .hm-hero-in { grid-template-columns: 1fr; padding: 34px 20px 52px; gap: 26px; }
  .hm .hm-hero h1 { font-size: 34px; }
  .hm .hm-hero .hm-lead { font-size: 17px; }
  .hm .hm-hero-art { justify-self: center; max-width: 420px; }
  .hm .hm-cols { margin-top: -26px; }
}
@media (max-width: 560px) {
  .hm .hm-hero-in { padding: 26px 16px 44px; }
  .hm .hm-hero h1 { font-size: 29px; }
  .hm .hm-cta-main, .hm .hm-cta-alt { flex: 1 1 100%; justify-content: center; }
  .hm .hm-cta-main { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
  .hm .hm-chips li { font-size: 13px; }
  .hm .hm-gal-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hm .hm-kind { min-height: 150px; padding: 14px; }
  .hm .hm-kind-d { font-size: 13px; }
  .hm .hm-gal-h h2 { font-size: 21px; }
}
@media print { .hm .hm-hero { display: none; } }
