/* =========================================================
   ORKHAN NURIYEV — PORTFOLIO STYLES
   ========================================================= */

/* --- Design Tokens --- */
:root {
  --ink:          #0f0f0f;
  --ink-light:    #1e1e1e;
  --muted:        #5e6470;
  --paper:        #f7f4ed;
  --paper-warm:   #fffaf0;
  --line:         #ddd7c9;
  --teal:         #0d7c7c;
  --teal-dark:    #075e61;
  --coral:        #df5b46;
  --mustard:      #c69324;
  --plum:         #5d4b73;
  --white:        #ffffff;
  --header-h:     68px;
  --shadow:       0 18px 50px rgba(32, 28, 20, 0.12);
  --radius:       10px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body { background: var(--paper); color: var(--ink); font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }

/* --- Universal canvas layer --- */
.section-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* --- Typography Scale --- */
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); line-height: 1.05; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.8rem, 3.8vw, 3.2rem); line-height: 1.08; letter-spacing: -0.025em; }
h3 { font-size: 1.15rem; line-height: 1.25; letter-spacing: -0.01em; }
h1, h2, h3, p { overflow-wrap: break-word; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(20px, 5vw, 72px);
  background: rgba(247, 244, 237, 0.90);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  /* entrance */
  opacity: 0;
  transform: translateY(-12px);
  animation: headerIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}

@keyframes headerIn {
  to { opacity: 1; transform: translateY(0); }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper-warm);
  font-size: 1.1rem;
  font-weight: 900;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
}

.nav-link {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 160ms ease;
  white-space: nowrap;
}

.nav-link:hover { color: var(--teal-dark); }

.header-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 18px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 0.88rem;
  transition: background 160ms ease, color 160ms ease;
}
.header-cta:hover { background: var(--ink); color: var(--paper-warm); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 80% 30%, rgba(13, 124, 124, 0.10), transparent),
    linear-gradient(155deg, #fffaf0 0%, #eef7f4 55%, #f0f7f4 100%);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.65;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(56px, 8vw, 100px) clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
}

.hero-copy { max-width: 780px; }

.eyebrow {
  display: inline-block;
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding: 6px 14px;
  border: 1px solid rgba(7, 94, 97, 0.3);
  border-radius: 999px;
  background: rgba(7, 94, 97, 0.06);
}

.hero-title {
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 22px;
  font-weight: 900;
}

.hero-text {
  max-width: 600px;
  color: #3a3a3a;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.65;
  margin-bottom: 36px;
}

/* Animated typing cursor on hero */
@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Floating badge on hero */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.70);
  backdrop-filter: blur(12px);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  animation: float-badge 4s ease-in-out infinite;
}

@keyframes float-badge {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-5px); }
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25); }
  50%       { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.10); }
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 44px;
  flex-wrap: wrap;
}

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

.hero-stat-number {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--teal-dark);
}

.hero-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* =========================================================
   HERO ENTRANCE ANIMATION
   ========================================================= */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Children start invisible; .hero-animate kicks off the sequence */
.hero-copy.hero-animate > * {
  opacity: 0;
}

.hero-copy.hero-animate .eyebrow {
  animation: heroFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.10s forwards;
}
.hero-copy.hero-animate .hero-title {
  animation: heroFadeUp 0.70s cubic-bezier(0.22, 1, 0.36, 1) 0.22s forwards;
}
.hero-copy.hero-animate .hero-text {
  animation: heroFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.38s forwards;
}
.hero-copy.hero-animate .hero-actions {
  animation: heroFadeUp 0.60s cubic-bezier(0.22, 1, 0.36, 1) 0.52s forwards;
}
.hero-copy.hero-animate .hero-stats {
  animation: heroFadeUp 0.60s cubic-bezier(0.22, 1, 0.36, 1) 0.66s forwards;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 0.93rem;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease, color 200ms ease;
  cursor: pointer;
  border: none;
}
.button:hover { transform: translateY(-2px); }

.button.primary {
  background: var(--teal-dark);
  color: var(--white);
  box-shadow: 0 10px 28px rgba(7, 94, 97, 0.24);
}
.button.primary:hover { box-shadow: 0 16px 36px rgba(7, 94, 97, 0.32); }

.button.secondary {
  border: 1.5px solid rgba(23, 23, 23, 0.35);
  background: rgba(255, 250, 240, 0.70);
  color: var(--ink);
}
.button.secondary:hover { background: var(--ink); color: var(--paper-warm); }

