:root {
  color-scheme: dark;
  --bg: oklch(0.13 0.018 255);
  --surface: oklch(0.2 0.025 255);
  --surface-2: oklch(0.26 0.035 255);
  --ink: oklch(0.96 0.012 248);
  --muted: oklch(0.76 0.025 250);
  --line: oklch(0.38 0.042 255);
  --accent: oklch(0.82 0.19 145);
  --accent-ink: oklch(0.13 0.03 145);
  --paper: oklch(0.93 0.015 250);
  --radius: 12px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: ui-serif, Georgia, serif;
  background: linear-gradient(180deg, oklch(0.15 0.02 255), var(--bg) 42rem);
  color: var(--ink);
  line-height: 1.65;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: .7rem .9rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  transition: top 180ms var(--ease-out);
}
.skip-link:focus { top: 1rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

main { max-width: 920px; margin: 0 auto; padding: clamp(1rem, 4vw, 3rem); }
.hero { min-height: 58dvh; display: grid; align-content: center; gap: 1rem; }
.hero-mark {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: .65rem;
  padding: .25rem .7rem .25rem .25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: oklch(0.18 0.022 255);
}
.hero .hero-mark p {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.2;
}
.hank-portrait {
  width: 52px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 36%;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid oklch(0.88 0.012 250);
}
.face {
  width: max-content;
  padding: .45rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: clamp(2.2rem, 7vw, 4.8rem);
  letter-spacing: .08em;
  box-shadow: 0 6px 8px oklch(0 0 0 / .16);
}
h1 {
  max-width: 9ch;
  margin: 0;
  font-size: clamp(4rem, 17vw, 6rem);
  letter-spacing: -.04em;
  line-height: .85;
  text-wrap: balance;
}
h2 { margin-top: 0; font-size: clamp(1.6rem, 4vw, 2.8rem); line-height: 1; text-wrap: balance; }
p { max-width: 68ch; color: var(--muted); }
.hero p { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--ink); }
a { color: var(--accent); text-underline-offset: .22em; }
.pill-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: .6rem .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: transform 140ms var(--ease-out), border-color 180ms var(--ease-out), background 180ms var(--ease-out);
}
.pill-link:hover { border-color: var(--accent); background: var(--surface-2); }
.pill-link:active { transform: scale(.97); }
.compact-link {
  min-height: 32px;
  padding: .25rem .65rem;
  font-size: .9rem;
}
.compact-link {
  min-height: 32px;
  padding: .25rem .65rem;
  font-size: .9rem;
}
.compact-link {
  min-height: 32px;
  padding: .25rem .65rem;
  font-size: .9rem;
}
.system-line {
  width: max-content;
  margin: 0;
  padding: .25rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .9rem;
}
section { border-bottom: 1px solid var(--line); padding: clamp(2rem, 6vw, 4rem) 0; }
.prompt-section,
.chat-section {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(280px, 1.15fr);
  gap: clamp(1rem, 4vw, 2rem);
  align-items: start;
}
form { display: grid; gap: .8rem; max-width: 720px; }
.prompt-box, .thanks-panel, .process-panel, .chat-window {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), oklch(0.17 0.022 255));
  padding: clamp(1rem, 3vw, 1.25rem);
}
.chat-section { grid-template-columns: 1fr; gap: 1rem; }
.chat-window {
  width: min(100%, 860px);
  min-height: 640px;
  justify-self: center;
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
  gap: 0;
  overflow: hidden;
  padding: 0;
  background: oklch(0.155 0.018 255);
}
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: oklch(0.2 0.022 255);
}
.chat-title {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.chat-avatar {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid oklch(0.82 0.014 250);
}
.chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 33%;
}
.chat-header h2 { margin: 0; font-size: 1.2rem; line-height: 1.1; }
.chat-status {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .25rem .6rem;
  border: 1px solid oklch(0.58 0.12 145);
  border-radius: 999px;
  color: var(--accent);
  font-size: .9rem;
  white-space: nowrap;
}
.chat-status[data-state="sealed"] {
  border-color: oklch(0.52 0.06 250);
  color: var(--muted);
}
.chat-status[data-state="sealed"] span {
  background: var(--muted);
  box-shadow: 0 0 0 4px oklch(0.76 0.025 250 / .12);
}
.chat-status span,
.live-chip span {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px oklch(0.82 0.19 145 / .16);
}
.chat-transcript {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  overflow: auto;
  padding: 1.1rem;
  scroll-behavior: smooth;
  background:
    linear-gradient(180deg, oklch(0.17 0.02 255), transparent 5rem),
    oklch(0.145 0.016 255);
}
.message {
  max-width: min(74ch, 84%);
  padding: .85rem 1rem;
  border-radius: 12px;
  background: oklch(0.22 0.024 255);
}
.message p { margin: .25rem 0 0; color: var(--ink); }
.message-role {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .8rem;
}
.user-message {
  align-self: flex-end;
  background: oklch(0.32 0.095 145);
  color: var(--ink);
}
.hank-message {
  align-self: flex-start;
  border: 1px solid oklch(0.34 0.036 255);
}
.system-message {
  align-self: center;
  max-width: min(68ch, 92%);
  background: oklch(0.19 0.018 255);
  border: 1px solid var(--line);
}
.typing-message {
  max-width: max-content;
}
.typing-message p {
  min-width: 3rem;
}
.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  min-height: 1.2rem;
}
.typing-dots span {
  width: .42rem;
  height: .42rem;
  border-radius: 999px;
  background: var(--muted);
  animation: typing-pulse 900ms var(--ease-out) infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 120ms; }
