:root {
  --text: #1f1f1f;
  --muted: #5b5b5b;
  --line: #d6d6d6;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --ink: #2d2d2d;
  --accent: #111111;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(0, 0, 0, 0.03), transparent 20%),
    linear-gradient(180deg, #ffffff 0%, #fcfcfc 100%);
}

p {
  color: var(--muted);
}

a,
.btn {
  transition: all 300ms ease;
}

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

a:hover {
  color: #7a7a7a;
  text-decoration: underline;
  text-underline-offset: 0.8rem;
  text-decoration-color: #bcbcbc;
}

nav,
.nav-links {
  display: flex;
}

nav {
  justify-content: space-around;
  align-items: center;
  height: 13vh;
}

.nav-links {
  gap: 2rem;
  list-style: none;
  font-size: 1.1rem;
}

.logo {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.logo:hover {
  cursor: default;
}

#hamburger-nav {
  display: none;
  position: relative;
  z-index: 1000;
}

.hamburger-menu {
  position: relative;
  display: inline-block;
  z-index: 1001;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 24px;
  width: 30px;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
}

.hamburger-icon span {
  width: 100%;
  height: 2px;
  background-color: #000;
  transition: all 0.3s ease-in-out;
}

.menu-links {
  position: absolute;
  top: 100%;
  right: 0;
  width: 12rem;
  max-width: calc(100vw - 2rem);
  max-height: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid transparent;
  border-radius: 1.25rem;
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.09);
  transition: all 0.3s ease-in-out;
  z-index: 1002;
}

.menu-links a {
  display: block;
  padding: 0.9rem 1rem;
  text-align: center;
  font-size: 1rem;
}

.menu-links.open {
  max-height: 20rem;
  border-color: var(--line);
}

.hamburger-icon.open span:first-child {
  transform: rotate(45deg) translate(8px, 5px);
}

.hamburger-icon.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-icon.open span:last-child {
  transform: rotate(-45deg) translate(8px, -5px);
}

section {
  padding-top: 1.25rem;
  min-height: fit-content;
  margin: 0 10rem;
  box-sizing: border-box;
}

.section-container {
  display: flex;
  gap: 4rem;
}

#profile {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5rem;
  min-height: 74vh;
}

.section__pic-container {
  display: flex;
  width: 400px;
  height: 400px;
  margin: auto 0;
}

.profile-pic {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  box-shadow: none;
  background: transparent;
  animation: agent-idle 3.5s ease-in-out infinite;
  will-change: transform;
}

.profile-pic.is-talking {
  animation: agent-idle 3.5s ease-in-out infinite;
}

.profile-pic-container {
  position: relative;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

#about .section__pic-container {
  width: 420px;
  height: 400px;
  flex: 0 0 auto;
}

.about-pic {
  width: 100%;
  height: 100%;
  border-radius: 2.5rem;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
}

.section__text {
  align-self: center;
  text-align: center;
  max-width: 36rem;
}

.section__text__p1 {
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.section__text__p2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.title {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 1rem;
}

.hero-summary {
  max-width: 34rem;
  margin: 0 auto 1.75rem;
  line-height: 1.8;
  font-size: 1rem;
}

#socials-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  gap: 1rem;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-width: 7.5rem;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
}

.social-icon {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
}

.social-pill:hover {
  background: #111;
  color: #fff;
  text-decoration: none;
}

.btn-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 1rem 1.25rem;
  min-width: 9rem;
  border-radius: 2rem;
}

.btn-with-icon {
  gap: 0.6rem;
}

.button-icon {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
}

.btn-color-1,
.btn-color-2 {
  border: 0.1rem solid rgb(53, 53, 53);
}

.btn-color-1,
.btn-color-2:hover {
  background: rgb(53, 53, 53);
  color: white;
  text-decoration: none;
}

.btn-color-1:hover {
  background: rgb(0, 0, 0);
}

.btn-color-2 {
  background: none;
}

.btn-color-2:hover {
  border-color: rgb(255, 255, 255);
}

#about,
#experience,
#projects {
  position: relative;
}

.about-details-container {
  justify-content: center;
  flex-direction: column;
}

