@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500&display=swap');

/* ═══════════════════════════════════════
   MATHEW JOHNSON — Design System
   Cool-toned. Technical. Precise.
   ═══════════════════════════════════════ */

:root {
  --bg:          #080c14;
  --bg-2:        #0d1220;
  --bg-3:        #111827;
  --bg-card:     #0f1521;
  --border:      #1e2d45;
  --border-2:    #2a3f5f;
  --border-glow: rgba(79, 156, 249, 0.3);

  --text:        #e8edf5;
  --text-2:      #8899b4;
  --text-3:      #4d6180;

  --blue:        #4f9cf9;
  --blue-dim:    #2d6bb5;
  --blue-glow:   rgba(79, 156, 249, 0.08);
  --blue-glow-2: rgba(79, 156, 249, 0.15);
  --teal:        #00d4aa;
  --teal-dim:    rgba(0, 212, 170, 0.1);

  --mono: 'JetBrains Mono', monospace;
  --display: 'Plus Jakarta Sans', sans-serif;
  --body: 'Plus Jakarta Sans', sans-serif;

  --max: 860px;
  --radius: 3px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Atmospheric background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79,156,249,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 90% 80%, rgba(0,212,170,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle grid overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(79,156,249,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,156,249,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ── Layout ── */
.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes scanDown {
  0%   { transform: translateY(-100%); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(400px); opacity: 0; }
}

/* ── Header / Nav ── */
.site-header {
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.nav-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--blue);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.08em;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
  animation: pulse 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

/* ── Chat Prompt Block ── */
.chat-section {
  padding: 64px 0 48px;
  animation: fadeUp 0.7s ease forwards;
}

.chat-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-eyebrow::after {
  content: '';
  flex: 1;
  max-width: 48px;
  height: 1px;
  background: var(--blue-dim);
}

.chat-headline {
  font-family: var(--display);
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.chat-headline span {
  color: var(--blue);
}

.chat-sub {
  font-size: 15px;
  color: var(--text-2);
  margin-bottom: 28px;
  max-width: 540px;
  line-height: 1.6;
}

/* Sample questions */
.sample-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.sample-q {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 7px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  letter-spacing: 0.02em;
}

.sample-q:hover {
  border-color: var(--blue-dim);
  color: var(--blue);
  background: var(--blue-glow);
}

/* Chat input row */
.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.chat-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  font-family: var(--body);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input::placeholder {
  color: var(--text-3);
}

.chat-input:focus {
  border-color: var(--blue-dim);
  background: var(--bg-2);
}

.chat-send {
  background: var(--blue);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 14px 24px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chat-send:hover {
  background: #6aabff;
}

.chat-note {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  margin-top: 10px;
  letter-spacing: 0.04em;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ── Links Section ── */
.links-section {
  padding: 56px 0;
}

.section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 28px;
}

.product-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.product-link {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  text-decoration: none;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.product-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-dim), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-link:hover {
  border-color: var(--border-2);
  background: var(--bg-2);
  transform: translateY(-1px);
}

.product-link:hover::before {
  opacity: 1;
}

.product-link-name {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.product-link-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 16px;
}

.product-link-arrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue);
  letter-spacing: 0.06em;
}

/* ── CV Section ── */
.cv-section {
  padding: 56px 0 80px;
}

/* Flagship: Invisible Architecture */
.flagship {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}

.flagship-header {
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.flagship-left {}

.flagship-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}

.flagship-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.flagship-tagline {
  font-size: 13px;
  color: var(--text-2);
}

.flagship-badge {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--teal);
  border: 1px solid rgba(0,212,170,0.25);
  background: var(--teal-dim);
  border-radius: 2px;
  padding: 5px 10px;
  letter-spacing: 0.1em;
  white-space: nowrap;
  flex-shrink: 0;
}

.flagship-body {
  padding: 28px 32px;
}

.flagship-summary {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 640px;
}

/* Stack tags */
.stack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 4px 10px;
  letter-spacing: 0.06em;
  background: var(--bg-2);
}

.tag-blue {
  color: var(--blue);
  border-color: rgba(79,156,249,0.2);
  background: var(--blue-glow);
}

/* Brag accordions inside flagship */
.brag-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.brag-item {}

.brag-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  font-family: var(--body);
  font-size: 13px;
  text-align: left;
  border-top: 1px solid var(--border);
  transition: color 0.2s ease;
  gap: 12px;
}

