/* Approved unified English + QA homepage. Kept separate from the course UI layer. */

body.ui-home {
  --home-ink: #0b1020;
  --home-muted: #667085;
  --home-violet: #4f46e5;
  --home-mint: #11b8ab;
  --home-amber: #f59e0b;
  min-height: 100vh;
  color: var(--home-ink);
  background:
    radial-gradient(circle at 8% -8%, rgba(79, 70, 229, .24), transparent 33vw),
    radial-gradient(circle at 96% 8%, rgba(20, 184, 166, .18), transparent 31vw),
    radial-gradient(circle at 58% 112%, rgba(245, 158, 11, .14), transparent 40vw),
    linear-gradient(135deg, #fbfdff 0%, #f3f6ff 46%, #eef7ff 100%);
  -webkit-font-smoothing: antialiased;
}

body.ui-home::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .42;
  background-image:
    linear-gradient(rgba(85, 101, 134, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(85, 101, 134, .08) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 78%);
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}

body.ui-home .home-page {
  min-height: 100vh;
}

body.ui-home .container {
  width: min(1180px, calc(100% - 48px));
}

body.ui-home .home-hero {
  display: block;
  min-height: 100vh;
  padding: 30px 0 110px;
}

body.ui-home .home-shell {
  display: grid;
  gap: 0;
}

body.ui-home .home-topbar {
  position: relative;
  top: auto;
  z-index: 40;
  min-height: 82px;
  margin: 0;
  padding: 14px 22px 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 30px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 18px 52px rgba(37, 47, 79, .10), inset 0 0 0 1px rgba(101, 116, 154, .08);
  backdrop-filter: blur(18px);
}

body.ui-home .home-topbar::before {
  display: none;
}

body.ui-home .home-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 46px;
  padding: 0 19px 0 50px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 7px 18px rgba(30, 41, 70, .12);
  color: var(--home-ink);
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -.035em;
}

body.ui-home .home-brand::before {
  content: "";
  position: absolute;
  left: 12px;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #5552e8, #12bcaa);
  box-shadow: 0 7px 16px rgba(70, 83, 214, .28);
}

body.ui-home .home-brand::after {
  content: "";
  position: absolute;
  left: 20px;
  width: 5px;
  height: 10px;
  border-radius: 4px;
  background: #fff;
}

body.ui-home .topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

body.ui-home .topbar-control {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(74, 87, 119, .12);
  border-radius: 18px;
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 7px 18px rgba(28, 39, 68, .08);
  color: var(--home-ink);
  font-size: 14px;
  font-weight: 750;
}

body.ui-home .home-hero-grid {
  padding: 88px 4px 34px;
  display: grid;
  grid-template-columns: .94fr 1.06fr;
  align-items: center;
  gap: 74px;
}

body.ui-home .home-copy {
  display: block;
  max-width: none;
}

body.ui-home .home-eyebrow {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 26px;
  padding: 7px 13px;
  border: 1px solid rgba(79, 70, 229, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .40);
  color: #4544ad;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .075em;
}

body.ui-home .home-copy h1 {
  max-width: none;
  margin: 0;
  color: var(--home-ink);
  background: none;
  font-size: clamp(58px, 6vw, 82px);
  line-height: .91;
  letter-spacing: -.068em;
  font-weight: 900;
}

body.ui-home .home-copy h1 span {
  color: inherit;
}

body.ui-home .home-copy h1 .home-title-accent {
  color: transparent;
  background: linear-gradient(90deg, #161b49 0%, #5346df 56%, #10b6aa 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

body.ui-home .home-subtitle {
  max-width: 590px;
  margin: 28px 0 0;
  color: #68758c;
  font-size: 19px;
  line-height: 1.7;
}

body.ui-home .home-visual-frame {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .86);
  border-radius: 30px;
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 24px 68px rgba(27, 43, 82, .16);
  transform: none;
}

body.ui-home .home-visual-frame::before {
  display: none;
}

body.ui-home .home-visual-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.6;
  border-radius: 0;
  object-fit: cover;
}

body.ui-home .home-topic-board {
  display: block;
  padding: 12px 0 0;
}

body.ui-home .home-section-heading {
  display: block;
  max-width: none;
}

