/* ============================================================
   tme.bio — clean Telegram-site-style light theme
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f7f9;
  --panel: #ffffff;
  --line: #e3e8ec;
  --txt: #232323;
  --mut: #707579;
  --blue: #0088cc;
  --btn: #2aabee;
  --btn-h: #229ed9;
  --up: #31b545;
  --down: #e53935;
  --chat-bg: #e7edf3;
  --bubble-out: #effdde;
  --body: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --rad: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--txt);
  line-height: 1.6;
  font-size: 16.5px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(42, 171, 238, 0.25); }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------------- header ---------------- */

.hd {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.hd-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--txt);
  letter-spacing: -0.01em;
}
.logo:hover { text-decoration: none; }
.logo svg { display: block; }
.logo b { color: var(--blue); font-weight: 700; }

.lang-menu { position: relative; }
.lang-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--mut);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 7px 14px;
  background: #fff;
  transition: color 0.15s, border-color 0.15s;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { color: var(--blue); border-color: #bfe3f7; }
.lang-menu[open] summary { color: var(--blue); border-color: #bfe3f7; }
.lang-menu nav {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 18px 44px -18px rgba(30, 60, 90, 0.35);
}
.lang-menu nav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--txt);
  white-space: nowrap;
}
.lang-menu nav a:hover { background: var(--bg-alt); text-decoration: none; }
.lang-menu nav a[aria-current] {
  background: rgba(42, 171, 238, 0.12);
  color: var(--blue);
  font-weight: 700;
}

/* ---------------- hero ---------------- */

