/* ============================================================
   Landing Page — Redesigned pre-login sections (index.html)
   Premium, Apple-inspired: stats band, feature bento,
   interactive tool showcase, subject explorer, languages, CTA.
   Built on the existing design tokens (variables.css).
   ============================================================ */

/* ---- Shared section heading ---- */
.land-head {
  text-align: center;
  margin-bottom: var(--spacing-3xl);
}

.land-eyebrow {
  display: inline-block;
  padding: var(--spacing-2xs) var(--spacing-md);
  margin-bottom: var(--spacing-md);
  border-radius: var(--radius-full);
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.18);
  color: var(--color-accent-primary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}

.land-head .section__title {
  margin-bottom: var(--spacing-md);
}

.land-head .section__title span {
  display: inline;
}

/* Horizontal gutters — the .section class only pads vertically, so wide
   inner wrappers need their own side padding to clear the viewport edges. */
.bento-wrap,
.showcase,
.land-curriculum .container--wide,
.land-langs__inner {
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
}

/* ============================================================
   1 · Stats band
   ============================================================ */
.land-stats {
  position: relative;
  padding: var(--spacing-2xl) var(--spacing-lg);
  background: var(--color-bg-secondary);
}

.land-stats__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg);
  padding: var(--spacing-xl) var(--spacing-lg);
  border-radius: var(--radius-2xl);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
}

.land-stat {
  text-align: center;
  position: relative;
}

.land-stat:not(:last-child)::after {
  content: '';
  position: absolute;
  right: calc(var(--spacing-lg) / -2);
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--color-border);
}

.land-stat__num {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  letter-spacing: var(--letter-spacing-tight);
  font-variant-numeric: tabular-nums;
}

.land-stat__label {
  margin-top: var(--spacing-sm);
  font-size: var(--font-size-sm);
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-medium);
}

/* ============================================================
   2 · Feature bento grid
   ============================================================ */
.land-features {
  background: var(--color-bg-primary);
}

.bento-wrap {
  margin: 0 auto;
}

.bento-grid {
  display: grid;
  gap: var(--spacing-md);
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(180px, auto);
  grid-template-areas:
    "org org sec sec"
    "org org hub prg"
    "ai  ai  lng lng"
    "cwk cwk cwk cwk"
    "cmy cmy cmy cmy"
    "msg msg msg msg";
}

.bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--spacing-xl);
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  isolation: isolate;
}

/* Cursor-follow spotlight glow */
.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(0, 113, 227, 0.13), transparent 62%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
  z-index: -1;
}

.bento-card:hover {
  transform: translateY(-4px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-xl);
}

.bento-card:hover::before {
  opacity: 1;
}

.bento-card__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--color-gradient-subtle);
  border: 1px solid rgba(0, 113, 227, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-2xl);
  margin-bottom: auto;
}

.bento-card__title {
  margin-top: var(--spacing-lg);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

.bento-card__desc {
  margin-top: var(--spacing-sm);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-secondary);
}

/* Grid placement */
.bento-card--org { grid-area: org; }
.bento-card--sec { grid-area: sec; }
.bento-card--hub { grid-area: hub; }
.bento-card--prg { grid-area: prg; }
.bento-card--ai  { grid-area: ai;  }
.bento-card--lng { grid-area: lng; }
.bento-card--cwk { grid-area: cwk; }

/* Co-Work tile — wide flagship card with a floating-window motif */
.bento-card--cwk {
  min-height: 200px;
  background:
    radial-gradient(130% 130% at 100% 0%, rgba(88, 86, 214, 0.12), transparent 55%),
    linear-gradient(135deg, rgba(0, 113, 227, 0.07), rgba(175, 82, 222, 0.06)),
    var(--glass-bg);
  border-color: rgba(88, 86, 214, 0.22);
}
.bento-card--cwk .bento-card__desc { max-width: 52ch; }

/* Decorative mini-windows drifting in the top-right of the card */
.bento-cwk__deco {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-xl);
  width: 190px;
  height: 108px;
  z-index: -1;
  opacity: 0.9;
  pointer-events: none;
}
.bento-cwk__win {
  position: absolute;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
  padding: 7px;
  display: flex;
  gap: 4px;
  align-items: flex-start;
}
.bento-cwk__win i { width: 6px; height: 6px; border-radius: 50%; }
.bento-cwk__win i:nth-child(1) { background: #ff5f57; }
.bento-cwk__win i:nth-child(2) { background: #febc2e; }
.bento-cwk__win i:nth-child(3) { background: #28c840; }
.bento-cwk__win--1 { width: 120px; height: 78px; right: 46px; top: 24px; animation: cwkFloatA 7s ease-in-out infinite; }
.bento-cwk__win--2 { width: 96px;  height: 62px; right: 0;   top: 0;  background: rgba(255,255,255,0.9); animation: cwkFloatB 7s ease-in-out infinite; }
.bento-cwk__win--3 { width: 74px;  height: 50px; right: 96px; top: 56px; animation: cwkFloatC 7s ease-in-out infinite; }
@keyframes cwkFloatA { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(-2deg); } }
@keyframes cwkFloatB { 0%,100% { transform: translateY(0) rotate(3deg); }  50% { transform: translateY(6px)  rotate(3deg); } }
@keyframes cwkFloatC { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-5px) rotate(-4deg); } }

/* Community tile — wide flagship card with stacked-post + vote motif */
.bento-card--cmy {
  grid-area: cmy;
  min-height: 200px;
  background:
    radial-gradient(130% 130% at 100% 0%, rgba(52, 199, 89, 0.12), transparent 55%),
    linear-gradient(135deg, rgba(0, 113, 227, 0.06), rgba(18, 179, 199, 0.06)),
    var(--glass-bg);
  border-color: rgba(18, 179, 199, 0.22);
}
.bento-card--cmy .bento-card__desc { max-width: 52ch; }
.bento-cmy__deco {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-xl);
  width: 210px;
  height: 120px;
  z-index: -1;
  pointer-events: none;
}
.bento-cmy__card {
  position: absolute;
  right: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.09);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bento-cmy__card i { height: 4px; border-radius: 2px; background: rgba(0, 0, 0, 0.12); display: block; }
