/* ═══════════════════════════════════════════════════════════════
   حكيمو ماث — تخطيط استوديو رياضيات
   شبكة إحداثيات · خط أعداد · بطاقات هندسية
   ═══════════════════════════════════════════════════════════════ */

@keyframes hkFadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes hkPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(241, 90, 36, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(241, 90, 36, 0); }
}
@keyframes hkMarquee {
  to { transform: translateX(50%); }
}
@keyframes hkMarqueeRtl {
  to { transform: translateX(-50%); }
}
@keyframes hkFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes hkPhotoFloat {
  0%   { transform: rotate(-3.5deg) translateY(0) scale(1); }
  40%  { transform: rotate(-1.5deg) translateY(-16px) scale(1.02); }
  70%  { transform: rotate(-4deg) translateY(-6px) scale(1.01); }
  100% { transform: rotate(-3.5deg) translateY(0) scale(1); }
}
@keyframes hkPhotoGlow {
  0%, 100% { opacity: .55; transform: scale(.92); }
  50% { opacity: .95; transform: scale(1.06); }
}
@keyframes hkMathDrift {
  0%, 100% { transform: translateY(0) rotate(var(--hk-rot, 0deg)); opacity: var(--hk-op, .38); }
  50% { transform: translateY(-10px) rotate(calc(var(--hk-rot, 0deg) + 6deg)); opacity: calc(var(--hk-op, .38) + .18); }
}

/* Ambient */
.hk-ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hk-ambient__grid {
  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% 60% at 50% 20%, #000 20%, transparent 75%);
}
.hk-ambient__orb {
  position: absolute; border-radius: 50%;
  filter: blur(40px); opacity: .35;
}
.hk-ambient__orb--a {
  width: 280px; height: 280px; top: -60px; inset-inline-end: -40px;
  background: var(--orange-300);
}
.hk-ambient__orb--b {
  width: 220px; height: 220px; bottom: 10%; inset-inline-start: -50px;
  background: var(--orange-200);
}
.hk-ambient__tri {
  position: absolute; top: 28%; inset-inline-start: 8%;
  width: 0; height: 0;
  border-inline-start: 28px solid transparent;
  border-inline-end: 28px solid transparent;
  border-bottom: 48px solid rgba(241, 90, 36, 0.10);
}
.hk-ambient__circ {
  position: absolute; bottom: 22%; inset-inline-end: 12%;
  width: 72px; height: 72px; border-radius: 50%;
  border: 3px solid rgba(241, 90, 36, 0.14);
}
.hk-ambient__fx {
  position: absolute; font-family: var(--font-mono);
  font-size: 13px; font-weight: 600; color: rgba(194, 65, 12, 0.22);
  white-space: nowrap;
}
html[data-theme="dark"] .hk-ambient__fx { color: rgba(251, 124, 60, 0.22); }
.hk-ambient__fx--0 { top: 18%; inset-inline-start: 6%; }
.hk-ambient__fx--1 { top: 42%; inset-inline-end: 8%; }
.hk-ambient__fx--2 { bottom: 28%; inset-inline-start: 18%; }
.hk-ambient__fx--3 { top: 62%; inset-inline-end: 22%; }
.hk-ambient__fx--4 { bottom: 12%; inset-inline-end: 6%; }
.student-perf-lite .hk-ambient { display: none; }