.button.cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid rgba(23, 23, 23, 0.35);
  background: rgba(255, 250, 240, 0.70);
  color: var(--ink);
}
.button.cv-btn:hover { background: var(--ink); color: var(--paper-warm); }
.button.cv-btn svg { flex-shrink: 0; }


/* =========================================================
   SECTIONS — BASE
   ========================================================= */
.section {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 9vw, 112px) clamp(20px, 5vw, 72px);
}

.section-kicker {
  display: inline-block;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 3.6vw, 3.0rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 0;
}

/* =========================================================
   WORK / PROJECTS
   ========================================================= */
.work-section { background: var(--paper); }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.section-heading h2 { margin: 0; max-width: 640px; }

.filter-tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-warm);
  flex-shrink: 0;
}

.tab {
  min-height: 36px;
  padding: 0 18px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  transition: background 180ms ease, color 180ms ease;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--ink); color: var(--white); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-warm);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transition: transform 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.project-card:hover { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(0,0,0,0.12); }
.project-card.is-hidden { display: none; }

/* Project visuals */
.project-visual { position: relative; height: 200px; overflow: hidden; }

.visual-ai { background: linear-gradient(135deg, #0d7c7c 0%, #f4c45f 100%); }
.visual-ai span { position: absolute; width: 64px; height: 64px; border: 1px solid rgba(255,255,255,0.72); border-radius: 8px; background: rgba(255,255,255,0.16); }
.visual-ai span:nth-child(1) { top: 28px; left: 26px; }
.visual-ai span:nth-child(2) { top: 84px; left: 94px; }
.visual-ai span:nth-child(3) { top: 44px; right: 42px; }
.visual-ai span:nth-child(4) { bottom: -18px; right: 112px; }

.visual-ml { display: flex; align-items: flex-end; gap: 12px; padding: 24px; background: linear-gradient(135deg, #2f2a35 0%, #df5b46 100%); }
.visual-ml span { flex: 1; border-radius: 8px 8px 0 0; background: rgba(255,250,240,0.78); }
.visual-ml span:nth-child(1) { height: 38%; }
.visual-ml span:nth-child(2) { height: 68%; }
.visual-ml span:nth-child(3) { height: 52%; }
.visual-ml span:nth-child(4) { height: 82%; }
.visual-ml span:nth-child(5) { height: 60%; }

.visual-code { display: grid; align-content: center; gap: 13px; padding: 28px; background: linear-gradient(135deg, #171717 0%, #5d4b73 54%, #0d7c7c 100%); }
.visual-code span { display: block; height: 13px; border-radius: 999px; background: rgba(255,250,240,0.78); }
.visual-code span:nth-child(1) { width: 72%; }
.visual-code span:nth-child(2) { width: 46%; }
.visual-code span:nth-child(3) { width: 88%; }
.visual-code span:nth-child(4) { width: 58%; }
.visual-code span:nth-child(5) { width: 76%; }

.project-body { padding: 22px; }

.project-type {
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.project-body h3 { margin: 6px 0 10px; font-size: 1.18rem; }
.project-body p { color: var(--muted); line-height: 1.6; }

.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 0; padding: 0; list-style: none; }
.tag-list li { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: #3b3f47; font-size: 0.78rem; font-weight: 700; }

.project-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.project-links a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px;
  border: 1px solid rgba(7, 94, 97, 0.28); border-radius: 8px;
  color: var(--teal-dark); font-size: 0.83rem; font-weight: 800;
  transition: background 160ms ease, color 160ms ease;
}
.project-links a:hover { background: var(--teal-dark); color: var(--white); }

/* =========================================================
   SKILLS
   ========================================================= */
.skills-section {
  position: relative;
  background: #101010;
  color: var(--white);
  overflow: hidden;
}

.bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.section-content-relative {
  position: relative;
  z-index: 1;
}

.skills-section .section-kicker { color: #f4c45f; }

.skills-section .section-title { color: var(--white); }

.skills-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 36px;
}

.skill-group {
  padding: 28px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  transition: transform 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              background 300ms ease;
}
.skill-group:hover { transform: translateY(-4px); background: rgba(255,255,255,0.08); }
.skill-group h3 { color: var(--white); margin-bottom: 12px; }
.skill-group p { color: rgba(255,255,255,0.65); line-height: 1.65; }

/* =========================================================
   EXPERIENCE
   ========================================================= */
.experience-section { background: var(--paper-warm); }

.section-heading.compact { align-items: flex-start; margin-bottom: 28px; }

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 26px;
  padding: 25px 28px;
  overflow: hidden;
  border: 1px solid rgba(26, 70, 65, 0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.54);
  box-shadow: 0 8px 22px rgba(23, 50, 46, 0.035);
  transition: transform 220ms ease, background 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.timeline-item::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  height: auto;
  border-radius: 16px 0 0 16px;
  background: linear-gradient(180deg, var(--teal), #48aaa2);
  content: "";
  opacity: 0;
  transform: scaleY(.35);
  transform-origin: center;
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,.8,.2,1);
}
.timeline-item.reveal { opacity: 0; transform: translateY(16px); transition: opacity .58s ease, transform .68s cubic-bezier(.22,1,.36,1), background .2s ease, box-shadow .2s ease; }
.timeline-item.reveal.is-visible { opacity: 1; transform: translateX(0); }
.timeline-item.is-visible::before { opacity: 1; transform: scaleY(1); }
.timeline-item.is-visible:hover { transform: translateY(-3px); border-color: rgba(7,94,97,.27); background: rgba(255,255,255,.82); box-shadow: 0 16px 32px rgba(23, 50, 46, .09); }

.timeline-date {
  align-self: start;
  display: inline-flex;
  width: fit-content;
  padding: 7px 11px;
  border: 1px solid rgba(7,94,97,.15);
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(13,124,124,.08);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: .01em;
}

.timeline-item h3 { margin: 1px 0 8px; font-size: 1.1rem; letter-spacing: -.02em; }
.timeline-item p { color: var(--muted); line-height: 1.7; }

/* =========================================================
   EDUCATION
   ========================================================= */
.education-section { background: var(--paper); }

.education-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 36px;
}

.education-card {
  position: relative;
  padding: 24px;
  overflow: hidden;
  border: 1px solid rgba(7, 94, 97, 0.18);
  border-radius: var(--radius);
  background: rgba(255,255,255,.82);
  box-shadow: 0 5px 20px rgba(7, 94, 97, 0.07);
  transition: transform 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 300ms ease;
}
.education-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: linear-gradient(180deg, var(--teal), #48aaa2);
  content: "";
}
.education-card.reveal { opacity: 0; transform: translateY(18px) scale(.99); transition: opacity .58s ease, transform .68s cubic-bezier(.22,1,.36,1), box-shadow .3s ease; }
.education-card.reveal.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.education-card.reveal.is-visible:hover { transform: translateY(-5px) scale(1.01); border-color: rgba(7,94,97,.36); box-shadow: 0 16px 34px rgba(7,94,97,.14); }
.education-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(7,94,97,.14); }
.education-card .project-type { margin-bottom: 8px; color: var(--teal-dark); }
.education-card h3 { font-size: 1.05rem; margin: 0 0 10px; }
.education-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }

/* =========================================================
   CREDENTIALS
   ========================================================= */
.credentials-block {
  position: relative;
  overflow: hidden;
  margin-top: clamp(52px, 7vw, 88px);
  padding-top: clamp(48px, 6vw, 72px);
  border-top: 1px solid var(--line);
}

.credential-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.credential-card {
  padding: 20px;
  border: 1px solid rgba(23, 23, 23, 0.10);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.62);
  transition: transform 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 300ms ease;
}
.credential-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.08); }

