/* Introduction sized to the available screen, without clipping enlarged text. */
.hero {
  min-height: calc(100svh - var(--header-height, 88px));
  display: flex;
  flex-direction: column;
  padding-top: clamp(10px, 2svh, 20px);
}
.hero-name {
  justify-content: center;
  gap: .2em;
  text-align: center;
  margin-inline: 0;
  font-size: clamp(3rem, min(13vw, 17svh), 13rem);
  padding-bottom: clamp(10px, 2svh, 22px);
}
.hero-stage {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 7%;
  align-items: center;
  flex: 1;
}
.hero-intro { padding-top: 0; max-width: 490px; }
.hero-profession { font-size: clamp(1.5rem, 2.7vw, 2.75rem); margin-bottom: 14px; }
.hero-description { max-width: 440px; line-height: 1.5; }
.hero-actions { margin-top: clamp(12px, 2.2svh, 24px); }
.hero-socials { margin-top: 8px; }
.hero-location { margin-top: 10px; }
.hero-portrait {
  width: min(100%, 50svh, 480px);
  justify-self: end;
}
.hero-portrait picture { width: 100%; height: auto; aspect-ratio: 1; }
.hero-portrait img { object-fit: cover; object-position: center; }
.hero-bottom { margin-top: auto; padding-block: 10px; }

/* Two native disclosures share a single full-width content area. */
.disclosure-pair { position: relative; padding-top: 58px; margin-top: 18px; }
.disclosure-pair > details { margin: 0; }
.disclosure-pair > details > summary {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(50% - 6px);
  min-height: 48px;
  padding: 10px 14px;
  gap: 8px;
  border: 1px solid currentColor;
  color: inherit;
}
.disclosure-pair > details + details > summary { left: calc(50% + 6px); }
.disclosure-pair > details[open] > summary,
.disclosure-pair > details[data-expanded="true"] > summary { background: var(--surface); }
.disclosure-pair > details[data-expanded="false"] > summary > span { transform: none; }
.disclosure-pair .disclosure-body { padding-top: 10px; }
.disclosure-pair .disclosure-body p + p { margin-top: 16px; }
.role-body > .secondary { margin-top: 12px; font-size: var(--small); }
.disclosure-body .coursework-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; list-style: none; padding: 8px 0; margin: 0; }
.disclosure-body .coursework-list > li { background: var(--surface); padding: 12px; margin: 0; }
.languages { display: block; margin-top: 48px; }
.languages > h3 { font-size: var(--lead); margin-bottom: 22px; }
.language-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.language-cards h4 { font-size: var(--lead); margin-bottom: 4px; }
.language-cards .secondary { margin-bottom: 12px; }
.language-cards article { padding-top: 20px; border-top: 1px solid var(--secondary); }
.language-details { margin-top: 16px; }
.language-details > summary {
  border: 1px solid currentColor;
  padding: 10px 14px;
  min-height: 48px;
  gap: 12px;
}
.language-details[open] > summary { background: var(--surface); }
.language-details .disclosure-body { padding-top: 16px; }
.language-details .disclosure-body p + p { margin-top: 14px; }
.campus-controls button { color: var(--page-text); }
.campus-picker button[aria-pressed="true"] { color: var(--page-text); }
.campus-controls button:disabled { opacity: .6; cursor: default; transform: none; }
.campus-transport { flex-wrap: wrap; }
.campus-slide figcaption { color: var(--page-text); }

