@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-stretch: 100%;
  font-display: swap;
  src: url(fonts/instrument-sans-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/instrument-serif-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/instrument-serif-italic-latin.woff2) format('woff2');
}
:root {
  --void:    #130B10;
  --surface: #1E1319;
  --line:    rgba(246, 238, 233, .10);
  --cream:   #F6EEE9;
  --ink:     #23161B;
  --text:    #F0E4E6;
  --muted:   rgba(240, 228, 230, .52);
  --rose:    #CF6C84;
  --rose-hi: #E28DA2;
  --glow:    255, 198, 176;
  --live:    #7FD9A6;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--void);
  color: var(--text);
  font-family: 'Instrument Sans', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; border-radius: 8px; }
.shell { max-width: 460px; margin: 0 auto; }
.app {
  position: relative;
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);   
  overflow: hidden;
  isolation: isolate;
}
.app > * { min-width: 0; }

.wall {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.3s ease;
  pointer-events: none;
}
.app.chat .wall { opacity: 1; }
.wall img {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  object-position: 60% 22%;
  filter: blur(26px) saturate(1.2) brightness(.42);
}
.wall::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(95% 55% at 50% 6%, rgba(19, 11, 16, .30), transparent 72%),
    linear-gradient(180deg, rgba(19, 11, 16, .50) 0%, rgba(19, 11, 16, .84) 58%, var(--void) 100%);
}

.app::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero {
  position: relative;
  z-index: 2;
  height: 62svh;
  min-height: 340px;
  transition: height 1s cubic-bezier(.65, 0, .35, 1);
}
.app.chat .hero { height: calc(66px + env(safe-area-inset-top)); min-height: 0; }
.app.chat .hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(19, 11, 16, .5);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  animation: fadeIn .7s ease both;
}
.face {
  appearance: none;
  border: 0;
  padding: 0;
  position: absolute;
  top: 0; left: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  transition:
    top 1s cubic-bezier(.65, 0, .35, 1),
    left 1s cubic-bezier(.65, 0, .35, 1),
    width 1s cubic-bezier(.65, 0, .35, 1),
    height 1s cubic-bezier(.65, 0, .35, 1),
    border-radius 1s cubic-bezier(.65, 0, .35, 1),
    box-shadow .5s ease;
}
.app.chat .face {
  top: calc(13px + env(safe-area-inset-top));
  left: 54px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(246, 238, 233, .45), 0 6px 20px -6px #000;
}
.app.chat .face:hover { box-shadow: 0 0 0 1.5px var(--rose), 0 6px 20px -6px #000; }
.face > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 26%;
  filter: saturate(1.02) contrast(1.02) brightness(1.04);
}
.lay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}
.app.chat .lay { opacity: 0; }
.lay.vig  { background: radial-gradient(115% 80% at 50% 32%, transparent 50%, rgba(12, 6, 10, .62) 100%); }
.lay.fade { background: linear-gradient(180deg,
              rgba(19, 11, 16, .34) 0%, rgba(19, 11, 16, .02) 26%,
              rgba(19, 11, 16, .55) 68%, rgba(19, 11, 16, .92) 88%, var(--void) 100%); }
.lay.grain {
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.lay.ambient {
  inset: -25%;
  mix-blend-mode: soft-light;
  will-change: transform;
  background: radial-gradient(closest-side,
    rgba(var(--glow), .9) 0%, rgba(var(--glow), .3) 45%, transparent 72%);
}

.bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  padding: calc(14px + env(safe-area-inset-top)) 16px 12px;
  pointer-events: none;   
}
.bar > * { pointer-events: auto; }
.bar-time {
  margin-left: auto;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.identity {
  position: absolute;
  left: 20px;
  bottom: 18px;
  z-index: 5;
  transition: left 1s cubic-bezier(.65, 0, .35, 1),
              bottom 1s cubic-bezier(.65, 0, .35, 1),
              top 1s cubic-bezier(.65, 0, .35, 1);
}
.app.chat .identity {
  left: 108px;
  bottom: auto;
  top: calc(16px + env(safe-area-inset-top));
}
.identity h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 3.7rem;
  line-height: .88;
  letter-spacing: -.025em;
  text-shadow: 0 4px 34px rgba(0, 0, 0, .5);
  transition: font-size 1s cubic-bezier(.65, 0, .35, 1), text-shadow .5s ease;
}
.app.chat .identity h1 { font-size: 1.45rem; text-shadow: none; }
.live {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  font-size: .84rem;
  font-weight: 500;
  color: var(--text);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
  transition: margin-top 1s ease, font-size 1s ease, color .5s ease, text-shadow .5s ease;
}
.app.chat .live { margin-top: 1px; font-size: .74rem; color: var(--muted); text-shadow: none; }
.live::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--rose);
}