.bento-cmy__card i:first-child { width: 78%; }
.bento-cmy__card i:nth-child(2) { width: 52%; }
.bento-cmy__card--1 { width: 150px; top: 6px; right: 30px; z-index: 3; animation: cmyFloatA 7s ease-in-out infinite; }
.bento-cmy__card--2 { width: 128px; top: 52px; right: 0; z-index: 2; opacity: 0.92; animation: cmyFloatB 7s ease-in-out infinite; }
.bento-cmy__card--3 { width: 104px; top: 88px; right: 58px; z-index: 1; opacity: 0.8; animation: cmyFloatC 7s ease-in-out infinite; }
.bento-cmy__solved {
  position: absolute;
  top: -8px; right: -8px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #34c759;
  color: #fff;
  font-size: 11px; font-weight: 700; font-style: normal;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(52, 199, 89, 0.4);
  animation: cmyStamp 7s ease-in-out infinite;
}
.bento-cmy__vote {
  position: absolute;
  left: 4px; top: 30px;
  width: 34px; height: 42px;
  border-radius: 9px;
  background: rgba(0, 113, 227, 0.1);
  border: 1px solid rgba(0, 113, 227, 0.22);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  color: var(--color-accent-primary);
  animation: cmyVote 3.5s ease-in-out infinite;
}
.bento-cmy__vote em { font-style: normal; font-size: 11px; }
.bento-cmy__vote s { width: 14px; height: 4px; border-radius: 2px; background: currentColor; opacity: 0.5; text-decoration: none; }
@keyframes cmyFloatA { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(-2deg); } }
@keyframes cmyFloatB { 0%,100% { transform: translateY(0) rotate(2deg); }  50% { transform: translateY(6px) rotate(2deg); } }
@keyframes cmyFloatC { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(-3deg); } }
@keyframes cmyStamp {
  0%, 55% { transform: scale(0) rotate(-25deg); opacity: 0; }
  62% { transform: scale(1.25) rotate(6deg); opacity: 1; }
  70%, 100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes cmyVote {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0, 113, 227, 0.2); }
}

/* Messages tile — floating chat bubbles + typing dots */
.bento-card--msg {
  grid-area: msg;
  min-height: 200px;
  background:
    radial-gradient(130% 130% at 100% 0%, rgba(0, 113, 227, 0.12), transparent 55%),
    linear-gradient(135deg, rgba(88, 86, 214, 0.06), rgba(0, 113, 227, 0.06)),
    var(--glass-bg);
  border-color: rgba(88, 86, 214, 0.22);
}
.bento-card--msg .bento-card__desc { max-width: 52ch; }
.bento-msg__deco {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-xl);
  width: 200px;
  height: 130px;
  z-index: -1;
  pointer-events: none;
}
.bento-msg__bub {
  position: absolute;
  border-radius: 13px;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
}
.bento-msg__bub i { height: 4px; border-radius: 2px; display: block; }
.bento-msg__bub--in { background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(0, 0, 0, 0.06); border-bottom-left-radius: 4px; }
.bento-msg__bub--in i { background: rgba(0, 0, 0, 0.14); }
.bento-msg__bub--in i:first-child { width: 60px; } .bento-msg__bub--in i:nth-child(2) { width: 40px; }
.bento-msg__bub--out { background: linear-gradient(135deg, #0071e3, #5856d6); border-bottom-right-radius: 4px; }
.bento-msg__bub--out i { background: rgba(255, 255, 255, 0.9); width: 46px; }
.bento-msg__bub--1 { top: 4px; right: 40px; z-index: 3; animation: cmyFloatA 7s ease-in-out infinite; }
.bento-msg__bub--2 { top: 52px; right: 0; z-index: 2; animation: cmyFloatB 7s ease-in-out infinite; }
.bento-msg__bub--3 { top: 60px; right: 96px; z-index: 1; opacity: 0.9; animation: cmyFloatC 7s ease-in-out infinite; }
.bento-msg__dots {
  position: absolute;
  left: 6px; bottom: 6px;
  display: flex; gap: 4px; align-items: center;
  padding: 8px 10px; border-radius: 12px; border-bottom-left-radius: 4px;
  background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}
.bento-msg__dots s { width: 5px; height: 5px; border-radius: 50%; background: var(--color-accent-primary); opacity: 0.5; text-decoration: none; animation: msgDot 1.4s ease-in-out infinite; }
.bento-msg__dots s:nth-child(2) { animation-delay: 0.2s; }
.bento-msg__dots s:nth-child(3) { animation-delay: 0.4s; }
@keyframes msgDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Hero tile — larger type + soft gradient wash */
.bento-card--org {
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(0, 113, 227, 0.07), transparent 55%),
    var(--glass-bg);
}

.bento-card--org .bento-card__icon {
  width: 64px;
  height: 64px;
  font-size: var(--font-size-3xl);
}

.bento-card--org .bento-card__title {
  font-size: var(--font-size-3xl);
  letter-spacing: var(--letter-spacing-tight);
}

.bento-card--org .bento-card__desc {
  font-size: var(--font-size-base);
  max-width: 36ch;
}

/* AI tile — brand gradient accent */
.bento-card--ai {
  background:
    linear-gradient(135deg, rgba(0, 113, 227, 0.10), rgba(88, 86, 214, 0.10)),
    var(--glass-bg);
  border-color: rgba(88, 86, 214, 0.22);
}

.bento-card--ai .bento-card__title {
  font-size: var(--font-size-2xl);
}

.bento-card--lng .bento-card__icon {
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.12), rgba(175, 82, 222, 0.12));
}

