/* =========================================================
   UpUpEdu homepage (loaded after style.css on index.html only)
   ========================================================= */

.home {
  --color-teal: #0f766e;
  --color-teal-soft: #e6f4f1;
  --color-amber: #92400e;
  --color-amber-soft: #fef3c7;
  --color-red: #b91c1c;
  --color-red-soft: #fdecec;
  --color-accent-soft: #e8f1fc;
  --vg-radius: 14px;
  --vg-shadow: 0 1px 2px rgba(15, 31, 51, 0.06), 0 12px 32px -8px rgba(15, 31, 51, 0.16);
}

.home .section {
  padding: 5.5rem 0;
}

.home h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: -0.025em;
}

.text-accent {
  display: block;
  color: var(--color-accent);
}

.btn-lg {
  min-height: 50px;
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  border-radius: 10px;
}

.btn-ghost {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.btn-ghost:hover {
  border-color: #b8c6d8;
  background: #fff;
  color: var(--color-primary);
}

.btn-ghost-dark {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-ghost-dark:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn:focus-visible,
.tab:focus-visible,
.faq-list summary:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 2px;
}

/* ---------- Hero ---------- */

.home-hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 5.5rem;
  background:
    radial-gradient(ellipse 50% 60% at 85% 30%, rgba(31, 111, 214, 0.14), transparent 70%),
    radial-gradient(ellipse 40% 50% at 70% 90%, rgba(15, 118, 110, 0.1), transparent 70%),
    radial-gradient(ellipse 40% 40% at 0% 0%, rgba(31, 111, 214, 0.08), transparent 70%),
    linear-gradient(180deg, #f7f9fc 0%, #f1f5fa 100%);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}

.home-hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.4rem;
  padding: 0.35rem 0.85rem 0.35rem 0.65rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--color-secondary);
  box-shadow: var(--shadow-sm);
}

.hero-kicker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-teal);
  box-shadow: 0 0 0 4px var(--color-teal-soft);
}

.home-hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.7rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin-bottom: 1.4rem;
  text-wrap: balance;
}

.home-hero-lead {
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--color-muted-foreground);
  max-width: 36rem;
  margin-bottom: 2rem;
}

.home .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.2rem;
}

.hero-principles {
  list-style: none;
  margin: 0;
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--color-secondary);
}

.hero-principles li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hero-principles .icon {
  color: var(--color-teal);
  width: 1.15rem;
  height: 1.15rem;
}

/* ---------- Vignette primitives ---------- */

.vg {
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: var(--vg-radius);
  box-shadow: var(--vg-shadow);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-foreground);
}

.vg p {
  margin: 0;
}

.vg-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.35rem !important;
}

.vg-strong {
  font-weight: 600;
  color: var(--color-foreground);
}

.vg-muted {
  font-size: 0.8rem;
  color: #64748b;
}

.vg-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: #1857a8;
  font-size: 0.75rem;
  font-weight: 700;
}

.vg-tag {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.vg-status {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.vg-status.is-ok {
  background: var(--color-teal-soft);
  color: var(--color-teal);
}

.vg-status.is-wait {
  background: var(--color-amber-soft);
  color: var(--color-amber);
}

.vg-source {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: #1857a8;
  font-weight: 600;
}

.vg-source::before {
  content: "";
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  margin-right: 0.35rem;
  vertical-align: -1px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5a2 2 0 0 1 2-2h12v18H6a2 2 0 0 1-2-2z'/%3E%3Cpath d='M4 17a2 2 0 0 1 2-2h12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5a2 2 0 0 1 2-2h12v18H6a2 2 0 0 1-2-2z'/%3E%3Cpath d='M4 17a2 2 0 0 1 2-2h12'/%3E%3C/svg%3E") center / contain no-repeat;
}

.vg-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.vg-mark,
.vg-mark.is-wrong {
  background: var(--color-red-soft);
  color: var(--color-red);
}

.vg-mark.is-right {
  background: var(--color-teal-soft);
  color: var(--color-teal);
}

.vg-connector {
  width: 2px;
  height: 22px;
  margin: 0 auto;
  background: repeating-linear-gradient(180deg, #b8c6d8 0 4px, transparent 4px 8px);
}

.vg-float-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--color-amber-soft);
  color: var(--color-amber);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vg-float-icon .icon {
  width: 1.1rem;
  height: 1.1rem;
}

.vg-footnote {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem !important;
  font-size: 0.75rem;
  color: #64748b;
}

.vg-footnote .icon {
  width: 0.9rem;
  height: 0.9rem;
}

/* ---------- Hero vignette ---------- */

.hero-visual {
  position: relative;
  padding: 3.6rem 1.5rem 3.5rem 1.5rem;
}

.vg-lesson {
  padding: 1.3rem 1.4rem 1.4rem;
}

.vg-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid #eef2f7;
}

.vg-steps {
  display: inline-flex;
  gap: 4px;
}

.vg-steps i {
  width: 22px;
  height: 5px;
  border-radius: 3px;
  background: #e2e8f0;
}

.vg-steps i.is-done {
  background: var(--color-teal);
}

.vg-steps i.is-active {
  background: var(--color-accent);
}

.vg-question {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 0.8rem !important;
}

.vg-answer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid #f3c4c4;
  background: #fff8f8;
  margin-bottom: 1rem;
}