.convo {
  position: relative;
  z-index: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: 12px 16px 42px;
}
.convo::-webkit-scrollbar { display: none; }
.thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;   
}
.msg {
  align-self: flex-start;
  max-width: 80%;
  padding: 11px 16px;
  background: linear-gradient(180deg, rgba(246, 238, 233, .17), rgba(246, 238, 233, .08));
  border: 1px solid rgba(246, 238, 233, .24);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  color: var(--text);
  border-radius: 20px 20px 20px 7px;
  font-size: 1rem;
  line-height: 1.38;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 12px 32px -14px rgba(0, 0, 0, .9);
}

.msg.voice {
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -.004em;
  padding: 13px 18px;
  background: linear-gradient(180deg, rgba(246, 238, 233, .26), rgba(246, 238, 233, .13));
  border-color: rgba(246, 238, 233, .38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 0 26px -8px rgba(246, 238, 233, .22), 0 12px 32px -14px rgba(0, 0, 0, .9);
}
.typing { display: inline-flex; gap: 4px; padding: 15px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: rgba(240, 228, 230, .55); }

.sent {
  align-self: flex-end;
  max-width: 80%;
  padding: 11px 16px;
  background: linear-gradient(180deg, rgba(207, 108, 132, .64), rgba(178, 82, 106, .52));
  border: 1px solid rgba(226, 141, 162, .55);
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  color: #fff;
  border-radius: 20px 20px 7px 20px;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 26px -14px rgba(0, 0, 0, .8);
}
.ticks {
  display: block;
  text-align: right;
  margin-top: 2px;
  font-size: .66rem;
  color: transparent;
  transition: color .4s ease;
}
.ticks.seen { color: var(--rose-hi); }

.card {
  align-self: flex-start;
  width: min(94%, 340px);
  padding: 6px;
  border-radius: 20px 20px 20px 7px;
  background: rgba(246, 238, 233, .07);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 44px -18px #000;
}
.card.hidden { display: none; }
.card-head {
  padding: 8px 10px 9px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-rows { display: flex; flex-direction: column; }
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 6px;
  color: var(--text);
  border-top: 1px solid var(--line);
  transition: padding-left .18s ease, color .18s ease;
}
.row:first-of-type { border-top: 0; }
.row:hover { padding-left: 12px; }
.row:active { opacity: .7; }
.row .ic {
  flex: none;
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  color: var(--text);
  opacity: .75;
}
.row .tx { flex: 1; min-width: 0; }
.row strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.005em;
}
.row small {
  display: block;
  margin-top: 1px;
  font-size: .8rem;
  font-weight: 400;
  color: var(--muted);
}

.row.key {
  margin-bottom: 6px;
  padding: 16px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--rose);
  color: #fff;
  gap: 15px;
}
.row.key:hover { padding-left: 18px; background: var(--rose-hi); }
.row.key .ic { color: #fff; opacity: 1; }
.row.key strong { font-size: 1.06rem; font-weight: 700; }
.row.key small { color: rgba(255, 255, 255, .82); }

.card .row.key {
  background: transparent;
  border: 1px solid rgba(207, 108, 132, .6);
  color: var(--rose-hi);
}
.card .row.key:hover { background: rgba(207, 108, 132, .12); }
.card .row.key .ic { color: var(--rose-hi); }
.card .row.key small { color: rgba(240, 228, 230, .6); }
.foot {
  padding: 14px 0 4px;
  text-align: center;
  font-size: .68rem;
  letter-spacing: .12em;
  color: rgba(240, 228, 230, .28);
}

.composer {
  position: relative;
  z-index: 3;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
}
.composer::before {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 100%;
  height: 26px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(19, 11, 16, .9));
}
.choices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  margin-bottom: 11px;
}
.choices-cue {
  align-self: flex-end;
  padding-right: 4px;
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: .95rem;
  color: var(--muted);
}
.chip {
  appearance: none;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 18px;
  background: rgba(246, 238, 233, .06);
  border: 1.5px solid rgba(246, 238, 233, .55);
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--cream);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.chip:hover { background: var(--cream); color: var(--ink); transform: translateY(-1px); }
.chip:active { transform: scale(.97); }
.composer-row { display: flex; align-items: center; gap: 10px; }
.plus {
  appearance: none;
  flex: 0 0 46px;
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(246, 238, 233, .07);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color .16s ease, transform .16s ease;
}
.plus:hover { background: rgba(246, 238, 233, .14); transform: translateY(-1px); }
.plus:active { transform: scale(.94); }
.plus-wrap { position: relative; flex: 0 0 46px; }
.plus-tag {
  position: absolute;
  left: 0;
  bottom: calc(100% + 9px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .9);
}
.plus-tag::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rose);
}