/* Buttons */
.hk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px; border: 1.5px solid transparent;
  font-family: var(--font-body); font-size: 15px; font-weight: 800;
  cursor: pointer; text-decoration: none;
  transition: transform .2s var(--ease), filter .2s, background .2s, border-color .2s, color .2s, box-shadow .2s;
}
.hk-btn--lg { padding: 14px 28px; font-size: 16px; }
.hk-btn--block { width: 100%; }
.hk-btn--solid {
  background: var(--btn-solid-bg); color: var(--btn-solid-text);
  box-shadow: var(--shadow-gold);
}
.hk-btn--solid:hover { filter: brightness(1.06); transform: translateY(-2px); color: #fff; }
.hk-btn--ghost {
  background: var(--card-bg-strong); color: var(--orange-700);
  border-color: var(--border-strong);
}
html[data-theme="dark"] .hk-btn--ghost {
  background: var(--card-bg-strong); color: var(--orange-300);
}
.hk-btn--ghost:hover {
  background: var(--orange-50); border-color: var(--orange-500); color: var(--orange-800);
}
.hk-btn--white {
  background: #fff; color: var(--orange-700);
  box-shadow: 0 10px 24px rgba(28, 18, 12, 0.12);
}
.hk-btn--white:hover { transform: translateY(-2px); color: var(--orange-800); }

/* Header */
.hk-hdr { position: sticky; top: 0; z-index: 100; }
.hk-hdr__band {
  background: var(--grad-brand);
  color: #fff;
}
.hk-hdr__bandInner {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 34px; padding: 6px 0;
}
.hk-hdr__teacherEn {
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.hk-hdr__teacherAr { font-size: 12px; font-weight: 700; opacity: .95; }
.hk-hdr__dot {
  width: 5px; height: 5px; border-radius: 50%; background: #fff; opacity: .7;
}
.hk-hdr__shell {
  background: color-mix(in srgb, var(--hdr-bg) 92%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hdr-border);
}
.hk-hdr__bar {
  display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 8px 0;
}
.hk-brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit; min-width: 0;
}
.hk-brand__mark {
  width: 52px; height: 52px; flex: none;
  display: grid; place-items: center;
  background: #000;
  color: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-gold);
}
.hk-brand__logo {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.hk-brand__pi {
  font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 1;
}
.hk-brand__text { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.hk-brand__en {
  font-family: var(--font-display); font-size: 18px; font-weight: 800;
  color: var(--text-strong); line-height: 1.15;
}
.hk-brand__ar { font-size: 12px; font-weight: 700; color: var(--orange-700); }
html[data-theme="dark"] .hk-brand__ar { color: var(--orange-400); }
.hk-hdr__nav { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.hk-hdr__theme { display: inline-flex; }
.hk-hdr__mobileTheme { display: none; }
.hk-burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 10px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--card-bg-strong); cursor: pointer;
}
.hk-burger span { display: block; height: 2px; background: var(--orange-600); border-radius: 2px; }
.hk-drawer {
  display: none; max-height: 0; overflow: hidden;
  background: var(--card-bg); border-top: 1px solid var(--border);
  transition: max-height .3s var(--ease);
}
.hk-drawer.is-open { max-height: 280px; }
.hk-drawer__box { display: grid; gap: 10px; padding: 16px 20px 20px; }

/* Hero */
.hk-hero {
  position: relative;
  min-height: min(88vh, 780px);
  display: flex; align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hk-hero__gridBg {
  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: 36px 36px;
  opacity: .7;
}
.hk-hero__slash {
  position: absolute; inset-block: 0; inset-inline-end: 0; width: 52%;
  background: var(--grad-brand);
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
  overflow: hidden;
}
html[data-theme="dark"] .hk-hero__slash { filter: none; opacity: .88; }
.hk-hero__slashGrid {
  position: absolute;
  inset: -6% -4%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(70px, 1fr);
  align-items: center;
  justify-items: center;
  color: #fff;
  font-family: var(--font-display), var(--font-mono), serif;
  font-weight: 800;
  font-size: clamp(22px, 2.6vw, 40px);
  line-height: 1;
  transform: rotate(-7deg);
  pointer-events: none;
  user-select: none;
}
.hk-hero__slashGrid span {
  opacity: .34;
  animation: hkMathDrift 7s ease-in-out infinite;
}
.hk-hero__slashGrid span:nth-child(odd) { transform: rotate(-14deg); opacity: .40; }
.hk-hero__slashGrid span:nth-child(even) { transform: rotate(10deg); }
.hk-hero__slashGrid span:nth-child(3n) { font-size: 1.45em; opacity: .46; }
.hk-hero__slashGrid span:nth-child(4n) { animation-delay: .6s; opacity: .28; }
.hk-hero__slashGrid span:nth-child(5n) { font-size: 1.7em; opacity: .38; animation-delay: 1.2s; }
.hk-hero__slashGrid span:nth-child(6n) { animation-delay: 1.8s; }
.hk-hero__slashGrid span:nth-child(7n) { font-size: .85em; opacity: .30; }
.hk-hero__stage {
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center;
  gap: 36px; padding: 52px 0 60px;
  animation: hkFadeUp .6s var(--ease) both;
}
.hk-hero__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.hk-hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0; padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: var(--card-bg-strong); border: 1px solid var(--border);
  color: var(--orange-700); font-size: 13px; font-weight: 800;
  box-shadow: var(--shadow-soft);
}
html[data-theme="dark"] .hk-hero__badge { background: var(--card-bg-strong); color: var(--orange-300); }
.hk-hero__badgeMark {
  width: 26px; height: 26px; display: grid; place-items: center;
  background: var(--grad-brand); color: #fff; border-radius: 50%;
  font-family: var(--font-display); font-size: 14px;
}
.hk-hero__name {
  margin: 0; font-family: var(--font-display);
  font-size: clamp(34px, 5.2vw, 58px); font-weight: 800;
  line-height: 1.05; color: var(--text-strong); letter-spacing: -0.03em;
}
.hk-hero__nameAr {
  margin: 0; font-size: 20px; font-weight: 800; color: var(--orange-700);
}
html[data-theme="dark"] .hk-hero__nameAr { color: var(--orange-400); }
.hk-hero__desc {
  margin: 0; max-width: 520px; font-size: 16px; line-height: 1.85; color: var(--muted-strong);
}
.hk-hero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.hk-hero__chips span {
  padding: 6px 14px;
  background: var(--orange-50); color: var(--orange-800);
  border: 1px dashed var(--border-strong);
  font-size: 13px; font-weight: 800;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}
html[data-theme="dark"] .hk-hero__chips span {
  background: var(--insight-soft); color: var(--orange-300);
}
.hk-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.hk-hero__board {
  position: relative; min-height: 560px;
  display: grid; place-items: center;
}
.hk-hero__axes {
  width: min(520px, 100%); height: auto;
  color: rgba(255,255,255,.42);
  filter: drop-shadow(0 18px 30px rgba(28,18,12,.18));
}
html[data-theme="dark"] .hk-hero__axes { color: rgba(255,237,213,.28); }
.hk-hero__photoStage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  pointer-events: none;
}
.hk-hero__mathBg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hk-hero__math {
  position: absolute;
  font-family: var(--font-display), var(--font-mono), serif;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  text-shadow: 0 6px 18px rgba(28, 18, 12, 0.18);
  animation: hkMathDrift 6.4s ease-in-out infinite;
  user-select: none;
}
.hk-hero__math--pi    { top: 6%;  inset-inline-start: 8%;  font-size: 64px; --hk-rot: -12deg; --hk-op: .42; }
.hk-hero__math--sum   { top: 10%; inset-inline-end: 6%;   font-size: 58px; --hk-rot: 8deg;   --hk-op: .40; animation-delay: .4s; }
.hk-hero__math--int   { top: 38%; inset-inline-start: 2%; font-size: 72px; --hk-rot: -6deg;  --hk-op: .36; animation-delay: .8s; }
.hk-hero__math--sqrt  { bottom: 18%; inset-inline-end: 4%; font-size: 54px; --hk-rot: 10deg; --hk-op: .38; animation-delay: 1.1s; }
.hk-hero__math--inf   { bottom: 8%; inset-inline-start: 10%; font-size: 48px; --hk-rot: 4deg; --hk-op: .34; animation-delay: .2s; }
.hk-hero__math--tri   { top: 22%; inset-inline-end: 18%; font-size: 40px; --hk-rot: -8deg; --hk-op: .32; animation-delay: 1.6s; }
.hk-hero__math--theta { bottom: 28%; inset-inline-start: 16%; font-size: 42px; --hk-rot: 14deg; --hk-op: .36; animation-delay: .6s; }
.hk-hero__math--delta { top: 58%; inset-inline-end: 10%; font-size: 46px; --hk-rot: -10deg; --hk-op: .34; animation-delay: 1.3s; }
.hk-hero__math--fx    { top: 16%; inset-inline-start: 22%; font-size: 28px; --hk-rot: 6deg; --hk-op: .40; animation-delay: .9s; }
.hk-hero__math--eq    { bottom: 14%; inset-inline-end: 20%; font-size: 34px; --hk-rot: -4deg; --hk-op: .38; animation-delay: 1.8s; }
.hk-hero__math--sig   { top: 48%; inset-inline-start: 12%; font-size: 36px; --hk-rot: 12deg; --hk-op: .30; animation-delay: .3s; }
.hk-hero__math--plus  { top: 4%; inset-inline-end: 28%; font-size: 40px; --hk-rot: 0deg; --hk-op: .28; animation-delay: 2s; }
.hk-hero__math--div   { bottom: 6%; inset-inline-end: 32%; font-size: 36px; --hk-rot: 16deg; --hk-op: .30; animation-delay: 1.4s; }
.hk-hero__math--rad   { top: 70%; inset-inline-start: 28%; font-size: 26px; --hk-rot: -14deg; --hk-op: .32; animation-delay: .7s; }
.hk-hero__math--lim   { top: 32%; inset-inline-end: 2%; font-size: 24px; --hk-rot: 8deg; --hk-op: .34; animation-delay: 1.9s; }
html[data-theme="dark"] .hk-hero__math { color: #FED7AA; }
.hk-hero__photoGlow {
  position: absolute;
  width: min(420px, 88%);
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  background: radial-gradient(circle, rgba(255,255,255,.55) 0%, rgba(241,90,36,.35) 55%, transparent 75%);
  filter: blur(18px);
  animation: hkPhotoGlow 4.8s ease-in-out infinite;
}
.hk-hero__photoWrap {
  position: relative;
  z-index: 1;
  width: min(380px, 86%);
  aspect-ratio: 4 / 5;
  padding: 8px;
  background: #fff;
  border-radius: 22px;
  box-shadow:
    0 22px 48px rgba(28, 18, 12, 0.28),
    0 0 0 6px rgba(255,255,255,.92);
  overflow: hidden;
  pointer-events: auto;
  animation: hkPhotoFloat 5.6s ease-in-out infinite;
  transform-origin: center center;
  will-change: transform;
}
html[data-theme="dark"] .hk-hero__photoWrap {
  background: var(--card-bg-strong);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, 0.45),
    0 0 0 6px rgba(42, 24, 16, .9);
}
.hk-hero__photoWrap:hover {
  animation-play-state: paused;
  transform: rotate(-2deg) translateY(-10px) scale(1.045);
  box-shadow:
    0 28px 60px rgba(28, 18, 12, 0.34),
    0 0 0 8px #fff,
    0 0 36px rgba(241, 90, 36, 0.35);
}
.hk-hero__photoWrap img,
.hk-hero__photoEmpty {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 12%;
  display: block;
  border-radius: 16px;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.hk-hero__photoWrap img {
  transform: scale(1.04);
  transition: transform .45s var(--ease);
}
.hk-hero__photoWrap:hover img { transform: scale(1.10); }
.hk-hero__photoEmpty {
  display: grid; place-items: center; align-content: center; gap: 6px;
  background: var(--orange-50); color: var(--orange-700); text-align: center; padding: 16px;
}
.hk-hero__photoEmpty span {
  font-family: var(--font-display); font-size: 42px; font-weight: 800; line-height: 1;
}
.hk-hero__photoEmpty strong { font-size: 12px; }
.hk-hero__float {
  position: absolute; z-index: 2;
  padding: 8px 12px; background: var(--card-bg-strong); color: var(--orange-800);
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  border: 1px solid var(--border); box-shadow: var(--shadow-soft);
  border-radius: 8px;
}
html[data-theme="dark"] .hk-hero__float { background: var(--card-bg-strong); color: var(--orange-300); }
.hk-hero__float--a { top: 8%; inset-inline-start: 4%; }
.hk-hero__float--b { bottom: 18%; inset-inline-start: 0; }
.hk-hero__float--c { bottom: 8%; inset-inline-end: 6%; }

/* Marquee */
.hk-marquee {
  overflow: hidden; background: var(--orange-600); color: #fff;
  padding: 12px 0; border-block: 1px solid rgba(255,255,255,.12);
}
.hk-marquee__track {
  display: flex; gap: 40px; width: max-content;
  animation: hkMarquee 28s linear infinite;
  font-family: var(--font-mono); font-size: 14px; font-weight: 700; white-space: nowrap;
}
html[dir="rtl"] .hk-marquee__track { animation-name: hkMarqueeRtl; }
.student-perf-lite .hk-marquee__track { animation: none; }

/* Section heads */
.hk-secHead { text-align: center; margin-bottom: 32px; }
.hk-secHead__kicker {
  margin: 0 0 6px; font-size: 13px; font-weight: 800; color: var(--orange-700);
}
html[data-theme="dark"] .hk-secHead__kicker { color: var(--orange-400); }
.hk-secHead__title {
  margin: 0; font-size: clamp(24px, 3.2vw, 36px); font-weight: 800; color: var(--text-strong);
}
.hk-secHead__sub {
  margin: 10px auto 0; max-width: 520px; color: var(--muted); font-size: 15px; line-height: 1.75;
}

/* Number line */
.hk-line {
  padding: 64px 0 72px;
  background: var(--card-bg-strong);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .hk-line { background: var(--card-bg); }
.hk-line__row {
  list-style: none; margin: 36px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; position: relative;
}
.hk-line__axis {
  position: absolute; top: 38px; inset-inline: 8%; height: 3px;
  background: linear-gradient(90deg, var(--orange-200), var(--orange-500), var(--orange-200));
  border-radius: 99px;
}
.hk-line__pt {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; padding-top: 8px;
}
.hk-line__tick {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--card-bg-strong); border: 3px solid var(--orange-500);
  box-shadow: 0 0 0 6px var(--orange-50);
}
.hk-line__pt.is-active .hk-line__tick {
  background: var(--orange-500); animation: hkPulse 2.2s ease-in-out infinite;
}
.hk-line__x {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--orange-700);
}
.hk-line__num {
  font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--text-strong); line-height: 1;
}
.hk-line__label { font-size: 16px; font-weight: 800; color: var(--text-strong); }
.hk-line__hint { font-size: 13px; color: var(--muted); max-width: 180px; line-height: 1.55; }

