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

:root {
  --bg:       #1e2d32;
  --surface:  #263840;
  --border:   #3d5a60;
  --text:     #e8edeb;
  --muted:    #a2b8b5;
  --accent:   #7a9faa;
  --green:    #6b8f72;
  --dark:     #293d45;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, .stat-number, .nav-brand, .cta-heading, .pull-quote {
  font-family: 'Space Grotesk', 'Instrument Sans', sans-serif;
}

/* ── Sticky Nav ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(30, 45, 50, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.8rem 2rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 1.4rem;
  margin-left: auto;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-links a:hover { color: var(--text); }

.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.nav-resume {
  font-weight: 600;
  white-space: nowrap;
}

/* ── About ── */
.about {
  border-bottom: 1px solid var(--border);
  padding: 4rem 2rem;
  background-image: url('hero-bg.jpg');
  background-size: cover;
  background-position: center 40%;
  position: relative;
}

.about::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(15, 25, 28, 0.35), rgba(15, 25, 28, 0.2));
  pointer-events: none;
  z-index: 0;
}

.about-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  align-items: stretch;
  position: relative;
  z-index: 1;
}

.about-photo-wrap {
  width: 210px;
  height: 250px;
  overflow: hidden;
  border-radius: 40px;
  flex-shrink: 0;
  background: transparent;
  margin-right: -56px;
  z-index: 2;
  border: 3px solid rgba(122, 159, 170, 0.45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.about-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  border-radius: 37px;
}

.about-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow: hidden;
  background: rgba(38, 56, 64, 0.92);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.75rem 1.75rem 1.75rem 4.5rem;
}

.about-text h1 {
  font-size: clamp(2.4rem, 5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.open-to {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9fd0a8;
  background: rgba(107, 143, 114, 0.16);
  border: 1px solid rgba(107, 143, 114, 0.45);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  margin-bottom: 0.35rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9fd0a8;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(159, 208, 168, 0.5); }
  50% { opacity: 0.6; box-shadow: 0 0 0 5px rgba(159, 208, 168, 0); }
}

.role {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.location {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.typed-tagline {
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 1.4em;
}

.typed-cursor {
  color: var(--green);
}

.bio {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.25rem;
  line-height: 1.65;
}

.about-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.resume-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.contact-link {
  color: var(--green);
  font-size: 0.9rem;
  text-decoration: none;
}

.contact-link:hover {
  text-decoration: underline;
}

/* ── Projects ── */
.projects {
  padding: 3rem 2rem;
  flex: 1;
}

.projects-inner {
  max-width: 860px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 1.75rem;
  animation-fill-mode: both;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.sec-num {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.1em;
}

.sec-num::after {
  content: ' —';
  color: var(--border);
}

.about-photo-wrap,
.about-text {
  animation-fill-mode: both;
}

/* Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, transform 0.22s ease, box-shadow 0.22s ease;
  will-change: transform;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.card-header {
  display: flex;
  align-items: center;
}

.tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #1e3a40;
  color: var(--accent);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  flex: 1;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.mini-tag {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
}

/* Buttons */
.card-footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  background: var(--accent);
  color: var(--dark);
  transition: opacity 0.15s, transform 0.15s;
}

.btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent);
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.55rem 1.1rem;
}

.btn--ghost:hover {
  border-color: var(--accent);
  opacity: 1;
}

.btn--lg {
  font-size: 0.95rem;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
}

/* ── Feature Card ── */
.card--feature {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.feature-shot-link {
  display: block;
  overflow: hidden;
  border-right: 1px solid var(--border);
}

.feature-shot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
  transition: transform 0.4s ease;
}

.card--feature:hover .feature-shot {
  transform: scale(1.03);
}

.feature-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tag--featured {
  background: rgba(107, 143, 114, 0.2);
  color: #9fd0a8;
  margin-left: 0.4rem;
}

/* ── Contact CTA ── */
.cta-section {
  padding: 5rem 2rem;
  background:
    radial-gradient(ellipse 60% 80% at 50% 100%, rgba(122, 159, 170, 0.12), transparent),
    var(--dark);
  border-top: 1px solid var(--border);
  text-align: center;
}

.cta-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.cta-heading {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.cta-sub {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 460px;
}

.cta-actions {
  display: flex;
  gap: 0.85rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-links span {
  margin: 0 0.5rem;
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 700px) {
  .nav-inner {
    padding: 0.7rem 1rem;
    gap: 0.75rem;
  }
  .nav-brand { display: none; }
  .nav-links {
    gap: 0.8rem;
    margin-left: 0;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { font-size: 0.82rem; white-space: nowrap; }
  .nav-resume { margin-left: auto; flex-shrink: 0; }
  .stat-number { font-size: 1.6rem; }
}

@media (max-width: 600px) {
  .about-inner {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }

  .about-photo-wrap {
    width: 150px;
    height: 180px;
    border-radius: 28px;
    margin-right: 0;
    margin-bottom: -44px;
  }

  .about-photo {
    border-radius: 25px;
  }

  .about-text {
    padding: 3.5rem 1.5rem 1.5rem;
    align-items: center;
    text-align: center;
  }

  .open-to { align-self: center; }
  .about-links { justify-content: center; flex-wrap: wrap; }
  .about-text h1 { font-size: 2rem; }
  .role { font-size: 0.92rem; }
  .projects-grid { grid-template-columns: 1fr; }

  .card--feature {
    grid-template-columns: 1fr;
  }
  .feature-shot-link {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 220px;
  }
}

/* ── Chat Widget ── */
#chat-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--dark);
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  z-index: 100;
  transition: background 0.15s, transform 0.15s;
}

#chat-btn:hover {
  background: var(--accent-hover, #9bbec8);
  transform: translateY(-1px);
}

#chat-panel {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 340px;
  max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s;
}

#chat-panel.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

#chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--dark);
}

.beta-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--green);
  color: #fff;
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
  margin-left: 0.4rem;
}

