/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --bg-card: #131313;
  --text: #f0ede8;
  --text-dim: #6b6b6b;
  --text-muted: #9a9a9a;
  --accent: #c8a96e;
  --accent-dim: rgba(200, 169, 110, 0.15);
  --border: rgba(240, 237, 232, 0.08);
  --border-strong: rgba(240, 237, 232, 0.16);

  --max-w: 1180px;
  --section-py: clamp(5rem, 10vw, 9rem);
  --radius: 14px;
  --radius-sm: 8px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 180ms;
  --t-med: 320ms;
  --t-slow: 600ms;

  font-size: 16px;
}

/* =========================================================
   RESET / BASE
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; color: inherit; cursor: pointer; }
ul { list-style: none; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; }
strong { color: var(--text); font-weight: 600; }
::selection { background: var(--accent); color: var(--bg); }

/* =========================================================
   LAYOUT
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: var(--section-py) 0;
  position: relative;
}

.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
  position: relative;
  padding-left: 2.25rem;
}
.section-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
}

.section-heading {
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin-bottom: 3rem;
  color: var(--text);
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
}
.btn--primary:hover {
  transform: translateY(-2px);
  background: #d4b87b;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
}

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background var(--t-med) var(--ease),
              backdrop-filter var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom-color: var(--border);
}

.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.nav__logo:hover { color: var(--accent); }

.nav__links {
  display: flex;
  gap: 2.25rem;
  align-items: center;
}
.nav__links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color var(--t-fast) var(--ease);
  position: relative;
}
.nav__links a:hover { color: var(--text); }

.nav__cta {
  color: var(--accent) !important;
  border: 1px solid var(--accent-dim);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast) var(--ease) !important;
}
.nav__cta:hover {
  background: var(--accent-dim);
}

.nav__hamburger {
  display: none;
  width: 28px;
  height: 22px;
  flex-direction: column;
  justify-content: space-between;
  padding: 0;
}
.nav__hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text);
  transition: transform var(--t-fast) var(--ease),
              opacity var(--t-fast) var(--ease);
}
.nav__hamburger.is-open span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
.nav__hamburger.is-open span:nth-child(2) {
  opacity: 0;
}
.nav__hamburger.is-open span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

.nav__mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem;
  transform: translateY(-12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease),
              transform var(--t-med) var(--ease);
}
.nav__mobile.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.nav__mobile ul { display: flex; flex-direction: column; gap: 1.25rem; }
.nav__mobile a {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
}
.nav__mobile a:hover { color: var(--accent); }

/* =========================================================
   HERO — AI APP INTERFACE
   ========================================================= */
.body--app {
  height: 100dvh;
  overflow: hidden;
}

.hero {
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1.25rem;
  overflow: hidden;
}

/* Ambient orb background */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.55;
  will-change: transform;
}
.hero__orb--1 {
  width: 560px;
  height: 560px;
  background: radial-gradient(circle, rgba(200, 169, 110, 0.45), transparent 70%);
  top: -180px;
  right: -140px;
  animation: drift1 26s ease-in-out infinite alternate;
}
.hero__orb--2 {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(120, 90, 200, 0.22), transparent 70%);
  bottom: -200px;
  left: -120px;
  animation: drift2 32s ease-in-out infinite alternate;
}
@keyframes drift1 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-80px, 60px) scale(1.15); }
}
@keyframes drift2 {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(120px, -80px) scale(1.1); }
}

/* The "app" itself */
.ai-app {
  position: relative;
  z-index: 2;
  width: 100%;
  height: calc(100dvh - 2.5rem);
  background: rgba(17, 17, 17, 0.78);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  display: grid;
  grid-template-columns: 260px 1fr;
  overflow: hidden;
}

/* ---- SIDEBAR ---- */
.ai-sidebar {
  background: rgba(8, 8, 8, 0.6);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  gap: 0.5rem;
}

.ai-sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.ai-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.ai-brand__mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ai-brand__dot { color: var(--accent); }

.ai-new-chat {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast) var(--ease);
}
.ai-new-chat:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.ai-history {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.25rem;
  overflow-y: auto;
  flex: 1;
}
.ai-history__label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.5rem 0.6rem 0.4rem;
}

