:root {
  /* Dark mode (default) */
  --bg: #070b11;
  --bg-elevated: #0f1725;
  --bg-soft: #111827;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --border-subtle: rgba(148, 163, 184, 0.3);
  --danger: #fb7185;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.8);
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* Pastel rainbow colors for sections - dark mode (subtle) */
  --pastel-red: rgba(255, 182, 193, 0.2);
  --pastel-orange: rgba(255, 218, 185, 0.2);
  --pastel-yellow: rgba(255, 250, 205, 0.2);
  --pastel-green: rgba(189, 252, 201, 0.2);
  --pastel-blue: rgba(174, 206, 250, 0.2);
  --pastel-indigo: rgba(199, 210, 254, 0.2);
  --pastel-violet: rgba(221, 214, 254, 0.2);
}

/* Light mode */
body.light-mode {
  --bg: #ffffff;
  --bg-elevated: #f8f9fa;
  --bg-soft: #f1f3f5;
  --text: #1a1a1a;
  --text-muted: #6c757d;
  --accent: #0d6efd;
  --accent-soft: rgba(13, 110, 253, 0.1);
  --border-subtle: rgba(0, 0, 0, 0.1);
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.1);
  
  /* Pastel rainbow colors for light mode (more vibrant) */
  --pastel-red: rgba(255, 182, 193, 0.4);
  --pastel-orange: rgba(255, 218, 185, 0.4);
  --pastel-yellow: rgba(255, 250, 205, 0.4);
  --pastel-green: rgba(189, 252, 201, 0.4);
  --pastel-blue: rgba(174, 206, 250, 0.4);
  --pastel-indigo: rgba(199, 210, 254, 0.4);
  --pastel-violet: rgba(221, 214, 254, 0.4);
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1e293b 0, #020617 55%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

body.light-mode {
  background: linear-gradient(to bottom, #f8f9fa 0, #ffffff 100%);
}

.container {
  width: min(1080px, 100% - 3rem);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.75),
    transparent
  );
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.32);
  transition: background 0.3s ease, border-color 0.3s ease;
}

body.light-mode .site-header {
  background: linear-gradient(
    to bottom,
    rgba(248, 249, 250, 0.96),
    rgba(248, 249, 250, 0.75),
    transparent
  );
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  padding: 1.25rem 0 1.4rem;
}

.profile-image {
  width: 112px;
  height: 112px;
  border-radius: 32px;
  object-fit: cover;
  border: 2px solid rgba(148, 163, 184, 0.5);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.8);
}

.intro {
  flex: 1;
}

.name {
  margin: 0 0 0.25rem;
  font-size: clamp(1.9rem, 3vw, 2.3rem);
  letter-spacing: 0.03em;
}

.tagline {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-weight: 500;
}

.location-contact {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.primary-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.primary-button {
  margin-top: 0.9rem;
  background: radial-gradient(circle at top left, #38bdf8 0, #0369a1 52%);
  color: #0b1120;
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.45);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(56, 189, 248, 0.6);
}

.link-button {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(56, 189, 248, 0.4);
}

.link-button:hover {
  background: rgba(56, 189, 248, 0.2);
  transform: translateY(-1px);
}

main {
  padding: 1.75rem 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: linear-gradient(145deg, #020617, #020617, #0b1120);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  transition: background 0.3s ease, border-color 0.3s ease;
}

body.light-mode .card {
  background: var(--bg-elevated);
}

/* Pastel rainbow backgrounds for each section */
#summary.card {
  background: linear-gradient(145deg, #020617, #020617, #0b1120);
  position: relative;
}

#summary.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, var(--pastel-red), transparent 70%);
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 0;
}

#summary.card > * {
  position: relative;
  z-index: 1;
}

body.light-mode #summary.card {
  background: linear-gradient(145deg, var(--bg-elevated), var(--bg-soft));
}

body.light-mode #summary.card::before {
  background: radial-gradient(circle at top right, var(--pastel-red), transparent 70%);
}

#education.card {
  background: linear-gradient(145deg, #020617, #020617, #0b1120);
  position: relative;
}

#education.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, var(--pastel-orange), transparent 70%);
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 0;
}

#education.card > * {
  position: relative;
  z-index: 1;
}

body.light-mode #education.card {
  background: linear-gradient(145deg, var(--bg-elevated), var(--bg-soft));
}

body.light-mode #education.card::before {
  background: radial-gradient(circle at top right, var(--pastel-orange), transparent 70%);
}

#experience.card {
  background: linear-gradient(145deg, #020617, #020617, #0b1120);
  position: relative;
}

#experience.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, var(--pastel-yellow), transparent 70%);
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 0;
}

#experience.card > * {
  position: relative;
  z-index: 1;
}

body.light-mode #experience.card {
  background: linear-gradient(145deg, var(--bg-elevated), var(--bg-soft));
}

body.light-mode #experience.card::before {
  background: radial-gradient(circle at top right, var(--pastel-yellow), transparent 70%);
}

#skills.card {
  background: linear-gradient(145deg, #020617, #020617, #0b1120);
  position: relative;
}

#skills.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, var(--pastel-green), transparent 70%);
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 0;
}

#skills.card > * {
  position: relative;
  z-index: 1;
}

body.light-mode #skills.card {
  background: linear-gradient(145deg, var(--bg-elevated), var(--bg-soft));
}

body.light-mode #skills.card::before {
  background: radial-gradient(circle at top right, var(--pastel-green), transparent 70%);
}

#certificates.card {
  background: linear-gradient(145deg, #020617, #020617, #0b1120);
  position: relative;
}

#certificates.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at top right, var(--pastel-blue), transparent 70%);
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 0;
}

#certificates.card > * {
  position: relative;
  z-index: 1;
}