.vg-chat {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}

.vg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-accent), #0f766e);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
}

.vg-bubble {
  padding: 0.75rem 0.9rem;
  border-radius: 4px 12px 12px 12px;
  background: #f4f7fb;
  border: 1px solid #e5ebf3;
}

.vg-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 0 2.7rem;
}

.vg-chip-btn {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
}

.vg-chip-btn.is-muted {
  background: #fff;
  color: var(--color-secondary);
  border: 1px solid var(--color-border);
}

.vg-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem 0.75rem 0.8rem;
  max-width: 290px;
}

.vg-float-title {
  font-weight: 700;
  font-size: 0.86rem;
}

.vg-float-meta {
  font-size: 0.76rem;
  color: #64748b;
}

.vg-float-mastery {
  top: 0;
  right: -0.5rem;
}

.vg-float-gap {
  bottom: 0;
  left: -1rem;
}

.vg-up {
  color: var(--color-teal);
  font-weight: 700;
}

.vg-ring {
  --size: 46px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  background:
    radial-gradient(closest-side, #fff 76%, transparent 78%),
    conic-gradient(var(--color-teal) calc(var(--value) * 1%), #e2e8f0 0);
}

.vg-ring b {
  font-size: 0.72rem;
  font-family: var(--font-display);
}

/* ---------- Audience ---------- */

.home-audience {
  background: #fff;
}

.segment-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.segment {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1.5rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.segment:hover {
  border-color: #b8c6d8;
  box-shadow: var(--shadow-lg);
}

.segment-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
}

.segment h3 {
  font-size: 1.1rem;
}

.segment p {
  color: var(--color-muted-foreground);
  font-size: 0.97rem;
  margin-bottom: 1.1rem;
}

.segment-points {
  list-style: none;
  margin: auto 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid #e8edf3;
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-secondary);
}

.segment-points li,
.check-points li {
  position: relative;
  padding-left: 1.5rem;
}

.segment-points li::before,
.check-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--color-teal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%230f766e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 0.65rem no-repeat;
}

/* ---------- Problem ---------- */

.home-problem {
  background: var(--color-background);
}

.problem-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 4rem;
  align-items: center;
}

.problem-copy p {
  color: var(--color-muted-foreground);
  font-size: 1.05rem;
}

.problem-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.problem-list li {
  display: flex;
  flex-direction: column;
  padding: 1.3rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
}

.problem-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--color-red-soft);
  color: var(--color-red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
}

.problem-list p {
  margin: 0;
  color: var(--color-muted-foreground);
  font-size: 0.95rem;
}

/* ---------- Platform tabs ---------- */

.home-platform {
  background: #fff;
}

.tab-list {
  display: none;
}

.js .tab-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.4rem;
  margin: 0 auto 2.5rem;
  width: fit-content;
  max-width: 100%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--color-secondary);
  font: 600 0.93rem/1 var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
}

.tab:hover {
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.6);
}

.tab[aria-selected="true"] {
  background: #fff;
  color: var(--color-primary);
  box-shadow: 0 1px 3px rgba(15, 31, 51, 0.12);
}

