.expert-detail {
  color-scheme: light;
  color: #000015;
  background: #fff;
  --color-focus: #3a737c;
}

.expert-detail ::selection { color: #000015; background: #d4e7ea; }
.expert-detail [id] { scroll-margin-top: 28px; }

.expert-profile {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: clamp(40px, 5vw, 96px);
  margin-top: 40px;
}

.expert-profile__portrait {
  position: sticky;
  top: calc(var(--header-height) + 32px);
  overflow: hidden;
  border-radius: 10px;
  background: #e0ebed;
}

.expert-profile__portrait img {
  width: 100%;
  height: auto;
  max-height: calc(100svh - var(--header-height) - 64px);
  aspect-ratio: 1 / 1.08;
  object-fit: cover;
  object-position: center;
}

.expert-profile__content { min-width: 0; }

.expert-profile h1,
.expert-profile h2,
.expert-materials h2,
.expert-material h3 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.5px;
  text-wrap: balance;
}

.expert-profile h1 { font-size: clamp(64px, 5vw, 96px); line-height: 1; }
.expert-profile h2, .expert-materials h2 { font-size: 56px; line-height: 1.05; }
.expert-profile__role { margin: 20px 0 0; color: #626b6e; font-size: 24px; line-height: 32px; }
.expert-profile__lead { max-width: 720px; margin: 28px 0; font-size: 24px; line-height: 36px; letter-spacing: -0.24px; }

.expert-detail__button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 60px;
  padding: 16px 24px;
  border-radius: 4px;
  color: #fff;
  background: #3a737c;
  font-size: 18px;
  line-height: 28px;
  transition: background-color 180ms ease;
}

.expert-detail__button img { filter: brightness(0) invert(1); }
.expert-profile__section { margin-top: 56px; padding-top: 32px; border-top: 1px solid #d9e1e3; }
.expert-profile__section > p { max-width: 70ch; margin: 20px 0 0; font-size: 20px; line-height: 32px; }
.expert-profile__section > .expert-profile__example { margin-top: 16px; color: #626b6e; font-size: 14px; line-height: 22px; }
.expert-profile__topics { display: grid; gap: 28px; margin: 28px 0 0; padding: 0; list-style: none; }
.expert-profile__topics h3 { margin: 0; font-size: 20px; font-weight: 500; line-height: 30px; }
.expert-profile__topics p { margin: 8px 0 0; color: #48585c; font-size: 18px; line-height: 28px; }

.expert-materials { margin-top: 88px; padding-block: 48px 24px; border-top: 1px solid #d9e1e3; }
.expert-materials__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.expert-materials__heading > a { display: inline-flex; align-items: center; gap: 24px; min-height: 44px; color: #3a737c; white-space: nowrap; }
.expert-materials__list { margin: 32px 0 0; padding: 0; list-style: none; }
.expert-materials__list > li { border-bottom: 1px solid #d9e1e3; }
.expert-material {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 24px;
  align-items: start;
  gap: 40px;
  padding-block: 32px;
}

.expert-material__date { padding-top: 8px; color: #626b6e; font-size: 16px; line-height: 24px; }
.expert-material h3 { max-width: 1120px; font-size: 36px; line-height: 1.12; transition: color 180ms ease; }
.expert-material p { max-width: 900px; margin: 12px 0 0; color: #48585c; font-size: 18px; line-height: 28px; }
.expert-material > img { margin-top: 12px; transition: transform 180ms ease; }
.expert-detail .contact { margin-top: 24px; }
.expert-detail .contact__description { opacity: 1; }
.expert-detail .consultation-card__avatar img { height: 100%; width: 100%; object-fit: cover; }
.expert-detail .form-field__control label { opacity: 0.6; }
.expert-detail .form-field__control:focus-within label,
.expert-detail .form-field__control input:not(:placeholder-shown) + label { opacity: 0.8; }
.expert-material:focus-visible h3 { color: #3a737c; }

@media (hover: hover) and (pointer: fine) {
  .expert-detail__button:hover { background: #305f66; }
  .expert-material:hover h3 { color: #3a737c; }
  .expert-material:hover > img { transform: rotate(-45deg); }
  .expert-materials__heading > a:hover { text-decoration: underline; text-underline-offset: 5px; }
}

@media (prefers-reduced-motion: no-preference) {
  html:has(.expert-detail-page) { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  .expert-detail__button, .expert-material h3, .expert-material > img { transition: none; }
}

@media (max-width: 1199px) {
  .expert-profile { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 40px; }
  .expert-profile h1 { font-size: 64px; }
  .expert-profile h2, .expert-materials h2 { font-size: 48px; }
  .expert-profile__lead { font-size: 22px; line-height: 32px; }
  .expert-material { grid-template-columns: 120px minmax(0, 1fr) 24px; gap: 24px; }
}

@media (max-width: 767px) {
  .expert-profile { grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: 28px; }
  .expert-profile__portrait { position: static; }
  .expert-profile__portrait img { max-height: none; aspect-ratio: 558 / 419; }
  .expert-profile__role { margin-top: 16px; font-size: 20px; line-height: 28px; }
  .expert-profile__lead { margin-block: 24px; font-size: 20px; line-height: 30px; }
  .expert-profile__section { margin-top: 40px; padding-top: 28px; }
  .expert-profile__section > p { font-size: 18px; line-height: 29px; }
  .expert-materials { margin-top: 56px; padding-top: 32px; }
  .expert-materials__heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .expert-materials__list { margin-top: 16px; }
  .expert-material { grid-template-columns: minmax(0, 1fr) 24px; gap: 12px 20px; padding-block: 24px; }
  .expert-material__date { grid-column: 1 / -1; padding-top: 0; font-size: 14px; line-height: 22px; }
  .expert-material h3 { font-size: 30px; }
  .expert-material p { font-size: 16px; line-height: 26px; }
  .expert-material > img { margin-top: 6px; }
}

@media (max-width: 639px) {
  .expert-profile h1 { font-size: 56px; }
  .expert-profile h2, .expert-materials h2 { font-size: 40px; }
  .expert-detail__button { width: 100%; }
}

@media (max-width: 359px) {
  .expert-profile h1 { font-size: 48px; }
  .expert-profile h2, .expert-materials h2 { font-size: 36px; }
}
