/*
 * gonglogic.com — the front page (HomePageController), rewritten 2026-10-25.
 *
 * A plain file like the library's, studio's and audio site's: the page's look changes
 * without rebuilding the shared theme. Everything is under `.home`, the page's own
 * wrapper, so nothing here can reach another page.
 *
 * ── HOW IT WINS AGAINST THE THEME
 *
 * This file is printed BEFORE main.css (controller requirements come first), so a tie
 * goes to the theme. The theme styles bare elements (h1, p, a, a:hover), so element
 * resets are `.home :where(h1)` (0,1,0, beating the theme's 0,0,1) and every component
 * is `.home .x` (0,2,0, beating `a:hover`'s 0,1,1).
 *
 * ── HOVER CHANGES PAINT ONLY
 *
 * A :hover rule here may change colour, background, border colour and shadow, never
 * size, padding, border width or weight: a control that grows under the pointer moves
 * the thing beside it. `check:read-hover` measures it.
 *
 * ── NO DARK MODE, ON PURPOSE
 *
 * The main site's theme has none (its header and footer are light paper and dark ink
 * whatever the system asks for), so a dark front page would sit between a light header
 * and every light page it links to on gonglogic.com. The Library has a real one.
 */

.home {
  --paper: #f8f4ea;
  --page: #f1ebdc;            /* the theme's .layout grey-100 */
  --surface: #fffdf8;
  --surface-2: #f4eee2;
  --ink: #15151b;
  --ink-2: #4e4a40;           /* 8.2:1 on paper */
  --ink-3: #6b6558;           /* 5.0:1 on paper, the floor for small text */
  --rule: rgba(21, 21, 27, 0.11);
  --rule-2: rgba(21, 21, 27, 0.22);
  --accent: #c8962f;          /* the brand amber: fills and marks, never small text */
  --accent-ink: #8a5e0d;      /* amber that has to be read: 5.6:1 on paper */
  --accent-ink-2: #6c4807;
  --lit: rgba(236, 184, 58, 0.34);
  --shadow-1: 0 1px 2px rgba(21, 21, 27, 0.05);
  --shadow-2: 0 1px 2px rgba(21, 21, 27, 0.05), 0 12px 30px -16px rgba(21, 21, 27, 0.3);
  --cjk: 'PingFang SC', 'PingFang TC', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN',
    'Apple SD Gothic Neo', 'Noto Sans CJK SC', 'Noto Sans CJK JP', 'Noto Sans KR',
    'Microsoft YaHei', 'Malgun Gothic', system-ui, sans-serif;

  color: var(--ink);
  background: var(--page);
}

/* ── resets against the theme ─────────────────────────────────────────────── */

.home :where(h1, h2, h3, p, ul, ol, figure) {
  margin: 0;
}
.home :where(ul, ol) {
  list-style: none;
  padding: 0;
}
.home :where(h1, h2, h3) {
  color: var(--ink);
  font-family: var(--font-heading, 'Outfit', sans-serif);
}
.home :where(p) {
  font-size: 1rem;
  line-height: 1.6;
}

/* The theme's .container exactly (1280px with its gutter inside), so the page's left
   edge lines up with the logo in the header above it. */
.home .home-wrap {
  box-sizing: border-box;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 48rem) {
  .home .home-wrap {
    padding: 0 2rem;
  }
}

/* ── links and buttons ─────────────────────────────────────────────────────── */

.home .home-link,
.home .home-link:hover {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
.home .home-link {
  color: var(--accent-ink);
  text-decoration-color: transparent;
}
.home .home-link:hover,
.home .home-link:focus-visible {
  color: var(--accent-ink-2);
  text-decoration-color: currentColor;
}

.home .home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}
.home .home-btn {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.4rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: 600 1rem/1 var(--font-sans, 'Inter', sans-serif);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.home .home-btn--primary,
.home .home-btn--primary:hover {
  color: var(--paper);
}
.home .home-btn--primary {
  background: var(--ink);
  border-color: var(--ink);
}
.home .home-btn--primary:hover,
.home .home-btn--primary:focus-visible {
  background: #2f2d33;
  border-color: #2f2d33;
}
.home .home-btn--ghost,
.home .home-btn--ghost:hover {
  color: var(--ink);
}
.home .home-btn--ghost {
  background: transparent;
  border-color: var(--rule-2);
}
.home .home-btn--ghost:hover,
.home .home-btn--ghost:focus-visible {
  background: var(--surface);
  border-color: var(--ink);
}

/* ── the hero ──────────────────────────────────────────────────────────────── */

.home .home-hero {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 2.5rem 0 2rem;
}
@media (min-width: 48rem) {
  .home .home-hero {
    padding: 4.5rem 0 2.75rem;
  }
}
.home .home-hero__split {
  display: grid;
  gap: 2.25rem;
}
@media (min-width: 62rem) {
  .home .home-hero__split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    gap: 4rem;
    align-items: center;
  }
}

.home .home-hero__say {
  min-width: 0;
}