.hero {
  padding: 64px 0 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 56px;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #b3261e;
  background: #fdecea;
  border: 1px solid #f7cfcb;
  border-radius: 100px;
  padding: 6px 14px;
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

h1 {
  font-weight: 800;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.14;
  letter-spacing: -0.022em;
  margin: 20px 0 16px;
  animation: rise 0.6s 0.06s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
h1 .x {
  color: var(--down);
  position: relative;
  white-space: nowrap;
}
h1 .x::after {
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  top: 55%;
  height: 3px;
  background: var(--down);
  border-radius: 2px;
  transform: rotate(-2deg);
  animation: strike 0.45s 0.9s cubic-bezier(0.7, 0, 0.2, 1) both;
  transform-origin: left center;
}
h1 em { font-style: normal; color: var(--blue); }

.sub {
  color: var(--mut);
  font-size: 17.5px;
  max-width: 52ch;
  animation: rise 0.6s 0.12s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.sub b { color: var(--txt); font-weight: 700; }
.sub code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--txt);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

/* converter */

.conv {
  margin-top: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 20px;
  box-shadow: 0 10px 34px -18px rgba(30, 60, 90, 0.25);
  animation: rise 0.6s 0.18s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.conv label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 10px;
}
.conv-row { display: flex; gap: 10px; }
.conv input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 14.5px;
  color: var(--txt);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.conv input::placeholder { color: #9aa2a9; }
.conv input:focus {
  background: #fff;
  border-color: var(--btn);
  box-shadow: 0 0 0 3px rgba(42, 171, 238, 0.18);
}

.btn {
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 0;
  border-radius: 10px;
  padding: 13px 22px;
  cursor: pointer;
  white-space: nowrap;
  background: var(--btn);
  color: #fff;
  transition: background 0.15s, transform 0.15s, box-shadow 0.2s;
}
.btn:hover {
  background: var(--btn-h);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(42, 171, 238, 0.8);
}
.btn:active { transform: translateY(0); }

.cv-out {
  display: none;
  margin-top: 12px;
  align-items: center;
  gap: 10px;
  background: #f0faf1;
  border: 1px solid #cdeacf;
  border-radius: 10px;
  padding-block: 10px;
  padding-inline: 15px 10px;
  animation: rise 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.cv-out.show { display: flex; }
.cv-out a.res {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 500;
  color: #1e9e33;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cv-out .mini {
  font-family: var(--body);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--txt);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.cv-out .mini:hover { border-color: var(--btn); color: var(--blue); text-decoration: none; }
.cv-out .mini.ok { color: var(--up); border-color: #b5e2ba; background: #f0faf1; }
.err {
  display: none;
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--down);
}
.err.show { display: block; }

.hint {
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--mut);
}
.hint code { font-family: var(--mono); font-size: 0.92em; color: var(--txt); }

/* ---------------- chat mockup ---------------- */

.phone {
  background: linear-gradient(160deg, #dfe9f2, var(--chat-bg));
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px -28px rgba(30, 60, 90, 0.35);
  animation: rise 0.7s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.phone-hd {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}
.phone-hd .ava {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #54c0f0, #1e88c9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex: none;
}
.phone-hd .who { line-height: 1.25; }
.phone-hd .who b { display: block; font-size: 15px; }
.phone-hd .who span { font-size: 12.5px; color: var(--blue); }

.chat {
  padding: 22px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.55) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
}
.msg {
  max-width: 84%;
  padding: 9px 13px 7px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(30, 60, 90, 0.12);
  font-size: 14.5px;
  line-height: 1.45;
  opacity: 0;
  animation: pop 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.msg.in { align-self: flex-start; border-bottom-left-radius: 4px; animation-delay: 0.5s; }
.msg.out { align-self: flex-end; background: var(--bubble-out); border-bottom-right-radius: 4px; }
.msg:nth-child(2) { animation-delay: 1.15s; }
.msg:nth-child(3) { animation-delay: 1.9s; }
.msg .lnk { font-family: var(--mono); font-size: 0.92em; font-weight: 500; }
.msg .lnk.dead { color: #97a1ab; text-decoration: line-through; text-decoration-color: var(--down); text-decoration-thickness: 2px; }
.msg .lnk.live { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.msg .meta {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  font-size: 11px;
  color: #9db09c;
  margin-top: 2px;
}
.msg.in .meta { color: #a9b2ba; }
.msg .meta .ticks { color: #4fae4e; letter-spacing: -0.35em; padding-right: 0.35em; }
.msg .note { display: block; font-size: 12.5px; color: var(--down); margin-top: 3px; }

/* status dots */

.dot-up, .dot-down {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
.dot-up {
  background: var(--up);
  box-shadow: 0 0 0 0 rgba(49, 181, 69, 0.4);
  animation: pulse 2.2s ease-out infinite;
}
.dot-down { background: var(--down); }
.chip .dot-down { animation: blink 1.6s steps(2, start) infinite; }

/* ---------------- status strip ---------------- */

.status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 8px 0;
}
.st {
  display: flex;
  align-items: center;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: #fff;
  padding: 15px 18px;
}
.st .nm {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--txt);
}
.st .lb {
  font-size: 13px;
  color: var(--mut);
  display: block;
  line-height: 1.35;
}
.st .tag {
  margin-inline-start: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 100px;
}
.st .tag.up { color: #1e7e2e; background: #e6f6e8; }
.st .tag.down { color: #b3261e; background: #fdecea; }

/* ---------------- sections ---------------- */

section { padding: 68px 0; }
section.alt { background: var(--bg-alt); }

.kick {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 12px;
}

h2 {
  font-weight: 800;
  font-size: clamp(24px, 3.2vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  max-width: 26ch;
}
.lead { color: var(--mut); max-width: 62ch; margin-bottom: 8px; }
.lead code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--txt);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}
section.alt .lead code { background: #fff; }

/* steps */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 32px;
}
.step {
  border: 1px solid var(--line);
  border-radius: var(--rad);
  background: #fff;
  padding: 24px 22px 22px;
  transition: transform 0.25s, box-shadow 0.25s;
}
.step:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(30, 60, 90, 0.3); }
.step .n {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--btn);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.step h3 { font-size: 17px; font-weight: 700; margin-bottom: 7px; letter-spacing: -0.01em; }
.step p { font-size: 14.5px; color: var(--mut); }
.step p code {
  font-family: var(--mono);
  font-size: 0.88em;
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--txt);
}
.step p code.bad { color: #b3261e; background: #fdecea; border-color: #f7cfcb; text-decoration: line-through; }
.step p code.good { color: #1e7e2e; background: #e6f6e8; border-color: #c6e8ca; }

/* swap demo */

.swap {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: clamp(15px, 2.3vw, 20px);
  font-weight: 500;
  border: 1px dashed #c9d4dc;
  border-radius: var(--rad);
  padding: 24px 20px;
  background: #fff;
}
.swap .from { color: #97a1ab; text-decoration: line-through; text-decoration-color: var(--down); text-decoration-thickness: 2px; }
.swap .arr { color: var(--btn); font-size: 1.2em; }
.swap .to { color: var(--blue); }
.swap .to .d { color: var(--txt); }

/* link types */

.types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 32px;
}
.type {
  border: 1px solid var(--line);
  border-radius: var(--rad);
  padding: 20px 20px 18px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.25s;
}
.type:hover { border-color: #bfe3f7; box-shadow: 0 10px 24px -18px rgba(30, 60, 90, 0.3); }
.type h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 5px; }
.type p { font-size: 13.5px; color: var(--mut); margin-bottom: 12px; }
.type code {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--blue);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.type code::before { content: '→ '; color: #b9c4cc; }

/* faq */

.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 18px 4px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: color 0.15s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: '+';
  font-family: var(--mono);
  font-weight: 500;
  color: var(--btn);
  font-size: 19px;
  line-height: 1;
  flex: none;
  width: 18px;
}
.faq details[open] summary::before { content: '−'; }
.faq summary:hover { color: var(--blue); }
.faq .a {
  padding-block: 0 20px;
  padding-inline: 36px 4px;
  color: var(--mut);
  font-size: 15px;
  max-width: 68ch;
}
.faq .a code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--txt);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
}

/* footer */

footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
}
.ft {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.ft .col { max-width: 60ch; }
.ft .disc {
  font-size: 13px;
  color: var(--mut);
  margin-top: 12px;
}
.ft nav { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.ft nav a { color: var(--mut); }
.ft nav a:hover { color: var(--blue); }
.ft .mono-min { font-family: var(--mono); font-size: 12px; color: #9aa2a9; margin-top: 16px; }

.ft-langs {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 2;
  color: #b9c4cc;
}
.ft-langs a { color: var(--mut); white-space: nowrap; }
.ft-langs a:hover { color: var(--blue); }

/* terms page */

.doc { max-width: 760px; padding: 52px 0 64px; }
.doc h1 { font-size: clamp(28px, 4vw, 38px); animation: none; margin-top: 12px; }
.doc .upd { font-size: 13.5px; color: #9aa2a9; margin-bottom: 32px; }
.doc h2 { font-size: 20px; margin: 36px 0 10px; max-width: none; }
.doc p, .doc li { color: #55595e; font-size: 15.5px; margin-bottom: 12px; }
.doc ul { padding-left: 22px; margin-bottom: 12px; }
.doc code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
}
.doc .hl {
  border: 1px solid #ffe1a6;
  background: #fff8e8;
  border-radius: var(--rad);
  padding: 18px 20px;
  margin: 22px 0;
}
.doc .hl p { color: var(--txt); margin: 0; }

/* RTL fixes */

code, .lnk, .st .nm, .res, .mono-min, .hint, .swap { unicode-bidi: isolate; }
code, .lnk, .st .nm, .res { direction: ltr; }
[dir="rtl"] .swap { direction: ltr; }
[dir="rtl"] .type code { text-align: end; }
[dir="rtl"] .logo span { direction: ltr; }

/* reveal on scroll */

.rv { opacity: 0; transform: translateY(20px); transition: opacity 0.65s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1); }
.rv.in { opacity: 1; transform: none; }

/* keyframes */

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes strike {
  from { transform: scaleX(0) rotate(-2deg); }
  to { transform: scaleX(1) rotate(-2deg); }
}
@keyframes blink { 50% { opacity: 0.25; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(49, 181, 69, 0.4); }
  70% { box-shadow: 0 0 0 9px rgba(49, 181, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(49, 181, 69, 0); }
}

/* responsive */

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 44px 0 36px; }
  .status, .steps, .types { grid-template-columns: 1fr 1fr; }
  section { padding: 52px 0; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .status, .steps, .types { grid-template-columns: 1fr; }
  .conv-row { flex-direction: column; }
  .btn { width: 100%; }
  .hd-in { height: 54px; }
  .logo { font-size: 16px; }
  .cv-out { flex-wrap: wrap; }
  .cv-out a.res { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .msg, .rv { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* status updated line */
.status-upd {
  margin-top: 10px;
  font-size: 12.5px;
  color: #9aa2a9;
}