body.light-mode #certificates.card {
  background: linear-gradient(145deg, var(--bg-elevated), var(--bg-soft));
}

body.light-mode #certificates.card::before {
  background: radial-gradient(circle at top right, var(--pastel-blue), transparent 70%);
}

.card h2 {
  margin-top: 0;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.card p {
  line-height: 1.6;
  color: var(--text);
}

.section-with-image {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
}

#summary .section-image {
  max-height: 300px;
  margin-bottom: 0.5rem;
}

.education-image {
  max-height: 250px;
  margin-bottom: 1rem;
}

.experience-image {
  max-height: 250px;
  margin-bottom: 1.25rem;
}

.skills-image {
  max-height: 250px;
  margin-bottom: 1.25rem;
}

.certificates-image {
  max-height: 250px;
  margin-bottom: 1.25rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.timeline {
  border-left: 1px solid rgba(148, 163, 184, 0.35);
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -1.48rem;
  top: 0.32rem;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at center, #38bdf8 0, #0f172a 52%);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.timeline-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.timeline-heading h3 {
  margin: 0;
  font-size: 1rem;
}

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

.timeline-subtitle {
  margin: 0.15rem 0 0.4rem;
  font-size: 0.9rem;
  color: var(--accent);
}

.edu-brief {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
}

.edu-details {
  margin: 0.1rem 0 0.3rem 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.edu-details-hidden {
  display: none;
}

.experience-item + .experience-item {
  border-top: 1px solid rgba(30, 64, 175, 0.5);
  margin-top: 0.9rem;
  padding-top: 0.9rem;
}

.experience-item header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.experience-item h3 {
  margin: 0;
  font-size: 1rem;
}

.experience-item .meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.experience-item ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.skills-grid h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: var(--accent);
}

.skills-grid ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.cert-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.cert-list li + li {
  margin-top: 0.25rem;
}

.muted {
  color: var(--text-muted);
}

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  padding: 1.2rem 0 1.6rem;
  background: radial-gradient(circle at bottom, #0f172a 0, #020617 60%);
  transition: background 0.3s ease, border-color 0.3s ease;
}

body.light-mode .site-footer {
  background: linear-gradient(to top, #f8f9fa 0, #ffffff 100%);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}


@media (max-width: 720px) {
  .header-content {
    padding: 1rem 0 1.2rem;
  }

  .header-content {
    flex-direction: row;
    align-items: flex-start;
  }

  .profile-image {
    width: 96px;
    height: 96px;
  }

  .experience-item header {
    flex-direction: column;
    align-items: flex-start;
  }

  .experience-item .meta {
    flex-wrap: wrap;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-with-image {
    flex-direction: column;
  }

  .section-image {
    max-height: 200px;
  }
}

/* --- Ask Chris chatbot --- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.ask-chris-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  background: radial-gradient(circle at top left, #38bdf8 0, #0369a1 52%);
  color: #0b1120;
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.ask-chris-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(56, 189, 248, 0.6);
}

body.light-mode .ask-chris-fab {
  background: radial-gradient(circle at top left, #0d6efd 0, #0a58ca 52%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(13, 110, 253, 0.35);
}

body.light-mode .ask-chris-fab:hover {
  box-shadow: 0 16px 40px rgba(13, 110, 253, 0.5);
}

.ask-chris-panel {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  z-index: 99;
  width: min(380px, calc(100vw - 3rem));
  max-height: min(420px, calc(100vh - 8rem));
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, #0b1120, #020617);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.ask-chris-panel-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem) scale(0.98);
  pointer-events: none;
}

body.light-mode .ask-chris-panel {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}

.ask-chris-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.ask-chris-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.ask-chris-close {
  padding: 0.25rem 0.5rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.12s ease, background 0.12s ease;
}

.ask-chris-close:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.ask-chris-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 120px;
  max-height: 240px;
}

.ask-chris-welcome {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.ask-chris-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0;
}

.ask-chris-suggestion {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.ask-chris-suggestion:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.ask-chris-suggestion:active {
  transform: translateY(0);
}

body.light-mode .ask-chris-suggestion {
  background: var(--bg-soft);
  border-color: var(--border-subtle);
}

body.light-mode .ask-chris-suggestion:hover {
  background: rgba(13, 110, 253, 0.1);
  border-color: rgba(13, 110, 253, 0.3);
}

.ask-chris-msg {
  margin: 0;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 90%;
  word-wrap: break-word;
}

.ask-chris-msg-user {
  align-self: flex-end;
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

body.light-mode .ask-chris-msg-user {
  border-color: rgba(13, 110, 253, 0.25);
}

.ask-chris-msg-assistant {
  align-self: flex-start;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border-subtle);
}

body.light-mode .ask-chris-msg-assistant {
  background: var(--bg-soft);
}

.ask-chris-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.ask-chris-input {
  flex: 1;
  min-height: 44px;
  max-height: 100px;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.ask-chris-input::placeholder {
  color: var(--text-muted);
}

.ask-chris-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ask-chris-send {
  align-self: flex-end;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--accent);
  color: #0b1120;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.ask-chris-send:hover:not(:disabled) {
  transform: translateY(-1px);
  opacity: 0.95;
}

.ask-chris-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

body.light-mode .ask-chris-send {
  background: var(--accent);
  color: #fff;
}

.ask-chris-loading {
  align-self: flex-start;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
}

.ask-chris-error {
  align-self: flex-start;
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--danger);
  background: rgba(251, 113, 133, 0.15);
  border: 1px solid rgba(251, 113, 133, 0.4);
}

@media (max-width: 480px) {
  .ask-chris-fab {
    bottom: 1rem;
    right: 1rem;
  }

  .ask-chris-panel {
    bottom: 4rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    max-height: min(400px, calc(100vh - 6rem));
  }
}