/* Experience unfolds in photographs, echoing the project compositions above. */
.experience .experience-layout { display: block; }
.experience .experience-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px 8%;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.experience-overview { max-width: 38ch; padding-bottom: 8px; }
.experience-overview > p { margin-bottom: 20px; }
.experience .roles { display: flex; flex-direction: column; gap: clamp(32px, 4vw, 64px); }
.experience .role-row {
  --page-text: #f4ede4;
  --text: #f4ede4;
  --secondary: #e0d1c1;
  --surface: #30251f;
  --accent: #c99d75;
  --button-foreground: #211a17;
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: space-between;
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 560px;
  gap: 56px;
  margin: 0;
  padding: clamp(28px, 4.5vw, 72px);
  background: rgb(33 26 23 / .78);
  color: var(--page-text);
}
.experience .role-row::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.experience .role-photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .45;
  filter: grayscale(.85) sepia(.18);
  pointer-events: none;
}
/* Neutral scrims keep text legible while leaving the other side to the photograph. */
.experience .role-row::after {
  background: linear-gradient(90deg, rgb(24 19 16 / .65), rgb(24 19 16 / .5) 55%, rgb(24 19 16 / .12));
}
.experience .role-scene-1 { min-height: 580px; }
.experience .role-scene-2 { width: 92%; align-self: end; min-height: 560px; }
.experience .role-scene-3 { width: 88%; min-height: 520px; }
.experience .role-scene-4 { width: 94%; align-self: end; min-height: 500px; }
.experience :is(.role-scene-2, .role-scene-4)::after {
  background: linear-gradient(270deg, rgb(24 19 16 / .65), rgb(24 19 16 / .5) 55%, rgb(24 19 16 / .12));
}
.experience .role-body { display: block; width: 58%; max-width: 660px; }
.experience :is(.role-scene-2, .role-scene-4) .role-body { align-self: end; }
.experience :is(.role-identity, .role-content) { min-width: 0; }
.experience .role-date {
  align-self: end;
  padding: 6px 10px;
  background: transparent;
  color: var(--page-text);
  font-size: 1rem;
  line-height: 1.5;
}
.experience :is(.role-scene-2, .role-scene-4) .role-date { align-self: start; }
.experience .role-identity h3 {
  font-size: clamp(2.5rem, 5.8vw, 5.5rem);
  letter-spacing: -.055em;
  line-height: 1.02;
}
.experience .role-scene-4 h3 { font-size: clamp(2.5rem, 4.4vw, 4.5rem); }
.experience .role-identity h3 a {
  display: inline-block;
  min-height: 44px;
  transition: color 180ms;
}
.experience .role-identity h3 a:hover { color: var(--accent); }
.experience .role-title {
  color: var(--page-text);
  margin-block: 16px 12px;
  font-size: clamp(1.375rem, 1.8vw, 1.75rem);
}
.experience .role-title .accent { color: inherit; }
.experience .role-identity > .secondary {
  color: var(--page-text);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 48ch;
  margin-bottom: 28px;
}
.experience .role-content > p { max-width: 55ch; }
.experience .disclosure-pair { margin-top: 24px; padding-top: 56px; }
.experience .role-body details { margin: 0; padding: 0; background: transparent; }
.experience .disclosure-pair > details > summary {
  border: 0;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--surface);
  color: var(--page-text);
  font-size: 1rem;
  line-height: 1.5;
  transition: background-color 180ms, color 180ms;
}
.experience .disclosure-pair > details > summary:hover {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
}
.experience .disclosure-pair > details[open] > summary,
.experience .disclosure-pair > details[data-expanded="true"] > summary {
  background: var(--accent);
  color: var(--button-foreground);
}
.experience .disclosure-pair > details[data-expanded="false"] > summary {
  background: var(--surface);
  color: var(--page-text);
}
.experience .disclosure-pair > details[data-expanded="false"] > summary:hover {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
}
.experience summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.experience .disclosure-body {
  padding: clamp(18px, 2vw, 28px);
  background: var(--surface);
  font-size: var(--body);
  line-height: 1.6;
}
.experience .disclosure-body :is(p, ul) { max-width: 66ch; }
.experience .disclosure-body ul { padding-left: 1.2em; }
.experience .disclosure-body li + li { margin-top: 14px; }
.experience .disclosure-body .technology-list {
  margin-top: 24px;
  color: var(--secondary);
  font-size: 1rem;
  line-height: 1.6;
}
@media (max-width: 1000px) {
  .experience .role-row { padding: 36px; gap: 72px; }
  .experience .role-body { width: 76%; }
}
@media (max-width: 640px) {
  .experience .experience-intro { display: block; margin-bottom: 36px; }
  .experience-overview { margin-top: 24px; padding: 0; }
  .experience-overview > p { margin-bottom: 16px; }
  .experience .roles { gap: 28px; }
  .experience .role-row { width: 100%; min-height: 580px; padding: 24px; gap: 112px; }
  .experience .role-photo { object-position: 60% top; }
  .experience .role-row::after {
    background: linear-gradient(0deg, rgb(24 19 16 / .75), rgb(24 19 16 / .55) 60%, rgb(24 19 16 / .2));
  }
  .experience .role-body { width: 100%; max-width: none; }
  .experience .role-date { align-self: start; padding: 6px 10px; }
  .experience .role-identity h3 { font-size: clamp(2.125rem, 10vw, 3.5rem); }
  .experience .role-title { margin-block: 12px; }
  .experience .role-identity > .secondary { margin-bottom: 24px; }
  .experience .disclosure-pair { margin-top: 24px; }
  .experience .disclosure-pair > details > summary { padding-inline: 8px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .experience :is(summary, .role-identity h3 a) { transition: none; }
}

@media (min-width: 641px) and (max-height: 760px) {
  .hero-name { font-size: clamp(3rem, 12svh, 6.5rem); }
  .hero-portrait { width: min(100%, 46svh); }
  .hero-intro .button { min-height: 44px; padding-block: 10px; }
  .hero-profession { margin-bottom: 8px; }
  .hero-actions { margin-top: 12px; }
  .hero-location { margin-top: 6px; }
}
@media (max-width: 850px) {
  .language-cards { grid-template-columns: 1fr; gap: 24px; }
  .disclosure-body .coursework-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .experience-layout, .education-layout, .section-heading { grid-template-columns: minmax(0, 1fr); }
  .experience-intro, .roles, .section-heading > *, .contact-heading h2 { min-width: 0; }
  h2, .word-mask { overflow-wrap: anywhere; max-width: 100%; }
  .site-header { padding-block: 10px; }
  .hero { padding-top: 8px; min-height: calc(100svh - var(--header-height, 64px)); }
  .hero-name { font-size: clamp(3rem, min(15vw, 10svh), 5rem); padding-bottom: 12px; flex-wrap: wrap; column-gap: 16px; white-space: normal; }
  .hero-stage { grid-template-columns: minmax(0, 1fr) 116px; gap: 10px 14px; align-content: center; }
  .hero-intro { display: contents; }
  .hero-profession, html[lang="it"] .hero-profession {
    grid-column: 1 / -1; grid-row: 1;
    font-size: 1.5rem; margin: 0;
  }
  .hero-profession { min-width: 0; }
  .hero .role-line, html[lang="it"] .hero .role-line { white-space: normal; }
  .hero-description { grid-column: 1; grid-row: 2; font-size: 1rem; line-height: 1.45; overflow-wrap: anywhere; }
  .hero-portrait { grid-column: 2; grid-row: 2; width: 116px; align-self: center; }
  .hero-actions { grid-column: 1 / -1; grid-row: 3; margin: 2px 0 0; }
  .hero-actions .button { min-height: 44px; padding: 10px 18px; }
  .hero-socials { grid-column: 1 / -1; grid-row: 4; gap: 24px; margin: 0; }
  .hero-location { grid-column: 1 / -1; grid-row: 5; margin: 0; font-size: .875rem; }
  .hero-bottom { padding-block: 8px; font-size: .8125rem; }
  .hero-bottom p { max-width: 255px; }
}
@media print {
  .hero { min-height: 0; }
  .disclosure-pair { padding-top: 0; }
  .disclosure-pair > details > summary { position: static; width: 100%; }
}