#chat-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

#chat-close:hover { color: var(--text); }

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chat-msg {
  max-width: 85%;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-msg--bot {
  background: var(--dark);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-msg--user {
  background: var(--accent);
  color: var(--dark);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.65rem 0.85rem;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
  40% { transform: translateY(-5px); opacity: 1; }
}

#chat-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
}

#chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
}

#chat-input:focus { border-color: var(--accent); }

#chat-send {
  background: var(--accent);
  color: var(--dark);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

#chat-send:hover { opacity: 0.85; }
#chat-send:disabled, #chat-input:disabled { opacity: 0.5; }

@media (max-width: 400px) {
  #chat-panel { width: calc(100vw - 2rem); right: 1rem; }
  #chat-btn span { display: none; }
}

/* ── Hero Particles ── */
#hero-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Scroll Reveal ── */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease var(--delay, 0s), transform 0.55s ease var(--delay, 0s);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .card, .value-tile, #chat-btn, .btn, .feature-shot {
    transition: none;
  }
  .card:hover, .value-tile:hover, #chat-btn:hover, .btn:hover, .card--feature:hover .feature-shot {
    transform: none;
  }
  .pulse-dot {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}
.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.about-photo-wrap.scroll-reveal {
  transform: translateX(-24px);
}
.about-photo-wrap.scroll-reveal.is-visible {
  transform: translateX(0);
}

/* ── Stats Bar ── */
.stats-bar {
  background: var(--dark);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 2rem;
}

.stats-inner {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
}

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

@media (max-width: 600px) {
  .stats-inner { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

/* ── Value Prop ── */
.value-prop {
  padding: 3rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.value-inner {
  max-width: 860px;
  margin: 0 auto;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.value-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.2s, transform 0.22s ease, box-shadow 0.22s ease;
  will-change: transform;
}

.value-tile:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.value-icon {
  color: var(--accent);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(122, 159, 170, 0.12);
  border-radius: 8px;
  flex-shrink: 0;
}

.value-tile h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.value-tile p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Testimonial ── */
.testimonial-section {
  padding: 3.5rem 2rem;
  background: var(--dark);
  border-bottom: 1px solid var(--border);
}

.testimonial-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.quote-mark {
  color: var(--accent);
  opacity: 0.35;
}

.pull-quote {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.35;
  color: var(--text);
  font-style: normal;
  border: none;
  padding: 0;
  background: none;
}

.quote-attribution {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