.about-containers,
.about-details-container {
  gap: 2rem;
  display: flex;
}

.about-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.about-highlight {
  padding: 1.2rem 1.1rem;
  border: 0.1rem solid rgb(163, 163, 163);
  border-radius: 1.5rem;
  background: var(--surface-soft);
  text-align: left;
}

.about-highlight h3 {
  margin-bottom: 0.55rem;
  font-size: 1rem;
}

.about-highlight p {
  line-height: 1.65;
}

.details-container {
  padding: 1.5rem;
  flex: 1;
  background: var(--surface);
  border-radius: 2rem;
  border: 0.1rem solid rgb(163, 163, 163);
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.details-icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  font-weight: 700;
  color: var(--ink);
}

.text-container {
  padding: 0 0.25rem;
}

.text-container p + p {
  margin-top: 1rem;
}

.text-container p,
.project-copy {
  line-height: 1.8;
}

.experience-sub-title {
  color: var(--muted);
  font-weight: 600;
  font-size: 1.75rem;
  margin-bottom: 2rem;
}

.experience-details-container {
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.article-container {
  display: flex;
  text-align: initial;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 1.5rem;
  justify-content: space-around;
}

.article-container.compact article {
  width: 100%;
}

.article-container article {
  display: flex;
  align-items: flex-start;
  width: 14rem;
  gap: 0.8rem;
}

.article-container h4 {
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.mini-icon {
  flex: 0 0 auto;
  width: 0.9rem;
  height: 0.9rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: #111;
}

.project-grid {
  align-items: stretch;
}

.color-container {
  border-color: rgb(163, 163, 163);
  background: rgb(250, 250, 250);
}

.project-preview {
  display: grid;
  place-items: center;
  width: 100%;
  height: 16rem;
  margin-bottom: 1rem;
  border-radius: 1.5rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%);
  overflow: hidden;
  padding: 0.75rem;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}

.project-image-wetrain {
  object-position: center top;
  transform: translateY(-18px);
}

.project-image-fruitsdb {
  object-position: center top;
  transform: translateY(-16px) scale(0.93);
}

.project-title {
  margin: 1rem 0;
  color: black;
  font-size: 1.5rem;
}

.project-btn {
  color: black;
  border-color: rgb(163, 163, 163);
}

#contact {
  display: flex;
  justify-content: center;
  flex-direction: column;
  min-height: 70vh;
}

.contact-info-upper-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  width: min(100%, 52rem);
  border-radius: 2rem;
  border: 0.1rem solid rgb(163, 163, 163);
  background: rgb(250, 250, 250);
  margin: 2rem auto;
  padding: 1rem;
}

.contact-info-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.5rem;
}

.contact-info-container p {
  font-size: 1.05rem;
}

.contact-logo {
  width: 1.3rem;
  height: 1.3rem;
  object-fit: contain;
}

.contact-logo-linkedin {
  width: 1.15rem;
  height: 1.15rem;
}

footer {
  min-height: 26vh;
  margin: 0 1rem;
}

footer p {
  text-align: center;
}

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 500ms ease, transform 500ms ease;
}

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

@media screen and (max-width: 1400px) {
  #profile {
    min-height: 78vh;
    margin-bottom: 2rem;
  }

  .about-containers {
    flex-wrap: wrap;
  }
}

@media screen and (max-width: 1200px) {
  #desktop-nav {
    display: none;
  }

  #hamburger-nav {
    display: flex;
  }

  #profile,
  .section-container {
    display: block;
  }

  .about-highlights {
    grid-template-columns: 1fr;
  }

  section {
    margin: 0 5%;
  }

  .section__pic-container {
    width: 275px;
    height: 275px;
    margin: 0 auto 2rem;
  }

  .about-containers {
    margin-top: 0;
  }
}

@media screen and (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  section {
    margin: 0 1.5rem;
  }

  .about-containers {
    flex-direction: column;
  }

  .article-container {
    gap: 1rem;
    justify-content: stretch;
  }

  .article-container article {
    width: calc(50% - 0.5rem);
  }

  .project-grid .details-container,
  .contact-info-container {
    width: 100%;
  }

  .contact-info-container {
    justify-content: flex-start;
  }

  .contact-info-container a {
    overflow-wrap: anywhere;
  }
}