.input {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 20px;
  background: var(--rose);
  border-radius: 999px;
  box-shadow: 0 16px 44px -16px rgba(207, 108, 132, .9);
  transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.input:hover {
  background: var(--rose-hi);
  transform: translateY(-1px);
  box-shadow: 0 20px 52px -14px rgba(207, 108, 132, 1);
}
.input:active { transform: scale(.985); }
.input .lbl {
  flex: 1 1 auto;
  min-width: 0;
  font-size: .98rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.input .send {
  flex: 0 0 42px;
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: var(--rose);
}

.sheet-bg {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(10, 5, 9, .74);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
}
.sheet-bg.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 41;
  width: min(100%, 460px);
  transform: translate(-50%, 100%);
  padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -24px 70px -20px #000;
  transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-grip {
  display: block;
  width: 38px; height: 4px;
  margin: 2px auto 14px;
  border-radius: 999px;
  background: rgba(240, 228, 230, .2);
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 16px;
}
.sheet-av {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 62% 26%;
}
.sheet-who strong {
  display: block;
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 1.4rem;
  line-height: 1.1;
}
.sheet-who small {
  display: block;
  font-size: .8rem;
  color: var(--muted);
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 4, 7, .95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.viewer.open { opacity: 1; pointer-events: auto; }
.viewer img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 78svh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 40px 100px -30px #000;
  transform: scale(.94);
  transition: transform .4s cubic-bezier(.22, 1, .36, 1);
}
.viewer.open img { transform: scale(1); }
.viewer-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 18px;
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(246, 238, 233, .1);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
}
.viewer-cap {
  position: absolute;
  bottom: calc(26px + env(safe-area-inset-bottom));
  left: 0; right: 0;
  text-align: center;
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes pop { from { opacity: 0; transform: translateY(9px) scale(.97); } to { opacity: 1; transform: none; } }
  @keyframes heroIn { from { transform: scale(1.06); } to { transform: none; } }
  @keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes drift { 0% { transform: translate3d(-4%, -3%, 0); } 100% { transform: translate3d(5%, 4%, 0); } }
  @keyframes blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
  .face > img  { animation: heroIn 1.9s cubic-bezier(.22, 1, .36, 1) both; }
  .identity    { animation: riseIn .8s cubic-bezier(.22, 1, .36, 1) .3s both; }
  .lay.ambient { animation: drift 18s ease-in-out infinite alternate; }
  .lay.ambient.held { animation: none; }
  .pop         { animation: pop .38s cubic-bezier(.22, 1, .36, 1) both; }
  .msg-1       { animation: pop .42s cubic-bezier(.22, 1, .36, 1) 1.1s both; }
  .msg-2       { animation: pop .42s cubic-bezier(.22, 1, .36, 1) 1.7s both; }
  .typing i    { animation: blink 1.1s ease-in-out infinite; }
  .typing i:nth-child(2) { animation-delay: .18s; }
  .typing i:nth-child(3) { animation-delay: .36s; }
  
  @keyframes halo {
    0%, 100% { box-shadow: 0 0 0 0 rgba(207, 108, 132, 0);
               border-color: var(--line); background: rgba(246, 238, 233, .07); }
    4%       { box-shadow: 0 0 26px 4px rgba(207, 108, 132, .75);
               border-color: var(--rose); background: rgba(207, 108, 132, .28); }
    20%      { box-shadow: 0 0 20px 2px rgba(207, 108, 132, .5);
               border-color: rgba(207, 108, 132, .8); background: rgba(207, 108, 132, .2); }
    30%      { box-shadow: 0 0 0 0 rgba(207, 108, 132, 0);
               border-color: var(--line); background: rgba(246, 238, 233, .07); }
  }
  @keyframes tagIn {
    from { opacity: 0; transform: translateY(6px) scale(.96); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes ctaNudge {
    0%, 100% { transform: none; }
    3%  { transform: scale(1.025); }
    6%  { transform: none; }
    9%  { transform: scale(1.015); }
    12% { transform: none; }
  }
  .plus         { animation: halo 12s ease-in-out 2s infinite; }
  .plus-tag     { animation: tagIn .5s ease 1.4s both; }
  .composer .input { animation: ctaNudge 13s ease-in-out 7s infinite; }
  body.seen-links .plus { animation: none !important; }
}
@media (max-height: 700px) {
  .hero { height: 54svh; min-height: 260px; }
  .identity h1 { font-size: 2.9rem; }
  .msg, .sent { font-size: .95rem; padding: 9px 14px; }
  .msg.voice { font-size: 1rem; }
  .chip { min-height: 40px; }
}
@media (min-width: 640px) {
  body {
    background:
      radial-gradient(70vmin 55vmin at 50% 10%, rgba(207, 108, 132, .10), transparent 70%),
      #0B0509;
    padding: 3svh 0;
  }
  .shell {
    max-width: 430px;
    border-radius: 36px;
    overflow: hidden;
    border: 1px solid rgba(246, 238, 233, .08);
    box-shadow: 0 60px 120px -40px #000;
  }
  .app { height: min(94svh, 900px); }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .msg { background: #2d1e26; border-color: rgba(246, 238, 233, .18); }
  .msg.voice { background: #382730; }
  .sent { background: #b85a74; }
  .card { background: #241820; }
  .chip { background: #241820; }
  .plus { background: #241820; }
  .app.chat .hero::before { background: rgba(19, 11, 16, .92); }
  .sheet-bg { background: rgba(10, 5, 9, .88); }
}
