:root {
  --ink: #111111;
  --soft-ink: #656565;
  --line: #dedede;
  --bubble: #f1f1f1;
  --blue: #087bf2;
  --white: #ffffff;
  --serif: "Libre Caslon Display", Georgia, serif;
  --sans: "Inter", Arial, sans-serif;
  --mono: "DM Mono", monospace;
  --gutter: clamp(1.25rem, 4vw, 4.5rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::after {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  content: "";
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

::selection {
  background: #cce5ff;
}

.masthead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 88px;
  padding: 0 var(--gutter);
  align-items: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.monogram {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  transition: background 180ms, color 180ms;
}

.monogram:hover {
  background: var(--ink);
  color: var(--white);
}

.availability {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.availability i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #35a853;
  box-shadow: 0 0 0 4px rgba(53, 168, 83, 0.12);
}

.masthead > a:last-child {
  justify-self: end;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--ink);
}

.intro {
  padding: clamp(3rem, 7vw, 7rem) var(--gutter) clamp(5rem, 9vw, 9rem);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(5rem, 13.8vw, 13.5rem);
  font-weight: 400;
  line-height: 0.69;
  letter-spacing: -0.075em;
}

h1 span {
  display: block;
}

h1 span:last-child {
  margin-left: 16.5vw;
}

.intro-role {
  display: flex;
  margin: clamp(3.5rem, 7vw, 7rem) 0 0;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--soft-ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-role i {
  display: block;
  width: 36px;
  height: 1px;
  background: var(--line);
}

.chat {
  width: min(800px, calc(100% - 2 * var(--gutter)));
  min-height: 70vh;
  margin: 0 auto;
  padding-bottom: 10rem;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  display: flex;
  max-width: 82%;
  align-items: flex-end;
  gap: 0.7rem;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  animation: arrive 500ms var(--delay, 0s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.from-tommaso {
  align-self: flex-start;
}

.from-visitor {
  align-self: flex-end;
}

.avatar {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-family: var(--serif);
  font-size: 0.9rem;
}

.bubble {
  padding: 1rem 1.2rem;
  border-radius: 20px 20px 20px 5px;
  background: var(--bubble);
  font-size: clamp(0.98rem, 1.6vw, 1.16rem);
  line-height: 1.55;
}

.bubble p {
  margin: 0;
}

.visitor-bubble {
  border-radius: 20px 20px 5px 20px;
  background: var(--blue);
  color: var(--white);
}

.name-bubble {
  min-width: min(430px, 70vw);
}

.name-bubble label {
  display: block;
  margin-bottom: 0.65rem;
}

.name-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.65);
}

.name-entry input {
  min-width: 0;
  padding: 0.4rem 0 0.65rem;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--white);
  font-size: 1.1rem;
}

.name-entry input::placeholder {
  color: rgba(255, 255, 255, 0.56);
}

.name-entry button {
  display: grid;
  width: 29px;
  height: 29px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--white);
  color: var(--blue);
  cursor: pointer;
  font-weight: 600;
}

.choice-bubble {
  display: grid;
  min-width: min(390px, 70vw);
  padding: 0.45rem;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.choice-bubble button {
  padding: 0.8rem 0.9rem;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.13);
  color: var(--white);
  cursor: pointer;
  text-align: left;
  transition: background 160ms, transform 160ms;
}

.choice-bubble button:hover,
.choice-bubble button:focus-visible {
  outline: 0;
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.choice-bubble button:disabled {
  cursor: default;
  opacity: 0.5;
  transform: none;
}

.choice-bubble button.selected {
  background: var(--white);
  color: var(--blue);
  opacity: 1;
}

.response-card {
  width: min(590px, 100%);
}

.response-card a {
  display: inline-block;
  margin-top: 0.85rem;
  border-bottom: 1px solid currentColor;
  font-size: 0.86rem;
  font-weight: 500;
}

.project-chat-list {
  display: grid;
  margin-top: 1rem;
  gap: 0.55rem;
}

.project-chat-list div {
  padding-top: 0.7rem;
  border-top: 1px solid #d2d2d2;
}

.project-chat-list strong {
  display: block;
  font-size: 0.9rem;
}

.project-chat-list small {
  color: var(--soft-ink);
}

.skip-chat {
  display: block;
  margin: 5rem auto 0;
  padding: 0.55rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--soft-ink);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile {
  border-top: 1px solid var(--line);
}

.profile[hidden] {
  display: none;
}

.profile.is-revealed {
  animation: reveal-profile 600ms ease both;
}

.profile-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 68px;
  padding: 0 var(--gutter);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.profile-nav div {
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.profile-section {
  display: grid;
  grid-template-columns: minmax(120px, 0.32fr) minmax(0, 1fr);
  min-height: 75vh;
  padding: clamp(5rem, 10vw, 10rem) var(--gutter);
  gap: clamp(2rem, 8vw, 9rem);
  border-bottom: 1px solid var(--line);
}

.section-label {
  margin: 0;
  color: var(--soft-ink);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h2 {
  max-width: 11ch;
  margin: 0 0 3rem;
  font-family: var(--serif);
  font-size: clamp(3rem, 7vw, 7.5rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.profile-about > div > p {
  max-width: 660px;
  margin-left: auto;
  color: var(--soft-ink);
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  line-height: 1.7;
}

.work-list article,
.experience-list article {
  display: grid;
  padding: 2rem 0;
  align-items: start;
  border-top: 1px solid var(--ink);
}

.work-list article {
  grid-template-columns: 60px minmax(0, 1fr) auto;
  gap: 1rem;
}

.work-list article > span,
.work-list small,
.experience-list > article > p,
.experience-list strong {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.work-list h3,
.experience-list h3 {
  margin: 0 0 0.7rem;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.2vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.work-list div > p,
.experience-list div > p {
  max-width: 530px;
  margin: 0;
  color: var(--soft-ink);
  line-height: 1.6;
}

.work-kicker {
  margin: 0 0 0.55rem !important;
  color: var(--blue) !important;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.featured-work .agent-preview {
  grid-column: 2 / -1;
  margin-top: 2rem;
}

.agent-preview {
  overflow: hidden;
  border: 1px solid #d9d9dd;
  border-radius: 14px;
  background: #fbfbfc;
  box-shadow: 0 24px 70px rgba(17, 17, 17, 0.08);
  color: #101114;
}

.agent-preview-bar {
  display: flex;
  min-height: 52px;
  padding: 0 1rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e7e7ea;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 600;
}

.agent-preview-bar p {
  display: flex;
  margin: 0;
  align-items: center;
  gap: 0.6rem;
}

.agent-preview-bar i {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(145deg, #1b1b20, #5b40f2);
  color: #fff;
  font-style: normal;
  font-weight: 700;
}

.agent-preview-bar > span {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: #f1efff;
  color: #5b40f2;
  font-size: 0.52rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.agent-preview-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #111217;
  color: #fff;
}

.agent-preview-stats div {
  padding: 1rem;
  border-right: 1px solid #2c2d34;
}

.agent-preview-stats div:last-child {
  border-right: 0;
}

.agent-preview-stats span {
  display: block;
  color: #a7a8b0;
  font-size: 0.58rem;
}

.agent-preview-stats strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.35rem;
}

.agent-preview-body {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  min-height: 310px;
}

.agent-leads {
  padding: 1.25rem;
}

.agent-leads > p {
  margin: 0 0 0.85rem;
  color: #5b40f2;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.agent-lead {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  margin-bottom: 0.6rem;
  padding: 0.7rem;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid #e7e7ea;
  border-radius: 9px;
  background: #fff;
}

.agent-lead.is-active {
  border-color: #b8aefb;
  background: #faf9ff;
}

.agent-lead > b {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 3px solid #5b40f2;
  border-radius: 50%;
  font-size: 0.58rem;
}

.agent-lead span strong,
.agent-lead span small {
  display: block;
}

.agent-lead span strong {
  overflow: hidden;
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-lead span small {
  margin-top: 0.15rem;
  color: #696b73;
  font-size: 0.52rem;
}

.agent-lead em {
  padding: 0.28rem 0.4rem;
  border-radius: 5px;
  background: #eeeaff;
  color: #4d31d5;
  font-size: 0.46rem;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.agent-detail {
  padding: 1.25rem;
  border-left: 1px solid #e7e7ea;
  background: #f7f7f9;
}

.agent-detail > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.agent-detail > div:first-child > span {
  padding: 0.28rem 0.4rem;
  border-radius: 5px;
  background: #eeeaff;
  color: #4d31d5;
  font-size: 0.46rem;
  font-weight: 700;
  text-transform: uppercase;
}

.agent-detail > div:first-child > strong {
  font-size: 1.45rem;
}

.agent-detail > div:first-child small {
  color: #696b73;
  font-size: 0.5rem;
}

.agent-detail h4 {
  margin: 0.7rem 0 0.2rem;
  font-size: 0.92rem;
}

.agent-detail > p {
  margin: 0;
  color: #696b73;
  font-size: 0.58rem;
}

.agent-detail dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin: 1rem 0;
}

.agent-detail dl div {
  padding: 0.55rem;
  border: 1px solid #e7e7ea;
  border-radius: 7px;
  background: #fff;
}

.agent-detail dt {
  color: #696b73;
  font-size: 0.45rem;
  text-transform: uppercase;
}

.agent-detail dd {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
}

.agent-detail ul {
  margin: 0;
  padding: 0;
  color: #3f4147;
  font-size: 0.54rem;
  line-height: 1.8;
  list-style: none;
}

.agent-detail li::before {
  margin-right: 0.4rem;
  color: #5b40f2;
  content: "•";
}

.work-disclaimer {
  grid-column: 2 / -1;
  max-width: none !important;
  margin: 0.9rem 0 0 !important;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.experience-list article {
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 1.5rem;
}

.experience-list > article > p,
.experience-list strong {
  margin: 0.3rem 0 0;
}

.profile-contact {
  min-height: 85vh;
  padding: clamp(6rem, 12vw, 12rem) var(--gutter);
  background: var(--ink);
  color: var(--white);
}

.profile-contact > p {
  margin: 0 0 1.5rem;
  color: #a7a7a7;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-contact h2 {
  max-width: none;
  margin-bottom: clamp(5rem, 12vw, 11rem);
  font-size: clamp(5rem, 15vw, 14rem);
}

.profile-contact > div {
  display: flex;
  justify-content: flex-end;
  gap: clamp(1rem, 4vw, 4rem);
}

.profile-contact a {
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #777;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

footer {
  display: flex;
  min-height: 90px;
  padding: 0 var(--gutter);
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #333;
  background: var(--ink);
  color: #888;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

@keyframes reveal-profile {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 720px) {
  .masthead {
    grid-template-columns: 1fr 1fr;
    min-height: 72px;
  }

  .availability {
    display: none;
  }

  h1 {
    font-size: clamp(4.2rem, 21vw, 7rem);
    line-height: 0.76;
  }

  h1 span:last-child {
    margin-left: 0.12em;
  }

  .intro-role {
    justify-content: flex-start;
  }

  .chat {
    width: calc(100% - 2.5rem);
    padding-bottom: 7rem;
  }

  .message {
    max-width: 94%;
  }

  .avatar {
    display: none;
  }

  .name-bubble,
  .choice-bubble {
    min-width: min(88vw, 390px);
  }

  .choice-bubble {
    grid-template-columns: 1fr;
  }

  .profile-nav p {
    display: none;
  }

  .profile-nav {
    justify-content: center;
  }

  .profile-nav div {
    width: 100%;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .profile-section {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .work-list article,
  .experience-list article {
    grid-template-columns: 42px 1fr;
  }

  .work-list small,
  .experience-list strong {
    grid-column: 2;
    margin-top: 0.8rem;
  }

  .featured-work .agent-preview,
  .work-disclaimer {
    grid-column: 1 / -1;
  }

  .agent-preview-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .agent-preview-stats div:nth-child(2) {
    border-right: 0;
  }

  .agent-preview-stats div:nth-child(-n + 2) {
    border-bottom: 1px solid #2c2d34;
  }

  .agent-preview-body {
    grid-template-columns: 1fr;
  }

  .agent-detail {
    display: none;
  }

  .profile-contact > div {
    flex-direction: column;
    align-items: flex-start;
  }
}