@media screen and (max-width: 600px) {
  #contact,
  footer {
    min-height: 40vh;
  }

  #profile {
    min-height: 78vh;
    margin-bottom: 0;
    gap: 2rem;
  }

  footer nav {
    height: fit-content;
    margin-bottom: 2rem;
  }

  .about-containers,
  .contact-info-upper-container,
  .btn-container {
    flex-wrap: wrap;
  }

  #socials-container {
    flex-wrap: wrap;
  }

  .contact-info-container {
    margin: 0;
    justify-content: flex-start;
  }

  .contact-info-container p,
  .nav-links li a {
    font-size: 1rem;
  }

  .experience-sub-title {
    font-size: 1.25rem;
  }

  .logo {
    font-size: 1.5rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .section__pic-container {
    width: min(100%, 300px);
    height: 46vw;
    min-height: 220px;
    justify-content: center;
  }

  .section__text {
    max-width: 100%;
  }

  .hero-summary {
    margin-bottom: 1.25rem;
  }

  .btn {
    width: 100%;
    min-width: 0;
  }

  .social-pill {
    width: 100%;
    min-width: 0;
  }

  .article-container article {
    width: 100%;
  }

  .project-preview {
    height: 12rem;
  }

  .contact-info-upper-container {
    padding: 1rem 0.85rem;
  }

  .contact-info-container p {
    font-size: 0.95rem;
  }

  .section__text__p2 {
    font-size: 1.25rem;
  }

  .title {
    font-size: 2rem;
  }

  .text-container {
    text-align: justify;
  }
}

/* ── Agent animations ── */
@keyframes agent-idle {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}


@keyframes ring-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%       { opacity: 0;   transform: scale(1.06); }
}

/* ── Ring overlay ── */
.agent-ring {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  pointer-events: none;
  border: 2.5px solid transparent;
  transition: border-color 300ms;
}

.profile-pic-container.is-talking .agent-ring {
  border-color: #111;
  animation: ring-pulse 0.75s ease-in-out infinite;
}


/* ── Agent column wrapper ── */
.agent-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 400px;
  flex-shrink: 0;
}

.agent-col .section__pic-container {
  margin: 0;
}

/* ── Hint label ── */
.agent-hint {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-align: center;
  transition: color 200ms;
  cursor: default;
}

/* ── Transcript ── */
.agent-transcript-wrap {
  min-height: 2.8rem;
  width: 100%;
  text-align: center;
  margin-top: 0.4rem;
  padding: 0 0.5rem;
}

.agent-transcript {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.6;
  font-style: italic;
}

/* ── Chat panel ── */
.agent-panel {
  width: 100%;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.agent-panel[hidden] {
  display: none;
}

.agent-messages {
  padding: 1rem;
  max-height: 13rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.agent-msg {
  max-width: 86%;
  padding: 0.55rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text);
}

.agent-msg--agent {
  background: #f0f0f0;
  align-self: flex-start;
  border-bottom-left-radius: 0.25rem;
}

.agent-msg--user {
  background: #111;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 0.25rem;
}

/* ── Chips ── */
.agent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.75rem;
}

.agent-chip {
  font-size: 0.76rem;
  padding: 0.32rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all 200ms;
}

.agent-chip:hover {
  background: #111;
  color: white;
  border-color: #111;
}

/* ── Input form ── */
.agent-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
}

.agent-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.86rem;
  font-family: inherit;
  background: white;
  outline: none;
  transition: border-color 200ms;
}

.agent-input:focus {
  border-color: #111;
}

.agent-send {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: #111;
  color: white;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 200ms;
  flex-shrink: 0;
}

.agent-send:hover  { background: #444; }
.agent-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Agent responsive ── */
@media screen and (max-width: 1200px) {
  .agent-col {
    width: 275px;
    margin: 0 auto 2rem;
  }
}

@media screen and (max-width: 600px) {
  .agent-col {
    width: min(100%, 340px);
  }
}
