:root {
  color-scheme: dark;
  --bg: #0f1110;
  --ink: #f5f2ea;
  --muted: #aeb8b1;
  --line: rgba(245, 242, 234, 0.14);
  --panel: rgba(22, 27, 25, 0.76);
  --panel-solid: #171d1b;
  --soft: rgba(245, 242, 234, 0.06);
  --green: #66d7a7;
  --gold: #f2c66d;
  --blue: #84a9ff;
  --coral: #ff806f;
  --shadow: 0 28px 86px rgba(0, 0, 0, 0.42);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 18%, rgba(102, 215, 167, 0.18), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(132, 169, 255, 0.14), transparent 27%),
    linear-gradient(180deg, #101311 0%, #0f1110 52%, #111412 100%);
  line-height: 1.5;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(245, 242, 234, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 242, 234, 0.035) 1px, transparent 1px);
  background-size: 38px 38px;
  content: "";
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 74%);
}

a,
button,
input {
  font: inherit;
}

a {
  color: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 18px clamp(18px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(15, 17, 16, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(12px, 3vw, 26px);
  color: var(--muted);
  font-size: 0.94rem;
}

.nav a {
  text-decoration: none;
}

.nav a:hover {
  color: var(--green);
}

.experience {
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(340px, 0.95fr) minmax(260px, 0.5fr);
  gap: clamp(18px, 3vw, 32px);
  min-height: calc(100vh - 77px);
  padding: clamp(30px, 6vw, 78px) clamp(18px, 5vw, 72px);
}

.intro {
  align-self: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(3.1rem, 6.8vw, 6.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.8vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.lede {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.7vw, 1.22rem);
}

.chat-shell,
.context-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(245, 242, 234, 0.08), rgba(245, 242, 234, 0.035)),
    var(--panel);
  box-shadow: var(--shadow);
}

.chat-shell {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto auto;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.chat-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-header p,
.chat-header span,
.memory-list p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(102, 215, 167, 0.8);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 12px rgba(102, 215, 167, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(102, 215, 167, 0);
  }
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding: 20px;
}

.message {
  max-width: 86%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 15px;
  background: rgba(245, 242, 234, 0.055);
}

.message.ai {
  align-self: flex-start;
}

.message.user {
  align-self: flex-end;
  border-color: rgba(132, 169, 255, 0.38);
  background: rgba(132, 169, 255, 0.12);
}

.message strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.message p {
  margin: 0;
}

.typing {
  width: fit-content;
  color: var(--muted);
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 20px 18px;
}

.prompt-chips button,
.ask-box button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  padding: 10px 13px;
  font-weight: 800;
}

.prompt-chips button:hover,
.ask-box button:hover {
  border-color: rgba(102, 215, 167, 0.58);
  background: rgba(102, 215, 167, 0.12);
}

.ask-box {
  display: grid;
  gap: 9px;
  padding: 18px 20px 20px;
  border-top: 1px solid var(--line);
}

.ask-box label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ask-box div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.ask-box input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--ink);
}

.ask-box input:focus,
.prompt-chips button:focus,
.ask-box button:focus {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.context-panel {
  align-self: center;
  padding: 20px;
}

.context-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.18);
}

.context-card span {
  display: inline-flex;
  margin-bottom: 44px;
  color: var(--coral);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.context-card p {
  margin: 16px 0 0;
  color: var(--muted);
}

.memory-list {
  margin-top: 18px;
}

.memory-list ul {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.memory-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 1120px) {
  .experience {
    grid-template-columns: 1fr 1.15fr;
  }

  .context-panel {
    grid-column: 1 / -1;
    align-self: stretch;
  }
}

@media (max-width: 780px) {
  .site-header {
    position: static;
    align-items: flex-start;
  }

  .experience {
    grid-template-columns: 1fr;
  }

  .chat-shell {
    grid-template-rows: auto minmax(300px, 54vh) auto auto;
  }

  .message {
    max-width: 94%;
  }
}

@media (max-width: 480px) {
  .ask-box div {
    grid-template-columns: 1fr;
  }

  .ask-box button {
    border-radius: 6px;
  }
}
