:root {
  --sidebar-bg: #f6f7f9;           /* almost white */
  --page-bg: #ffffff;
  --content-bg: #ffffff;
  --border: #e2e4ea;               /* thin vertical line */
  --text-main: #1f2933;
  --text-muted: #6b7280;
  --link: #2563eb;
  --link-hover: #1d4ed8;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-card: 18px;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--text-main);
  background: var(--page-bg);
}

/* Layout */

.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */

.sidebar {
  width: 270px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border); /* thin grey vertical line */
  display: flex;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.sidebar-inner {
  max-width: 220px;
}

/* Avatar */

.avatar {
  text-align: center;
  margin-bottom: 1.5rem;
}

.avatar-circle {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  border-radius: 50%;
  background: #d4d4d8;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Sidebar text */

.name {
  margin: 1rem 0 0.3rem 0;
  font-size: 1.4rem;
  text-align: center;
}

.headline {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
}

.degree {
  margin: 0.6rem 0 1.1rem 0;
  font-size: 0.86rem;
  color: #4b5563;
  text-align: center;
}

.meta {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem 0;
  font-size: 0.9rem;
}

.meta li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.4rem;
}

.icon {
  width: 1.6rem;
  flex-shrink: 0;
}

/* Nav blocks */

.nav-block {
  margin-top: 1rem;
}

.nav-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.sidebar-links {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
}

.sidebar-links li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

/* "Material-ish" small chips */

.chip-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #374151;
  flex-shrink: 0;
}

/* Links */

.sidebar a,
a {
  color: var(--link);
  text-decoration: none;
}

.sidebar a:hover,
a:hover {
  color: var(--link-hover);
}

/* Main column */

.main-column {
  flex: 1;
  padding: 2rem 2.5rem;
  background: #f9fafb;
}

/* Topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.topbar-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Minimal hamburger (tighter, cleaner) */

.hamburger {
  border: none;
  background: var(--content-bg);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  display: flex;                 /* key: stack spans inside */
  flex-direction: column;        /* vertical */
  align-items: center;
  justify-content: center;
  gap: 3px;                      /* explicit spacing between lines */
  padding: 0;
  cursor: pointer;
}

.hamburger span {
  width: 18px;
  height: 2px;
  background: #111827;
  border-radius: 999px;
  display: block;
  margin: 0;                     /* no margin, we use gap on parent */
}

/* Hamburger dropdown */

.hamburger-menu {
  position: absolute;
  right: 2.5rem;
  top: 4.1rem;
  background: var(--content-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.4rem 0;
  box-shadow: var(--shadow);
  display: none;
  min-width: 150px;
  z-index: 10;
}

.hamburger-menu.open {
  display: block;
}

.hamburger-menu a {
  display: block;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
  color: var(--text-main);
  text-decoration: none;
}

.hamburger-menu a:hover {
  background: #eef2ff;
  color: var(--link);
}

/* Content card */

.content {
  background: var(--content-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.8rem 2.1rem 1.4rem 2.1rem;
}

.section {
  margin-bottom: 1.8rem;
}

.section h2 {
  margin-top: 0;
  margin-bottom: 0.7rem;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}

.section p {
  margin-top: 0;
  line-height: 1.6;
}

.section ul {
  margin-top: 0.4rem;
  padding-left: 1.2rem;
}

/* Project blocks */

.project {
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.project:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.project h3 {
  margin: 0 0 0.3rem 0;
  font-size: 1.02rem;
}

.project h3 a {
  text-decoration: none;
}

/* Footer */

.footer {
  margin-top: 1.4rem;
  padding-top: 0.8rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Responsive */

@media (max-width: 880px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 1.25rem;
  }

  .sidebar-inner {
    max-width: none;
  }

  .avatar-circle {
    width: 130px;
    height: 130px;
  }

  .main-column {
    padding: 1.5rem 1.25rem 2rem 1.25rem;
  }

  .hamburger-menu {
    right: 1.25rem;
  }
}

/* ===== Chat assistant widget ===== */

.chat-card {
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
  height: 420px;                 /* fixed height */
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #f9fafb;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header with tiny status orb */
.chat-header {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #ffffff;
}

.chat-orb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #e0f2fe, #60a5fa);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.65);
  flex-shrink: 0;
}

.chat-title-main {
  font-size: 0.9rem;
  font-weight: 600;
}

.chat-title-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Messages area (scrollable) */
.chat-messages {
  flex: 1;
  padding: 0.8rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: #f9fafb;
}

/* Message rows */
.message-row {
  display: flex;
  width: 100%;
}

.message-row.assistant {
  justify-content: flex-start;
}

.message-row.user {
  justify-content: flex-end;
}

/* Bubbles */
.message-bubble {
  max-width: 72%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  border-radius: 16px;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
}

.message-bubble.assistant {
  background: #e5e7eb;
  color: #111827;
  border-bottom-left-radius: 4px;
}

.message-bubble.user {
  background: #dbeafe;
  color: #0f172a;
  border-bottom-right-radius: 4px;
}

/* Tick / status line */
.message-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  align-self: flex-end;
}

/* Input row */
.chat-input-row {
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 0.55rem 0.7rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.chat-input-row textarea {
  flex: 1;
  resize: none;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.45rem 0.75rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  min-height: 40px;
  max-height: 80px;
  outline: none;
  background: #f9fafb;
}

.chat-input-row textarea:focus {
  border-color: var(--link);
  background: #ffffff;
}

.chat-input-row button {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.45);
}

.chat-input-row button:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

/* Orb simple states */
.chat-orb.state-idle {
  opacity: 0.9;
}

.chat-orb.state-typing {
  animation: orb-pulse 1.4s ease-in-out infinite;
}

.chat-orb.state-error {
  background: radial-gradient(circle at 30% 30%, #fee2e2, #ef4444);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.8);
}

@keyframes orb-pulse {
  0%   { transform: scale(1);   box-shadow: 0 0 6px rgba(37,99,235,0.5); }
  50%  { transform: scale(1.12); box-shadow: 0 0 10px rgba(37,99,235,0.9); }
  100% { transform: scale(1);   box-shadow: 0 0 6px rgba(37,99,235,0.5); }
}
