

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/InstrumentSans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root{
  --bg: #fbfbf9;
  --bg-tint: #f2f2ef;
  --ink: #171a14;
  --ink-soft: #3d4136;
  --ink-mute: #6a6e62;
  --rule: #e0e1dc;
  --accent: #6f9a2f;
  --accent-strong: #5d8226;
  --accent-deep: #4a6a1d;
  --accent-soft: #eaf1da;
  --error: #b03a2e;
  --bubble-user: #f2f2ef;
  --bubble-assistant: transparent;
  --dot: rgba(23, 26, 20, 0.06);

  --font-sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
}

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

html,
body{
  height: 100%;
}

body{
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}



.page{
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  
  min-height: 100dvh;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}



#dotfield{
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  
  pointer-events: none;
}



.brand{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark{
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark:hover{
  color: var(--accent-deep);
}

.tagline{
  font-size: 0.85rem;
  color: var(--ink-mute);
  letter-spacing: 0.005em;
}



.chat{
  width: 100%;
  height: auto;
  max-height: 78dvh;
  margin: auto 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px rgba(31, 29, 27, 0.06);
  padding: 1.25rem 1.5rem;
}

.messages{
  flex: 1;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.25rem 0 1rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}


.messages > :first-child{
  margin-top: auto;
}

.messages::-webkit-scrollbar{
  width: 8px;
}

.messages::-webkit-scrollbar-thumb{
  background: var(--rule);
  border-radius: 4px;
}

.message{
  font-size: 1rem;
  line-height: 1.65;
  max-width: 100%;
}

.message.assistant{
  color: var(--ink);
  padding: 0.25rem 0;
}

.message.user{
  align-self: flex-end;
  background: var(--bubble-user);
  color: var(--ink);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  max-width: 85%;
}

.message a{
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.message strong,
.message b{
  font-weight: 600;
}

.message code{
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--bg-tint);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

.message p{
  margin: 0 0 0.75rem;
}

.message p:last-child{
  margin-bottom: 0;
}

.message ul,
.message ol{
  margin: 0.5rem 0 0.75rem 1.25rem;
}

.message li{
  margin-bottom: 0.25rem;
}

.message pre{
  background: var(--bg-tint);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 0.75rem;
  overflow-x: auto;
  font-size: 0.9em;
  line-height: 1.45;
}

.message pre code{
  background: transparent;
  padding: 0;
}



.composer{
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--bg-tint);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer:focus-within{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

#input{
  flex: 1;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.5rem 0.25rem;
  outline: 0;
  max-height: 12rem;
  min-height: 1.5rem;
  
  scrollbar-width: none;
}

#input::-webkit-scrollbar{
  display: none;
}

#input::placeholder{
  color: var(--ink-mute);
}

.icon-btn.recording{
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}



.chips{
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.chip{
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover{
  background: var(--bg-tint);
  color: var(--ink);
  border-color: var(--ink-mute);
}



.site-footer{
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-mute);
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.site-footer a{
  color: var(--ink-mute);
  text-decoration: none;
}

.site-footer a:hover{
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}



.thinking-indicator{
  display: inline-flex;
  gap: 4px;
  padding: 0.4rem 0;
}

.thinking-indicator span{
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-mute);
  animation: thinking 1.2s ease-in-out infinite;
}

.thinking-indicator span:nth-child(2){
  animation-delay: 0.2s;
}

.thinking-indicator span:nth-child(3){
  animation-delay: 0.4s;
}

@keyframes thinking {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.assistant-tools{
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.tool-badge.done{
  color: var(--ink-soft);
}

.tool-badge.error{
  color: var(--error);
  border-color: var(--error);
}

.reentrance-notice{
  font-size: 0.85rem;
  color: var(--ink-mute);
  font-style: italic;
  padding: 0.5rem 0;
}

.message.error{
  color: var(--error);
  background: var(--bg-tint);
  border-left: 3px solid var(--error);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.chip.entering{
  animation: chip-in 0.3s ease both;
}

@keyframes chip-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



@media (max-width: 540px) {
  .page{
    padding: 1.25rem 1rem 1.5rem;
  }

  .brand{
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .wordmark{
    font-size: 1.35rem;
  }

  .message{
    font-size: 0.97rem;
  }
}



.page-scroll{
  gap: 3.25rem;
  padding-bottom: 3rem;
}

.brand-nav{
  display: flex;
  gap: 1.1rem;
  font-size: 0.85rem;
}

.brand-nav a{
  color: var(--ink-mute);
  text-decoration: none;
}

.brand-nav a:hover{
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}



.hero{
  padding: 1.5rem 0 0;
}

@media (min-width: 720px) {
  .hero{
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 1.5rem;
  }
}

.hero h1{
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 10vw, 4.4rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin-bottom: 1rem;
}

.hero-cred{
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin-bottom: 0.9rem;
}

.hero-avail{
  font-size: 0.95rem;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.hero-cta{
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.4rem;
}



.section-label{
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  margin-bottom: 0.6rem;
}

.section-intro{
  color: var(--ink-soft);
  font-size: 0.97rem;
  max-width: 36rem;
  margin-bottom: 1.5rem;
}



.demo{
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 2px 16px rgba(31, 29, 27, 0.06);
  padding: 1.4rem 1.5rem 1rem;
  margin-bottom: 1.4rem;
}

.demo-replay{
  margin-left: auto;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-mute);
  padding: 0.25rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.demo-replay:hover{
  border-color: var(--ink-mute);
  color: var(--ink);
}



.demo-flow{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: 340px;
}

.rbeat{
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.rbeat.shown{
  opacity: 1;
  transform: none;
}

.rowner{
  align-self: flex-end;
  max-width: 85%;
  background: var(--bubble-user);
  border-radius: 16px 16px 4px 16px;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
}

.rstep{
  max-width: 92%;
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.55rem 0.95rem;
  font-size: 0.86rem;
}

.rstep .act{
  color: var(--ink-mute);
  transition: color 0.4s ease;
}

.rstep.done .act{
  color: var(--ink-soft);
}

.rstep .res{
  display: block;
  color: var(--ink);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.45s ease, opacity 0.45s ease;
}

.rstep.done .res{
  max-height: 3.2em;
  opacity: 1;
}

.rstep.recheck.done{
  border-color: var(--accent-strong);
}

.ranswer{
  align-self: stretch;
  max-width: 100%;
  margin-top: 0.4rem;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: 0 2px 16px rgba(31, 29, 27, 0.06);
  border-left: 3px solid var(--accent-strong);
  padding: 0.85rem 1.1rem;
}

.ranswer .figure{
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ranswer .detail{
  color: var(--ink-soft);
  font-size: 0.86rem;
  margin-top: 0.2rem;
}

.ranswer .stat,
.study-output .stat{
  color: var(--ink-mute);
  font-size: 0.78rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--rule);
}

.check{
  color: var(--accent-deep);
  font-weight: 600;
  margin-right: 0.25rem;
}

.study-prompt.shown{
  opacity: 1;
  transform: none;
}

.beat{
  opacity: 0;
  transform: translateY(7px);
  transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}

.beat.shown{
  opacity: 1;
  transform: none;
}

.study-action.done{
  background: #fdfefb;
  border-color: #dbe5ce;
  color: var(--ink);
}

.study-action.done .study-result{
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 0.3rem;
}

.field{
  background: var(--bg-tint);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  font-size: 0.78rem;
  color: var(--ink-mute);
}

.field b{
  color: var(--ink);
  font-weight: 600;
}



.chat-section .chat{
  height: min(64dvh, 480px);
  max-height: none;
  margin: 0;
}


.chat-section .messages > :first-child{
  margin-top: 0;
}

.contact-btn{
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.3rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.contact-btn:hover{
  border-color: var(--ink-mute);
  background: var(--bg-tint);
}

.contact-primary{
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}

.contact-primary:hover{
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #ffffff;
}

@media (max-width: 540px) {
  .page-scroll{
    gap: 2.25rem;
  }

  .brand-nav{
    gap: 0.85rem;
  }

  .demo{
    padding: 1.1rem 1rem 0.8rem;
  }

  .demo-flow{
    min-height: 380px;
  }

  .chat-section .chat{
    height: min(78dvh, 560px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rbeat,.rstep .act,.rstep .res,.beat{
    transition: none;
  }
}



a:focus-visible,
button:focus-visible,
summary:focus-visible,
#input:focus-visible{
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}




.rstep.compact,
.study-action.compact{
  padding: 0.25rem 0.8rem;
  font-size: 0.78rem;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transition: padding 0.3s ease, font-size 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.rstep.compact .act,
.study-action.compact{
  color: var(--ink-mute);
}

.rstep.compact .act{
  display: none;
}

.rstep.compact .res{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.study-action.compact{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.study-action.compact .field-grid,
.study-action.compact .inbox,
.study-action.compact .pills{
  display: none;
}

.study-action.compact .study-result{
  display: inline;
  margin: 0;
}

.study-action.compact .study-result > span{
  overflow: visible;
}

.person-name{
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}



.chips.sending .chip{
  opacity: 0.45;
  pointer-events: none;
}
