/* Ported from the prototype's teachers.css — kept in the 'legacy' cascade layer so Tailwind utilities can override it. */
@layer legacy {
/* =========================================================
   الأترجة — المعلمون (public directory)
   Loads after circles.css, which carries the page ground and the
   shared catalogue (toolbar, chips, sort, drawer, empty, more).
   ---------------------------------------------------------
   HERO — tokko.framer.website, measured at 1280: a big centred
     headline with four small white pills (100px radius, shadow
     0 12 20 /.1) tilted around it, then 277px square portraits in a
     4px white frame (32 / 28px radius, same shadow) overlapping by
     ~77px with small vertical offsets. Here: five framed teachers,
     subject tags instead of social numbers, cream ground.

   CARDS — the same page's feature cards: 368×560, 32px radius,
     image-filled, a fade to 80% dark at the foot, 40 / 32px inset,
     a 16px kicker, a 32px title, a 18px line, shadow 0 16 48 -4 /.2,
     a thin light ring. Here: teacher portrait, specialty tag, name,
     expertise line, what they offer, one "عرض الملف" action.
   ========================================================= */


/* =========================================================
   1 — HERO
   ========================================================= */

.th{
  position:relative;
  overflow:hidden;
  isolation:isolate;
  padding:150px 24px 90px;
  text-align:center;
  background:
    radial-gradient(55% 45% at 50% 30%, rgba(255,252,244,.95), rgba(255,252,244,0) 70%),
    radial-gradient(45% 40% at 85% 85%, rgba(168,199,181,.18), transparent 70%),
    radial-gradient(40% 40% at 12% 80%, rgba(212,175,90,.12), transparent 70%),
    var(--cl-bg);
}

/* the homepage dot matrix (hero3.css .bg-matrix), on a light ground:
   26px grid of small squares, faded toward the edges */
.th-matrix{
  position:absolute; inset:0; z-index:-1;
  width:100%; height:100%;
  pointer-events:none;
  -webkit-mask-image:radial-gradient(85% 70% at 50% 38%, #000 0%, rgba(0,0,0,.55) 58%, transparent 90%);
          mask-image:radial-gradient(85% 70% at 50% 38%, #000 0%, rgba(0,0,0,.55) 58%, transparent 90%);
}

.th-head{ position:relative; max-width:860px; margin:0 auto; }

.th-badge{
  display:inline-flex; align-items:center; gap:9px;
  margin:0;
  padding:7px 16px;
  border-radius:99px;
  font-size:14px; font-weight:600;
  color:var(--gold-deep);
  background:rgba(255,253,248,.8);
  border:1px solid rgba(176,143,62,.22);
}
.th-badge span{ width:6px; height:6px; border-radius:50%; background:var(--gold); box-shadow:0 0 0 3px rgba(212,175,90,.18); }

.th-title{
  position:relative; z-index:1;
  margin:24px 0 0;
  font-size:clamp(42px, 6.4vw, 92px);
  line-height:1.16;
  font-weight:700;
  letter-spacing:0;                            /* negative tracking breaks Arabic joins */
  color:var(--cl-ink);
}
.th-title > span{ display:block; }

.th-lead{
  position:relative; z-index:1;
  max-width:560px;
  margin:26px auto 0;
  font-size:clamp(16px, 1.3vw, 19px);
  line-height:1.95;
  color:var(--cl-sub);
}

/* a quiet text action that only scrolls to the search */
.th-scroll{
  display:inline-flex; align-items:center; gap:8px;
  margin-top:26px;
  padding:8px 4px;
  font-size:15px; font-weight:600;
  color:var(--cl-ink);
  border-bottom:1px solid rgba(176,143,62,.45);
  transition:gap .35s var(--cl-out), border-color .3s var(--ease);
}
.th-scroll svg{ width:16px; height:16px; color:var(--gold-deep); transition:transform .35s var(--cl-out); }
.th-scroll:hover{ border-color:var(--gold-deep); }
.th-scroll:hover svg{ transform:translateY(3px); }

/* ---- floating tags (tokko's pills, with subjects) ---- */
.th-tags{ position:absolute; inset:0; pointer-events:none; }
.th-tag{
  position:absolute;
  left:var(--tx); top:var(--ty);                /* not --x/--y: hero3.css registers --y as a length */
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 16px;
  border-radius:99px;
  font-size:15px; font-weight:600;
  color:var(--cl-ink);
  background:#FFFDF8;
  box-shadow:0 12px 20px rgba(18,60,53,.08), 0 1px 0 rgba(255,255,255,.9) inset;
  white-space:nowrap;
  transform:translateX(-50%) rotate(var(--r));
  opacity:0;
  animation:
    th-pop .7s var(--cl-out) var(--d) forwards,
    th-bob var(--f) ease-in-out calc(var(--d) + .7s) infinite alternate;
}
.th-tag.is-soft{ font-size:13.5px; font-weight:500; color:var(--cl-sub); padding:8px 14px; }
.th-tag i{ width:8px; height:8px; border-radius:50%; flex:none; }
.th-tag i.g{ background:var(--gold); }
.th-tag i.s{ background:var(--u-sage); }
.th-tag i.f{ background:rgba(18,60,53,.35); }
@keyframes th-pop{ from{ opacity:0; transform:translateX(-50%) rotate(var(--r)) scale(.8); } to{ opacity:1; transform:translateX(-50%) rotate(var(--r)); } }
@keyframes th-bob{ from{ translate:0 0; } to{ translate:0 -8px; } }

/* ---- the portrait stack ---- */
.th-stack{
  --ph:268px;                                  /* frame size */
  --lap:-74px;                                 /* overlap */
  display:flex; justify-content:center;
  margin-top:64px;
  padding:0 20px 40px;
}
.th-ph{
  position:relative;
  flex:none;
  width:var(--ph); height:var(--ph);
  margin:0;
  margin-inline-start:var(--lap);
  padding:4px;
  border-radius:32px;
  background:#FFFDF8;
  box-shadow:0 12px 20px rgba(18,60,53,.10), 0 30px 50px -30px rgba(18,60,53,.35);
  transform:translateY(var(--y)) rotate(var(--r));
  opacity:0;
  animation:
    th-rise .9s var(--cl-out) calc(.45s + var(--i) * .09s) forwards,
    th-float 7s ease-in-out calc(1.4s + var(--i) * .4s) infinite alternate;
  transition:transform .6s var(--cl-out);
}
.th-ph:first-child{ margin-inline-start:0; }
.th-ph:nth-child(odd){ z-index:1; }
.th-ph:nth-child(3){ z-index:2; }
.th-ph img{
  width:100%; height:100%;
  display:block;
  border-radius:28px;
  object-fit:cover;
  object-position:50% 25%;
}
@keyframes th-rise{ from{ opacity:0; transform:translateY(calc(var(--y) + 60px)) rotate(var(--r)); } to{ opacity:1; transform:translateY(var(--y)) rotate(var(--r)); } }
@keyframes th-float{ from{ translate:0 0; } to{ translate:0 -10px; } }

/* entrance */
.th-up{
  opacity:0;
  transform:translateY(20px);
  animation:th-up .8s var(--cl-out) forwards;
  animation-delay:var(--d, 0s);
}
@keyframes th-up{ to{ opacity:1; transform:none; } }


/* =========================================================
   2 — TEACHER CARD
   ========================================================= */

.tc-page .cat{ padding-top:20px; }

.tc{
  position:relative;
  isolation:isolate;
  display:flex; flex-direction:column; justify-content:flex-end;
  aspect-ratio:368 / 520;
  padding:30px 28px 26px;
  border-radius:32px;
  overflow:hidden;
  color:#fff;
  background:#2A3A34;
  box-shadow:0 16px 48px -6px rgba(18,60,53,.22);
  transition:transform .55s var(--cl-out), box-shadow .55s var(--cl-out);
  animation:cc-in .6s var(--cl-out) both;
  animation-delay:calc(var(--i, 0) * 60ms);
}
.tc:hover{ transform:translateY(-6px); box-shadow:0 30px 60px -14px rgba(18,60,53,.32); }
.tc:focus-visible{ outline:2px solid var(--gold); outline-offset:4px; }

.tc-img{
  position:absolute; inset:0; z-index:-2;
  width:100%; height:100%;
  object-fit:cover;
  object-position:50% 22%;
  transition:transform 1s var(--cl-out);
}
.tc:hover .tc-img{ transform:scale(1.05); }

/* calm forest fade for the text; a touch richer on hover */
.tc::before{
  content:""; position:absolute; inset:0; z-index:-1;
  background:linear-gradient(180deg, rgba(7,31,26,0) 38%, rgba(7,31,26,.55) 62%, rgba(7,31,26,.9) 100%);
  transition:opacity .55s var(--ease);
}
.tc::after{                                       /* the thin light ring */
  content:""; position:absolute; inset:0;
  border-radius:inherit;
  box-shadow:inset 0 0 0 2px rgba(255,253,248,.55);
  pointer-events:none;
}
.tc:hover::before{ background:linear-gradient(180deg, rgba(7,31,26,.05) 30%, rgba(7,31,26,.62) 58%, rgba(7,31,26,.94) 100%); }

.tc-tag{
  position:absolute; top:20px; right:20px;
  display:inline-flex; align-items:center; gap:7px;
  padding:7px 14px;
  border-radius:99px;
  font-size:13px; font-weight:600;
  color:var(--u-forest);
  background:rgba(255,253,248,.9);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}
.tc-tag::before{ content:""; width:6px; height:6px; border-radius:50%; background:var(--gold); }

.tc-kicker{ font-size:14px; font-weight:500; color:rgba(255,255,255,.7); }
.tc-name{ margin:6px 0 0; font-size:clamp(24px, 2.1vw, 29px); line-height:1.35; font-weight:600; }
.tc-line{ margin:8px 0 0; font-size:15.5px; line-height:1.75; color:rgba(255,255,255,.78); }

.tc-foot{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-top:20px; padding-top:16px;
  border-top:1px solid rgba(255,255,255,.16);
}
.tc-meta{ display:flex; flex-wrap:wrap; gap:4px 12px; font-size:13px; color:rgba(255,255,255,.75); }
.tc-meta span{ display:inline-flex; align-items:center; gap:6px; }
.tc-meta svg{ width:15px; height:15px; color:var(--gold-light); }

.tc-go{
  flex:none;
  display:inline-flex; align-items:center; gap:8px;
  height:42px;
  padding-inline:16px 5px;
  border-radius:99px;
  font-size:14px; font-weight:600;
  color:var(--u-forest);
  background:#FFFDF8;
  transition:background .35s var(--ease);
}
.tc-go i{
  width:32px; height:32px;
  display:grid; place-items:center;
  border-radius:50%;
  background:linear-gradient(140deg, #EAD3A0, var(--gold));
}
.tc-go svg{ width:16px; height:16px; transition:transform .45s var(--cl-out); }
.tc:hover .tc-go svg{ transform:translateX(-3px); }

/* skeleton */
.tc.is-skel{ background:#EEE7D7; box-shadow:none; animation:none; pointer-events:none; }
.tc.is-skel::before, .tc.is-skel::after{ display:none; }
.tc.is-skel .sk{ background:#E4DBC7; }


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width:1180px){
  .th-stack{ --ph:220px; --lap:-62px; }
}

@media (max-width:1100px){
  .th-tag:nth-child(n+5){ display:none; }
}

/* below this the tags would crowd the headline or hit the edges */
@media (max-width:1060px){
  .th-tags{ display:none; }
}

/* phones: tags step aside, the portraits become a swipeable strip */
@media (max-width:720px){
  .th{ padding:120px 18px 56px; }

  .th-tags{ display:none; }
  .th-stack{
    --ph:170px; --lap:12px;
    justify-content:flex-start;
    margin:40px -18px 0;
    padding:10px 18px 30px;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    scrollbar-width:none;
  }
  .th-stack::-webkit-scrollbar{ display:none; }
  .th-ph{ scroll-snap-align:center; }
  .tc{ aspect-ratio:auto; min-height:460px; padding:24px 22px 22px; }
}

@media (prefers-reduced-motion:reduce){
  .th-up, .th-tag, .th-ph{ opacity:1; animation:none; }
  .th-up{ transform:none; }
  .tc{ animation:none; }
  .tc, .tc-img, .tc-go svg{ transition-duration:.01s !important; }
}



/* =========================================================
   3 — JOIN (closing invitation to teach)
   starlight-camp.framer.website, "From the families": two columns
   on a 1320 max width — a 736 column (headline, then a big media
   card 60px below) and a 541 column (a coloured block with white-
   framed photos spilling past its sides, then a testimonial card
   40px below). Its motion, read from the site's code:
     · columns: opacity 0 → 1 and x ∓60 → 0, spring stiffness 300 /
       damping 80 (overdamped: a long soft ease-out, ~1.1s), fired
       once when the section enters
     · tag: y −40 → 0, opacity → 1, spring bounce .6 / 1s, delay .6
     · sparkle: scale .4 → 1, opacity → 1, same spring as the
       columns, delay .7
     · photo stack hover: every photo flips its tilt (8° → −6°,
       −7° → 5° …), spring .4s, no bounce
     · phones: the blocks rise from y 60 instead
   Here: RTL (headline and action on the right, level with the
   left column), ivory ground, a muted-gold block, a sage testimonial.
   ========================================================= */

.tx{
  position:relative;
  isolation:isolate;
  overflow:hidden;
  padding:120px 24px 130px;
  background:
    radial-gradient(40% 50% at 82% 20%, rgba(255,252,244,.9), transparent 70%),
    radial-gradient(36% 40% at 12% 70%, rgba(168,199,181,.16), transparent 70%),
    var(--cl-bg);
}
/* a faint eight-point star lattice, only behind the headline */
.tx::before{
  content:"";
  position:absolute; inset:0; z-index:-1;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23123C35' stroke-width='.8'%3E%3Crect x='20' y='20' width='24' height='24'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E");
  background-size:64px 64px;
  opacity:.045;
  -webkit-mask-image:radial-gradient(42% 55% at 78% 22%, #000, transparent 75%);
          mask-image:radial-gradient(42% 55% at 78% 22%, #000, transparent 75%);
  pointer-events:none;
}

.tx-wrap{
  display:flex; align-items:center; justify-content:space-between;
  gap:40px;
  max-width:1320px;
  margin:0 auto;
}
.tx-col{ display:flex; flex-direction:column; }
.tx-col--main{ flex:0 1 736px; gap:56px; }
.tx-col--side{ flex:0 1 541px; gap:40px; }

/* ---- headline block ---- */
.tx-head{ position:relative; padding-top:10px; }

.tx-badge{ margin:0; }
.tx-badge span{
  display:inline-block;
  padding:8px 16px;
  border-radius:10px;
  font-size:14.5px; font-weight:700;
  color:var(--u-forest);
  background:var(--u-sage);
  transform:rotate(-6deg);
  transform-origin:100% 50%;
}

.tx-title{
  margin:22px 0 0;
  padding-inline-end:64px;                     /* room for the sparkle */
  font-size:clamp(36px, 4.2vw, 60px);
  text-wrap:balance;
  line-height:1.22;
  font-weight:700;
  letter-spacing:0;
  color:var(--cl-ink);
}
.tx-spark{
  position:absolute;
  inset-inline-end:0; top:2px;
  width:48px; height:40px;
  color:var(--gold);
  transform:scaleX(-1);                        /* strokes lean toward the title in RTL */
}

.tx-lead{
  max-width:600px;
  margin:20px 0 0;
  font-size:clamp(16px, 1.25vw, 18px);
  line-height:1.95;
  color:var(--cl-sub);
}

/* ---- the one action ---- */
.tx-cta{
  display:inline-flex; align-items:center; gap:10px;
  margin-top:28px;
  padding:15px 28px;
  border-radius:99px;
  font-size:16px; font-weight:600;
  color:var(--u-ivory);
  background:var(--u-forest);
  box-shadow:0 14px 30px -12px rgba(18,60,53,.55);
  transition:transform .4s var(--cl-out), box-shadow .4s var(--cl-out), background-color .3s var(--cl-out);
}
.tx-cta svg{ width:18px; height:18px; color:var(--gold); transition:transform .4s var(--cl-out); }
.tx-cta:hover{
  transform:translateY(-3px);
  background:#174A41;
  box-shadow:0 20px 36px -14px rgba(18,60,53,.6), 0 0 0 4px rgba(212,175,90,.2);
}
.tx-cta:hover svg{ transform:translateX(-4px); }
.tx-cta:focus-visible{ outline:2px solid var(--gold); outline-offset:4px; }

/* ---- photo stack ---- */
.tx-stack{
  position:relative;
  aspect-ratio:541 / 308;
  border-radius:20px;
  background:
    radial-gradient(80% 90% at 30% 20%, rgba(255,246,222,.55), transparent 70%),
    linear-gradient(150deg, #E8D6A6 0%, #D9BF82 100%);
}
.tx-mark{ position:absolute; z-index:5; width:36px; height:30px; color:var(--gold-deep); }
.tx-mark--a{ top:-16px; right:-10px; }
.tx-mark--b{ bottom:4px; left:30%; color:#FFFDF8; transform:rotate(180deg); }

.tx-photos{
  position:absolute;
  left:-6%; right:-6%;
  top:50%; height:78%;
  translate:0 -50%;
}
.tx-ph{
  position:absolute;
  left:var(--x); top:50%;
  height:100%;
  aspect-ratio:.81;
  margin:0;
  z-index:var(--z);
  translate:-50% -50%;
  rotate:var(--r);
  border:6px solid #FFFDF8;
  border-radius:16px;
  overflow:hidden;
  background:#FFFDF8;
  box-shadow:0 10px 22px -10px rgba(18,60,53,.35);
  transition:rotate .45s cubic-bezier(.25,.8,.35,1);
}
.tx-ph img{ width:100%; height:100%; display:block; object-fit:cover; filter:saturate(.85); }
.tx-stack:hover .tx-ph{ rotate:var(--h); }

/* ---- testimonial ---- */
.tx-quote{
  position:relative;
  padding:36px 40px 40px;
  border-radius:20px;
  color:var(--u-forest);
  background:linear-gradient(160deg, #DCE9E0 0%, #C9DDD0 100%);
}
.tx-dots{
  position:absolute;
  inset-inline-end:40px; top:40px;
  display:flex; gap:8px;
}
.tx-dots button{
  width:11px; height:11px;
  padding:0; border:0; border-radius:50%;
  background:var(--u-forest);
  opacity:.3;
  cursor:pointer;
  transition:opacity .3s var(--cl-out);
}
.tx-dots button[aria-selected="true"]{ opacity:1; }
.tx-dots button:focus-visible{ outline:2px solid var(--gold-deep); outline-offset:3px; }

.tx-slides{ display:grid; }
.tx-slide{
  grid-area:1 / 1;
  margin:0;
  opacity:0;
  visibility:hidden;
  transition:opacity .6s var(--cl-out), visibility 0s linear .6s;
}
.tx-slide.is-on{ opacity:1; visibility:visible; transition:opacity .6s var(--cl-out) .1s, visibility 0s; }
.tx-who{ display:flex; align-items:center; gap:14px; padding-inline-end:64px; }
.tx-who img{
  width:64px; height:64px; flex:none;
  border-radius:50%;
  object-fit:cover;
  border:3px solid #FFFDF8;
}
.tx-who b{ display:block; font-size:18px; font-weight:700; }
.tx-who small{ display:block; margin-top:2px; font-size:14px; color:rgba(18,60,53,.7); }
.tx-slide blockquote{
  margin:24px 0 0;
  font-size:17px;
  line-height:1.95;
}

/* ---- reveal (teachers.js adds .is-in once) ---- */
.tx.js .tx-in{ opacity:0; }
.tx.js .tx-col[data-from="right"]{ translate:60px 0; }
.tx.js .tx-col[data-from="left"]{ translate:-60px 0; }
.tx.js .tx-in.is-in{
  opacity:1; translate:0 0;
  transition:opacity 1.1s cubic-bezier(.16,1,.3,1), translate 1.1s cubic-bezier(.16,1,.3,1);
}
.tx.js .tx-badge span{ opacity:0; translate:0 -40px; }
.tx.js .tx-spark{ opacity:0; scale:.4; }
.tx.js .is-in .tx-badge span{ animation:tx-drop 1s linear .6s forwards; }
.tx.js .is-in .tx-spark{
  opacity:1; scale:1;
  transition:opacity 1.1s cubic-bezier(.16,1,.3,1) .7s, scale 1.1s cubic-bezier(.16,1,.3,1) .7s;
}
/* a spring with bounce .6 over 1s, sampled */
@keyframes tx-drop{
  0%  { opacity:0; translate:0 -40px; }
  18% { opacity:1; translate:0 0; }
  30% { translate:0 9px; }
  46% { translate:0 -4px; }
  62% { translate:0 2px; }
  80% { translate:0 -.6px; }
  100%{ opacity:1; translate:0 0; }
}

/* ---- responsive ---- */
@media (max-width:1100px){
  .tx-col--main{ gap:44px; }

  .tx-quote{ padding:30px 28px 32px; }
  .tx-dots{ inset-inline-end:28px; top:34px; }
}

/* phones & small tablets: one column — headline, photos,
   testimonial, then the action; each block rises from y 60 */
@media (max-width:860px){
  .tx{ padding:84px 16px 96px; }
  .tx-wrap{ flex-direction:column; align-items:stretch; gap:0; }
  .tx-col, .tx-head{ display:contents; }
  .tx-badge  { order:1; }
  .tx-title  { order:2; padding-inline-end:0; }
  .tx-spark  { display:none; }
  .tx-lead   { order:3; }
  .tx-stack  { order:4; margin:56px 6% 0; }
  .tx-quote  { order:6; margin-top:20px; }
  .tx-cta    { order:7; align-self:stretch; justify-content:center; margin-top:28px; }

  .tx-ph{ border-width:4px; border-radius:12px; }
  .tx-photos{ left:-5%; right:-5%; height:74%; }
  .tx-mark--a{ right:-6px; }
  .tx-slide blockquote{ font-size:16px; }

  /* the columns no longer move; their blocks do */
  .tx.js .tx-in[data-from]{ translate:none; opacity:1; transition:none; }
  .tx.js [data-m]{ opacity:0; translate:0 60px; }
  .tx.js [data-m].is-in{
    opacity:1; translate:0 0;
    transition:opacity 1.1s cubic-bezier(.16,1,.3,1), translate 1.1s cubic-bezier(.16,1,.3,1);
  }
  .tx.js .tx-badge.is-in span{ animation:tx-drop 1s linear .3s forwards; }
  /* touch: the photos keep their tilt */
  .tx-stack:hover .tx-ph{ rotate:var(--r); }
}

@media (prefers-reduced-motion:reduce){
  .tx.js .tx-in, .tx.js [data-m], .tx.js .tx-badge span, .tx.js .tx-spark{ opacity:1 !important; translate:none !important; scale:none !important; animation:none !important; }
  .tx-ph{ transition:none; }
}

}
