/* LoHo Meadow — hero + chat. Palette and type ported from the Claude Design source. */

:root {
  --ground-0: #0E0F08;
  --ground-1: #121309;
  --bone: #F2EDE2;
  --bone-dim: #B7B0A1;
  --kicker: #C9C2B2;
  --ember: #C8552E;
  --ember-soft: rgba(200, 85, 46, 0.16);
  --sage: #8A9A6F;
  --line: rgba(242, 237, 226, 0.12);
  --panel: rgba(12, 13, 18, 0.55);
  --display: "Fraunces", Georgia, serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--ground-0); }
body {
  font-family: var(--body);
  color: var(--bone);
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- Hero media: photo poster + (optional) YouTube background ---- */
.hero-media { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: var(--ground-0); }
.hero-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 44%;
}
.hero-video { position: absolute; inset: 0; }
.hero-video iframe {
  position: absolute; top: 50%; left: 50%;
  width: 177.78vh; height: 56.25vw;
  min-width: 100vw; min-height: 100vh;
  transform: translate(-50%, -50%) scale(1.22);
  pointer-events: none; border: 0;
  filter: saturate(1.05) contrast(1.03) brightness(0.9);
}

.hero-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(58% 54% at 50% 56%, rgba(8,9,5,0.74) 0%, rgba(8,9,5,0.40) 52%, rgba(8,9,5,0.12) 100%),
    linear-gradient(180deg, rgba(8,9,5,0.66) 0%, rgba(8,9,5,0.16) 24%, rgba(8,9,5,0.18) 62%, rgba(8,9,5,0.66) 100%);
}

/* ---- Header ---- */
.site-header {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 44px;
  border-bottom: 1px solid rgba(242, 237, 226, 0.08);
  animation: loho-up .6s ease both;
}
.wordmark { font-family: var(--display); font-size: 1.55rem; font-weight: 500; letter-spacing: .01em; }
.agent-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--sage);
}
.agent-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sage); box-shadow: 0 0 10px var(--sage);
  animation: loho-pulse 2.4s ease-in-out infinite;
}

/* ---- Content ---- */
.hero-content {
  position: relative; z-index: 2; flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 36px 40px; min-height: 0;
}
.hero-inner { width: 100%; max-width: 640px; animation: loho-up2 .7s .1s ease both; }
.kicker {
  text-align: center; font-family: var(--display); font-style: italic;
  font-size: 1.32rem; color: var(--kicker); margin: 0 0 26px; line-height: 1.4;
}

/* ---- Chat panel ---- */
.chat-panel {
  background: var(--panel);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 20px; box-shadow: 0 24px 60px -28px rgba(0,0,0,.7);
  text-align: left;
}
.chat-log {
  display: flex; flex-direction: column; gap: 14px;
  max-height: min(52vh, 560px); overflow-y: auto;
  padding: 2px 6px 2px 2px;
  scrollbar-width: thin; scrollbar-color: rgba(242,237,226,.18) transparent;
}
.chat-log::-webkit-scrollbar { width: 7px; }
.chat-log::-webkit-scrollbar-thumb { background: rgba(242,237,226,.16); border-radius: 8px; }
.chat-log::-webkit-scrollbar-track { background: transparent; }

.msg { animation: loho-rise .35s ease; }
.msg-bot { align-self: flex-start; max-width: 92%; }
.msg-user {
  align-self: flex-end; max-width: 88%;
  background: var(--ember-soft); border: 1px solid rgba(200,85,46,.28);
  padding: 9px 13px; border-radius: 14px 14px 4px 14px;
  font-size: 1.04rem; line-height: 1.5; white-space: pre-wrap;
}
.msg-label {
  display: block; font-weight: 600; font-size: .7rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--sage); margin-bottom: 6px;
}
.msg-text { font-size: 1.04rem; line-height: 1.56; white-space: pre-wrap; }