/* ============================================================
   3 · Interactive tool showcase (tabs)
   ============================================================ */
.land-showcase {
  background: var(--color-bg-secondary);
  position: relative;
  overflow: hidden;
}

.showcase {
  max-width: var(--container-max);
  margin: 0 auto;
}

.showcase__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-2xl);
}

.showcase__tab {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-full);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.showcase__tab:hover {
  color: var(--color-text-primary);
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
}

.showcase__tab.is-active {
  background: var(--color-gradient);
  color: var(--color-text-primary);
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.showcase__tab-ico {
  font-size: var(--font-size-base);
  line-height: 1;
}

.showcase__stage {
  position: relative;
}

.showcase__panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-2xl);
  align-items: center;
}

/* Only the active panel is shown; inactive ones are removed from flow */
.showcase__panel:not(.is-active) {
  display: none;
}

.showcase__panel.is-active {
  animation: showcaseIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes showcaseIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.showcase__title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  margin-bottom: var(--spacing-md);
}

.showcase__desc {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--spacing-lg);
}

.showcase__list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
}

.showcase__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
}

.showcase__check {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(52, 199, 89, 0.12);
  color: var(--color-success);
  display: flex;
  align-items: center;
  justify-content: center;
}

.showcase__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--color-accent-primary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  transition: gap var(--transition-fast);
}

.showcase__cta:hover { gap: var(--spacing-sm); }

/* ---- Faux "window" mockups ---- */
.showcase__visual { width: 100%; }

.mk {
  position: relative;
  border-radius: var(--radius-xl);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.mk__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.5);
}

.mk__bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border-hover);
}

.mk__bar span:nth-child(1) { background: #ff5f57; }
.mk__bar span:nth-child(2) { background: #febc2e; }
.mk__bar span:nth-child(3) { background: #28c840; }

.mk__body {
  flex: 1;
  padding: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.mk__title,
.mk__label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-tertiary);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}

/* Subjects mock */
.mk__chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-sm);
}

.mk__chip {
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  background: var(--color-gradient-subtle);
  border: 1px solid rgba(0, 113, 227, 0.15);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  color: var(--color-accent-primary);
  text-align: center;
  transition: transform var(--transition-base);
}

.mk__chip:hover { transform: translateY(-3px); }

/* Dates mock */
.mk__count {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm);
}

.mk__cell {
  padding: var(--spacing-md) var(--spacing-xs);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-align: center;
}