.tab-num {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: var(--color-accent);
}

.tab-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 4rem;
  align-items: center;
}

/* Without JS every panel shows, stacked */
html:not(.js) .tab-panel + .tab-panel {
  margin-top: 4.5rem;
  padding-top: 4.5rem;
  border-top: 1px solid var(--color-border);
}

.js .tab-panel[hidden] {
  display: none;
}

.panel-kicker {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.panel-copy h3 {
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}

.panel-copy > p {
  color: var(--color-muted-foreground);
  font-size: 1.05rem;
  margin-bottom: 1.4rem;
}

.check-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
  color: var(--color-secondary);
}

.panel-visual {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  padding: 2.5rem;
  border-radius: 22px;
  background:
    radial-gradient(ellipse 70% 60% at 80% 10%, rgba(31, 111, 214, 0.14), transparent 70%),
    radial-gradient(ellipse 60% 60% at 10% 100%, rgba(15, 118, 110, 0.1), transparent 70%),
    #f4f7fb;
  border: 1px solid #e5ebf3;
}

.panel-visual > .vg {
  width: 100%;
  max-width: 470px;
  margin: 0 auto;
  padding: 1.3rem;
}

/* Import */
.vg-file {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  border: 1px dashed #b8c6d8;
  border-radius: 10px;
  background: #fafcff;
}

.vg-file > div {
  flex: 1;
}

.vg-file-badge {
  width: 38px;
  height: 44px;
  border-radius: 6px;
  background: var(--color-red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
}

.vg-outline {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  border: 1px solid #e5ebf3;
  border-radius: 10px;
}

.vg-outline li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.8rem;
}

.vg-outline li + li {
  border-top: 1px solid #eef2f7;
}

.vg-outline .vg-strong {
  flex: 1;
  min-width: 0;
}

.vg-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--color-accent-soft);
  color: #1857a8;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.vg-chips span {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #dfe6ef;
  font-size: 0.74rem;
  color: var(--color-secondary);
  background: #fff;
}

/* Tutor */
.vg-qcard {
  padding: 0.9rem;
  border-radius: 10px;
  background: #fafcff;
  border: 1px solid #e5ebf3;
  margin-bottom: 1rem;
}

.vg-qcard .vg-strong {
  margin-bottom: 0.6rem;
}

.vg-answer-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-secondary);
}

.vg-answer-row + .vg-answer-row {
  margin-top: 0.35rem;
}

.vg-thread {
  display: grid;
  gap: 0.6rem;
}

.vg-msg {
  max-width: 85%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
}

.vg-msg.is-student {
  justify-self: end;
  background: var(--color-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.vg-msg.is-tutor {
  background: #f4f7fb;
  border: 1px solid #e5ebf3;
  border-top-left-radius: 4px;
}

.vg-typing {
  display: inline-flex;
  gap: 4px;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: #f4f7fb;
  width: fit-content;
}

.vg-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
}

/* Evaluation */
.vg-eval-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.vg-score {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-primary);
}

.vg-score small {
  font-size: 0.9rem;
  color: #64748b;
}

.vg-rubric {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.vg-rubric li {
  display: grid;
  grid-template-columns: 6.5rem 1fr 2.2rem;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.84rem;
}

.vg-rubric b {
  text-align: right;
  font-weight: 700;
}

.vg-bar,
.vg-progress {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: #e8edf3;
  overflow: hidden;
}

.vg-bar i,
.vg-progress i {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: var(--color-teal);
}

.vg-bar.is-low i {
  background: #d97706;
}

.vg-feedback {
  padding: 0.8rem 0.9rem;
  border-radius: 10px;
  background: #f4f7fb;
  border-left: 3px solid var(--color-accent);
}

/* Remediation */
.vg-remed {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.vg-gapcard,
.vg-lessoncard {
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: 12px;
  box-shadow: var(--vg-shadow);
  padding: 1rem;
}

.vg-gapcard {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.vg-lessoncard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
}

.vg-meta-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 0.5rem 0 1rem;
  padding: 0;
  font-size: 0.82rem;
  color: #64748b;
}

.vg-meta-list li::before {
  content: "•";
  margin-right: 0.4rem;
  color: #94a3b8;
}

.vg-btns {
  display: flex;
  gap: 0.5rem;
}

.vg-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-secondary);
}

