/* „Тук и сега“ (/tuk-i-sega/): големият блок, плочките, страницата на инструмента и портата с имейл.
   Ползва речника на подстраниците (pages.css): .glass, .kicker, .glyph, .node, .head, .btn, .crumb, .sh. Анимират се само transform и opacity. */

/* ── големият блок: „Трудно ти е точно сега?“ ── */
.tis-first-wrap { margin-top: clamp(30px, 5vw, 80px); }
.tis-first { position: relative; overflow: hidden; z-index: 2; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(22px, 3.5vw, 56px); align-items: center;
  padding: clamp(30px, 4.5vw, 64px) clamp(24px, 5vw, 72px); border-radius: 40px;
  background: linear-gradient(118deg, rgba(246, 244, 233, .92), rgba(240, 226, 230, .8) 52%, rgba(222, 229, 213, .78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 2px 4px rgba(40, 48, 38, .05), 0 26px 50px -24px rgba(40, 48, 38, .28), 0 80px 130px -60px rgba(109, 66, 98, .38);
  transition: transform .8s var(--ease); }
.tis-first:hover { transform: translateY(-5px); }
.tis-first__lines { position: absolute; right: -150px; top: 50%; width: 660px; height: 660px; margin-top: -330px; fill: none; stroke: var(--plum); stroke-width: 1; opacity: .22; pointer-events: none; }
.tis-first__lines path { stroke-dasharray: 3 7; }
.tis-first__icon { position: relative; display: grid; place-items: center; width: clamp(96px, 10vw, 140px); aspect-ratio: 1; border-radius: 50%;
  background: linear-gradient(160deg, var(--blue), var(--plum) 58%, var(--rose));
  box-shadow: 0 22px 40px -18px rgba(109, 66, 98, .75), 0 60px 90px -50px rgba(195, 43, 89, .55); }
.tis-first__icon .glyph { width: 50%; height: 50%; }
.tis-first__icon .glyph path, .tis-first__icon .glyph circle:not(.f) { stroke: #fff; }
.tis-first__icon .glyph .f { fill: #fff; }
/* бавен „дъх“ около иконата – един слой, само transform и opacity */
.tis-first__icon::after { content: ""; position: absolute; inset: -16px; border-radius: 50%; border: 1px solid rgba(109, 66, 98, .45); animation: tisBreath 8s ease-in-out infinite; }
@keyframes tisBreath { 0%, 100% { transform: scale(.9); opacity: .2; } 50% { transform: scale(1.14); opacity: .85; } }
.tis-first__text { position: relative; display: grid; gap: 12px; }
.tis-first__h { font: var(--p-hw, 500) clamp(1.9rem, 3.6vw, 3.3rem)/1.06 var(--serif); letter-spacing: -.01em; }
.tis-first__p { max-width: 62ch; font-size: 1.04rem; opacity: .85; }
.tis-first__go { position: relative; display: grid; gap: 12px; justify-items: center; }

.tis-badge { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--plum);
  border: 1px solid rgba(109, 66, 98, .35); background: rgba(255, 255, 255, .5); white-space: nowrap; }
.tis-badge--sub { color: var(--blue); border-color: rgba(52, 80, 106, .35); }

/* ── плочките ── */
.tis-day { margin-top: clamp(80px, 10vw, 150px); }
.tis-day .head { margin-bottom: 0; }
.tis-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(16px, 2vw, 28px); margin-top: clamp(30px, 4vw, 54px); }
.tis-tile { display: flex; flex-direction: column; gap: 16px; padding: clamp(26px, 3vw, 40px); transition: transform .8s var(--ease), box-shadow .8s var(--ease); }
.tis-tile:hover { transform: translateY(-6px); }
.tis-tile h3 { font-size: 1.45rem; }
.tis-tile p { flex: 1; font-size: 1rem; opacity: .85; }
.tis-tile__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; min-height: 30px; }
.tis-tile__arr { margin-left: auto; font-size: 1.35rem; color: var(--plum); transition: transform .5s var(--ease); }
.tis-tile:hover .tis-tile__arr { transform: translateX(6px); }

/* ── страницата на инструмента ── */
.tis-tool { padding-top: clamp(130px, 17vh, 200px); padding-bottom: clamp(50px, 7vw, 110px); }
.tis-tool__head { position: relative; z-index: 3; max-width: 780px; }
.tis-tool__title { display: flex; align-items: center; gap: clamp(16px, 2.4vw, 26px); }
.tis-tool__title .glyph { flex: none; width: clamp(54px, 6vw, 76px); height: clamp(54px, 6vw, 76px); }
.tis-tool h1 { font-size: clamp(2.1rem, 4.6vw, 4.2rem); line-height: 1.04; }
.tis-tool__lead { margin-top: 22px; font-size: 1.1rem; max-width: 58ch; opacity: .85; }
.tis-soon { position: relative; z-index: 3; overflow: hidden; margin-top: clamp(36px, 5vw, 70px); max-width: 780px; padding: clamp(30px, 4vw, 56px); display: grid; gap: 14px; justify-items: start; }
.tis-soon h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
.tis-soon p { opacity: .85; }
.tis-soon__lines { position: absolute; right: -90px; top: -90px; width: 320px; height: 320px; fill: none; stroke: var(--plum); stroke-width: 1; opacity: .25; pointer-events: none; }
.tis-locked { position: relative; z-index: 3; margin-top: clamp(36px, 5vw, 60px); height: min(62vh, 560px); display: grid; align-content: center; gap: 18px; padding: clamp(30px, 6vw, 80px); }
.tis-locked span { height: 14px; border-radius: 999px; background: rgba(40, 48, 38, .08); }
.tis-locked span:nth-child(1) { width: 70%; } .tis-locked span:nth-child(2) { width: 92%; } .tis-locked span:nth-child(3) { width: 54%; }
.tis-app { position: relative; z-index: 3; margin-top: clamp(30px, 4vw, 50px); padding: 8px; border-radius: 34px; overflow: hidden; }
.tis-app iframe { display: block; width: 100%; height: calc(100svh - 110px); min-height: 560px; border: 0; border-radius: 27px; background: #edecdf; }
.tis-app__full, .tis-tool__back { position: relative; z-index: 3; margin-top: 24px; }
.tis-tracks { position: relative; z-index: 3; list-style: none; display: grid; gap: 14px; margin: clamp(30px, 4vw, 50px) 0 0; padding: 0; max-width: 880px; }
.tis-track { padding: 22px 26px; display: grid; gap: 14px; }
.tis-track__t { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.tis-track h3 { font-size: 1.25rem; }
.tis-track__t span { font-size: .9rem; opacity: .65; white-space: nowrap; }
.tis-track audio { width: 100%; }

/* ── готово приложение: на целия екран като отделно приложение (Пламен 30.11): без менюто на сайта,
      логото „Медитация и чай“ е в горната лента на самото приложение (слага го wp/tools/sync_tis_apps.py) ── */
html:has(.tis-full) { overflow: hidden; }
html:has(.tis-full) body > .top, html:has(.tis-full) .thread { display: none; }
.tis-full__app { position: fixed; inset: 0; z-index: 50; display: block; width: 100%; height: 100vh; height: 100dvh;
  border: 0; background: #edecdf; }

/* ── портата: страницата се вижда размазана зад стъклен панел ── */
html:has(#tisgate:not(.is-out)) { overflow: hidden; }
.tisgate { position: fixed; inset: 0; z-index: 38; display: grid; overflow-y: auto; overscroll-behavior: contain; padding: clamp(86px, 12vh, 120px) 16px 26px;
  background: rgba(237, 236, 223, .34); -webkit-backdrop-filter: blur(16px) saturate(1.1); backdrop-filter: blur(16px) saturate(1.1);
  transition: opacity .7s ease, visibility .7s; }
.tisgate.is-out { opacity: 0; visibility: hidden; pointer-events: none; }
.tisgate__in { margin: auto; width: min(600px, 100%); display: grid; gap: 18px; justify-items: center; }
.tisgate__box { position: relative; overflow: hidden; width: 100%; padding: clamp(30px, 5vw, 54px) clamp(22px, 5vw, 50px) clamp(26px, 4vw, 40px); display: grid; gap: 16px; justify-items: center; text-align: center;
  background: linear-gradient(160deg, rgba(247, 245, 235, .95), rgba(236, 238, 226, .88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 2px 4px rgba(40, 48, 38, .06), 0 30px 60px -26px rgba(40, 48, 38, .38), 0 90px 150px -60px rgba(109, 66, 98, .4);
  transition: opacity .4s; }
.tisgate.is-auto .tisgate__box { opacity: 0; }
.tisgate__box > :not(.tisgate__lines) { position: relative; }
.tisgate__lines { position: absolute; right: -170px; top: -170px; width: 460px; height: 460px; fill: none; stroke: var(--plum); stroke-width: 1; opacity: .2; pointer-events: none; }
.tisgate__lines path { stroke-dasharray: 3 7; }
.tisgate__node { margin-bottom: 4px; }
.tisgate__h { font-size: clamp(1.55rem, 3.4vw, 2.35rem); line-height: 1.14; max-width: 18ch; }
.tisgate__p { max-width: 48ch; font-size: 1rem; opacity: .86; }
.tisgate__row { display: flex; flex-wrap: wrap; gap: 10px; width: 100%; margin-top: 6px; }
.tisgate__row input { flex: 1 1 220px; min-width: 0; padding: 15px 22px; border-radius: 999px; border: 1px solid var(--hair); background: rgba(255, 255, 255, .8); font: inherit; color: inherit; }
.tisgate__row input:focus { outline: none; border-color: var(--plum); box-shadow: 0 0 0 3px rgba(109, 66, 98, .14); }
.tisgate__row .btn { flex: 0 0 auto; }
.tisgate__row .btn[disabled] { opacity: .7; cursor: progress; }
.tisgate__err { color: #a3243f; font-size: .95rem; }
.tisgate__small { max-width: 46ch; font-size: .82rem; line-height: 1.5; opacity: .72; }
.tisgate__small a { border-bottom: 1px solid currentColor; }
.tisgate__sos { font-size: .92rem; opacity: .8; text-align: center; }

@media (max-width: 860px) {
  .tis-first { grid-template-columns: minmax(0, 1fr); justify-items: start; border-radius: 32px; }
  .tis-first__go { justify-items: start; grid-auto-flow: column; align-items: center; }
  .tis-first__lines { right: -330px; top: 0; margin-top: -200px; }
}
/* телефон: панелът по-стегнат, за да се вижда и редът със 112 без превъртане */
@media (max-width: 520px) {
  .tisgate { padding: 74px 12px 16px; }
  .tisgate__in { gap: 12px; }
  .tisgate__box { padding: 24px 20px 20px; gap: 11px; border-radius: 26px; }
  .tisgate__node { display: none; }
  .tisgate__h { font-size: 1.4rem; }
  .tisgate__p { font-size: .93rem; line-height: 1.5; }
  .tisgate__row input { padding: 13px 18px; }
  .tisgate__row .btn { flex: 1 1 100%; padding-block: 13px; }
  .tisgate__small { font-size: .78rem; }
  .tisgate__sos { font-size: .88rem; }
  .tis-app { padding: 5px; border-radius: 26px; }
  .tis-app iframe { border-radius: 22px; height: calc(100svh - 90px); }
}
/* нисък телефон (напр. iPhone SE): без надписа отгоре, по-плътен текст */
@media (max-width: 520px) and (max-height: 720px) {
  .tisgate { padding-top: 66px; }
  .tisgate .kicker { display: none; }
  .tisgate__h { font-size: 1.3rem; }
  .tisgate__p { font-size: .88rem; line-height: 1.45; }
}

/* ── вариант 2 на началната страница (/tuk-i-sega/?izgled=2, за преглед 01.12): нисък подреден хедър,
      всички инструменти в една мрежа с еднакъв приоритет ── */
body.tis-v2 .phero, body:has(.tis2-head) .phero { display: none; } /* тема без body_class() → :has() */
.tis2-head { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(28px, 5vw, 80px); align-items: end;
  padding-top: clamp(118px, 15vh, 150px); }
.tis2-head__lines { position: absolute; left: -260px; top: 40px; width: 720px; height: 720px; fill: none; stroke: var(--plum); stroke-width: 1; opacity: .14; pointer-events: none; z-index: 0; }
.tis2-head__lines path { stroke-dasharray: 3 7; }
.tis2-head__text { position: relative; z-index: 2; display: grid; gap: 18px; padding-bottom: clamp(6px, 1vw, 14px); }
.tis2-head__h { font-size: clamp(2.5rem, 4.8vw, 4.3rem); line-height: 1; letter-spacing: -.02em; }
.tis2-head__lead { max-width: 58ch; font-size: 1.04rem; opacity: .85; }
.tis2-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--plum); }
.tis2-head__meta i { width: 22px; height: 1px; background: currentColor; opacity: .45; }

.tis2-head__h em { font-style: italic; color: var(--p-temcol, #7e355f); }
.tis2-art { position: relative; z-index: 2; justify-self: end; margin-right: 4%; width: min(100%, 320px); height: clamp(270px, 24vw, 340px); }
.tis2-art__geo { position: absolute; left: 50%; top: 50%; width: 132%; aspect-ratio: 1; translate: -50% -50%; fill: none; stroke: var(--plum); stroke-width: 1; opacity: .28; pointer-events: none; }
.tis2-art__geo .tk { stroke-dasharray: 1 6; opacity: .8; }
.tis2-art__ph { position: absolute; inset: 0; }
.tis2-art__ph img { width: 170%; height: auto; max-width: none; object-fit: unset; translate: -41% -9.5%; } /* по-близо: Пламен в средата на формата */
.tis2-tools, .wrap.tis2-tools { margin-top: clamp(34px, 4vw, 56px); }
.wrap.tis2-head { margin-top: 0; } /* темата слага голям отстъп между секциите – тук не трябва */
.tis2-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 26px); }
.tis2-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr auto; column-gap: clamp(18px, 2vw, 28px); row-gap: 10px;
  padding: clamp(24px, 2.6vw, 36px); border-radius: 30px; min-height: 100%;
  transition: transform .8s var(--ease), box-shadow .8s var(--ease); }
.tis2-card:hover { transform: translateY(-5px); }
.tis2-card__top { display: contents; }
.tis2-card__top .tis2-card__icon { grid-row: 1 / 4; align-self: start; }
.tis2-card__n { position: absolute; top: clamp(22px, 2.4vw, 32px); right: clamp(24px, 2.6vw, 36px); }
.tis2-card__icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(160deg, var(--blue), var(--plum) 58%, var(--rose)); box-shadow: 0 16px 30px -16px rgba(109, 66, 98, .7); }
.tis2-card__icon .glyph { width: 52%; height: 52%; }
.tis2-card__icon .glyph path, .tis2-card__icon .glyph circle:not(.f) { stroke: #fff; }
.tis2-card__icon .glyph .f { fill: #fff; }
.tis2-card__n { font: 500 .78rem/1 var(--serif); letter-spacing: .12em; color: var(--plum); opacity: .55; }
.tis2-card__h { grid-column: 2; padding-right: 36px; font-size: clamp(1.25rem, 1.7vw, 1.6rem); line-height: 1.15; }
.tis2-card__p { grid-column: 2; font-size: 1rem; opacity: .82; }
.tis2-card__foot { grid-column: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; margin-top: 6px; }
.tis2-card__go { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; padding: 9px 18px; border-radius: 999px; color: #fff; font-size: .95rem;
  background: linear-gradient(110deg, var(--blue), var(--plum) 55%, var(--rose)); transition: transform .5s var(--ease); }
.tis2-card:hover .tis2-card__go { transform: translateX(4px); }
.tis2-card.is-soon .tis2-card__icon { background: linear-gradient(160deg, #8a9a7a, #6f7f66); box-shadow: 0 16px 30px -18px rgba(70, 84, 61, .6); }
@media (max-width: 860px) {
  .tis2-head { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .tis2-art { justify-self: end; width: min(60vw, 320px); height: min(52vw, 280px); margin: -10px 4% -6px 0; }
    .tis2-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .tis2-head { padding-top: 96px; gap: 20px; }
  .tis2-head__text { gap: 14px; }
  .tis2-head__lead { font-size: .98rem; }
  .tis2-art { width: 210px; height: 190px; margin: -4px 6% -4px 0; }
      .tis2-tools, .wrap.tis2-tools { margin-top: 26px; }
  .tis2-card { grid-template-columns: minmax(0, 1fr); }
  .tis2-card__top .tis2-card__icon { grid-row: auto; margin-bottom: 4px; }
  .tis2-card__h, .tis2-card__p, .tis2-card__foot { grid-column: 1; }
  .tis2-card__icon { width: 54px; height: 54px; }
}