/* Branches */
.hk-branches { padding: 72px 0; background: var(--page-bg-alt); }
.hk-branches__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.hk-branch {
  position: relative; overflow: hidden;
  padding: 28px 20px 24px;
  background: var(--card-bg-strong); border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  min-height: 220px;
}
html[data-theme="dark"] .hk-branch { background: var(--card-bg-strong); }
.hk-branch--algebra { clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%); }
.hk-branch--geometry { clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 92%); }
.hk-branch--calculus { clip-path: polygon(0 0, 100% 10%, 100% 100%, 0 90%); }
.hk-branch--stats { clip-path: polygon(0 6%, 100% 0, 100% 94%, 0 100%); }
.hk-branch--mechanics { clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 90%); }
.hk-branch--trig { clip-path: polygon(0 10%, 100% 0, 100% 92%, 0 100%); }
.hk-branch__shape {
  display: block; font-family: var(--font-display);
  font-size: 56px; font-weight: 800; line-height: 1;
  color: var(--orange-500); opacity: .88; margin-bottom: 18px;
}
.hk-branch__en {
  margin: 0 0 4px; font-family: var(--font-display);
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--orange-700);
}
.hk-branch__name { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.hk-branch__hint { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.65; }

/* Stats */
.hk-stats { padding: 28px 0; background: var(--page-bg); border-bottom: 1px solid var(--border); }
html[data-theme="dark"] .hk-stats { background: var(--page-bg); }
.hk-stats__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hk-stat {
  text-align: center; padding: 22px 16px;
  background: var(--page-bg-alt); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
html[data-theme="dark"] .hk-stat { background: var(--card-bg-strong); }
.hk-stat::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px;
  background: var(--grad-brand);
}
.hk-stat__val {
  font-family: var(--font-display); font-size: 40px; font-weight: 800; color: var(--orange-600);
}
.hk-stat__lbl { margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }

/* Features */
.hk-features { padding: 72px 0; background: var(--page-bg); }
html[data-theme="dark"] .hk-features { background: var(--page-bg); }
.hk-features__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.hk-feat {
  padding: 22px 20px;
  background: var(--page-bg-alt); border: 1px solid var(--border);
  border-inline-start: 5px solid var(--orange-500);
}
html[data-theme="dark"] .hk-feat { background: var(--card-bg-strong); }
.hk-feat__top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.hk-feat__n {
  font-family: var(--font-display); font-size: 28px; font-weight: 800;
  color: var(--orange-500); line-height: 1;
}
.hk-feat__ico { width: 36px; height: 36px; object-fit: contain; }
.hk-feat__mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--grad-brand); color: #fff;
  font-family: var(--font-display); font-weight: 800;
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
}
.hk-feat__title { margin: 0 0 8px; font-size: 18px; font-weight: 800; }
.hk-feat__text { margin: 0; font-size: 14px; color: var(--muted-strong); line-height: 1.75; }

