:root {
  /* Apple-esque: warm paper + forest graphite + sage accent (light mode) */
  --bg: hsl(80 15% 98%);
  --card: hsl(80 18% 99%);
  --text: hsl(150 10% 18%);
  --muted: hsl(150 8% 38%);
  --accent: hsl(145 25% 42%);

  /* Hairline borders + soft rings */
  --border: hsla(150, 10%, 18%, 0.10);
  --border-strong: hsla(150, 10%, 18%, 0.16);
  --ring: hsla(145, 25%, 42%, 0.22);

  /* Subtle surfaces */
  --surface-hover: hsla(150, 10%, 18%, 0.035);
  --shadow-sm: 0 1px 2px hsla(150, 10%, 18%, 0.06);
  --shadow-md: 0 16px 48px hsla(150, 10%, 18%, 0.10);
  --shadow-popover: 0 18px 55px hsla(150, 10%, 18%, 0.14);
}

/* Explicit theme control (set by JS). */
:root[data-theme="dark"] {
  /* Dark mode: deep green-black + soft sage highlights */
  --bg: hsl(150 10% 8%);
  --card: hsl(150 10% 10%);
  --text: hsl(80 15% 96%);
  --muted: hsl(80 8% 72%);
  --accent: hsl(145 25% 55%);

  --border: hsla(80, 15%, 96%, 0.12);
  --border-strong: hsla(80, 15%, 96%, 0.18);
  --ring: hsla(145, 25%, 55%, 0.24);

  --surface-hover: hsla(80, 15%, 96%, 0.06);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 60px rgba(0, 0, 0, 0.55);
  --shadow-popover: 0 22px 70px rgba(0, 0, 0, 0.65);
}

/* If JS is disabled, fall back to OS preference. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: hsl(150 10% 8%);
    --card: hsl(150 10% 10%);
    --text: hsl(80 15% 96%);
    --muted: hsl(80 8% 72%);
    --accent: hsl(145 25% 55%);

    --border: hsla(80, 15%, 96%, 0.12);
    --border-strong: hsla(80, 15%, 96%, 0.18);
    --ring: hsla(145, 25%, 55%, 0.24);

    --surface-hover: hsla(80, 15%, 96%, 0.06);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 18px 60px rgba(0, 0, 0, 0.55);
    --shadow-popover: 0 22px 70px rgba(0, 0, 0, 0.65);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
  text-underline-offset: 3px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.brand-title {
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
}

.nav-contact {
  position: relative;
}

.contact-toggle {
  padding: 6px 2px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.contact-toggle:hover {
  opacity: 0.7;
}

.contact-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.contact-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  padding: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow-popover);
  z-index: 100;
}

:root[data-theme="dark"] .contact-menu {
  box-shadow: var(--shadow-popover);
}

.contact-menu-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 10px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}

.contact-menu-item:hover {
  text-decoration: none;
  background: var(--surface-hover);
}

:root[data-theme="dark"] .contact-menu-item:hover {
  background: var(--surface-hover);
}

.contact-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.contact-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.contact-label {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav-links a {
  padding: 6px 2px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: opacity 0.2s ease;
}

.nav-links a:hover {
  opacity: 0.7;
}

.nav-links a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  background: var(--surface-hover);
}

:root[data-theme="dark"] .theme-toggle:hover {
  background: var(--surface-hover);
}

.theme-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Stack intro above chat for a slim prompt bar */
.layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 16px 44px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

.intro-card {
  max-width: 100%;
  padding: 0;
}

.intro-card,
.chat-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.intro-card:not(.hero) h1 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.intro-card:not(.hero) p {
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.5;
}

.hero {
  padding-top: 6px;
  padding-bottom: 8px;
  text-align: center;
}

.hero-name {
  margin: 14px 0 6px;
  /* Match the top-left “tracked” look, but keep normal casing */
  font-size: clamp(32px, 3.3vw, 49px);
  line-height: 1.05;
  letter-spacing: 0.03em;
  font-weight: 400;
  text-transform: none;
}

.hero-title {
  /* Slightly smaller than the name (like the reference) */
  /* Smaller, but never smaller than the tagline text (18px) */
  font-size: clamp(18px, 2.1vw, 30px);
  line-height: 1.2;
  font-weight: 300;
  margin-bottom: 6px;
}

.hero-tagline {
  margin: 0 auto 12px;
  max-width: 740px;
  font-size: 18px;
  line-height: 1.45;
  color: var(--text);
  opacity: 0.72;
}

.hero-contact {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 14px;
  color: var(--text);
  opacity: 0.9;
}

/* Minimal “more below” hint */
.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  color: var(--text);
  opacity: 0.32;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 40;
}

.scroll-hint.is-hidden {
  opacity: 0;
}

.scroll-hint svg {
  width: 18px;
  height: 18px;
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-hint {
    animation: scrollHintFloat 1.8s ease-in-out infinite;
  }
  @keyframes scrollHintFloat {
    0%,
    100% {
      transform: translateX(-50%) translateY(0);
    }
    50% {
      transform: translateX(-50%) translateY(4px);
    }
  }
}

.hero-contact-item {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.02em;
}

.hero-contact a:hover {
  opacity: 0.7;
  text-decoration: none;
}

.hero-contact-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--text) 88%, transparent);
}