.vg-btn.is-primary {
  background: var(--color-teal);
  border-color: var(--color-teal);
  color: #fff;
}

/* Recommendations */
.vg-recs-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.6rem;
}

.vg-progress {
  margin-bottom: 1rem;
}

.vg-reclist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.vg-reclist li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #e5ebf3;
  border-radius: 10px;
}

.vg-reclist li > div {
  flex: 1;
  min-width: 0;
}

.vg-reclist li.is-done {
  background: #f8fafc;
}

.vg-reclist li.is-done .vg-strong {
  color: #64748b;
  text-decoration: line-through;
}

.vg-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.is-done .vg-check {
  background: var(--color-teal);
  border-color: var(--color-teal);
  color: #fff;
}

/* Dashboard */
.vg-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.vg-kpis > div {
  padding: 0.7rem;
  border: 1px solid #e5ebf3;
  border-radius: 10px;
}

.vg-kpi {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}

.vg-kpi.is-warn {
  color: var(--color-amber);
}

.vg-dash-body {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 0.9rem;
}

.vg-heat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.vg-heat-grid i {
  aspect-ratio: 1;
  border-radius: 4px;
}

.vg-heat-grid .h1 { background: #f5b5a8; }
.vg-heat-grid .h2 { background: #fcd9a0; }
.vg-heat-grid .h3 { background: #9fd8c9; }

.vg-person {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
}

.vg-person + .vg-person {
  border-top: 1px solid #eef2f7;
}

.vg-person .vg-strong {
  font-size: 0.84rem;
}

.vg-initials {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: #1857a8;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- Inside a lesson ---------- */

.home-lesson {
  background: var(--color-background);
}

.lesson-flow {
  list-style: none;
  margin: 0 auto 2.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0;
  counter-reset: none;
}

.lesson-flow li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem 0.45rem 0.5rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-secondary);
  white-space: nowrap;
}

.lesson-flow li + li {
  margin-left: 1.6rem;
  position: relative;
}

.lesson-flow li + li::before {
  content: "";
  position: absolute;
  left: -1.35rem;
  top: 50%;
  width: 1.1rem;
  height: 2px;
  background: #b8c6d8;
}

.lesson-flow-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: #1857a8;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.pillar {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.4rem 1.6rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.pillar:hover {
  border-color: #b8c6d8;
  box-shadow: var(--shadow-lg);
}

.pillar h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

.pillar > p:not(.panel-kicker) {
  color: var(--color-muted-foreground);
  font-size: 0.97rem;
  margin-bottom: 1.1rem;
}

.pillar .check-points {
  font-size: 0.93rem;
  gap: 0.5rem;
}

.pillar-visual {
  height: 176px;
  margin-bottom: 1.4rem;
  padding: 0.9rem;
  border-radius: 12px;
  background: linear-gradient(160deg, #f4f8fd, #eaf1f9);
  border: 1px solid #e5ebf3;
}

.pillar-activities {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0.55rem;
}

.pillar-activities .activity-art {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 8px;
}

.pillar-types {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 0.4rem;
}

.pillar-types span {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #dfe6ef;
  font-size: 0.78rem;
  color: var(--color-secondary);
}

.pillar-types span.is-hi {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  font-weight: 600;
}

.pillar-analysis {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #fff;
}

.pillar-analysis p {
  margin: 0;
}

.miss-bars {
  list-style: none;
  margin: 0.2rem 0 0.7rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.miss-bars li {
  display: grid;
  grid-template-columns: 5.2rem 1fr 1.2rem;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.miss-bars b {
  text-align: right;
}

.miss-insight {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  background: var(--color-amber-soft);
  color: var(--color-amber);
  font-size: 0.78rem;
  font-weight: 600;
}

.miss-insight .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.activity-art {
  display: block;
}

.a-grid,
.a-ticks line,
.a-track {
  fill: none;
  stroke: #9fb1c7;
  stroke-width: 1.5;
}

.a-line {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.a-dot {
  fill: #9fb1c7;
}

.a-dot:first-of-type,
.a-hi-fill,
.a-knob {
  fill: var(--color-accent);
}

.a-knob {
  stroke: #fff;
  stroke-width: 2;
}

.a-bar {
  fill: #b7cbe4;
}

.a-bar.a-hi {
  fill: var(--color-accent);
}

.a-card {
  fill: #fff;
  stroke: #9fb1c7;
  stroke-width: 1.2;
}

.a-shape {
  fill: rgba(31, 111, 214, 0.1);
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-linejoin: round;
}

.a-shape-in {
  fill: rgba(15, 118, 110, 0.25);
  stroke: var(--color-teal);
  stroke-width: 1.5;
}

.a-text {
  fill: #c9d5e4;
}

.a-mark {
  fill: #fde68a;
}

.a-venn {
  fill: rgba(31, 111, 214, 0.14);
  stroke: var(--color-accent);
  stroke-width: 1.8;
}

.a-venn-2 {
  fill: rgba(15, 118, 110, 0.14);
  stroke: var(--color-teal);
}

/* ---------- How it works ---------- */

.home-how {
  background: #fff;
}

.loop {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1rem;
  position: relative;
}

.loop::before {
  content: "";
  position: absolute;
  top: 22px;
  left: calc(100% / 14);
  right: calc(100% / 14);
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-teal));
  opacity: 0.35;
}

.loop-step {
  position: relative;
  text-align: center;
}

.loop-num {
  position: relative;
  width: 46px;
  height: 46px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  font-family: var(--font-display);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loop-step:nth-child(n + 4) .loop-num {
  border-color: var(--color-teal);
  color: var(--color-teal);
}

.loop-step h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.loop-step p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted-foreground);
}

.loop-return {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: fit-content;
  margin: 2.5rem auto 0;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--color-teal-soft);
  color: var(--color-teal);
  font-weight: 700;
  font-size: 0.92rem;
}

.loop-return svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Trust ---------- */

.home-trust {
  background:
    radial-gradient(ellipse 50% 70% at 100% 0%, rgba(31, 111, 214, 0.28), transparent 70%),
    radial-gradient(ellipse 40% 60% at 0% 100%, rgba(15, 118, 110, 0.22), transparent 70%),
    var(--color-primary);
  color: #cbd5e1;
}

.home-trust h2,
.home-trust h3 {
  color: #fff;
}

.home-trust .eyebrow {
  color: #93c5fd;
}

.trust-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: end;
  margin-bottom: 3rem;
}

