/* Components added on top of style.css: hero collage, flagship cases, Telegram chat
   and app mocks, the "More experiments" group, track-record timeline, reveal motion. */

.print-only { display: none; }

/* ---------- hero collage ---------- */
.hero-visual { position: relative; aspect-ratio: 1 / 0.95; }
.stack-shot {
  position: absolute; display: block; padding: 0; border: 1px solid var(--line); background: var(--bg);
  cursor: pointer; overflow: hidden; border-radius: 8px;
  box-shadow: 0 30px 60px -30px rgba(11, 11, 13, 0.45), 0 2px 6px rgba(11, 11, 13, 0.06);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
  animation: rise 0.9s var(--ease) both;
}
.stack-shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; }
.stack-shot:hover, .stack-shot:focus-visible { transform: translateY(-8px); z-index: 5; box-shadow: 0 40px 70px -30px rgba(0, 47, 167, 0.55); }
.stack-bar { display: flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; background: #f3f3f5; border-bottom: 1px solid var(--line); }
.stack-bar i { width: 7px; height: 7px; border-radius: 50%; background: #cfcfd6; }
.stack-bar span { margin-left: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.stack-1 { left: 0; top: 27%; width: 70%; z-index: 3; animation-delay: 0.05s; }
.stack-2 { right: 0; top: 4%; width: 64%; z-index: 1; animation-delay: 0.2s; }
.stack-3 { right: 0; bottom: 0; width: 60%; z-index: 2; animation-delay: 0.35s; }
.hero-live {
  position: absolute; left: 0; top: 0; z-index: 4; display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; }
.pulse::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #3ddc84; animation: ping 1.8s ease-out infinite; }
@keyframes ping { from { opacity: 0.9; transform: scale(0.6); } to { opacity: 0; transform: scale(1.8); } }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (max-width: 960px) { .hero-visual { max-width: 640px; } }

/* ---------- flagship case studies ---------- */
.cases { display: grid; gap: clamp(3.5rem, 2rem + 4vw, 6rem); }
.case {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 24px; align-items: start;
  border-top: 1px solid var(--line); padding-top: clamp(1.5rem, 1rem + 1vw, 2rem);
}
.case-visual { grid-column: 1 / span 7; grid-row: 1; position: relative; margin: 0 0 32px; }
.case-text { grid-column: 9 / -1; grid-row: 1; }
.case-flip .case-visual { grid-column: 6 / -1; }
.case-flip .case-text { grid-column: 1 / span 4; }
.case-shot { aspect-ratio: 16 / 10; overflow: hidden; border: 1px solid var(--line); background: var(--bg-alt); }
.case-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform 0.8s var(--ease); }
.case:hover .case-shot img { transform: scale(1.02); }
.case-visual > .phone { position: absolute; right: -14px; bottom: -32px; width: min(225px, 34%); z-index: 2; }
.case-flip .case-visual > .phone { right: auto; left: -14px; }
.case-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.case-num { font-weight: 600; color: var(--blue); font-variant-numeric: tabular-nums; }
.case-name { margin-top: 14px; font-size: clamp(2rem, 1.4rem + 2vw, 3.2rem); letter-spacing: -0.04em; }
.case-tagline { margin-top: 12px; font-size: 1.1rem; line-height: 1.45; }
.case-facts { display: grid; grid-template-columns: minmax(7.5em, auto) 1fr; margin: 24px 0 0; font-size: 0.97rem; }
.case-facts dt, .case-facts dd { padding: 11px 0; border-top: 1px solid var(--line); }
.case-facts dt { font-size: 13px; font-weight: 600; color: var(--blue); padding-right: 16px; padding-top: 13px; }
.case-facts dd { margin: 0; color: var(--muted); }
.case-facts dd:last-of-type { color: var(--ink); font-weight: 500; }
.case-actions { margin-top: 24px; }
.btn-text { background: none; color: var(--blue); padding: 0 8px; }
.btn-text:hover { color: var(--ink); }
@media (max-width: 960px) {
  .case-visual, .case-text, .case-flip .case-visual, .case-flip .case-text { grid-column: 1 / -1; grid-row: auto; }
  .case-visual { display: flex; flex-direction: column; margin-bottom: 28px; }
  .case-visual > .phone, .case-flip .case-visual > .phone { position: relative; inset: auto; width: min(270px, 80%); margin: -56px 10px 0 auto; }
}

/* ---------- Telegram chat mock ---------- */
.phone {
  --accent: var(--blue);
  display: flex; flex-direction: column; width: 100%; max-width: 300px; overflow: hidden;
  background: #fff; border: 1px solid #cfd3da; border-radius: 22px;
  box-shadow: 0 24px 48px -24px rgba(11, 11, 13, 0.5);
  font-size: 13px; line-height: 1.35; text-align: left;
}
.phone-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--accent); color: #fff; }
.phone-avatar { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); font-size: 17px; }
.phone-title { min-width: 0; }
.phone-title strong { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.phone-title small { display: block; font-size: 11.5px; opacity: 0.85; }
.phone-chat {
  display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 12px 10px;
  background-color: #e9eef2; background-color: color-mix(in srgb, var(--accent) 9%, #eef1f4);
}
.bubble { max-width: 86%; padding: 7px 10px; border-radius: 12px; white-space: pre-line; overflow-wrap: anywhere; box-shadow: 0 1px 0 rgba(11, 11, 13, 0.08); }
.bubble-out { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.bubble-in { align-self: flex-end; background: #dcf5cb; border-bottom-right-radius: 4px; }
.phone-input { padding: 9px 12px; border-top: 1px solid var(--line); background: #fff; color: #9a9aa3; font-size: 12px; }
.phone-note { padding: 0 12px 8px; background: #fff; color: #9a9aa3; font-size: 10.5px; text-align: center; }
.phone-compact { font-size: 12px; border-radius: 18px; }
.phone-compact .phone-head { padding: 8px 10px; }
.phone-compact .phone-avatar { width: 28px; height: 28px; font-size: 15px; }

/* card and dialog backdrops for mocks */
.visual-chat, .visual-app {
  display: flex; justify-content: center; align-items: flex-start; padding: 16px 16px 0;
  background-color: var(--bg-alt); background-color: color-mix(in srgb, var(--accent) 10%, #f7f7f8);
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 22%, transparent) 1px, transparent 1px);
  background-size: 18px 18px;
}
.visual-chat .phone { width: 72%; }
.modal-shot .visual-chat, .modal-shot .visual-app { padding: 28px 28px 0; }
.modal-shot .visual-chat .phone { width: min(340px, 90%); max-width: none; }

/* ---------- designed app mock ---------- */
.app { width: 100%; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 10px 10px 0 0; box-shadow: 0 24px 48px -28px rgba(11, 11, 13, 0.45); }
.app-bar { display: flex; align-items: center; gap: 5px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: #f6f6f8; }
.app-bar i { width: 8px; height: 8px; border-radius: 50%; background: #d4d4da; }
.app-bar span { margin-left: 8px; font-size: 11px; color: var(--muted); }
.app-body { display: flex; gap: 14px; padding: 14px; }
.app-main { flex: 1; min-width: 0; }
.app-name { display: block; margin-bottom: 10px; font-size: 20px; font-weight: 700; letter-spacing: -0.03em; color: var(--accent); }
.app-rows li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.app-rows b { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 11px; }
.app .phone { flex: none; width: 44%; max-width: 210px; font-size: 11px; }
.app .phone-note, .app .phone-input { display: none; }

/* ---------- More experiments ---------- */
.more { margin-top: clamp(2rem, 1.5rem + 2vw, 3rem); border-top: 1px solid var(--line-strong); }
.more-summary {
  display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 6px 24px;
  padding: 20px 0; cursor: pointer; list-style: none;
}
.more-summary::-webkit-details-marker { display: none; }
.more-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; }
.more-n { margin-left: 10px; font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.more-lead { color: var(--muted); font-size: 0.97rem; }
.more-toggle { font-size: 1.8rem; line-height: 1; color: var(--blue); transition: transform 0.3s var(--ease); }
.more-summary:hover .more-title { color: var(--blue); }
.more[open] .more-toggle { transform: rotate(45deg); }
.grid.grid-more { grid-template-columns: repeat(5, 1fr); }
.grid-more .card-name { font-size: 1.15rem; }
.grid-more .card-tagline { font-size: 0.9rem; }
@media (max-width: 1080px) { .grid.grid-more { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  .grid.grid-more { grid-template-columns: 1fr; }
  .more-summary { grid-template-columns: 1fr auto; }
  .more-lead { grid-row: 2; }
}

/* ---------- track record ---------- */
.timeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); row-gap: 8px; }
.tl-item { position: relative; padding: 22px 24px 26px 0; border-top: 1px solid var(--line-strong); }
.tl-item::before { content: ''; position: absolute; top: -5px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.tl-date { display: block; font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tl-item:last-child .tl-date { color: var(--blue); }
.tl-text { margin-top: 8px; color: var(--muted); font-size: 0.97rem; }
.tl-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  padding: 3px 9px; border: 1px solid var(--line); background: var(--bg); cursor: pointer;
  font-size: 12.5px; font-weight: 500; transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.tag:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- reveal on scroll (enabled by motion.js only without reduced motion) ---------- */
.reveal-on [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), background-color 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.reveal-on [data-reveal].is-in { opacity: 1; transform: none; }
.reveal-on .grid > [data-reveal]:nth-child(3n + 2), .reveal-on .points > [data-reveal]:nth-child(even) { transition-delay: 0.08s; }
.reveal-on .grid > [data-reveal]:nth-child(3n) { transition-delay: 0.16s; }