.mk__cell b {
  display: block;
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  font-variant-numeric: tabular-nums;
  background: var(--color-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mk__cell span {
  display: block;
  margin-top: var(--spacing-2xs);
  font-size: 0.6875rem;
  color: var(--color-text-tertiary);
}

.mk__bars {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-top: auto;
}

.mk__row {
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-bg-tertiary);
}

.mk__row--a { width: 90%; background: linear-gradient(90deg, var(--color-accent-primary), rgba(0,113,227,.25)); }
.mk__row--b { width: 70%; background: linear-gradient(90deg, var(--color-accent-secondary), rgba(88,86,214,.2)); }
.mk__row--c { width: 50%; }

/* Workspace mock */
.mk__upload {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  border: 2px dashed var(--color-border-hover);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  text-align: center;
}

.mk__upload-ico { font-size: 2rem; }

.mk__btn {
  padding: var(--spacing-xs) var(--spacing-lg);
  border-radius: var(--radius-full);
  background: var(--color-gradient);
  color: var(--color-text-primary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  box-shadow: var(--shadow-glow);
}

.mk__stars {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.mk__star {
  padding: var(--spacing-2xs) var(--spacing-md);
  border-radius: var(--radius-full);
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.25);
  color: var(--color-warning);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

/* AI mock */
.mk--ai .mk__body { justify-content: flex-end; }

.mk__bubble {
  max-width: 85%;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  animation: bubbleIn 0.5s var(--transition-smooth) both;
}

.mk__bubble--user {
  align-self: flex-end;
  background: var(--color-gradient);
  color: var(--color-text-primary);
  border-bottom-right-radius: var(--radius-sm);
}

.mk__bubble--bot {
  align-self: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  border-bottom-left-radius: var(--radius-sm);
  animation-delay: 0.18s;
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* AI Assistant mock — answer-key tutor flow (attach question → ask → answer),
   looped on one shared 9s timeline so the staged reveal stays in sync. */
.mk--ai .mk__body { gap: 7px; }

.mkai-attach {
  align-self: flex-end;
  max-width: 88%;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.22);
  border-left: 3px solid #0071e3;
  border-radius: 12px;
  padding: 6px 10px;
  animation: mkaiA 9s ease infinite;
}
.mkai-attach__tag {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0071e3;
  margin-bottom: 1px;
}
.mkai-attach__txt { font-size: var(--font-size-sm); color: var(--color-text-primary); }

.mkai-user { animation: mkaiB 9s ease infinite; }
.mkai-bot  { position: relative; min-height: 2.2em; animation: mkaiC 9s ease infinite; }
.mkai-typing { position: absolute; left: 14px; top: 12px; display: inline-flex; gap: 4px; }
.mkai-typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-text-tertiary, #9ca3af);
  animation: mkaiTyping 9s ease infinite;
}
.mkai-typing i:nth-child(2) { animation-delay: 0.15s; }
.mkai-typing i:nth-child(3) { animation-delay: 0.3s; }
.mkai-reply { display: block; opacity: 0; animation: mkaiReply 9s ease infinite; }

.mkai-tools { display: flex; gap: 6px; align-self: flex-start; animation: mkaiTools 9s ease infinite; }
.mkai-pill {
  font-size: 0.64rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--color-border); color: var(--color-text-secondary, #6b7280);
  background: var(--color-surface);
}
.mkai-pill--on { color: #0071e3; border-color: rgba(0, 113, 227, 0.3); background: rgba(0, 113, 227, 0.08); }

@keyframes mkaiA     { 0%,3%{opacity:0;transform:translateY(8px);} 9%,93%{opacity:1;transform:none;} 100%{opacity:0;transform:translateY(-6px);} }
@keyframes mkaiB     { 0%,17%{opacity:0;transform:translateY(8px);} 23%,93%{opacity:1;transform:none;} 100%{opacity:0;} }
@keyframes mkaiC     { 0%,37%{opacity:0;transform:translateY(8px);} 43%,93%{opacity:1;transform:none;} 100%{opacity:0;} }
@keyframes mkaiTyping{ 0%,39%{opacity:0;} 43%,52%{opacity:1;} 55%,100%{opacity:0;} }
@keyframes mkaiReply { 0%,54%{opacity:0;} 60%,93%{opacity:1;} 100%{opacity:0;} }
@keyframes mkaiTools { 0%,63%{opacity:0;transform:translateY(6px);} 69%,93%{opacity:1;transform:none;} 100%{opacity:0;} }

/* Focus Timer mock — depleting progress ring + phase pills */
.mk--focus .mk__body {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--spacing-lg);
}

.mk__ring {
  position: relative;
  width: 168px;
  height: 168px;
}

.mk__ring svg { width: 100%; height: 100%; display: block; }

.mk__ring-track {
  fill: none;
  stroke: rgba(0, 0, 0, 0.07);
  stroke-width: 9;
}

.mk__ring-prog {
  fill: none;
  stroke: url(#mkFocusGrad);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 0;
  animation: mkDeplete 6s linear infinite;
}

.mk__ring-time {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-family-mono, monospace);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-3xl);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}

.mk__phases {
  display: flex;
  gap: var(--spacing-xs);
  flex-wrap: wrap;
  justify-content: center;
}

.mk__phase {
  padding: var(--spacing-2xs) var(--spacing-md);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: #fff;
}

.mk__phase--study { background: linear-gradient(135deg, #0a84ff, #5e5ce6); }
.mk__phase--break { background: linear-gradient(135deg, #34c759, #0aa2b0); }

/* Highlight each phase pill in turn, in sync with the ring cycle */
.mk__phase { opacity: 0.4; animation: mkPhasePulse 6s ease-in-out infinite; }
.mk__phase:nth-child(1) { animation-delay: 0s; }
.mk__phase:nth-child(2) { animation-delay: 1.5s; }
.mk__phase:nth-child(3) { animation-delay: 3s; }
.mk__phase:nth-child(4) { animation-delay: 4.5s; }

@keyframes mkDeplete { to { stroke-dashoffset: 326.7; } }

@keyframes mkPhasePulse {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  8%, 17%  { opacity: 1;   transform: translateY(-2px); }
  25%      { opacity: 0.4; transform: translateY(0); }
}

/* Co-Work mock — a rail + canvas where windows appear and one is dragged */
.mk--collab .mk__body { padding: 0; overflow: hidden; }
.mkco { display: flex; height: 100%; min-height: 214px; background: var(--color-bg-secondary); }
.mkco__rail {
  flex: 0 0 42px;
  display: flex; flex-direction: column; align-items: center;
  gap: 9px; padding: 11px 0;
  background: var(--glass-bg-strong);
  border-right: 1px solid var(--glass-border);
}
.mkco__pin { width: 24px; height: 24px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.mkco__pin--a { background: linear-gradient(135deg, #0071e3, #5856d6); }
.mkco__pin--b { background: linear-gradient(135deg, hsl(280 68% 52%), hsl(308 66% 42%)); }
.mkco__add {
  width: 24px; height: 24px; border-radius: 7px; margin-top: auto;
  display: grid; place-items: center;
  border: 1px dashed var(--color-border-hover);
  color: var(--color-text-tertiary); font-weight: 700; font-size: 15px; line-height: 1;
  animation: mkcoAddPulse 3s ease-in-out infinite;
}
@keyframes mkcoAddPulse {
  0%, 100% { transform: scale(1); border-color: var(--color-border-hover); color: var(--color-text-tertiary); }
  50%      { transform: scale(1.14); border-color: var(--color-accent-primary); color: var(--color-accent-primary); }
}

.mkco__canvas {
  position: relative; flex: 1; overflow: hidden;
  background-image: radial-gradient(circle, rgba(0, 0, 0, 0.07) 1px, transparent 1.5px);
  background-size: 17px 17px;
}
.mkco__win {
  position: absolute;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.mkco__win::before { content: ""; position: absolute; left: 0; right: 0; top: 21px; height: 1px; background: var(--glass-border); }
.mkco__win::after {
  content: ""; position: absolute; left: 9px; right: 9px; top: 30px; bottom: 9px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.16), rgba(88, 86, 214, 0.12));
}
.mkco__lights { position: absolute; top: 8px; left: 9px; display: flex; gap: 4px; z-index: 2; }
.mkco__lights i { width: 6px; height: 6px; border-radius: 50%; }
.mkco__lights i:nth-child(1) { background: #ff5f57; }
.mkco__lights i:nth-child(2) { background: #febc2e; }
.mkco__lights i:nth-child(3) { background: #28c840; }

.mkco__win--1 { left: 6%;  top: 12%; width: 54%; height: 60%; z-index: 3; animation: mkcoWin1 8s ease-in-out infinite; }
.mkco__win--2 { left: 40%; top: 34%; width: 54%; height: 60%; z-index: 2; animation: mkcoWin2 8s ease-in-out infinite; }
.mkco__win--3 { left: 22%; top: 54%; width: 42%; height: 40%; z-index: 1; animation: mkcoWin3 8s ease-in-out infinite; }
.mkco__win--3::after { background: linear-gradient(135deg, hsl(280 68% 52% / 0.16), hsl(308 66% 42% / 0.12)); }

/* Cursor rides inside window 1, so it tracks the drag automatically */
.mkco__cursor {
  position: absolute; top: 2px; left: 46%; width: 15px; height: 15px; z-index: 4;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 2 L4 19 L8.5 14.5 L11.5 21.5 L14.5 20.2 L11.5 13.5 L18 13.5 Z' fill='%23111' stroke='white' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
  animation: mkcoCursor 8s ease-in-out infinite;
}

@keyframes mkcoWin1 {
  0%       { opacity: 0; transform: translate(0, 0) scale(0.9); }
  8%       { opacity: 1; transform: translate(0, 0) scale(1); }
  34%      { transform: translate(0, 0); }
  52%      { transform: translate(34%, 30%); }
  70%      { transform: translate(34%, 30%); }
  88%, 100%{ opacity: 1; transform: translate(0, 0); }
}
@keyframes mkcoWin2 {
  0%, 2%   { opacity: 0; transform: scale(0.9); }
  12%      { opacity: 1; transform: scale(1); }
  100%     { opacity: 1; }
}
@keyframes mkcoWin3 {
  0%, 16%  { opacity: 0; transform: scale(0.85); }
  26%      { opacity: 1; transform: scale(1); }
  100%     { opacity: 1; }
}
/* Subtle "press" as the drag starts/ends */
@keyframes mkcoCursor {
  0%, 32%  { transform: scale(1); }
  36%, 70% { transform: scale(0.82); }
  74%, 100%{ transform: scale(1); }
}

/* Community mock — a mini feed: cards reveal, a vote ticks up, a "solved" chip stamps */
.mk--community .mk__body { padding: 0; overflow: hidden; }
.mkcm { display: flex; flex-direction: column; height: 100%; min-height: 214px; background: var(--color-bg-secondary); padding: 12px; gap: 10px; }
.mkcm__top { display: flex; align-items: center; gap: 8px; }
.mkcm__search { flex: 1; height: 24px; border-radius: 999px; background: rgba(0,0,0,0.05); border: 1px solid var(--glass-border); }
.mkcm__new {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--color-gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; line-height: 1;
  box-shadow: 0 4px 10px rgba(0,113,227,0.3);
}
.mkcm__feed { display: flex; flex-direction: column; gap: 8px; }
.mkcm__card {
  display: flex; gap: 9px;
  padding: 9px 10px;
  border-radius: 11px;
  background: var(--color-surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(10px);
}
.mkcm__card--1 { animation: cmReveal 4.6s ease-in-out infinite; }
.mkcm__card--2 { animation: cmReveal 4.6s ease-in-out 0.5s infinite; }
.mkcm__card--3 { animation: cmReveal 4.6s ease-in-out 1s infinite; }
.mkcm__vote {
  flex: none;
  width: 34px;
  border-radius: 8px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--glass-border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--color-text-tertiary);
  font-size: 10px;
}
.mkcm__card--1 .mkcm__vote { color: var(--color-accent-primary); background: rgba(0,113,227,0.08); border-color: rgba(0,113,227,0.25); }
.mkcm__vote em { font-style: normal; font-size: 11px; }
.mkcm__vote b { font-size: 11px; font-weight: 700; position: relative; height: 13px; overflow: hidden; display: flex; flex-direction: column; }
/* The number rolls from 11 → 12 on the "helpful" card */
.mkcm__votenum span { line-height: 13px; }
.mkcm__card--1 .mkcm__votenum { animation: cmTick 4.6s ease-in-out infinite; }
.mkcm__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; justify-content: center; }
.mkcm__pills { display: flex; gap: 5px; align-items: center; }
.mkcm__pill { height: 13px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; padding: 0 6px; }
.mkcm__pill--q { background: #0071e3; }
.mkcm__pill--d { background: #7c5cff; width: 34px; }
.mkcm__pill--r { background: #34c759; width: 40px; }
.mkcm__pill--ok {
  background: #34c759;
  opacity: 0;
  transform: scale(0);
  animation: cmSolved 4.6s ease-in-out infinite;
}
.mkcm__line { height: 5px; border-radius: 3px; background: rgba(0,0,0,0.12); width: 92%; }
.mkcm__line--sm { width: 60%; opacity: 0.7; }
@keyframes cmReveal {
  0% { opacity: 0; transform: translateY(10px); }
  14%, 88% { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes cmTick {
  0%, 48% { transform: translateY(0); }
  56%, 100% { transform: translateY(-13px); }
}
@keyframes cmSolved {
  0%, 52% { opacity: 0; transform: scale(0) rotate(-18deg); }
  60% { opacity: 1; transform: scale(1.3) rotate(5deg); }
  68%, 100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* Messages mock — a chat that fills in bubble by bubble, then a reply is typed */
.mk--messages .mk__body { padding: 0; overflow: hidden; }
.mkmsg { display: flex; flex-direction: column; height: 100%; min-height: 214px; background: var(--color-bg-secondary); }
.mkmsg__head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--color-surface, #fff); border-bottom: 1px solid var(--glass-border); }
.mkmsg__avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #0071e3, #34c759); flex: none; }
.mkmsg__id { display: flex; flex-direction: column; gap: 4px; }
.mkmsg__name { width: 66px; height: 7px; border-radius: 4px; background: rgba(0,0,0,0.2); }
.mkmsg__status { width: 42px; height: 5px; border-radius: 3px; background: rgba(52,199,89,0.6); }
.mkmsg__thread { flex: 1; display: flex; flex-direction: column; gap: 7px; padding: 12px; justify-content: flex-end; }
.mkmsg__bubble { max-width: 70%; padding: 8px 10px; border-radius: 13px; display: flex; flex-direction: column; gap: 4px; opacity: 0; transform: translateY(8px); }
.mkmsg__bubble i { height: 5px; border-radius: 3px; display: block; }
.mkmsg__bubble--in { align-self: flex-start; background: var(--color-surface, #fff); border: 1px solid var(--glass-border); border-bottom-left-radius: 4px; }
.mkmsg__bubble--in i { background: rgba(0,0,0,0.15); } .mkmsg__bubble--in i:first-child { width: 84px; } .mkmsg__bubble--in i:nth-child(2) { width: 54px; }
.mkmsg__bubble--out { align-self: flex-end; background: linear-gradient(135deg, #0071e3, #5856d6); border-bottom-right-radius: 4px; }
.mkmsg__bubble--out i { background: rgba(255,255,255,0.92); width: 60px; }
.mkmsg__bubble--img { width: 104px; height: 60px; padding: 0; border: none; background: linear-gradient(135deg, #5ac8fa, #0071e3); }
.mkmsg__typing { flex-direction: row; gap: 5px; align-items: center; }
.mkmsg__typing s { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.92); text-decoration: none; animation: msgDot 1.4s ease-in-out infinite; }
.mkmsg__typing s:nth-child(2) { animation-delay: 0.2s; } .mkmsg__typing s:nth-child(3) { animation-delay: 0.4s; }
.mkmsg__b1 { animation: msgReveal 6.4s ease-in-out infinite; }
.mkmsg__b2 { animation: msgReveal 6.4s ease-in-out 0.9s infinite; }
.mkmsg__b3 { animation: msgReveal 6.4s ease-in-out 1.9s infinite; }
.mkmsg__b4 { animation: msgReveal 6.4s ease-in-out 3.1s infinite; }
.mkmsg__composer { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--color-surface, #fff); border-top: 1px solid var(--glass-border); }
.mkmsg__input { flex: 1; height: 22px; border-radius: 999px; background: rgba(0,0,0,0.05); border: 1px solid var(--glass-border); }
.mkmsg__send { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #0071e3, #5856d6); color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; animation: msgSend 6.4s ease-in-out infinite; }
@keyframes msgReveal {
  0% { opacity: 0; transform: translateY(10px) scale(0.96); }
  8% { opacity: 1; transform: translateY(0) scale(1); }
  90% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-6px); }
}
@keyframes msgSend {
  0%, 44% { transform: scale(1); }
  50% { transform: scale(1.28); box-shadow: 0 4px 12px rgba(0,113,227,0.4); }
  56%, 100% { transform: scale(1); }
}

/* Account Center mock — avatar + popover menu that opens on a loop */
.mk--account .mk__body { justify-content: flex-start; gap: var(--spacing-md); }

.mk__navrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
}

.mk__brand {
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  letter-spacing: var(--letter-spacing-tight);
}

.mk__avatar {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-gradient);
  color: #fff;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}
.mk__avatar::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--color-accent-primary);
  opacity: 0;
  animation: mkAvatarRing 4.6s ease-in-out infinite;
}
@keyframes mkAvatarRing {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  10%, 30% { opacity: 0.6; transform: scale(1); }
  46%      { opacity: 0; transform: scale(1.18); }
}

.mk__pop {
  align-self: flex-end;
  width: min(232px, 100%);
  border-radius: var(--radius-lg);
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform-origin: top right;
  animation: mkPopIn 4.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
@keyframes mkPopIn {
  0%       { opacity: 0; transform: translateY(-8px) scale(0.92); }
  12%, 88% { opacity: 1; transform: translateY(0) scale(1); }
  100%     { opacity: 0; transform: translateY(-8px) scale(0.92); }
}

.mk__pop-head {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: var(--color-gradient-subtle);
  border-bottom: 1px solid var(--glass-border);
}
.mk__pop-av {
  flex: none;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-gradient);
  color: #fff;
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-xs);
}
.mk__pop-id { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.mk__pop-id b { font-size: var(--font-size-sm); color: var(--color-text-primary); }
.mk__pop-id span { font-size: var(--font-size-xs); color: var(--color-text-tertiary); }

.mk__pop-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  opacity: 0;
  animation: mkItemIn 4.6s ease-in-out infinite;
}
.mk__pop-item:nth-child(3) { animation-delay: 0.1s; }
.mk__pop-item:nth-child(4) { animation-delay: 0.2s; }
.mk__pop-item:nth-child(5) { animation-delay: 0.3s; }
@keyframes mkItemIn {
  0%, 6%   { opacity: 0; transform: translateX(8px); }
  16%, 88% { opacity: 1; transform: translateX(0); }
  100%     { opacity: 0; transform: translateX(8px); }
}
.mk__pop-ico { width: 20px; text-align: center; flex: none; }
.mk__pop-item--accent { color: var(--color-accent-primary); font-weight: var(--font-weight-medium); }
.mk__pop-item--danger { color: var(--color-error); }

@media (prefers-reduced-motion: reduce) {
  .mk__avatar::after,
  .mk__pop,
  .mk__pop-item { animation: none; opacity: 1; transform: none; }
  .mk__avatar::after { opacity: 0; }
  .mkco__win, .mkco__cursor, .mkco__add,
  .bento-cwk__win { animation: none; opacity: 1; transform: none; }
  .mkcm__card, .mkcm__votenum, .mkcm__pill--ok,
  .bento-cmy__card, .bento-cmy__solved, .bento-cmy__vote { animation: none; opacity: 1; transform: none; }
}

/* ============================================================
   4 · Subject explorer
   ============================================================ */
.land-curriculum {
  background: var(--color-bg-primary);
}

.curriculum-grid {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

.subj-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  isolation: isolate;
}

.subj-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(360px circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(88, 86, 214, 0.12), transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
  z-index: -1;
}

.subj-tile::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--color-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.subj-tile:hover {
  transform: translateY(-4px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg);
}

.subj-tile:hover::before { opacity: 1; }
.subj-tile:hover::after { transform: scaleX(1); }

.subj-tile__code {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-accent-primary);
}

.subj-tile__name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.subj-tile__arrow {
  position: absolute;
  top: var(--spacing-lg);
  right: var(--spacing-lg);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-primary);
  transition: all var(--transition-base);
}

.subj-tile:hover .subj-tile__arrow {
  background: var(--color-accent-primary);
  color: #fff;
  transform: translateX(3px);
}

/* ============================================================
   5 · Languages band
   ============================================================ */
.land-langs {
  background: var(--color-bg-secondary);
}

.land-langs__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-3xl);
  align-items: center;
}

.land-langs__title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  margin: var(--spacing-md) 0;
}

.land-langs__desc {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  max-width: 46ch;
}

.land-langs__flags {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-md);
}

.lang-chip {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.lang-chip:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-lg);
}

.lang-chip .flag {
  width: 26px;
  height: 19px;
}

/* ============================================================
   6 · Final CTA
   ============================================================ */
.land-cta {
  position: relative;
  background: var(--color-bg-primary);
  overflow: hidden;
}

.land-cta__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.land-cta__orb--1 {
  width: 460px;
  height: 460px;
  background: rgba(173, 216, 230, 0.45);
  top: -30%;
  left: -8%;
  animation: float 9s ease-in-out infinite;
}

.land-cta__orb--2 {
  width: 380px;
  height: 380px;
  background: rgba(221, 160, 221, 0.40);
  bottom: -30%;
  right: -6%;
  animation: float 11s ease-in-out infinite reverse;
}

.land-cta__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
}

.land-cta__title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  margin-bottom: var(--spacing-lg);
}

.land-cta__title span { display: block; }

.land-cta__subtitle {
  font-size: var(--font-size-xl);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  max-width: 600px;
  margin: 0 auto var(--spacing-2xl);
}

.land-cta__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet */
@media (max-width: 1023px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: minmax(170px, auto);
    grid-template-areas:
      "org org"
      "sec hub"
      "ai  prg"
      "lng lng"
      "cwk cwk"
      "cmy cmy"
      "msg msg";
  }

  .bento-card--org .bento-card__title { font-size: var(--font-size-2xl); }

  .showcase__panel {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .showcase__visual { order: -1; max-width: 520px; margin: 0 auto; }

  .land-langs__inner {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    text-align: center;
  }

  .land-langs__desc { margin-left: auto; margin-right: auto; }
}

/* Mobile */
@media (max-width: 767px) {
  .land-stats__inner {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    padding: var(--spacing-lg) var(--spacing-md);
  }

  /* Remove vertical dividers; the 2-col layout keeps the 2nd item's divider only */
  .land-stat:not(:last-child)::after { display: none; }

  .bento-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    grid-template-areas:
      "org"
      "sec"
      "hub"
      "prg"
      "ai"
      "lng"
      "cwk"
      "cmy"
      "msg";
  }

  .bento-card { justify-content: flex-start; min-height: 0; }
  .bento-card__icon { margin-bottom: var(--spacing-md); }
  .bento-card__title { margin-top: 0; }

  .showcase__tabs { gap: var(--spacing-xs); }

  .showcase__tab {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-xs);
  }

  .showcase__title { font-size: var(--font-size-2xl); }
  .showcase__desc { font-size: var(--font-size-base); }

  .curriculum-grid { grid-template-columns: 1fr; }

  .land-langs__flags { grid-template-columns: 1fr; }

  .land-cta__actions { flex-direction: column; }
  .land-cta__actions .btn { width: 100%; }
}

/* Small mobile — let tab labels hide their icon-only overflow gracefully */
@media (max-width: 360px) {
  .mk__count { grid-template-columns: repeat(2, 1fr); }
}

/* Large desktop polish */
@media (min-width: 1440px) {
  .land-stats__inner,
  .showcase,
  .curriculum-grid,
  .land-langs__inner { max-width: var(--container-wide); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .showcase__panel.is-active,
  .mk__bubble { animation: none; }

  .land-cta__orb { animation: none; }

  .bento-card::before,
  .subj-tile::before { display: none; }
}

/* ============================================================
   Ambient idle motion — floating · drifting · breathing
   Applied only to elements WITHOUT scroll-reveal animations
   (pseudo-orbs, icons, mockups, chips) so nothing conflicts.
   ============================================================ */

.land-features,
.land-curriculum { position: relative; overflow: hidden; }
.land-stats { overflow: hidden; }

.land-features > *,
.land-showcase > *,
.land-curriculum > * { position: relative; z-index: 1; }
.land-stats__inner { position: relative; z-index: 1; }

/* Slow drifting background orbs */
.land-features::before,
.land-showcase::after,
.land-curriculum::before {
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.42;
  pointer-events: none;
  z-index: 0;
}
.land-features::before   { background: rgba(173, 216, 230, 0.42); top: -10%; right: -6%; animation: drift 17s ease-in-out infinite; }
.land-showcase::after    { background: rgba(221, 160, 221, 0.34); bottom: -12%; left: -6%; animation: drift 21s ease-in-out infinite reverse; }
.land-curriculum::before { background: rgba(173, 216, 230, 0.34); top: 15%; left: -8%; animation: drift 19s ease-in-out infinite; }

/* Breathing glow behind the stats card */
.land-stats::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.12), transparent 70%);
  filter: blur(34px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
  animation: breatheCenter 6s ease-in-out infinite;
}

/* Gently floating feature icons (desynced per tile) */
.bento-card__icon { animation: floatSoft 5.5s ease-in-out infinite; will-change: transform; }
.bento-card--sec .bento-card__icon { animation-duration: 6.4s; animation-delay: -1s; }
.bento-card--hub .bento-card__icon { animation-duration: 5.8s; animation-delay: -2.1s; }
.bento-card--prg .bento-card__icon { animation-duration: 6.8s; animation-delay: -0.6s; }
.bento-card--ai  .bento-card__icon { animation-duration: 5.2s; animation-delay: -1.6s; }
.bento-card--lng .bento-card__icon { animation-duration: 6.2s; animation-delay: -2.6s; }

/* Breathing accent glow on the AI tile */
.bento-card--ai::after {
  content: '';
  position: absolute;
  inset: -12%;
  border-radius: inherit;
  background: radial-gradient(circle at 72% 22%, rgba(88, 86, 214, 0.20), transparent 60%);
  pointer-events: none;
  z-index: -1;
  animation: breathe 5s ease-in-out infinite;
}

/* Floating faux-window mockup */
.showcase__visual .mk { animation: floatSoft 6.5s ease-in-out infinite; will-change: transform; }

/* Breathing glow on the active showcase tab */
.showcase__tab.is-active { animation: pulseGlow 3s ease-in-out infinite; }

/* Floating language chips */
.lang-chip { animation: floatSoft 5s ease-in-out infinite; will-change: transform; }
.lang-chip:nth-child(1) { animation-duration: 5.2s; animation-delay: -0.2s; }
.lang-chip:nth-child(2) { animation-duration: 6.0s; animation-delay: -1.1s; }
.lang-chip:nth-child(3) { animation-duration: 5.6s; animation-delay: -2.0s; }
.lang-chip:nth-child(4) { animation-duration: 6.4s; animation-delay: -0.8s; }
.lang-chip:nth-child(5) { animation-duration: 5.4s; animation-delay: -1.6s; }
.lang-chip:nth-child(6) { animation-duration: 6.2s; animation-delay: -2.6s; }

/* Calm everything for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
  .land-features::before,
  .land-showcase::after,
  .land-curriculum::before,
  .land-stats::before,
  .bento-card__icon,
  .bento-card--ai::after,
  .showcase__visual .mk,
  .showcase__tab.is-active,
  .mk__ring-prog,
  .mk__phase,
  .lang-chip { animation: none; }

  .mk__ring-prog { stroke-dashoffset: 98; }
  .mk__phase { opacity: 1; }
}

/* ── Showcase mockup — Answer Reader ─────────────────────────── */
.mk--reader .mk__body { gap: 8px; justify-content: flex-start; }
.mk__rbar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.72); border: 1px solid rgba(18, 57, 95, 0.10); box-shadow: 0 1px 5px rgba(18, 57, 95, 0.06); }
.mk__rback { font-size: 10.5px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #2f6fb3, #12395f); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.mk__rsw { display: flex; gap: 4px; margin-left: auto; }
.mk__rsw i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(18, 57, 95, 0.18); }
.mk__rsw i:nth-child(1) { background: #fff; border-color: #2f6fb3; box-shadow: 0 0 0 2px rgba(47, 111, 179, 0.2); }
.mk__rsw i:nth-child(2) { background: #f9f7f3; }
.mk__rsw i:nth-child(3) { background: #fef9e7; }
.mk__rlang { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: #20344a; border: 1px solid rgba(18, 57, 95, 0.18); border-radius: 999px; padding: 3px 8px; background: #fff; }
.mk__lrot { position: relative; display: inline-block; width: 20px; height: 14px; overflow: hidden; text-align: center; }
.mk__lrot > span { position: absolute; inset: 0; opacity: 0; animation: mkReaderRot 11s infinite; }
.mk__zone { border-radius: 9px; padding: 7px 11px; }
.mk__zone--q { background: #eef4fb; border: 1px solid #d3e0f0; border-left: 3px solid #4183C4; }
.mk__zone--a { background: #fff; border: 1px solid #e4e4e4; border-left: 3px solid #34a853; }
.mk__zone--n { background: #fbf7ee; border: 1px solid #ece2cc; border-left: 3px solid #e0a83d; }
.mk__ztag { display: block; font-size: 8px; letter-spacing: 0.09em; font-weight: 700; margin-bottom: 6px; }
.mk__zone--q .mk__ztag { color: #4183C4; }
.mk__zone--a .mk__ztag { color: #2a9d54; }
.mk__zone--n .mk__ztag { color: #b9822a; }
.mk__zline { display: block; height: 7px; border-radius: 4px; background: linear-gradient(90deg, rgba(18, 57, 95, 0.20), rgba(18, 57, 95, 0.05)); }
.mk__zline--sm { width: 68%; }
.mk__nrot { position: relative; display: block; height: 15px; }
.mk__nrot > span { position: absolute; left: 0; top: 0; font-size: 11px; color: #8a6317; white-space: nowrap; opacity: 0; animation: mkReaderRot 11s infinite; }
.mk__lrot > span:nth-child(1), .mk__nrot > span:nth-child(1) { animation-delay: 0s; }
.mk__lrot > span:nth-child(2), .mk__nrot > span:nth-child(2) { animation-delay: 2.2s; }
.mk__lrot > span:nth-child(3), .mk__nrot > span:nth-child(3) { animation-delay: 4.4s; }
.mk__lrot > span:nth-child(4), .mk__nrot > span:nth-child(4) { animation-delay: 6.6s; }
.mk__lrot > span:nth-child(5), .mk__nrot > span:nth-child(5) { animation-delay: 8.8s; }
@keyframes mkReaderRot {
  0% { opacity: 0; transform: translateY(5px); }
  3%, 17% { opacity: 1; transform: translateY(0); }
  20%, 100% { opacity: 0; transform: translateY(-5px); }
}
@media (prefers-reduced-motion: reduce) {
  .mk__lrot > span, .mk__nrot > span { animation: none; }
  .mk__lrot > span:first-child, .mk__nrot > span:first-child { opacity: 1; }
}
