/* Original June 4 phone styles, isolated inside a shadow root. */
:host {
  /* ink scale (cool slightly violet) */
  --bg:           oklch(0.13 0.012 290);
  --bg-2:         oklch(0.15 0.014 290);
  --surface:      oklch(0.17 0.014 290);
  --surface-2:    oklch(0.20 0.014 290);
  --surface-hi:   oklch(0.24 0.015 290);
  --hairline:     oklch(0.28 0.014 290 / 0.7);
  --hairline-2:   oklch(0.32 0.014 290 / 0.5);

  /* text */
  --ink:          oklch(0.98 0.005 290);
  --ink-2:        oklch(0.82 0.01 290);
  --ink-3:        oklch(0.65 0.01 290);
  --ink-4:        oklch(0.50 0.01 290);
  --dim:          oklch(0.55 0.01 290);

  /* brand */
  --purple:       oklch(0.72 0.20 295);
  --purple-2:     oklch(0.60 0.22 290);
  --purple-soft:  oklch(0.78 0.16 300);
  --grad-1:       #c4a8ff;
  --grad-2:       #7c5cff;
  --grad-3:       #ff9bb1;

  /* accents */
  --mint:         oklch(0.82 0.13 160);
  --coral:        oklch(0.78 0.16 25);
  --amber:        oklch(0.86 0.14 80);
  --sky:          oklch(0.80 0.13 230);

  /* radii */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-2xl: 36px;

  /* shadow */
  --sh-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 24px 60px -28px rgba(0,0,0,0.7);
  --sh-glow-purple: 0 30px 80px -20px rgba(124,92,255,0.45);
}
:host { display:block; width:min(360px,100%); aspect-ratio:360/730; font-family:'Inter',system-ui,-apple-system,sans-serif; color:var(--ink); font-size:16px; line-height:1.55; -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }
* { box-sizing:border-box; }
button { background:none; border:none; color:inherit; font-family:inherit; font-size:13.3333px; cursor:pointer; padding:0; }
img,svg { display:block; } p { margin:0; }
.mono { font-family:'JetBrains Mono',ui-monospace,monospace; font-size:11.5px; letter-spacing:.02em; text-transform:lowercase; }
.hero-stage {
  position: relative;
  display: grid; place-items: center;
  min-height: 720px;
}
.phone {
  --phone-scale: 1;
  position: relative;
  width: 360px;
  filter: drop-shadow(0 60px 80px rgba(0,0,0,0.5)) drop-shadow(0 30px 60px rgba(124,92,255,0.25));
  transform: scale(var(--phone-scale));
  transform-origin: top center;
  margin-bottom: calc((1 - var(--phone-scale)) * -730px);
}
.phone-bezel {
  width: 360px; height: 730px;
  border-radius: 56px;
  background: linear-gradient(180deg, #1c1c22, #0e0e13);
  padding: 9px;
  border: 1px solid rgba(255,255,255,0.06);
  position: relative;
}
.phone-bezel::before {
  content: ''; position: absolute; inset: 1px;
  border-radius: 55px;
  border: 1px solid rgba(0,0,0,0.6);
  pointer-events: none;
}
.phone-notch {
  position: absolute;
  top: 18px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 30px;
  background: #000;
  border-radius: 18px;
  z-index: 5;
}
.phone-screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 48px;
  background: oklch(0.13 0.01 290);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.ios-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 28px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.ios-icons { display: flex; gap: 5px; align-items: center; }
.ios-i { width: 16px; height: 10px; background: var(--ink); border-radius: 2px; opacity: 0.85; }
.ios-cell { mask: linear-gradient(to right, #000 25%, #000 25%, #0006 25%, #0006 50%, #000 50%, #000 75%, #0006 75%); }
.ios-wifi { width: 14px; }
.ios-batt { width: 22px; border-radius: 3px; position: relative; }
.ios-batt::after { content: ''; position: absolute; right: -3px; top: 3px; width: 2px; height: 4px; background: var(--ink); border-radius: 1px; }

.chat-head {
  display: grid; grid-template-columns: 24px 1fr 24px;
  align-items: center; gap: 12px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--hairline);
  background: oklch(0.15 0.012 290 / 0.7);
  backdrop-filter: blur(10px);
}
.chat-back, .chat-info {
  color: var(--purple); font-size: 22px; line-height: 1; font-weight: 400;
}
.chat-info { font-style: italic; font-family: 'Space Grotesk', serif; font-size: 16px; border: 1px solid var(--purple); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.chat-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-stack { display: flex; }
.ch-av {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--c);
  color: #1a1216; font-weight: 600; font-size: 11px;
  display: grid; place-items: center;
  border: 2px solid oklch(0.15 0.012 290);
  margin-left: -7px;
}
.ch-av:first-child { margin-left: 0; }
.chat-name { font-size: 14px; font-weight: 600; line-height: 1.1; }
.chat-sub { font-size: 10.5px; color: var(--ink-4); margin-top: 2px; }

.chat-body {
  flex: 1; overflow: hidden;
  padding: 14px 12px 14px;
  display: flex; flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(80% 60% at 20% 0%, oklch(0.18 0.05 295 / 0.4), transparent 60%),
    oklch(0.12 0.012 290);
}
.day-divider {
  text-align: center;
  color: var(--ink-4);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  margin: 4px 0 6px;
}
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg.them { justify-content: flex-start; }
.msg.me { justify-content: flex-end; }
.msg.agent { align-items: flex-start; }
.msg-av {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c, var(--purple));
  color: #1a1216; font-weight: 600; font-size: 10px;
  display: grid; place-items: center;
  flex: none;
}
.msg-bubble {
  max-width: 230px;
  background: oklch(0.21 0.012 290);
  border: 1px solid var(--hairline);
  color: var(--ink);
  padding: 8px 11px;
  border-radius: 16px 16px 16px 4px;
  font-size: 13.5px; line-height: 1.4;
}
.msg-name { font-size: 10.5px; color: var(--ink-4); margin-bottom: 2px; font-weight: 500; }
.me-bubble {
  background: linear-gradient(180deg, oklch(0.62 0.22 295), oklch(0.5 0.24 290));
  color: white;
  border: none;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 6px 16px -6px rgba(124,92,255,0.6);
}

/* agent trace */
.agent-trace {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 4px 0 2px;
}
.agent-orb-sm {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background:
    radial-gradient(circle at 30% 30%, #d6c1ff 0%, var(--purple) 40%, var(--purple-2) 100%);
  box-shadow: 0 0 0 1.5px rgba(255,255,255,0.12), 0 0 18px rgba(124,92,255,0.5);
  position: relative;
}
.agent-orb-sm::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, var(--purple) 50deg, transparent 100deg);
  mask: radial-gradient(circle, transparent 56%, black 58%);
  -webkit-mask: radial-gradient(circle, transparent 56%, black 58%);
  animation: orbit 4s linear infinite;
}
@keyframes orbit { to { transform: rotate(360deg); } }
.trace-line {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--ink-3);
}
.trace-step {
  padding: 3px 7px;
  border-radius: 6px;
  background: oklch(0.20 0.012 290);
  border: 1px solid var(--hairline);
}
.trace-step.done { color: var(--ink-3); }
.trace-step.live {
  color: var(--purple-soft);
  border-color: rgba(196,168,255,0.4);
  background: rgba(124,92,255,0.10);
  display: inline-flex; align-items: center; gap: 5px;
}
.trace-arrow { color: var(--ink-4); }
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--purple-soft);
  box-shadow: 0 0 0 3px rgba(196,168,255,0.15);
  animation: pulse 1.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(196,168,255,0.5); }
  100% { box-shadow: 0 0 0 6px rgba(196,168,255,0); }
}