.credential-feature {
  grid-column: span 2;
  background: var(--ink);
  color: var(--white);
}
.credential-feature .project-type { color: #f4c45f; }
.credential-feature span { color: rgba(255,255,255,0.68); }

.credential-card strong,
.credential-card span { display: block; }
.credential-card strong { margin-bottom: 8px; line-height: 1.3; }
.credential-card span { color: var(--muted); font-size: 0.88rem; line-height: 1.55; }
.credential-feature span { color: rgba(255,255,255,0.68); }

/* =========================================================
   CONTACT
   ========================================================= */
.contact-section {
  position: relative;
  overflow: hidden;
  padding: clamp(64px, 9vw, 112px) clamp(20px, 5vw, 72px);
  background: linear-gradient(135deg, #edf6f3 0%, #fffaf0 100%);
}

.contact-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}

.contact-inner h2 { max-width: 680px; margin: 10px 0 18px; }
.contact-inner p { color: var(--muted); font-size: 1.05rem; line-height: 1.65; }

.contact-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(20px, 5vw, 72px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}
.site-footer a { transition: color 160ms ease; }
.site-footer a:hover { color: var(--teal-dark); }

/* =========================================================
   PORTFOLIO AI CHAT
   ========================================================= */
.portfolio-chat {
  --chat-ink: #182322;
  --chat-muted: #77807f;
  --chat-accent: #087a73;
  --chat-paper: #fffefa;
  position: fixed;
  right: clamp(18px, 3vw, 38px);
  bottom: clamp(18px, 3vw, 34px);
  z-index: 150;
  font-family: "Inter", system-ui, sans-serif;
}

.chat-launcher {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 22px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #113f3e, #087a73 72%, #14958b);
  box-shadow: 0 12px 34px rgba(7, 74, 71, .31), inset 0 1px rgba(255,255,255,.2);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease;
  animation: launcherArrive .65s cubic-bezier(.2,.8,.2,1) .8s both;
}
.chat-launcher:hover { transform: translateY(-3px); box-shadow: 0 17px 40px rgba(7,74,71,.38), inset 0 1px rgba(255,255,255,.2); }
.chat-launcher-orbit {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.chat-launcher-orbit::after {
  position: absolute;
  inset: -42px auto -42px -65px;
  width: 75px;
  content: "";
  transform: rotate(30deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.13), transparent);
  animation: launcherShimmer 4.8s ease-in-out infinite;
}
.chat-launcher-icon { position: relative; width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-launcher-label { position: relative; font-size: .9rem; font-weight: 750; letter-spacing: -.01em; }

.robot-eye { transform-box: view-box; animation: robotBlink 5.2s ease-in-out infinite; }
.robot-eye-left { transform-origin: 66px 78px; }
.robot-eye-right { transform-origin: 114px 78px; animation-delay: .12s; }
.robot-mouth { transform-box: view-box; transform-origin: 90px 100px; animation: robotTalk 2.2s ease-in-out infinite; }
.robot-arm-left { transform-box: view-box; transform-origin: 55px 148px; animation: robotArmLeft 4.8s ease-in-out infinite; }
.robot-arm-right { transform-box: view-box; transform-origin: 125px 148px; animation: robotArmRight 4.8s ease-in-out infinite; }
.robot-body { transform-box: view-box; transform-origin: 90px 132px; animation: robotBody 4.8s ease-in-out infinite; }
.robot-head { transform-box: view-box; transform-origin: 90px 82px; animation: robotHead 5.4s ease-in-out infinite; }
.robot-antenna-light { animation: robotBeacon 2.4s ease-in-out infinite; }
.roaming-bot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 140;
  display: grid;
  width: 132px;
  height: 161px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
  will-change: transform;
  filter: drop-shadow(0 9px 8px rgba(15, 61, 57, .14));
}
.roaming-bot.is-dragging { z-index: 160; cursor: grabbing; filter: drop-shadow(0 15px 12px rgba(15,61,57,.25)); }
.roaming-bot.is-dragging .roaming-bot-art { animation-play-state: paused; }
.roaming-bot:focus-visible { outline: 2px solid #c69324; outline-offset: 4px; border-radius: 24px; }
.roaming-bot::after {
  position: absolute;
  top: -10px;
  left: 50%;
  padding: 6px 10px;
  border: 1px solid rgba(7,94,97,.12);
  border-radius: 999px;
  color: #164b47;
  background: rgba(255,254,250,.96);
  box-shadow: 0 5px 15px rgba(17,63,61,.12);
  content: "Drag to move · Click to chat";
  font: 700 .68rem/1.2 "Inter", system-ui, sans-serif;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 5px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.roaming-bot:hover::after, .roaming-bot:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.roaming-bot-art { display: block; width: 100%; height: 100%; overflow: visible; animation: mascotFloat 4s ease-in-out infinite; transition: filter .2s ease; }
.roaming-bot:hover .roaming-bot-art { filter: brightness(1.06); }

@keyframes mascotFloat { 0%, 100% { transform: translateY(0) rotate(-1deg) scaleX(var(--bot-direction, 1)); } 50% { transform: translateY(-6px) rotate(1.5deg) scaleX(var(--bot-direction, 1)); } }
@keyframes robotBlink { 0%, 42%, 46%, 86%, 90%, 100% { transform: scaleY(1); } 44%, 88% { transform: scaleY(.08); } }
@keyframes robotTalk { 0%, 100% { transform: scaleY(.72); } 18% { transform: scaleY(.72); } 24% { transform: scaleY(1.16); } 31% { transform: scaleY(.78); } 39% { transform: scaleY(1.25); } 47% { transform: scaleY(.7); } 53% { transform: scaleY(1.1); } 60%, 78% { transform: scaleY(.72); } }
@keyframes robotArmLeft { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(1.8deg); } }
@keyframes robotArmRight { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-1.8deg); } }
@keyframes robotBody { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.012); } }
@keyframes robotHead { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-.7deg); } }
@keyframes robotBeacon { 0%, 100% { opacity: .42; } 50% { opacity: 1; } }
@keyframes launcherArrive { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes launcherShimmer { 0%, 48% { left: -65px; } 75%, 100% { left: calc(100% + 10px); } }

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  display: flex;
  flex-direction: column;
  width: min(392px, calc(100vw - 28px));
  height: min(610px, calc(100dvh - 116px));
  min-height: 430px;
  overflow: hidden;
  border: 1px solid rgba(31, 73, 69, .12);
  border-radius: 24px;
  color: var(--chat-ink);
  background: var(--chat-paper);
  box-shadow: 0 28px 90px rgba(24, 48, 45, .24), 0 4px 16px rgba(24,48,45,.08);
  transform-origin: 92% 100%;
  opacity: 0;
  transform: translateY(14px) scale(.96);
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, transform .28s cubic-bezier(.2,.8,.2,1), visibility .28s;
}
.chat-panel.is-open { opacity: 1; transform: translateY(0) scale(1); visibility: visible; pointer-events: auto; }
.chat-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 14px 18px;
  color: #fff;
  background: radial-gradient(ellipse at 85% 0%, rgba(130,221,198,.28), transparent 42%), linear-gradient(115deg, #143d3b, #087a73);
}
.chat-avatar { display: grid; width: 42px; height: 42px; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.36); border-radius: 14px; background: rgba(255,255,255,.13); box-shadow: inset 0 1px rgba(255,255,255,.2); }
.chat-avatar svg { width: 31px; height: 31px; }
.chat-heading { display: grid; gap: 3px; }
.chat-heading strong { font-size: .97rem; letter-spacing: -.015em; }
.chat-heading > span { display: flex; align-items: center; gap: 7px; color: rgba(255,255,255,.76); font-size: .73rem; }
.chat-heading i { width: 7px; height: 7px; border-radius: 50%; background: #7be0a6; box-shadow: 0 0 0 3px rgba(123,224,166,.16); }
.chat-close { display: grid; place-items: center; width: 36px; height: 36px; margin-left: auto; border: 1px solid rgba(255,255,255,.19); border-radius: 50%; color: white; background: rgba(255,255,255,.08); font: 300 1.45rem/1 sans-serif; cursor: pointer; transition: background .18s, transform .18s; }
.chat-close:hover { background: rgba(255,255,255,.2); transform: rotate(90deg); }
.chat-intro { padding: 23px 20px 4px; }
.chat-eyebrow { margin-bottom: 7px; color: var(--chat-accent); font-size: .67rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.chat-intro h2 { margin-bottom: 7px; font-size: 1.35rem; line-height: 1.2; letter-spacing: -.045em; }
.chat-intro > p:not(.chat-eyebrow) { max-width: 310px; color: var(--chat-muted); font-size: .83rem; line-height: 1.5; }
.chat-suggestions { display: grid; gap: 7px; margin-top: 16px; }
.chat-suggestions[hidden] { display: none; }
.chat-suggestions button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 39px; padding: 8px 12px; border: 1px solid #e6ece8; border-radius: 11px; color: #344744; background: #fff; text-align: left; font-family: inherit; font-size: .75rem; font-weight: 600; line-height: 1.35; cursor: pointer; transition: border .16s, background .16s, transform .16s; }
.chat-suggestions button:hover { transform: translateX(2px); border-color: #abd4cb; background: #f3faf7; }
.chat-suggestions button span { color: var(--chat-accent); font-size: .95rem; }
.chat-messages { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 0; padding: 15px 17px 12px; overflow: auto; overscroll-behavior: contain; scrollbar-color: #ccd9d3 transparent; scrollbar-width: thin; }
.chat-message { max-width: 87%; padding: 11px 13px; border-radius: 15px; font-size: .82rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; animation: messageEnter .2s ease-out both; }
.chat-message.from-assistant { align-self: flex-start; border: 1px solid #e9eee9; border-bottom-left-radius: 5px; color: #35413f; background: #f5f7f3; }
.chat-message.from-assistant a { color: #06736d; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.chat-message.from-assistant a:hover { color: #034e4a; }
.chat-message.from-user { align-self: flex-end; border-bottom-right-radius: 5px; color: white; background: linear-gradient(135deg,#087a73,#076a65); box-shadow: 0 4px 12px rgba(7,122,115,.15); }
.chat-message.is-error { border-color: #f2d6c9; color: #80412e; background: #fff5ef; }
.chat-message.is-typing { color: #788582; font-style: italic; }
.chat-message.is-typing::after { display: inline-block; width: 16px; content: ""; animation: typingDots 1.2s steps(4, end) infinite; }
@keyframes typingDots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%,100% { content: "..."; } }
@keyframes messageEnter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.chat-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 14px; padding: 7px 7px 7px 13px; border: 1px solid #dfe7e2; border-radius: 16px; background: white; box-shadow: 0 2px 9px rgba(31,73,69,.04); transition: border-color .18s, box-shadow .18s; }
.chat-form:focus-within { border-color: #79bcb0; box-shadow: 0 0 0 3px rgba(8,122,115,.09); }
.chat-form textarea { flex: 1; min-width: 0; max-height: 112px; padding: 7px 0; resize: none; border: 0; outline: 0; color: var(--chat-ink); background: transparent; font-family: inherit; font-size: .82rem; font-weight: 400; line-height: 1.45; }
.chat-form textarea::placeholder { color: #9aa4a1; }
.chat-send { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 12px; color: white; background: var(--chat-accent); cursor: pointer; transition: transform .18s, background .18s; }
.chat-send:hover { transform: translateY(-2px); background: #075e59; }
.chat-send:disabled { opacity: .5; cursor: wait; }
.chat-send svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chat-footnote { padding: 9px 12px 12px; color: #a0a8a5; text-align: center; font-size: .64rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); border: 0; }

@media (max-width: 520px) {
  .portfolio-chat { right: 14px; bottom: 14px; }
  .roaming-bot { width: 108px; height: 132px; }
  .chat-launcher { min-height: 56px; padding: 0 18px; }
  .chat-panel { right: -6px; bottom: 70px; width: min(392px, calc(100vw - 28px)); height: min(630px, calc(100dvh - 98px)); min-height: 390px; border-radius: 21px; }
  .chat-intro { padding: 18px 17px 2px; }
  .chat-messages { padding-right: 14px; padding-left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .chat-launcher, .chat-launcher-orbit::after, .roaming-bot-art, .roaming-bot::after, .robot-eye, .robot-mouth, .robot-arm-left, .robot-arm-right, .robot-body, .robot-head, .robot-antenna-light, .chat-message, .chat-message.is-typing::after { animation: none !important; }
  .chat-panel, .chat-launcher, .chat-close, .chat-suggestions button, .chat-send { transition-duration: .01ms !important; }
}

/* =========================================================
   SCROLL REVEAL ANIMATIONS
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 90ms; }
.delay-2 { transition-delay: 180ms; }
.delay-3 { transition-delay: 270ms; }
.delay-4 { transition-delay: 360ms; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .contact-inner { grid-template-columns: 1fr; }
  .contact-actions { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 860px) {
  .hero-stats { gap: 20px; }
  .project-grid { grid-template-columns: 1fr; }
  .skills-layout { grid-template-columns: 1fr; }
  .education-grid { grid-template-columns: repeat(2, 1fr); }
  .credential-grid { grid-template-columns: 1fr 1fr; }
  .credential-feature { grid-column: span 2; }
  .section-heading { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .site-header { padding: 0 16px; }
  .brand span:last-child { display: none; }
  .site-nav { display: none; }
  .education-grid { grid-template-columns: 1fr; }
  .credential-grid { grid-template-columns: 1fr; }
  .credential-feature { grid-column: span 1; }
  .timeline-item { grid-template-columns: 1fr; gap: 6px; }
  .button { width: 100%; }
  .hero-stats { gap: 24px; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
  /* Ensure entrance elements are visible without animation */
  .site-header,
  .hero-copy.hero-animate > * {
    opacity: 1 !important;
    transform: none !important;
  }
  .reveal { opacity: 1 !important; filter: none !important; transform: none !important; }
}