.home .home-eyebrow {
  font: 600 0.8rem/1.2 var(--font-sans, 'Inter', sans-serif);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 0.9rem;
}
.home .home-hero__title {
  font-size: clamp(2.3rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  max-width: 13ch;
}
.home .home-hero__lede {
  margin-top: 1.25rem;
  max-width: 34rem;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.home .home-hero__note {
  margin-top: 1.25rem;
  max-width: 34rem;
  padding: 0.7rem 0.95rem;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 0.5rem 0.5rem 0;
  font-size: 0.95rem;
  color: var(--ink-2);
}
.home .home-hero__note strong {
  color: var(--ink);
}

.home .home-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  color: var(--ink-3);
}
.home .home-facts strong {
  font: 700 1.35rem/1 var(--font-heading, 'Outfit', sans-serif);
  color: var(--ink);
  margin-right: 0.3rem;
  letter-spacing: -0.02em;
}

/* ── the demonstration ─────────────────────────────────────────────────────── */

.home .home-demo {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 1.1rem;
  box-shadow: var(--shadow-2);
  padding: 1.1rem 1.1rem 1rem;
  min-width: 0;
}
@media (min-width: 48rem) {
  .home .home-demo {
    padding: 1.5rem 1.6rem 1.25rem;
  }
}
.home .home-demo__cap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
  font-size: 0.8rem;
  color: var(--ink-3);
  margin-bottom: 0.9rem;
}
.home .home-demo__lang {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.home .home-demo__title {
  color: var(--ink-2);
}
.home .home-demo__lines {
  display: grid;
  gap: 0.9rem;
}
.home .home-demo__source {
  font-family: var(--cjk);
  font-size: 1.4rem;
  line-height: 2.1;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.home .home-demo__source:lang(it),
.home .home-demo__source:lang(fr),
.home .home-demo__source:lang(de),
.home .home-demo__source:lang(es) {
  font-family: Georgia, 'Iowan Old Style', serif;
  line-height: 1.6;
}
@media (min-width: 48rem) {
  .home .home-demo__source {
    font-size: 1.55rem;
  }
}
.home .home-demo__source rt {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 0.42em;
  color: var(--ink-3);
  letter-spacing: 0;
}
.home .home-demo__english {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.home .home-word {
  font: inherit;
  color: inherit;
  line-height: inherit;
  margin: 0;
  padding: 0 0.04em;
  border: 0;
  border-bottom: 2px dotted rgba(138, 94, 13, 0.45);
  border-radius: 0.2em 0.2em 0 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.home .home-word--plain {
  border-bottom-color: transparent;
  cursor: auto;
}
.home .home-word[role="button"]:hover {
  background: var(--surface-2);
  border-bottom-color: var(--accent-ink);
}
.home .home-word--on,
.home .home-word--on[role="button"]:hover {
  background: var(--lit);
  border-bottom-color: var(--accent-ink);
}

.home .home-demo__card {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.7rem;
  background: var(--ink);
  color: #f4eee2;
  min-height: 4.5rem;
}
.home .home-demo__word {
  display: inline;
  font-family: var(--cjk);
  font-size: 1.15rem;
  font-weight: 600;
  color: #fffdf8;
}
.home .home-demo__reading {
  display: inline;
  margin-left: 0.5rem;
  font-size: 0.9rem;
  color: #d3c8ac;
}
.home .home-demo__def {
  margin-top: 0.2rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #e6dcc6;
}
.home .home-demo__try {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-top: 0.85rem;
  font-size: 0.875rem;
  color: var(--ink-3);
}

/* ── sections ──────────────────────────────────────────────────────────────── */

.home .home-section {
  padding: 3rem 0;
}
/* 4rem, not more: with a card's own padding above and a heading's below, two of these
   meeting make the widest gap on the page, and check:read-layout holds that under 160px. */
@media (min-width: 48rem) {
  .home .home-section {
    padding: 4rem 0;
  }
}
.home .home-section--band {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.home .home-section--last {
  border-bottom: 0;
}

.home .home-head {
  margin-bottom: 1.75rem;
}
.home .home-head--row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem 2rem;
}
.home .home-head__title {
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.home .home-head__note {
  margin-top: 0.6rem;
  max-width: 44rem;
  color: var(--ink-2);
}
.home .home-more {
  margin-top: 1.25rem;
}

/* ── the courses ───────────────────────────────────────────────────────────── */

.home .home-courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr));
  gap: 0.75rem;
}
.home .home-course,
.home .home-course:hover {
  color: var(--ink);
  text-decoration: none;
}
.home .home-course {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  height: 100%;
  padding: 1rem 1.15rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.9rem;
  box-shadow: var(--shadow-1);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.home .home-course:hover,
.home .home-course:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
}
.home .home-course__native {
  font-family: var(--cjk);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}
.home .home-course__name {
  font-weight: 600;
  font-size: 0.95rem;
}
.home .home-course__holdings {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink-3);
}

/* ── the other sites ───────────────────────────────────────────────────────── */

.home .home-sites {
  display: grid;
  gap: 1rem;
}
@media (min-width: 64rem) {
  .home .home-sites {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}
.home .home-site {
  display: flex;
  flex-direction: column;
  padding: 1.35rem 1.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 1rem;
  box-shadow: var(--shadow-1);
  min-width: 0;
}
@media (min-width: 48rem) {
  .home .home-site {
    padding: 1.6rem 1.6rem 1.4rem;
  }
}
.home .home-site__host {
  font: 600 0.75rem/1.2 var(--font-sans, 'Inter', sans-serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.home .home-site__title {
  margin-top: 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.home .home-site__link,
.home .home-site__link:hover {
  text-decoration: none;
}
.home .home-site__link {
  color: var(--ink);
}
.home .home-site__link:hover,
.home .home-site__link:focus-visible {
  color: var(--accent-ink);
}
.home .home-site__text {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  color: var(--ink-2);
}
.home .home-site__go {
  margin-top: auto;
  padding-top: 1.1rem;
}

.home .home-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}
.home .home-tag,
.home .home-tag:hover {
  color: var(--ink);
  text-decoration: none;
}
.home .home-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  font-size: 0.85rem;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.home .home-tag:hover,
.home .home-tag:focus-visible {
  background: var(--surface-2);
  border-color: var(--accent);
}
.home .home-tag__n {
  color: var(--ink-3);
  font-size: 0.8rem;
}

.home .home-list {
  margin-top: 1rem;
  border-top: 1px solid var(--rule);
}
.home .home-list > li {
  border-bottom: 1px solid var(--rule);
}
.home .home-list--plain > li {
  padding: 0.5rem 0;
  font-size: 0.95rem;
  color: var(--ink-2);
}
.home .home-list__link,
.home .home-list__link:hover {
  text-decoration: none;
}
.home .home-list__link {
  display: block;
  padding: 0.55rem 0;
  color: var(--ink);
  transition: color 0.15s ease;
}
.home .home-list__link:hover,
.home .home-list__link:focus-visible {
  color: var(--accent-ink);
}
.home .home-list__main {
  font-weight: 600;
  font-size: 0.95rem;
}
.home .home-list__sub {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-3);
}

.home .home-packs {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}
.home .home-pack {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}
.home .home-pack__cover {
  flex: 0 0 auto;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 0.6rem;
  object-fit: cover;
  background: var(--surface-2);
}
.home .home-pack__say {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.home .home-pack__name {
  font-weight: 700;
}
.home .home-pack__tagline {
  font-size: 0.9rem;
  color: var(--ink-2);
}
.home .home-pack__facts {
  font-size: 0.82rem;
  color: var(--ink-3);
}

/* ── today's words ─────────────────────────────────────────────────────────── */

.home .home-words {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
  gap: 0.75rem;
}
.home .home-wordcard,
.home .home-wordcard:hover {
  color: var(--ink);
  text-decoration: none;
}
.home .home-wordcard {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  height: 100%;
  padding: 0.95rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.home .home-wordcard:hover,
.home .home-wordcard:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
}
.home .home-wordcard__lang {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.home .home-wordcard__word {
  margin-top: 0.2rem;
  font-family: var(--cjk);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.home .home-wordcard__reading {
  font-size: 0.85rem;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}
.home .home-wordcard__meaning {
  font-size: 0.9rem;
  color: var(--ink-2);
}

/* ── games ─────────────────────────────────────────────────────────────────── */

.home .home-games {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 48rem) {
  .home .home-games {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.home .home-game,
.home .home-game:hover {
  color: var(--ink);
  text-decoration: none;
}
.home .home-game {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  height: 100%;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.home .home-game:hover,
.home .home-game:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
}
.home .home-game__name {
  font: 700 1.15rem/1.2 var(--font-heading, 'Outfit', sans-serif);
}
.home .home-game__line {
  font-size: 0.95rem;
  color: var(--ink-2);
}
.home .home-game__where {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-ink);
}

/* ── DARK (the family bar's Light · Dark · Auto, 2026-10-25) ──────────────────────
   Every colour above is a token, so dark is these values; the two hard-coded spots are
   the primary button's hover and the demo's definition card, which stays a dark panel. */
:root[data-scheme="dark"] .home {
  --paper: #1d1b18;
  --page: #171512;
  --surface: #221f1b;
  --surface-2: #2a2722;
  --ink: #ede6d7;
  --ink-2: #c6bdab;
  --ink-3: #9d947f;
  --rule: rgba(237, 230, 215, 0.11);
  --rule-2: rgba(237, 230, 215, 0.22);
  --accent: #d6a646;
  --accent-ink: #e4b95e;
  --accent-ink-2: #efc976;
  --lit: rgba(214, 166, 70, 0.3);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -16px rgba(0, 0, 0, 0.7);
}
:root[data-scheme="dark"] .home .home-btn--primary:hover,
:root[data-scheme="dark"] .home .home-btn--primary:focus-visible { background: #fff6e2; border-color: #fff6e2; }
:root[data-scheme="dark"] .home .home-demo__card { background: #2c2924; }