body.ui-home .home-section-heading h2 {
  margin: 0;
  font-size: 42px;
  line-height: 1.1;
  letter-spacing: -.05em;
  font-weight: 900;
}

body.ui-home .home-section-heading p,
body.ui-home .home-section-heading .subtitle {
  max-width: 830px;
  margin: 13px 0 0;
  color: #6d788b;
  font-size: 15px;
  line-height: 1.75;
}

body.ui-home .topic-group {
  margin-top: 34px;
}

body.ui-home .career-topic-group {
  margin-top: 48px;
}

body.ui-home .topic-group-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 15px;
}

body.ui-home .topic-group-heading span {
  min-width: 31px;
  padding: 6px 7px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .72);
  color: #5c68a7;
  box-shadow: 0 5px 14px rgba(31, 43, 78, .08);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

body.ui-home .topic-group-heading h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -.02em;
}

body.ui-home .topic-group-heading i {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(84, 99, 136, .2), transparent);
}

body.ui-home .home-topic-grid {
  display: grid;
  grid-auto-rows: auto;
  align-items: stretch;
  gap: 18px;
}

body.ui-home .english-topic-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.ui-home .career-topic-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.ui-home .home-topic-card {
  position: relative;
  min-height: 190px;
  padding: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 24px;
  background:
    radial-gradient(circle at 85% 10%, rgba(79, 70, 229, .24), transparent 34%),
    linear-gradient(rgba(255, 255, 255, .95), rgba(255, 255, 255, .68));
  box-shadow: 0 10px 28px rgba(22, 31, 61, .08);
  color: var(--home-ink);
  text-decoration: none;
  backdrop-filter: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body.ui-home .home-topic-card:hover {
  z-index: 2;
  transform: translateY(-4px);
  border-color: rgba(155, 145, 239, .55);
  box-shadow: 0 24px 70px rgba(22, 31, 61, .14);
}

body.ui-home .home-topic-card::after {
  content: "";
  position: absolute;
  top: 17px;
  right: 18px;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(120, 114, 238, .22), rgba(86, 187, 228, .13));
  opacity: 1;
  transform: rotate(12deg);
}

body.ui-home .home-topic-card.accent-mint {
  background:
    radial-gradient(circle at 85% 10%, rgba(20, 184, 166, .23), transparent 35%),
    linear-gradient(rgba(255, 255, 255, .95), rgba(255, 255, 255, .68));
}

body.ui-home .home-topic-card.accent-mint::after {
  background: linear-gradient(145deg, rgba(52, 211, 184, .24), rgba(58, 135, 230, .12));
}

body.ui-home .home-topic-card.accent-amber {
  background:
    radial-gradient(circle at 85% 10%, rgba(245, 158, 11, .21), transparent 35%),
    linear-gradient(rgba(255, 255, 255, .95), rgba(255, 255, 255, .68));
}

body.ui-home .home-topic-card.accent-amber::after {
  background: linear-gradient(145deg, rgba(245, 184, 66, .22), rgba(59, 190, 180, .13));
}

body.ui-home .home-topic-card strong {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 0;
  max-width: calc(100% - 24px);
  padding: 11px 15px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(100deg, #4f46e5, #0dbbb0);
  box-shadow: 0 10px 24px rgba(70, 79, 201, .22);
  font-size: 15px;
  line-height: 1.15;
  font-weight: 850;
  text-align: left;
}

body.ui-home .home-topic-card > span:last-child {
  position: relative;
  z-index: 1;
  min-height: 0;
  margin-top: 19px;
  color: #293347;
  font-size: 14px;
  line-height: 1.55;
}

body.ui-home .qa-topic-card {
  border-color: rgba(99, 95, 217, .28);
  box-shadow: 0 18px 42px rgba(41, 53, 110, .13);
}

body.ui-home .qa-card-meta {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  padding: 6px 9px;
  border: 1px solid rgba(79, 70, 229, .11);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: #626c82;
  font-size: 8px;
  font-weight: 850;
}

body.ui-home .qa-topic-card::after {
  top: auto;
  bottom: 13px;
}

body.ui-home .home-app-card {
  width: min(720px, 100%);
  min-height: 88px;
  margin: 40px auto 0;
  padding: 15px 17px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 22px;
  background: rgba(255, 255, 255, .74);
  color: var(--home-ink);
  box-shadow: 0 16px 45px rgba(30, 42, 75, .12);
  backdrop-filter: blur(14px);
}

body.ui-home .home-app-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #222c48;
  color: #fff;
  font-size: 13px;
}