.ai-chat-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-chat-item__icon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  transition: background var(--t-fast) var(--ease);
}
.ai-chat-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}
.ai-chat-item:hover .ai-chat-item__icon {
  background: var(--text-muted);
}
.ai-chat-item--active {
  background: rgba(200, 169, 110, 0.1);
  color: var(--text);
}
.ai-chat-item--active .ai-chat-item__icon {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.ai-sidebar__bottom {
  padding: 0.75rem 0.5rem 0.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}
.ai-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem;
  border-radius: 8px;
}
.ai-user__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8a6f3f);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.ai-user__name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.2;
}
.ai-user__plan {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.3;
}

/* ---- MAIN PANEL ---- */
.ai-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.ai-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.01);
  flex-shrink: 0;
}

.ai-sidebar-toggle {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid var(--border);
  margin-right: 0.5rem;
}
.ai-sidebar-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.ai-model {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease);
  position: relative;
  user-select: none;
}
.ai-model:hover,
.ai-model.is-open { border-color: var(--accent); }
.ai-model__label { color: var(--text-dim); }
.ai-model__name {
  color: var(--text);
  font-weight: 500;
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
  font-size: 0.78rem;
  letter-spacing: -0.01em;
}
.ai-model__chevron {
  color: var(--text-dim);
  transition: transform var(--t-fast) var(--ease);
}
.ai-model.is-open .ai-model__chevron { transform: rotate(180deg); }

/* Dropdown */
.ai-model__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: rgba(18, 18, 18, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0.4rem;
  z-index: 200;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  animation: dropIn 180ms var(--ease);
}
.ai-model.is-open .ai-model__dropdown { display: flex; flex-direction: column; gap: 0.15rem; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.model-option {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.8rem;
  border-radius: 7px;
  text-align: left;
  background: transparent;
  transition: background var(--t-fast) var(--ease);
  cursor: pointer;
  font-family: inherit;
  border: none;
}
.model-option:hover { background: rgba(255, 255, 255, 0.05); }
.model-option--active { background: var(--accent-dim); }
.model-option--active:hover { background: var(--accent-dim); }
.model-option__name {
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text);
  letter-spacing: -0.01em;
}
.model-option--active .model-option__name { color: var(--accent); }
.model-option__sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.ai-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5ec486;
  box-shadow: 0 0 8px rgba(94, 196, 134, 0.7);
  animation: status-pulse 2s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* ---- THREAD ---- */