/* agent card */
.agent-card {
  flex: 1;
  background: linear-gradient(180deg, oklch(0.18 0.018 295 / 0.95), oklch(0.16 0.014 290 / 0.95));
  border: 1px solid rgba(196,168,255,0.22);
  border-radius: 16px 16px 16px 4px;
  padding: 12px;
  box-shadow: 0 16px 40px -16px rgba(124,92,255,0.45);
  position: relative;
}
.agent-card::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(196,168,255,0.06) 50%, transparent 70%);
}
.agent-card-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.ag-name { font-size: 12px; font-weight: 600; color: var(--purple-soft); }
.ag-time { color: var(--ink-4); margin-left: auto; }
.agent-card-line { font-size: 12.5px; color: var(--ink-2); margin-bottom: 10px; line-height: 1.4; }

.place-card {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center; gap: 10px;
  padding: 8px 8px 8px 4px;
  border-top: 1px solid var(--hairline);
}
.place-card.faded { opacity: 0.6; }
.place-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-4);
  text-align: center;
}
.place-name { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.place-sub { color: var(--ink-4); margin-top: 2px; font-size: 10px; }
.place-cta {
  font-size: 11px; font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(196,168,255,0.10);
  border: 1px solid rgba(196,168,255,0.25);
  color: var(--purple-soft);
}
.tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(127,214,168,0.10);
  color: var(--mint);
  border: 1px solid rgba(127,214,168,0.20);
  text-transform: lowercase;
}
.tag.mint { background: rgba(127,214,168,0.10); color: var(--mint); border-color: rgba(127,214,168,0.20); }
.tag.coral { background: rgba(245,167,107,0.10); color: var(--coral); border-color: rgba(245,167,107,0.20); }
.tag.amber { background: rgba(255,210,128,0.10); color: var(--amber); border-color: rgba(255,210,128,0.20); }
.tag.purple { background: rgba(196,168,255,0.10); color: var(--purple-soft); border-color: rgba(196,168,255,0.25); }

.agent-foot {
  display: flex; gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
}
.ag-btn {
  flex: 1;
  font-size: 11px;
  padding: 7px 8px;
  border-radius: 7px;
  background: oklch(0.22 0.012 290);
  border: 1px solid var(--hairline);
  color: var(--ink-2);
}

/* composer */
.composer {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  gap: 8px; align-items: center;
  padding: 8px 10px 6px;
  border-top: 1px solid var(--hairline);
  background: oklch(0.14 0.012 290);
}
.cmp-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: oklch(0.22 0.012 290);
  display: grid; place-items: center;
  color: var(--ink-2); font-size: 16px;
}
.cmp-input {
  height: 30px;
  padding: 0 12px;
  border-radius: 16px;
  background: oklch(0.20 0.012 290);
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
  border: 1px solid var(--hairline);
}
.cmp-mention {
  color: var(--purple-soft);
  background: rgba(196,168,255,0.10);
  padding: 1px 6px; border-radius: 4px;
  font-weight: 500;
}
.cmp-caret { width: 1px; height: 14px; background: var(--purple-soft); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cmp-send {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(180deg, var(--purple), var(--purple-2));
  color: white; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 10px -2px rgba(124,92,255,0.5);
}
.ios-home {
  height: 22px;
  display: grid; place-items: center;
}
.ios-home::after {
  content: ''; width: 110px; height: 4px; border-radius: 2px;
  background: var(--ink);
  opacity: 0.7;
}


.hero-stage { width:360px; height:730px; min-height:0; transform:scale(var(--june-scale,1)); transform-origin:top left; }
.phone { transform:perspective(1200px) rotateY(var(--phone-y,0deg)) rotateX(var(--phone-x,0deg)); }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none !important; } .phone { transform:none; } }