.hero-contact-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.hero-contact-text {
  line-height: 1.1;
}

.chat-card {
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  background: var(--card);
  overflow: hidden; /* keep dividers flush */
  box-shadow: var(--shadow-md);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 500;
}

.chat-header-icon {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
}

.chat-header-title {
  color: var(--text);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.chip:hover {
  background: var(--surface-hover);
}

.chat-log {
  min-height: 260px;
  max-height: min(520px, 54vh);
  overflow-y: auto;
  padding: 18px;
  background: var(--card);
  border: none;
  border-radius: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-log::-webkit-scrollbar {
  width: 10px;
}

.chat-log::-webkit-scrollbar-thumb {
  background: rgba(10, 10, 10, 0.22);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}

.msg {
  padding: 12px 14px;
  border-radius: 18px;
  max-width: 85%;
  line-height: 1.6;
  font-size: 15px;
}

.msg.user {
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  color: var(--text);
  align-self: flex-end;
}

.msg.bot {
  background: var(--card);
  border: 1px solid var(--border-strong);
  align-self: flex-start;
  color: var(--text);
}

.msg-body {
  color: inherit;
}

/* Markdown formatting in bot messages */
.msg.bot .msg-body h1,
.msg.bot .msg-body h2,
.msg.bot .msg-body h3 {
  margin: 16px 0 4px 0; /* more space above headers, less below to stay close to content */
  font-weight: 600;
  line-height: 1.3;
}

.msg.bot .msg-body h2:first-child,
.msg.bot .msg-body h3:first-child {
  margin-top: 0; /* remove top margin for first header */
}

.msg.bot .msg-body h1 {
  font-size: 18px;
}

.msg.bot .msg-body h2 {
  font-size: 16px;
}

.msg.bot .msg-body h3 {
  font-size: 15px;
}

.msg.bot .msg-body p {
  margin: 0 0 14px 0; /* more space between paragraphs */
  line-height: 1.5;
}

.msg.bot .msg-body p:last-child {
  margin-bottom: 0;
}

.msg.bot .msg-body strong {
  font-weight: 600;
  color: var(--text);
}

.msg.bot .msg-body em {
  font-style: italic;
}

.msg.bot .msg-body ul {
  margin: 4px 0 12px 0; /* space after list for paragraphs */
  padding-left: 22px;
  list-style-type: disc;
}

.msg.bot .msg-body ul:last-child {
  margin-bottom: 0;
}

.msg.bot .msg-body li {
  margin: 0; /* no gaps between bullets for tighter formatting */
  line-height: 1.2; /* tighter line spacing */
}

.msg.bot .msg-body a {
  color: var(--accent);
  text-decoration: underline;
}

.msg.bot .msg-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  font-size: 0.92em;
  padding: 0.12em 0.38em;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in hsl, var(--bg) 70%, var(--card));
}

.msg.bot .msg-body pre {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in hsl, var(--bg) 70%, var(--card));
  overflow: auto;
}

.msg.bot .msg-body pre code {
  border: none;
  padding: 0;
  background: transparent;
}

.msg-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  text-align: right;
  display: none; /* screenshot-style: no timestamps */
}

.chat-form {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  align-items: center;
  border-top: 1px solid var(--border);
}

.chat-form input {
  flex: 1;
  padding: 10px 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-form input:focus {
  outline: none;
  box-shadow: none;
}

.send-button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.send-button:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.resume {
  padding-top: 36px;
}

.resume-section {
  padding: 36px 0 10px;
}

.resume-section h2 {
  margin: 0 0 22px;
  text-align: center;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 14px 0 14px;
}

.resume-grid {
  display: grid;
  gap: 18px;
}

.resume-grid--one {
  grid-template-columns: 1fr;
}

.resume-grid--two {
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.resume-card {
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--card);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
}

/* Subtle reveal-on-scroll (Lovable-like). No layout changes. */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 420ms ease, transform 420ms ease;
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.resume-card-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 8px;
}

.resume-card-kicker {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.resume-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.resume-card-subtitle {
  font-size: 15px;
  color: var(--text);
  opacity: 0.9;
  margin-top: 2px;
}

.resume-card-status {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
  opacity: 0.9;
}

.resume-card-meta {
  font-size: 14px;
  color: var(--text);
  opacity: 0.8;
  white-space: nowrap;
}

.resume-bullets {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text);
  opacity: 0.92;
}

.resume-bullets.is-collapsed .is-extra {
  display: none;
}

.resume-card-toggle {
  margin-top: 10px;
  padding: 0;
  border: none;
  background: transparent;
  color: color-mix(in srgb, var(--accent) 88%, var(--text));
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  opacity: 0.9;
}

.resume-card-toggle:hover {
  opacity: 0.75;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
  text-underline-offset: 3px;
}

.resume-bullets li {
  margin: 6px 0;
  line-height: 1.45;
}

.skills-grid {
  display: grid;
  gap: 26px;
  margin-top: 6px;
}

.skills-kicker {
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  margin: 0 0 12px;
}

.skills-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip--static {
  cursor: default;
}

.chip--static:hover {
  background: transparent;
}

@media (max-width: 960px) {
  .chat-log {
    max-height: 45vh;
  }

  .resume-section h2 {
    font-size: 38px;
  }

  .resume-grid--two {
    grid-template-columns: 1fr;
  }
}