.brag-trigger:hover {
  color: var(--text);
}

.brag-trigger-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brag-icon {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue);
  flex-shrink: 0;
}

.brag-plus {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.brag-trigger[aria-expanded="true"] .brag-plus {
  transform: rotate(45deg);
  color: var(--blue);
}

.brag-content {
  display: none;
  padding: 0 0 16px 24px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  border-left: 1px solid var(--border);
  margin-left: 6px;
  padding-left: 16px;
}

.brag-content.open {
  display: block;
}

/* Collapsed CV items */
.cv-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cv-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cv-item-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
  gap: 16px;
}

.cv-item-trigger:hover {
  background: var(--bg-2);
}

.cv-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cv-item-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  flex-shrink: 0;
  width: 24px;
}

.cv-item-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.cv-item-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 1px;
}

.cv-item-plus {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform 0.25s ease, color 0.2s ease;
}

.cv-item-trigger[aria-expanded="true"] .cv-item-plus {
  transform: rotate(45deg);
  color: var(--blue);
}

.cv-item-body {
  display: none;
  padding: 0 24px 24px 62px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.75;
}

.cv-item-body.open {
  display: block;
}

.cv-item-body p { margin-bottom: 12px; }
.cv-item-body p:last-child { margin-bottom: 0; }

.cv-item-body strong {
  color: var(--text);
  font-weight: 500;
}

.cv-stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.cv-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cv-stat-val {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: -0.02em;
}

.cv-stat-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.06em;
  position: relative;
  z-index: 2;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-storage {
  color: var(--text-3);
  font-size: 10px;
}

/* ══════════════════════════════════════
   CHAT PAGE
   ══════════════════════════════════════ */

.chat-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-page .site-header { flex-shrink: 0; }

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
  width: 100%;
  position: relative;
  z-index: 2;
}

/* Thread */
.chat-thread {
  flex: 1;
  padding: 32px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 60px 0;
  text-align: center;
  gap: 12px;
  animation: fadeIn 0.5s ease forwards;
}

.chat-empty-icon {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue);
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}

.chat-empty-title {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.chat-empty-sub {
  font-size: 13px;
  color: var(--text-2);
  max-width: 380px;
  line-height: 1.6;
}

.chat-empty-qs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
  max-width: 500px;
}

/* Messages */
.msg {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeUp 0.3s ease forwards;
}

.msg:first-child { border-top: 1px solid var(--border); }

.msg-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.msg-user .msg-label { color: var(--text-3); }
.msg-assistant .msg-label { color: var(--blue); }

.msg-body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-2);
}

.msg-assistant .msg-body {
  color: var(--text);
}

.msg-body p { margin-bottom: 10px; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body strong { color: var(--text); font-weight: 500; }

/* Typing indicator */
.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
  animation: pulse 1.4s ease-in-out infinite;
}

.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }

/* Chat footer input */
.chat-footer {
  padding: 20px 0 28px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-footer-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.chat-footer-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  font-family: var(--body);
  color: var(--text);
  outline: none;
  resize: none;
  min-height: 50px;
  max-height: 140px;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}

.chat-footer-input::placeholder { color: var(--text-3); }
.chat-footer-input:focus { border-color: var(--blue-dim); }

.chat-footer-send {
  background: var(--blue);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 14px 22px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: flex-end;
}

.chat-footer-send:hover { background: #6aabff; }
.chat-footer-send:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-footer-hint {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.chat-new-btn {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 5px 12px;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: all 0.2s ease;
}

.chat-new-btn:hover {
  color: var(--text);
  border-color: var(--border-2);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .product-links { grid-template-columns: 1fr; }
  .flagship-header { flex-direction: column; }
  .flagship-body { padding: 20px; }
  .flagship-header { padding: 20px; }
  .chat-input-row { flex-direction: column; }
  .chat-send { width: 100%; }
  .nav { flex-direction: column; align-items: flex-start; gap: 8px; }
  .site-footer { flex-direction: column; gap: 8px; text-align: center; }
  .cv-item-body { padding-left: 24px; }
  .chat-main { padding: 0 20px; }
}