.typing-dots span:nth-child(3) { animation-delay: 240ms; }
.chat-composer {
  max-width: none;
  padding: .8rem;
  border-top: 1px solid var(--line);
  background: oklch(0.18 0.02 255);
}
.composer-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .65rem;
  align-items: end;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out);
}
.composer-shell:focus-within {
  border-color: var(--accent);
  background: oklch(0.22 0.026 255);
}
.chat-composer textarea {
  min-height: 46px;
  max-height: 150px;
  padding: .55rem .65rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.chat-composer textarea:focus { outline: 0; }
.composer-actions {
  display: flex;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
  padding-inline: .2rem;
}
.composer-actions input { flex: 1 1 180px; max-width: 22rem; }
.composer-actions span { color: var(--muted); font-size: .9rem; }
.composer-shell button { flex: 0 0 auto; min-height: 40px; padding: .55rem .85rem; }
label { font-weight: 700; color: var(--ink); }
.helper { margin: -.4rem 0 .1rem; color: var(--muted); font-size: .95rem; }
textarea, input {
  width: 100%;
  min-height: 48px;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
textarea { min-height: 190px; resize: vertical; }
textarea::placeholder, input::placeholder { color: oklch(0.7 0.025 250); }
button {
  justify-self: start;
  min-height: 48px;
  padding: .8rem 1.05rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: transform 140ms var(--ease-out), filter 180ms var(--ease-out);
}
button:hover { filter: brightness(1.05); }
button:active { transform: scale(.97); }
button:disabled { cursor: wait; filter: saturate(.65); opacity: .78; }
.mind-item {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 1rem 1.1rem;
  margin: .75rem 0;
  background: oklch(0.18 0.022 255);
  transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out);
}
.mind-item::before {
  content: "";
  position: absolute;
  inset: 1rem auto auto -.26rem;
  width: .5rem;
  height: .5rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px oklch(0.82 0.19 145 / .12);
}
.mind-item-self::before { background: var(--accent); }
.mind-item-market::before { background: oklch(0.78 0.16 75); }
.mind-item-signal::before { background: oklch(0.76 0.13 225); }
.mind-item-note::before { background: var(--muted); }
.mind-item p { color: var(--ink); margin: .55rem 0 .65rem; }
.mind-item small {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .78rem;
}
.mind-item-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem .8rem;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .78rem;
}
.mind-item-meta span {
  color: var(--accent);
}
.mind-item-meta time { color: var(--muted); }
.mind-empty { color: var(--ink); }
.mind-feed {
  min-height: 7rem;
}
.mind-feed-large {
  display: flex;
  flex-direction: column;
  position: relative;
}
.mind-feed-large::before {
  content: "";
  position: absolute;
  inset: .85rem auto 1rem 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line) 1rem, var(--line) calc(100% - 1rem), transparent);
}
.public-status-section {
  padding-top: clamp(1.5rem, 5vw, 3rem);
}
.public-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .85rem;
}
.public-status-card {
  display: grid;
  min-height: 136px;
  gap: .85rem;
  align-content: space-between;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(0.18 0.022 255);
}
.public-status-card.pass {
  border-color: oklch(0.58 0.12 145);
}
.public-status-card.warn {
  border-color: oklch(0.52 0.06 250);
}
.public-status-card div {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: .75rem;
}
.public-status-card span {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .78rem;
}
.public-status-card strong {
  color: var(--ink);
  line-height: 1.1;
  text-align: right;
}
.public-status-card p {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.4;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.live-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .25rem .6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: .9rem;
  white-space: nowrap;
}
.market-panel {
  display: grid;
  width: min(100%, 860px);
  justify-self: center;
  grid-template-columns: minmax(0, .95fr) minmax(280px, 1.05fr);
  gap: clamp(1rem, 3vw, 1.4rem);
  padding: clamp(1rem, 3vw, 1.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, oklch(0.18 0.022 255), oklch(0.13 0.018 255));
}
.market-copy h2 {
  margin: .75rem 0 .35rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
}
.market-copy p:last-child {
  margin-bottom: 0;
}
.market-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}
.market-metrics div {
  min-height: 84px;
  display: grid;
  align-content: space-between;
  padding: .85rem;
  border: 1px solid oklch(0.34 0.036 255);
  border-radius: 10px;
  background: oklch(0.155 0.018 255);
}
.market-metrics span {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .78rem;
}
.market-metrics strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
}
:focus-visible { outline: 3px solid oklch(0.82 0.19 145 / .86); outline-offset: 3px; }

@media (max-width: 560px) {
  main { padding-inline: 1rem; }
  .hero { min-height: 50dvh; }
  .prompt-section, .chat-section { grid-template-columns: 1fr; }
  .chat-window { min-height: 560px; }
  .chat-header { flex-direction: column; align-items: stretch; }
  .chat-status { width: fit-content; }
  .composer-shell { grid-template-columns: 1fr; }
  .composer-shell button { justify-self: end; }
  .composer-actions { flex-direction: column; align-items: stretch; }
  .composer-actions input { flex: 0 0 auto; }
  .market-panel { grid-template-columns: 1fr; }
  .market-metrics { grid-template-columns: 1fr 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .message { max-width: 94%; }
}

@keyframes typing-pulse {
  0%, 80%, 100% { opacity: .35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-.14rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .typing-dots span { transform: none !important; opacity: .75; }
}