/* Grades */
.hk-grades { padding: 72px 0; background: var(--page-bg-alt); }
.hk-grades__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}
.hk-grades__grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; margin-inline: auto; }
.hk-grades__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hk-grade {
  display: flex; flex-direction: column;
  background: var(--card-bg-strong); border: 1px solid var(--border);
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s;
}
html[data-theme="dark"] .hk-grade { background: var(--card-bg-strong); }
.hk-grade:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.hk-grade__media {
  position: relative; aspect-ratio: 16/10; background: var(--orange-50); overflow: hidden;
}
.hk-grade__media img { width: 100%; height: 100%; object-fit: cover; }
.hk-grade__empty {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 56px; font-weight: 800; color: var(--orange-400);
}
.hk-grade__badge {
  position: absolute; inset-inline-start: 12px; bottom: 12px;
  padding: 5px 10px; background: var(--orange-600); color: #fff;
  font-size: 12px; font-weight: 800; border-radius: 8px;
}
.hk-grade__body { padding: 16px 16px 18px; }
.hk-grade__name { margin: 0; font-size: 20px; font-weight: 800; }
.hk-grade__hint { margin: 4px 0 10px; font-size: 13px; color: var(--muted); }
.hk-grade__cta { font-size: 13px; font-weight: 800; color: var(--orange-700); }