.ai-thread {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  padding: 2rem 1.75rem 1rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---- VIEWS ---- */
.ai-view {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  animation: viewIn 380ms var(--ease);
}
.ai-view--active { display: flex; }
@keyframes viewIn {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Section labels inside views */
.ai-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.35rem;
}
.ai-section-sub {
  font-size: 0.92rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

/* Long-form paragraphs in About view */
.ai-paragraphs {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.ai-paragraphs p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Inline fast-facts grid */
.ai-facts-inline {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.ai-fact { display: flex; flex-direction: column; gap: 0.15rem; }
.ai-fact__label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.ai-fact__value {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
}

.ai-pill-accent {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.5rem 1rem;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
}

/* Contact view styling */
.ai-contact-heading {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #b6b3ad 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ai-contact-sub {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.75rem;
  max-width: 540px;
}
.ai-contact-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.ai-contact-location {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.ai-contact-location svg { color: var(--accent); }

/* Override section-level overrides for inline content */
.ai-view .timeline { padding-left: 1.75rem; margin-top: 0.5rem; }
.ai-view .timeline-dot { left: -1.75rem; }
.ai-view .timeline-content { padding: 1.25rem; }
.ai-view .timeline-company { font-size: 1.15rem; }
.ai-view .timeline-item { padding-bottom: 1.75rem; }

.ai-view .projects-grid {
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}
@media (min-width: 1100px) {
  .ai-view .projects-grid { grid-template-columns: repeat(2, 1fr); }
}
.ai-view .project-card { padding: 1.5rem; }

.ai-view .skills-grid {
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 0.5rem;
}
@media (min-width: 900px) {
  .ai-view .skills-grid { grid-template-columns: 1fr 1fr; gap: 3rem; }
}
.ai-view .skills-col-heading {
  font-size: 0.78rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
}

/* Make the sidebar "chat items" clickable buttons look identical to anchors */
button.ai-chat-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.ai-msg {
  display: flex;
  gap: 0.85rem;
  max-width: 720px;
}
.ai-msg--user {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.ai-msg__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}
.ai-msg__avatar--user {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.ai-msg__avatar--ai {
  background: linear-gradient(135deg, var(--accent), #8a6f3f);
  color: var(--bg);
  box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.12);
}

.ai-msg__bubble {
  background: rgba(200, 169, 110, 0.08);
  border: 1px solid rgba(200, 169, 110, 0.18);
  color: var(--text);
  padding: 0.7rem 1rem;
  border-radius: 14px 14px 4px 14px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.ai-msg__content {
  flex: 1;
  min-width: 0;
}

.ai-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.ai-name {
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.85rem;
  background: linear-gradient(180deg, #ffffff 0%, #b6b3ad 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ai-title {
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1rem;
}
.ai-title__sep { color: var(--accent); }

.ai-bio {
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 560px;
}

.ai-cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: var(--accent);
  margin-left: 4px;
  vertical-align: -2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* ---- PROMPT AREA ---- */
.ai-prompt-area {
  padding: 0.75rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.ai-suggestions {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.ai-suggestion {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text);
  transition: all var(--t-fast) var(--ease);
  flex: 1 1 auto;
  min-width: 200px;
}
.ai-suggestion:hover {
  border-color: var(--accent);
  background: rgba(200, 169, 110, 0.08);
  transform: translateY(-1px);
}
.ai-suggestion__icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(200, 169, 110, 0.12);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-suggestion__label { flex: 1; font-weight: 500; }
.ai-suggestion__hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ai-input {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0.55rem 0.6rem 0.55rem 0.85rem;
  transition: border-color var(--t-fast) var(--ease);
}
.ai-input:focus-within { border-color: var(--accent); }
.ai-input__icon {
  color: var(--text-dim);
  display: inline-flex;
}
.ai-input__field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.4rem 0;
}
.ai-input__field::placeholder { color: var(--text-dim); }
.ai-input__send {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.ai-input__send:hover {
  transform: translateY(-1px);
  background: #d4b87b;
}

.ai-disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.65rem;
  letter-spacing: 0.01em;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 880px) {
  .hero { padding: 0; }
  .ai-app {
    grid-template-columns: 1fr;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .ai-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    z-index: 10;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform var(--t-med) var(--ease);
    background: rgba(8, 8, 8, 0.97);
  }
  .ai-app.is-sidebar-open .ai-sidebar {
    transform: translateX(0);
  }
  .ai-sidebar-toggle { display: inline-flex; }
  .ai-thread { padding: 1.5rem 1rem 0.75rem; }
  .ai-prompt-area { padding: 0.6rem 1rem 1rem; }
  .ai-topbar { padding: 0.75rem 1rem; }
  .ai-suggestion { min-width: 0; flex: 1 1 100%; }
  .ai-msg { max-width: 100%; }
}

@media (max-width: 480px) {
  .ai-model__label { display: none; }
  .ai-status__text { display: none; }
  .ai-thread { padding: 1.25rem 0.85rem 0.5rem; }
  .ai-prompt-area { padding: 0.5rem 0.85rem 0.85rem; }
  .ai-facts-inline { grid-template-columns: 1fr; }
  .ai-name { font-size: 2rem; }
  .skills-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .timeline-content { padding: 1rem; }
}

/* =========================================================
   ABOUT
   ========================================================= */
.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

.about__bio p {
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-bottom: 1.25rem;
}

.about__open-badge {
  display: inline-block;
  margin-top: 0.5rem !important;
  padding: 0.5rem 1rem;
  background: var(--accent-dim);
  color: var(--accent) !important;
  border-radius: 999px;
  font-size: 0.85rem !important;
  font-weight: 500;
}

.facts-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.fact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.fact-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  color: var(--accent);
  flex-shrink: 0;
}

.fact-label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.15rem;
}
.fact-value {
  font-size: 1rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.4;
}

@media (min-width: 900px) {
  .about__grid {
    grid-template-columns: 1.4fr 1fr;
    gap: 5rem;
  }
}

/* =========================================================
   TIMELINE
   ========================================================= */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(180deg,
    var(--accent) 0%,
    var(--border-strong) 30%,
    var(--border) 100%);
}

.timeline-item {
  position: relative;
  padding-bottom: 3rem;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
  z-index: 1;
}

.timeline-item:first-child .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(200, 169, 110, 0.15);
}

.timeline-dot__pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulse 2.4s ease-out infinite;
  opacity: 0;
}
@keyframes pulse {
  0%   { transform: scale(0.7); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--t-med) var(--ease),
              transform var(--t-med) var(--ease);
}
.timeline-content:hover {
  border-color: var(--border-strong);
  transform: translateX(4px);
}

.timeline-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
  background: var(--accent-dim);
  color: var(--accent);
}

.timeline-company {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.timeline-role {
  font-size: 0.92rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.85rem;
  letter-spacing: 0.005em;
}
.timeline-dates {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.82rem;
}

.timeline-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

@media (min-width: 768px) {
  .timeline { padding-left: 2.5rem; }
  .timeline-dot { left: -2.5rem; }
}

/* =========================================================
   PROJECTS
   ========================================================= */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 1.75rem; }
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease),
              background var(--t-med) var(--ease);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-strong);
  background: var(--bg-elev);
}
.project-card:hover::before { opacity: 1; }