.caret {
  display: inline-block; width: 8px; height: 1.05em; background: var(--ember);
  margin-left: 3px; transform: translateY(2px);
  animation: loho-caret .9s steps(1) infinite;
}
.caret[hidden] { display: none; }

.typing { display: flex; gap: 5px; align-self: flex-start; padding: 8px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--bone-dim); animation: loho-blink 1.3s infinite; }
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }

/* ---- Controls (revealed once the intro finishes) ---- */
.chat-controls { display: none; flex-direction: column; gap: 12px; margin-top: 16px; }
.hero.is-ready .chat-controls { display: flex; animation: loho-rise .5s ease both; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: inherit; font-size: .88rem; color: var(--bone);
  background: rgba(242,237,226,.05); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; line-height: 1.2;
  transition: border-color .18s, background .18s;
}
.chip:hover { border-color: rgba(200,85,46,.5); background: rgba(200,85,46,0.14); }
.input-row { display: flex; gap: 9px; align-items: flex-end; }
.chat-input {
  flex: 1; font-family: inherit; font-size: 1.04rem; color: var(--bone);
  background: rgba(242,237,226,.04); border: 1px solid var(--line); border-radius: 13px;
  padding: 12px 14px; resize: none; line-height: 1.4; max-height: 120px; min-height: 46px;
  transition: border-color .18s;
}
.chat-input::placeholder { color: var(--bone-dim); }
.chat-input:focus { outline: none; border-color: rgba(200,85,46,.6); }
.ask-btn {
  font-family: inherit; font-weight: 600; font-size: .96rem; color: #fff;
  background: var(--ember); border: none; border-radius: 13px;
  padding: 0 18px; height: 46px; cursor: pointer; white-space: nowrap; transition: filter .18s;
}
.ask-btn:hover { filter: brightness(1.08); }
.ask-btn:disabled { opacity: .55; cursor: default; }
.ask-btn:focus-visible, .chip:focus-visible, .link-btn:focus-visible {
  outline: 2px solid var(--ember); outline-offset: 2px;
}

/* ---- Quick links ---- */
.quick-links { display: none; flex-direction: column; gap: 10px; margin-top: 20px; }
.hero.is-ready .quick-links { display: flex; animation: loho-rise .6s ease both; }
.links-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.link-btn {
  font-family: inherit; font-size: .88rem; color: var(--bone-dim);
  background: transparent; border: 1px solid var(--line);
  padding: 9px 15px; border-radius: 11px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color .18s, border-color .18s;
}
.link-btn:hover { color: var(--bone); border-color: rgba(242,237,226,.34); }
.link-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ember); opacity: .85; flex: none; }
.links-note { text-align: center; font-size: .82rem; color: var(--bone-dim); font-style: italic; font-family: var(--display); }
.links-note[hidden] { display: none; }

/* ---- Animations ---- */
@keyframes loho-pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes loho-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes loho-up2 { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes loho-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes loho-blink { 0%,60%,100% { opacity: .25; } 30% { opacity: .85; } }
@keyframes loho-caret { 0%,50% { opacity: 1; } 50.01%,100% { opacity: 0; } }

/* ---- Compact / mobile ---- */
@media (max-width: 640px) {
  .site-header { padding: 14px 18px; }
  .wordmark { font-size: 1.2rem; }
  .hero-content { padding: 16px 16px 28px; }
  .hero-inner { max-width: 100%; }
  .kicker { font-size: 1.05rem; margin-bottom: 16px; }
  .chat-panel { padding: 14px; }
  .chat-log { max-height: min(50svh, 420px); }
  .msg-text, .msg-user, .chat-input { font-size: .98rem; }
  .chip { font-size: .84rem; }
  .links-row { flex-direction: column; align-items: stretch; }
  .link-btn { justify-content: center; }
}

/* ---- Reduced motion: no animation, no background video ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .hero-video { display: none !important; }
}