/* CTA */
.hk-cta { padding: 24px 0 80px; background: var(--page-bg); }
.hk-cta__box {
  position: relative; overflow: hidden;
  text-align: center; padding: clamp(40px, 6vw, 64px) 24px;
  background: var(--grad-brand); color: #fff;
  clip-path: polygon(0 8%, 100% 0, 100% 92%, 0 100%);
  box-shadow: var(--shadow-strong);
}
.hk-cta__pattern {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.hk-cta__kicker,
.hk-cta__title,
.hk-cta__sub { position: relative; color: #fff; }
.hk-cta__kicker {
  margin: 0 0 8px; font-family: var(--font-display); font-size: 14px; font-weight: 700;
}
.hk-cta__title { margin: 0 0 10px; font-size: clamp(26px, 3.4vw, 38px); }
.hk-cta__sub { margin: 0 auto 22px; max-width: 480px; font-size: 15px; line-height: 1.75; opacity: .92; }
.hk-cta .hk-btn { position: relative; }

/* Footer */
.hk-footer {
  position: relative;
  background: var(--card-bg);
  color: var(--text);
  border-top: 1px solid var(--border);
}
html[data-theme="dark"] .hk-footer { background: var(--card-bg); }
.hk-footer__diag {
  height: 8px; background: var(--grad-brand);
}
.hk-footer__inner { padding: 44px 20px 22px; }
.hk-footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 28px; }
.hk-footer__logoLink { display: inline-flex; margin-bottom: 12px; }
.hk-brand__mark--footer { width: 72px; height: 72px; border-radius: 18px; }
.hk-footer__en {
  margin: 0 0 2px; font-family: var(--font-display); font-size: 13px; font-weight: 800; color: var(--orange-700);
}
.hk-footer__name { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.hk-footer__teacher {
  margin: 0 0 10px; font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--orange-600);
}
.hk-footer__tag { margin: 0 0 16px; line-height: 1.75; max-width: 360px; color: var(--muted-strong); }
.hk-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.hk-footer__nav a { color: var(--text-strong); font-weight: 700; font-size: 14px; }
.hk-footer__nav a:hover { color: var(--orange-600); }
.hk-footer__heading { margin: 0 0 12px; font-size: 14px; font-weight: 800; color: var(--orange-700); }
.hk-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hk-footer__link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); font-weight: 600;
}
.hk-footer__link:hover { color: var(--orange-600); }
.hk-footer__linkIco { width: 18px; height: 18px; object-fit: contain; border-radius: 4px; }
.hk-footer__phones { display: grid; gap: 8px; }
.hk-footer__phone { color: var(--text-strong); font-weight: 800; direction: ltr; justify-self: start; }
.hk-footer__bottom {
  margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between;
}
.hk-footer__copy, .hk-footer__dev { margin: 0; font-size: 12px; color: var(--muted); }