body.ui-home .home-app-copy {
  display: flex;
  flex-direction: column;
}

body.ui-home .home-app-copy strong {
  font-size: 13px;
}

body.ui-home .home-app-copy small {
  margin-top: 5px;
  color: #768096;
  font-size: 10px;
  line-height: 1.35;
}

body.ui-home .home-app-cta {
  min-height: 0;
  padding: 11px 14px;
  border-radius: 999px;
  background: #232c49;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
}

body.ui-home .support-widget-fab,
body.ui-home .feedback-fab {
  min-height: 48px;
  bottom: 20px;
  border-radius: 999px;
  box-shadow: 0 13px 34px rgba(35, 47, 86, .18);
  font-size: 13px;
  font-weight: 850;
}

body.ui-home .feedback-fab {
  right: 20px;
  padding: 0 21px;
  background: linear-gradient(100deg, #4f46e5, #0dbbb0);
}

@media (max-width: 1000px) {
  body.ui-home .home-hero-grid {
    grid-template-columns: 1fr;
    padding-top: 65px;
    gap: 38px;
  }

  body.ui-home .home-copy {
    max-width: 760px;
  }

  body.ui-home .home-visual-frame {
    width: min(760px, 100%);
  }

  body.ui-home .english-topic-grid,
  body.ui-home .career-topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ui-home .career-topic-grid .home-topic-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 650px) {
  body.ui-home .container {
    width: min(100% - 28px, 1180px);
  }

  body.ui-home .home-hero {
    padding-top: 14px;
  }

  body.ui-home .home-topbar {
    min-height: 68px;
    padding: 10px 12px;
    border-radius: 22px;
    align-items: center;
  }

  body.ui-home .home-brand {
    min-height: 42px;
    padding-right: 13px;
    padding-left: 45px;
    font-size: 14px;
  }

  body.ui-home .home-brand::before {
    left: 10px;
  }

  body.ui-home .topbar-actions {
    width: auto;
    gap: 6px;
  }

  body.ui-home .topbar-control {
    min-height: 42px;
    padding: 0 11px;
    border-radius: 14px;
  }

  body.ui-home .auth-control .topbar-control-text {
    display: none;
  }

  body.ui-home .home-hero-grid {
    padding: 52px 0 20px;
  }

  body.ui-home .home-eyebrow {
    line-height: 1.25;
  }

  body.ui-home .home-copy h1 {
    font-size: 50px;
  }

  body.ui-home .home-subtitle {
    font-size: 16px;
  }

  body.ui-home .home-visual-frame {
    border-radius: 24px;
  }

  body.ui-home .home-section-heading h2 {
    font-size: 36px;
  }

  body.ui-home .english-topic-grid,
  body.ui-home .career-topic-grid {
    grid-template-columns: 1fr;
  }

  body.ui-home .career-topic-grid .home-topic-card:last-child {
    grid-column: auto;
  }

  body.ui-home .home-topic-card {
    min-height: 176px;
  }

  body.ui-home .home-app-card {
    grid-template-columns: auto 1fr;
  }

  body.ui-home .home-app-cta {
    grid-column: 1 / -1;
    text-align: center;
  }

  body.ui-home .support-widget {
    left: 12px;
    bottom: 12px;
  }

  body.ui-home .support-widget-fab,
  body.ui-home .feedback-fab {
    bottom: 12px;
  }

  body.ui-home .support-widget-fab {
    padding: 0 10px;
    font-size: 0;
  }

  body.ui-home .support-widget-icon {
    margin: 0;
  }

  body.ui-home .feedback-fab {
    left: auto;
    right: 12px;
    width: auto;
    padding: 0 18px;
  }
}

@media (max-width: 380px) {
  body.ui-home .home-copy h1 {
    font-size: 43px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ui-home *,
  body.ui-home *::before,
  body.ui-home *::after {
    transition: none !important;
  }
}
