/* TeachIn home — v4: the letter stops with its foot still inside the envelope, overlapping the open flap.
   v3: tap a card and a glossy black tile comes forward; its gold envelope opens, the flap tilts
   back, and the letter slides up out of the pocket and over the open flap. */
.ti-feature.is-card{appearance:none;width:100%;text-align:left;background:#fff;border:1px solid var(--ti-line-2,#E9DFE3);border-radius:18px;padding:20px 18px;
  font:inherit;color:inherit;cursor:pointer;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}
.ti-feature.is-card:hover,.ti-feature.is-card:focus-visible{transform:translateY(-4px);box-shadow:0 14px 34px rgba(58,20,32,.14);border-color:#D9B8C4}
.ti-feature.is-card .ti-more{display:inline-flex;align-items:center;gap:6px;margin-top:12px;font-size:.875rem;font-weight:700;color:var(--ti-burg,#8E2244)}
.tih-modal{position:fixed;inset:0;z-index:120;display:flex;align-items:center;justify-content:center;padding:20px;perspective:1100px}
.tih-modal[hidden]{display:none}
.tih-scrim{position:absolute;inset:0;border:0;padding:0;background:radial-gradient(60% 60% at 50% 45%,rgba(28,10,4,.74),rgba(0,0,0,.92));cursor:pointer;animation:tihFade .25s ease-out}
.tih-x{position:fixed;top:calc(14px + env(safe-area-inset-top,0px));right:14px;z-index:5;width:44px;height:44px;border:0;border-radius:22px;
  background:rgba(255,255,255,.16);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer}
.tih-x:hover{background:rgba(255,255,255,.28)}
.tih-stage{position:relative;width:min(430px,100%);height:520px;display:flex;align-items:flex-end;justify-content:center;
  transform:translateZ(-240px) translateY(26px) scale(.9);opacity:0;transition:transform .55s cubic-bezier(.18,.9,.25,1.05),opacity .35s ease}
.tih-modal.is-open .tih-stage{transform:none;opacity:1}
/* the glossy black tile */
.tih-tile{position:absolute;bottom:0;left:50%;width:330px;height:330px;margin-left:-165px;border-radius:78px;overflow:hidden;
  background:linear-gradient(152deg,#4a4a4a 0%,#242424 26%,#101010 62%,#050505 100%);
  box-shadow:inset 0 3px 2px rgba(255,255,255,.4),inset 2px 0 2px rgba(255,255,255,.12),inset -2px 0 2px rgba(255,255,255,.08),
    inset 0 -26px 46px rgba(0,0,0,.85),inset 0 0 0 1.5px rgba(255,255,255,.1),
    0 36px 70px rgba(0,0,0,.75),0 0 46px rgba(240,196,106,.22);
  animation:tihTilt 9s ease-in-out infinite}
.tih-tile::before{content:"";position:absolute;inset:0;background:radial-gradient(52% 30% at 50% 106%,rgba(240,196,106,.42),transparent 72%);pointer-events:none}
.tih-tile::after{content:"";position:absolute;top:-40%;left:-60%;width:80%;height:190%;transform:rotate(18deg);
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.22) 40%,rgba(255,255,255,.5) 50%,rgba(255,255,255,.2) 60%,transparent);
  animation:tihSweep 4.6s ease-in-out infinite}
/* the envelope sits low on the tile, leaving room for the flap to open */
.tih-env{position:absolute;bottom:48px;left:50%;width:262px;height:176px;margin-left:-131px}
.tih-env-body{position:absolute;inset:0;border-radius:18px;overflow:hidden;z-index:1;
  background:linear-gradient(160deg,#F7D98B 0%,#E0B35A 55%,#B9842E 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75),inset 0 -10px 22px rgba(90,56,10,.55),0 6px 18px rgba(0,0,0,.55),0 0 0 2px rgba(0,0,0,.5)}
.tih-env-rays{position:absolute;inset:0;background:repeating-conic-gradient(from 200deg at 50% 118%,rgba(255,255,255,.22) 0deg .6deg,transparent .6deg 2.6deg);opacity:.5}
.tih-env-sheen{position:absolute;inset:-30%;background:linear-gradient(105deg,transparent 36%,rgba(255,255,255,.9) 47%,rgba(255,255,255,.35) 55%,transparent 66%);
  mix-blend-mode:screen;animation:tihSheen 4.6s ease-in-out infinite}
/* the flap: closed over the pocket, then tilted back and held open */
.tih-flap{position:absolute;left:0;right:0;top:0;height:76%;z-index:2;transform-origin:50% 0;transform:scaleY(1);
  clip-path:polygon(0 0,100% 0,50% 100%);
  background:linear-gradient(170deg,#FFE9B4 0%,#EFC368 46%,#C08C33 100%);
  filter:brightness(1);transition:transform .6s cubic-bezier(.34,.86,.3,1) .15s,filter .6s ease .15s}
/* open: the flap folds up and back, showing its underside above the envelope */
.tih-modal.is-open .tih-flap{transform:scaleY(-0.62);filter:brightness(.6) saturate(.85) drop-shadow(0 -6px 12px rgba(0,0,0,.6))}
/* the letter rises out of the pocket and over the open flap */
.tih-letter{position:absolute;bottom:10px;left:50%;width:min(222px,66vw);z-index:3;transform:translate(-50%,34px) scale(.96);opacity:0;
  background:linear-gradient(180deg,#FFFDF8 0%,#FFF7E7 100%);border-radius:12px 12px 6px 6px;padding:16px 16px 34px;
  box-shadow:0 20px 44px rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.9);
  transition:transform .8s cubic-bezier(.2,.86,.26,1.02) .62s,opacity .34s ease .62s}
.tih-modal.is-open .tih-letter{transform:translate(-50%,-150px) scale(1);opacity:1}
.tih-letter h3{margin:0 0 6px;font-size:1.2rem;color:var(--ti-deep,#5C0E27)}
.tih-letter p{margin:0;font-size:.94rem;line-height:1.5;color:var(--ti-ink,#1F1417)}
.tih-letter .ti-btn{margin-top:14px}
/* the envelope's front pocket, always in front of the letter */
.tih-pocket{position:absolute;inset:0;z-index:4;clip-path:polygon(0 100%,0 14%,50% 74%,100% 14%,100% 100%);
  background:linear-gradient(185deg,#E9C275 0%,#D4A54C 40%,#A9762A 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.5);border-radius:0 0 18px 18px}
@keyframes tihFade{from{opacity:0}to{opacity:1}}
@keyframes tihSweep{0%{left:-60%}55%{left:120%}100%{left:120%}}
@keyframes tihSheen{0%{transform:translateX(-60%)}55%{transform:translateX(70%)}100%{transform:translateX(70%)}}
@keyframes tihTilt{0%{transform:rotateX(7deg) rotateY(-9deg)}50%{transform:rotateX(3deg) rotateY(9deg)}100%{transform:rotateX(7deg) rotateY(-9deg)}}
@media (prefers-reduced-motion:reduce){
  .tih-stage,.tih-letter,.tih-flap{transition:none}
  .tih-tile,.tih-tile::after,.tih-env-sheen{animation:none}
  .tih-modal.is-open .tih-flap{transform:scaleY(-0.62);filter:brightness(.6)}
  .ti-feature.is-card{transition:none}
}
@media (max-width:560px){
  .tih-stage{height:430px}
  .tih-tile{width:292px;height:292px;margin-left:-146px;border-radius:70px}
  .tih-env{width:234px;height:158px;margin-left:-117px;bottom:42px}
  .tih-letter{padding:16px 14px 14px}
  .tih-modal.is-open .tih-letter{transform:translate(-50%,-134px) scale(1)}
}