/* Auth */
.auth-page { padding: 36px 0 64px; position: relative; z-index: 1; }
.auth-card {
  overflow: hidden; background: var(--card-bg-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: grid;
}
html[data-theme="dark"] .auth-card { background: var(--card-bg-strong); }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; min-height: 560px; }
.auth-formPane { padding: 44px 40px; background: var(--card-bg-strong); }
html[data-theme="dark"] .auth-formPane { background: var(--card-bg-strong); }
.auth-step { display: none; }
.auth-head { text-align: start; margin-bottom: 22px; }
.auth-head__logo {
  width: 64px; height: 64px; margin: 0 0 14px;
  display: grid; place-items: center;
  background: #000; color: #fff;
  border-radius: 16px;
  overflow: hidden;
}
.auth-head__logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-head__logoFallback { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: #fff; }
.auth-head__title {
  font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--text-strong);
}
.auth-head__sub { color: var(--muted-strong); margin-top: 8px; font-size: 14px; line-height: 1.75; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-weight: 800; font-size: 13px; color: var(--text-strong); }
.input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1.5px solid var(--field-border); background: var(--field-bg); color: var(--field-text);
  font-family: inherit; font-size: 15px;
}
.input:focus { outline: none; border-color: var(--orange-500); box-shadow: 0 0 0 3px var(--insight-soft); }
.btn-submit {
  margin-top: 4px; width: 100%; padding: 14px 18px; border: none; border-radius: 12px;
  background: var(--btn-solid-bg); color: #fff;
  font-family: var(--font-body); font-weight: 800; font-size: 15px; cursor: pointer;
  box-shadow: var(--shadow-gold);
}
.btn-submit:hover { filter: brightness(1.05); }
.auth-foot { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.auth-link {
  color: var(--orange-700); font-weight: 800; cursor: pointer;
  background: none; border: 0; padding: 0; font: inherit;
}
html[data-theme="dark"] .auth-link { color: var(--orange-400); }

.auth-imgPane,
.auth-imgPane--plato,
.auth-imgPane--register {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  min-height: 100%;
  background: var(--page-bg-alt);
  padding: 0 !important;
}
.auth-imgPane:not(:has(.auth-img)) {
  background: var(--grad-brand);
}
.auth-imgPane::before {
  content: none;
}
.auth-imgPane:not(:has(.auth-img))::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}
.auth-imgPane__symbols { display: none !important; }
.auth-img {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; max-width: none; max-height: none;
  object-fit: cover; object-position: center top;
  border: 0; border-radius: 0;
  mix-blend-mode: normal;
  opacity: 1;
  filter: none;
}
.auth-imgFallback {
  position: relative; z-index: 1; text-align: center; color: #fff;
  display: grid; gap: 10px; place-items: center; padding: 32px;
}
.auth-imgFallback__hero {
  width: 88px; height: 88px; display: grid; place-items: center;
  background: rgba(255,255,255,.16); color: #fff;
  font-family: var(--font-display); font-size: 36px; font-weight: 800;
  clip-path: polygon(18% 0, 100% 0, 82% 100%, 0 100%);
}
.auth-imgFallback p { max-width: 220px; font-size: 13px; opacity: .9; }
.auth-imgPane__brand,
.auth-imgPane__headline {
  position: absolute; bottom: 0; inset-inline: 0; z-index: 2;
  padding: 36px 18px 22px;
  background: linear-gradient(transparent, rgba(40, 14, 4, 0.86));
  text-align: center; color: #fff;
}
.auth-imgPane__kicker {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #FFE4C8;
}
.auth-imgPane__brand strong,
.auth-imgPane__headline strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 4px;
}
.auth-imgPane__brand span,
.auth-imgPane__headline span {
  display: block;
  font-size: 13px;
  opacity: .92;
}