.project-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-tag {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 500;
}

.project-status {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.project-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.project-status--live   { background: rgba(94, 196, 134, 0.12); color: #5ec486; }
.project-status--dev    { background: rgba(200, 169, 110, 0.14); color: var(--accent); }
.project-status--active { background: rgba(120, 160, 255, 0.12); color: #7da4ff; }

.project-name {
  font-size: 1.5rem;
  margin-top: 0.25rem;
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
  flex-grow: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.project-tag-pill {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
}

.project-card__footer {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.project-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.project-github {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.project-github:hover { color: var(--text); }

.project-tech {
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* =========================================================
   SKILLS
   ========================================================= */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
@media (min-width: 768px) {
  .skills-grid { grid-template-columns: 1fr 1fr; gap: 4rem; }
}

.skills-col-heading {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.pill {
  display: inline-block;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
  cursor: default;
}
.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* =========================================================
   CONTACT
   ========================================================= */
.contact__inner {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}
.contact__inner .section-label { padding-left: 0; }
.contact__inner .section-label::before { display: none; }
.contact__inner .section-heading {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 1.5rem;
}

.contact__sub {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.contact__buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.contact__location {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.contact__location svg { color: var(--accent); }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}
.footer__text {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.02em;
}

/* =========================================================
   FADE / SCROLL ANIMATIONS
   ========================================================= */
.fade-in,
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--t-slow) var(--ease),
              transform var(--t-slow) var(--ease);
}
.fade-in.is-visible,
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero AI app entrance */
.ai-app.fade-up { transition-delay: 0.1s; }

/* =========================================================
   RESPONSIVE NAV
   ========================================================= */
@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }
  .nav__mobile { display: block; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .fade-in, .fade-up {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
   CHAT BUBBLES (fake AI response)
   ========================================================= */
.ai-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 180px;
  overflow-y: auto;
  padding: 0 0 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.ai-chat-messages:empty { display: none; }

.chat-bubble {
  max-width: 85%;
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  animation: bubbleIn 280ms var(--ease) both;
}

.chat-bubble--user {
  align-self: flex-end;
  background: var(--accent);
  color: var(--bg);
  border-bottom-right-radius: 4px;
}

.chat-bubble--ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-bubble--ai a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.chat-bubble--ai a:hover { color: #d4b87b; }

.chat-bubble__label {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}

/* Typing indicator */
.typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 0.15rem 0;
}
.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: dotPulse 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotPulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.85); }
  30% { opacity: 1; transform: scale(1); }
}

@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   BOOKS / READING LIST
   ========================================================= */
.books-section { margin-bottom: 1.5rem; }
.books-section:last-of-type { margin-bottom: 1.25rem; }

.books-section__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.books-section__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.books-section__dot--reading { background: var(--accent); }
.books-section__dot--done    { background: var(--green, #5ec486); }
.books-section__dot--list    { background: var(--text-dim); }

.books-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.book-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 200ms var(--ease);
}
.book-card:hover { border-color: var(--accent-dim); }

.book-card__icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.book-card__info { flex: 1; min-width: 0; }

.book-card__title {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card__author {
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* Suggest a book */
.books-suggest {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.books-suggest__label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.books-suggest__form {
  display: flex;
  gap: 0.5rem;
}

.books-suggest__input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 150ms var(--ease);
}
.books-suggest__input:focus { border-color: var(--accent); }
.books-suggest__input::placeholder { color: var(--text-dim); }

.books-suggest__thanks {
  font-size: 0.82rem;
  color: var(--accent);
  margin-top: 0.5rem;
  min-height: 1.2em;
}