.trust-head p {
  margin: 0;
  font-size: 1.08rem;
  color: #cbd5e1;
}

.trust-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  overflow: hidden;
}

.trust-grid li {
  padding: 1.8rem;
  background: rgba(15, 31, 51, 0.88);
}

.trust-grid h3 {
  font-size: 1.05rem;
}

.trust-grid p {
  margin: 0;
  font-size: 0.95rem;
}

.trust-grid a {
  color: #93c5fd;
}

.trust-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(147, 197, 253, 0.12);
  color: #93c5fd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

/* ---------- Subjects ---------- */

.home-subjects {
  background: #fff;
}

.subjects-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 4rem;
  align-items: center;
}

.subjects-layout > div > p {
  color: var(--color-muted-foreground);
  font-size: 1.05rem;
}

.subject-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.subject-list li {
  display: flex;
  gap: 0.9rem;
  padding: 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: 14px;
}

.subject-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-teal-soft);
  color: var(--color-teal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.subject-list h3 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.subject-list p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted-foreground);
}

/* ---------- FAQ ---------- */

.home-faq {
  background: var(--color-background);
}

.faq-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
  gap: 4rem;
  align-items: start;
}

.faq-layout > div > p {
  color: var(--color-muted-foreground);
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-list details {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.faq-list summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 56px;
  padding: 0.9rem 1.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  border-radius: 12px;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  background: var(--color-accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--ease);
}

.faq-list details[open] summary::after {
  transform: rotate(45deg);
}

.faq-list details p {
  margin: 0;
  padding: 0 1.2rem 1.1rem;
  color: var(--color-muted-foreground);
}

/* ---------- CTA ---------- */

.home-cta {
  padding: 0 0 5.5rem;
  background: var(--color-background);
}

.home-cta-card {
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 2.5rem;
  align-items: center;
  padding: 3.5rem;
  border-radius: 24px;
  background:
    radial-gradient(ellipse 60% 90% at 100% 0%, rgba(31, 111, 214, 0.45), transparent 70%),
    radial-gradient(ellipse 50% 80% at 0% 100%, rgba(15, 118, 110, 0.35), transparent 70%),
    var(--color-primary);
}

.home-cta-card .eyebrow {
  color: #93c5fd;
}

.home-cta-card h2 {
  color: #fff;
}

.home-cta-card p {
  margin: 0;
  color: #cbd5e1;
  max-width: 38rem;
}

.home-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
  .home-hero-copy,
  .hero-visual {
    animation: rise 0.6s ease both;
  }

  .hero-visual {
    animation-delay: 0.1s;
  }

  .vg-float-mastery {
    animation: float-in 0.6s 0.45s ease both;
  }

  .vg-float-gap {
    animation: float-in 0.6s 0.65s ease both;
  }

  .vg-typing i {
    animation: typing 1.2s infinite ease-in-out;
  }

  .vg-typing i:nth-child(2) {
    animation-delay: 0.15s;
  }

  .vg-typing i:nth-child(3) {
    animation-delay: 0.3s;
  }

  .tab-panel:not([hidden]) .vg {
    animation: rise 0.35s ease both;
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes typing {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: none;
  }

  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .segment,
  .pillar,
  .tab,
  .faq-list summary::after {
    transition: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .segment-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pillars {
    grid-template-columns: 1fr;
    max-width: 640px;
    margin: 0 auto;
  }

  .loop {
    grid-template-columns: repeat(4, 1fr);
    row-gap: 2rem;
  }

  .loop::before {
    display: none;
  }

  .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .home-hero-inner,
  .problem-layout,
  .tab-panel,
  .subjects-layout,
  .faq-layout,
  .trust-head,
  .home-cta-card {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-visual {
    max-width: 560px;
  }

  .js .tab-list {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    width: auto;
    scrollbar-width: none;
  }

  .js .tab-list::-webkit-scrollbar {
    display: none;
  }

  .home-cta-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .home .section {
    padding: 4rem 0;
  }

  .home-hero {
    padding: 3rem 0 3.5rem;
  }

  .home-hero-lead {
    font-size: 1.06rem;
  }

  .hero-visual {
    padding: 1.5rem 0 3rem;
  }

  .vg-float-mastery {
    top: -0.5rem;
    right: -0.25rem;
  }

  .vg-float-gap {
    left: 0.5rem;
    right: 0.5rem;
    max-width: none;
  }

  .panel-visual {
    padding: 1.25rem;
  }

  .home-cta-card {
    padding: 2.2rem 1.5rem;
  }

  .home-cta {
    padding-bottom: 4rem;
  }
}

@media (max-width: 640px) {
  .segment-grid,
  .problem-list,
  .subject-list,
  .trust-grid {
    grid-template-columns: 1fr;
  }

  .loop {
    grid-template-columns: 1fr;
    row-gap: 1.2rem;
  }

  .loop-step {
    display: grid;
    grid-template-columns: 46px 1fr;
    column-gap: 1rem;
    text-align: left;
  }

  .loop-num {
    grid-row: span 2;
    margin: 0;
  }

  .home .hero-actions .btn,
  .home-cta-actions .btn {
    width: 100%;
  }

  .vg-dash-body {
    grid-template-columns: 1fr;
  }

  .lesson-flow {
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    gap: 0.6rem;
  }

  .lesson-flow li + li {
    margin-left: 0;
  }

  .lesson-flow li + li::before {
    left: 1.05rem;
    top: -0.6rem;
    width: 2px;
    height: 0.6rem;
  }

  .hero-kicker {
    font-size: 0.8rem;
  }

  .hero-visual {
    padding: 0;
    display: grid;
    gap: 0.75rem;
  }

  .vg-float,
  .vg-float-mastery,
  .vg-float-gap {
    position: static;
    max-width: none;
    animation: none;
  }

  .vg-float-mastery {
    order: 2;
  }

  .vg-float-gap {
    order: 3;
  }

  .vg-rubric li {
    grid-template-columns: 5.5rem 1fr 2.2rem;
  }

  .vg-outline .vg-tag:last-child {
    display: none;
  }
}