/* Toasts */
.phy-alert {
  border-radius: 10px; padding: 14px 16px; margin-bottom: 16px;
  background: var(--danger-soft-bg); border: 1px solid var(--danger-soft-border); color: var(--danger);
}
.phy-toast {
  --toast-accent: var(--success); --toast-duration: 6000ms;
  position: fixed !important; left: 50% !important; right: auto !important;
  top: auto !important;
  bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 16px)) !important;
  z-index: 14000 !important; width: min(420px, calc(100vw - 24px));
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px; border-radius: 14px;
  background: var(--card-bg-strong); border: 1px solid var(--border);
  border-inline-start: 4px solid var(--toast-accent);
  box-shadow: var(--shadow-strong); transform: translateX(-50%);
  animation: authToastIn .35s var(--ease) both; overflow: hidden;
}
.phy-toast--success { --toast-accent: var(--success); }
.phy-toast--error { --toast-accent: var(--danger); }
.phy-toast__icon {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--toast-accent); color: #fff; font-weight: 900;
}
.phy-toast__body { min-width: 0; flex: 1; }
.phy-toast__title { display: block; font-weight: 800; color: var(--text-strong); }
.phy-toast__msg, .phy-toast__list { margin: 4px 0 0; color: var(--muted-strong); font-size: 13px; }
.phy-toast__close {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface-soft);
  color: var(--muted); cursor: pointer; font-size: 18px;
}
.phy-toast__progress { position: absolute; inset-inline: 0; bottom: 0; height: 3px; overflow: hidden; }
.phy-toast__progress span {
  display: block; height: 100%; width: 100%; background: var(--toast-accent);
  transform-origin: right; animation: phyToastBar var(--toast-duration) linear forwards;
}
.phy-toast.is-leaving { animation: authToastOut .28s var(--ease) both; pointer-events: none; }
@keyframes phyToastBar { to { transform: scaleX(0); } }
@keyframes authToastIn {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes authToastOut { to { opacity: 0; transform: translate(-50%, 10px); } }

/* Legacy class aliases so older markup still paints */
.lg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 12px; font-weight: 800; text-decoration: none; }
.lg-btn--solid, .lg-btn--gold { background: var(--btn-solid-bg); color: #fff; }
.lg-btn--ghost, .lg-btn--outline { background: var(--card-bg-strong); color: var(--orange-700); border: 1.5px solid var(--border-strong); }
.lg-ambient { display: none; }

/* Responsive */
@media (max-width: 1024px) {
  .hk-features__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hk-grades__grid, .hk-grades__grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hk-branches__grid { grid-template-columns: 1fr 1fr; }
  .hk-hero__slash { width: 38%; opacity: .35; }
}
@media (max-width: 900px) {
  .hk-hdr__nav { display: none; }
  .hk-hdr__mobileTheme { display: inline-flex; margin-inline-start: auto; }
  .hk-burger { display: flex; }
  .hk-drawer { display: block; }
  .hk-hero { min-height: 0; }
  .hk-hero__slash { display: none; }
  .hk-hero__stage {
    grid-template-columns: 1fr; justify-items: center; gap: 28px; padding: 28px 0 40px;
  }
  .hk-hero__board { order: -1; min-height: 420px; width: 100%; }
  .hk-hero__axes { color: var(--orange-400); }
  .hk-hero__copy { text-align: center; align-items: center; }
  .hk-hero__desc { margin-inline: auto; }
  .hk-hero__actions, .hk-hero__chips { justify-content: center; }
  .hk-hero__photoWrap { width: min(300px, 78%); }
  .hk-line__row { grid-template-columns: 1fr 1fr; gap: 22px 12px; }
  .hk-line__axis { display: none; }
  .hk-features__grid { grid-template-columns: 1fr; }
  .hk-grades__grid, .hk-grades__grid--2, .hk-grades__grid--4 { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; }
  .auth-grid { grid-template-columns: 1fr; }
  .auth-imgPane { order: -1; min-height: 240px; max-height: 280px; }
  .auth-imgPane__brand,
  .auth-imgPane__headline {
    display: block;
    padding: 28px 14px 14px;
  }
  .auth-imgPane__headline strong { font-size: 26px; }
  .auth-formPane { padding: 28px 20px; }
  .auth-head { text-align: center; }
  .auth-head__logo { margin-inline: auto; }
  .auth-foot { justify-content: center; }
  .hk-footer__grid { grid-template-columns: 1fr 1fr; }
  .hk-footer__brand { grid-column: 1 / -1; }
  .hk-cta__box { clip-path: none; border-radius: 18px; }
}
@media (max-width: 560px) {
  .hk-hdr__teacherAr { display: none; }
  .hk-brand__ar { display: none; }
  .hk-stats__row { grid-template-columns: 1fr; }
  .hk-branches__grid { grid-template-columns: 1fr; }
  .hk-branch { clip-path: none; border-radius: 16px; }
  .fgrid { grid-template-columns: 1fr; }
  .hk-footer__grid { grid-template-columns: 1fr; }
  .hk-hero__name { font-size: 32px; }
  .hk-hero__board { min-height: 360px; }
  .hk-hero__photoWrap { width: min(280px, 84%); }
  .hk-line__row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .hk-hero__photoWrap,
  .hk-hero__photoGlow,
  .hk-hero__math,
  .hk-hero__slashGrid span { animation: none !important; }
}
.student-perf-lite .hk-hero__photoWrap,
.student-perf-lite .hk-hero__photoGlow,
.student-perf-lite .hk-hero__math,
.student-perf-lite .hk-hero__slashGrid span { animation: none !important; }
