:root {
  --ink: #101a31;
  --muted: #536078;
  --line: #dce3ee;
  --paper: #ffffff;
  --soft: #f4f7fb;
  --blue: #2565f6;
  --blue-dark: #1749b7;
  --aqua: #5dd6d2;
  --max: 1240px;
  --shadow: 0 24px 70px rgba(16, 26, 49, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.menu-open { overflow: hidden; }

button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.page-shell {
  width: min(calc(100% - 48px), var(--max));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  padding: 0 max(24px, calc((100vw - var(--max)) / 2));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(220, 227, 238, 0.8);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  width: max-content;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand strong { color: var(--blue); }

.desktop-nav { display: flex; gap: 34px; }
.desktop-nav a {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  transition: color 160ms ease;
}
.desktop-nav a:hover, .desktop-nav a:focus-visible { color: var(--blue); }

.header-contact {
  justify-self: end;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
}

.menu-button { display: none; }

.hero {
  min-height: auto;
  padding-block: clamp(46px, 5vw, 70px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  align-items: center;
  gap: clamp(45px, 6vw, 84px);
}

.eyebrow {
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow span { width: 28px; height: 2px; background: currentColor; }
.eyebrow i { font-style: normal; }

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 760px;
  margin-bottom: 28px;
  font-size: clamp(3rem, 5.8vw, 5.7rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

h1 em { color: var(--blue); font-style: normal; }

.hero-intro {
  max-width: 650px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  line-height: 1.75;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.button {
  min-height: 50px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease;
}

.button:hover { transform: translateY(-2px); }
.button-primary { background: var(--ink); color: white; }
.button-primary span { color: var(--aqua); }
.button-secondary { border-color: var(--line); }

.hero-meta {
  margin-top: 40px;
  padding-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 180px));
  gap: 28px;
  border-top: 1px solid var(--line);
}

.hero-meta div { display: flex; flex-direction: column; }
.hero-meta strong { font-size: 1.02rem; }
.hero-meta span { color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; }

.image-placeholder {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: white;
}

.portrait-placeholder {
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.portrait-photo {
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px;
  background: var(--ink);
  box-shadow: var(--shadow);
}

.portrait-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 56%;
}

.placeholder-grid {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255,255,255,0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.16) 1px, transparent 1px),
    linear-gradient(145deg, transparent 54%, var(--blue) 55%, var(--blue) 70%, transparent 71%);
  background-size: 38px 38px, 38px 38px, 100% 100%;
}

.image-index { position: absolute; top: 24px; left: 24px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; }
.image-prompt { position: absolute; left: 24px; bottom: 28px; font-size: clamp(1.4rem, 2.6vw, 2.4rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.04em; }
.image-size { position: absolute; right: 24px; bottom: 28px; color: var(--aqua); font-size: 0.78rem; font-weight: 800; }

.section { padding-block: clamp(48px, 5.5vw, 76px); }
.section-layout, .about { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: clamp(24px, 4vw, 52px); }

.section-rail { padding-top: 8px; }
.section-rail span { color: var(--blue); font-size: 0.76rem; font-weight: 800; }
.section-rail p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.section-content { min-width: 0; }

.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 34px 58px; }
.about-grid h2, .section-heading h2, .contact h2 {
  max-width: 750px;
  margin-bottom: 0;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.about-copy { padding-top: 34px; color: var(--muted); font-size: 1.05rem; }

.education-card {
  grid-column: 1 / -1;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  gap: 35px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
}

.card-kicker { color: var(--blue); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.education-card h3 { margin: 10px 0 3px; font-size: 1.35rem; }
.education-card p { margin: 0; color: var(--blue); font-weight: 700; }
.education-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; color: var(--muted); }
.education-side strong { color: var(--ink); }

.section-dark { color: white; background: var(--ink); }
.section-dark .section-rail p { color: #9aa6ba; }
.section-dark .eyebrow { color: var(--aqua); }

.section-heading {
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
}
.section-heading > p { max-width: 390px; margin: 0 0 5px; color: var(--muted); }
.light-heading > p { color: #aeb8c9; }

.timeline { border-top: 1px solid rgba(255,255,255,0.22); }
.timeline-item {
  padding: 22px 0;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 22px;
  border-bottom: 1px solid rgba(255,255,255,0.16);
}
.timeline-date { padding-top: 4px; color: var(--aqua); font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; }
.timeline-body { position: relative; min-height: 76px; padding-left: 96px; }
.timeline-logo { position: absolute; top: 0; left: 0; width: 76px; height: 76px; padding: 7px; display: block; object-fit: contain; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: white; }
.timeline-body h3 { margin-bottom: 0; font-size: clamp(1.35rem, 2.2vw, 2rem); letter-spacing: -0.035em; }
.timeline-body .organization { margin-bottom: 14px; color: white; font-weight: 700; }
.timeline-body > p:last-child { max-width: 800px; margin-bottom: 0; color: #b4bed0; }

.projects { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: clamp(24px, 4vw, 52px); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

.project-card {
  min-width: 0;
  padding: 0;
  display: block;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  overflow: hidden;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.project-card:hover, .project-card:focus-visible { transform: translateY(-5px); border-color: var(--blue); box-shadow: 0 18px 45px rgba(16, 26, 49, 0.1); outline: none; }
.project-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 0.7fr; }

.project-visual { position: relative; min-height: 0; aspect-ratio: 16 / 10; display: block; overflow: hidden; background: var(--ink); }
.project-featured .project-visual { min-height: 350px; aspect-ratio: auto; }
.project-visual.image-placeholder::before, .dialog-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.55;
  background-image: linear-gradient(rgba(255,255,255,.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: 32px 32px;
}
.project-visual.image-placeholder::after {
  content: "";
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border: 30px solid rgba(255,255,255,0.09);
  border-radius: 50%;
  right: -30%;
  bottom: -55%;
}
.project-cover { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 320ms ease; }
.project-card:hover .project-cover, .project-card:focus-visible .project-cover { transform: scale(1.035); }
.dobot-visual { background: linear-gradient(145deg, #f4f7fb, #dce7f7); }
.project-cover-contain { padding: 24px; object-fit: contain; }
.has-media .image-index {
  z-index: 2;
  padding: 7px 10px;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.38);
  border-radius: 4px;
  background: rgba(5, 12, 28, 0.92);
  box-shadow: 0 5px 18px rgba(0,0,0,0.28);
  backdrop-filter: blur(10px);
}
.visual-blue { background: #225fe8; }
.visual-dark { background: #111b32; }
.visual-steel { background: #44546f; }
.visual-cobalt { background: #1945ac; }
.visual-aqua { background: #147f86; }
.visual-circuit { background: #382b68; }

.project-visual .image-prompt { font-size: 1.4rem; }
.project-info { min-height: 184px; padding: 24px; display: flex; flex-direction: column; }
.project-featured .project-info { min-height: auto; justify-content: flex-end; }
.project-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.project-title-row strong { font-size: 1.28rem; line-height: 1.25; letter-spacing: -0.03em; }
.project-title-row > span { color: var(--blue); font-size: 1.25rem; }
.project-summary { margin-top: 12px; color: var(--muted); }
.tag-row { margin-top: auto; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 7px; }
.tag-row i, .certificate-skills span {
  padding: 5px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
}

.recognition { background: var(--soft); }
.awards-list { border-top: 1px solid var(--ink); }
.awards-list article {
  min-height: 112px;
  padding: 18px 0;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 30px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.award-year { color: var(--blue); font-size: 0.78rem; font-weight: 800; }
.awards-list h3 { margin-bottom: 8px; font-size: 1.35rem; }
.awards-list p { margin: 0; color: var(--muted); }

.credentials { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: clamp(24px, 4vw, 52px); }
.credentials.section { padding-block: clamp(38px, 4.5vw, 58px); }
.credentials-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 24px; }
.certificate-card { padding: clamp(24px, 3vw, 34px); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 14px 42px rgba(16,26,49,0.07); }
.certificate-card h2 { margin: 10px 0 0; font-size: clamp(1.75rem, 3vw, 2.8rem); line-height: 1.08; letter-spacing: -0.045em; }
.certificate-card .organization { margin: 8px 0 16px; font-weight: 800; }
.pill { display: inline-block; margin-bottom: 16px; padding: 6px 11px; border-radius: 999px; background: #eaf0ff; color: var(--blue); font-size: 0.74rem; font-weight: 800; }
.certificate-card > p:last-of-type { color: var(--muted); }
.certificate-skills { display: flex; flex-wrap: wrap; gap: 8px; }
.credential-note { padding: 20px; color: white; background: var(--blue); border-radius: 8px; }
.credential-note span { color: #cfe1ff; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.credential-note p { margin: 14px 0 0; font-size: 1rem; line-height: 1.55; }

.skills.section { padding-block: clamp(46px, 5vw, 70px); }
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.skills-grid article { min-height: 140px; padding: 22px; border: 1px solid rgba(255,255,255,0.16); border-radius: 8px; }
.skills-grid article > span { display: block; margin-bottom: 18px; color: var(--aqua); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.skills-grid article div { display: flex; flex-wrap: wrap; gap: 7px; }
.skills-grid i { padding: 5px 9px; border: 1px solid rgba(255,255,255,0.22); border-radius: 4px; font-size: 0.88rem; font-style: normal; font-weight: 700; }

.interests { margin-top: 30px; padding-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 14px; border-top: 1px solid rgba(255,255,255,0.2); }
.interests-label { margin: 0; color: var(--aqua); font-size: 0.78rem; font-weight: 800; text-align: center; text-transform: uppercase; letter-spacing: 0.08em; }
.interest-list { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }
.interest-list span { position: relative; padding: 0 16px; color: #edf2fa; font-size: 0.88rem; font-weight: 700; line-height: 1.5; text-align: center; }
.interest-list span:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: 0; width: 3px; height: 3px; border-radius: 50%; background: var(--aqua); transform: translate(50%, -50%); }

.contact { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: clamp(24px, 4vw, 52px); }
.contact-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(50px, 8vw, 120px); }
.contact-copy > p:last-child { max-width: 480px; margin-top: 28px; color: var(--muted); font-size: 1.04rem; }
.contact-links { border-top: 1px solid var(--ink); }
.contact-links a { padding: 20px 0; display: grid; grid-template-columns: 95px 1fr 30px; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.contact-links a > span { color: var(--muted); font-size: 0.76rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.contact-links a > strong { min-width: 0; overflow-wrap: anywhere; }
.contact-links a > i { color: var(--blue); font-size: 1.2rem; font-style: normal; text-align: right; transition: transform 160ms ease; }
.contact-links a:hover i { transform: translate(3px, -3px); }

footer { padding: 26px 0; color: white; background: #091123; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 30px; }
.footer-inner p, .footer-inner a:last-child { margin: 0; color: #aab5c7; font-size: 0.8rem; }

.mobile-menu {
  position: fixed;
  z-index: 40;
  inset: 0;
  padding: 26px;
  display: flex;
  flex-direction: column;
  color: white;
  background: var(--ink);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}
.mobile-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.mobile-menu-top { display: flex; justify-content: space-between; align-items: center; }
.menu-label { color: var(--aqua); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.menu-close { padding: 8px 0; border: 0; color: white; background: transparent; cursor: pointer; }
.mobile-menu nav { margin-block: auto; display: flex; flex-direction: column; }
.mobile-menu nav a { padding: 11px 0; font-size: clamp(2rem, 10vw, 4.3rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.05em; }
.mobile-menu nav span { display: inline-block; width: 42px; color: var(--aqua); font-size: 0.72rem; letter-spacing: 0; }

.project-dialog {
  width: min(calc(100% - 40px), 980px);
  max-height: min(86vh, 820px);
  padding: 0;
  grid-template-columns: 1.05fr 0.95fr;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 30px 100px rgba(0,0,0,.35);
  overflow: hidden;
}
.project-dialog[open] { display: grid; animation: dialogIn 180ms ease; }
.project-dialog::backdrop { background: rgba(4, 10, 24, 0.74); backdrop-filter: blur(8px); }
.dialog-close { position: absolute; z-index: 2; top: 18px; right: 18px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: 0.76rem; font-weight: 800; cursor: pointer; }
.dialog-media-shell { position: relative; min-height: 560px; overflow: hidden; background: #091123; }
.dialog-media { position: absolute; inset: 0 0 58px; display: grid; place-items: center; overflow: hidden; }
.dialog-media img, .dialog-media video { width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: auto; display: block; object-fit: contain; object-position: 50% 50%; background: #091123; }
.dialog-media video { pointer-events: none; }
.media-nav { position: absolute; z-index: 2; top: calc(50% - 29px); width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border: 1px solid rgba(255,255,255,0.4); border-radius: 50%; color: white; background: rgba(9,17,35,0.72); font-size: 1.7rem; line-height: 1; cursor: pointer; backdrop-filter: blur(8px); }
.media-prev { left: 14px; }
.media-next { right: 14px; }
.media-nav:disabled { display: none; }
.dialog-media-meta { position: absolute; inset: auto 0 0; min-height: 58px; padding: 12px 18px; display: flex; align-items: center; gap: 16px; color: white; background: #091123; }
.dialog-media-meta span:first-child { flex: 0 0 auto; color: var(--aqua); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; }
.dialog-media-meta span:last-child { font-size: 0.82rem; line-height: 1.35; }
.dialog-copy { padding: 58px 38px 36px; overflow-y: auto; }
.dialog-copy h2 { margin-bottom: 18px; font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: 1.05; letter-spacing: -0.05em; }
.dialog-copy > p:not(.eyebrow) { color: var(--muted); }
.dialog-details { margin-top: 34px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dialog-details div { padding: 16px; background: var(--soft); border-radius: 6px; }
.dialog-details span { display: block; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; }
.dialog-details strong { display: block; margin-top: 4px; }
.dialog-tags { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; }
.dialog-tags span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; font-size: 0.76rem; font-weight: 700; }

@keyframes dialogIn { from { opacity: 0; transform: translateY(15px) scale(.98); } }

@media (max-width: 980px) {
  .desktop-nav, .header-contact { display: none; }
  .site-header { grid-template-columns: 1fr auto; }
  .menu-button { width: 44px; height: 44px; padding: 11px; display: flex; flex-direction: column; justify-content: center; gap: 7px; border: 0; background: transparent; cursor: pointer; }
  .menu-button span { width: 100%; height: 2px; background: var(--ink); }
  .hero { min-height: auto; grid-template-columns: 1fr; }
  .portrait-placeholder, .portrait-photo { width: min(72vw, 520px); justify-self: end; }
  .about-grid, .credentials-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-copy { padding-top: 0; }
  .credential-note { max-width: 520px; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-featured { grid-template-columns: 1fr; }
  .project-featured .project-visual { min-height: 300px; }
  .project-featured .project-info { min-height: 190px; }
}

@media (max-width: 720px) {
  .page-shell { width: min(calc(100% - 32px), var(--max)); }
  .site-header { min-height: 68px; padding-inline: 16px; }
  .hero { padding-block: 42px 54px; gap: 36px; }
  h1 { font-size: clamp(3rem, 15vw, 4.9rem); }
  .hero-meta { gap: 18px; }
  .hero-meta strong { font-size: 0.92rem; }
  .hero-meta span { font-size: 0.62rem; }
  .portrait-placeholder, .portrait-photo { width: 100%; }
  .section-layout, .about, .projects, .credentials, .contact { grid-template-columns: 1fr; gap: 28px; }
  .section-rail { display: flex; align-items: center; gap: 12px; }
  .section-rail p { margin: 0; writing-mode: initial; }
  .about-grid { display: block; }
  .about-copy { margin-top: 28px; }
  .education-card { margin-top: 32px; flex-direction: column; }
  .education-side { align-items: flex-start; gap: 8px; }
  .section-heading { align-items: flex-start; flex-direction: column; margin-bottom: 30px; }
  .timeline-item { grid-template-columns: 1fr; gap: 10px; }
  .timeline-body { min-height: 64px; padding-left: 80px; }
  .timeline-logo { width: 64px; height: 64px; padding: 6px; }
  .project-grid, .skills-grid { grid-template-columns: 1fr; }
  .project-featured { grid-column: auto; }
  .project-visual { min-height: 0; aspect-ratio: 16 / 10; }
  .project-featured .project-visual { min-height: 240px; aspect-ratio: auto; }
  .awards-list article { grid-template-columns: 1fr; gap: 10px; }
  .award-year { grid-column: 1; }
  .awards-list article > div { grid-column: 1; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .project-dialog { width: calc(100% - 20px); max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); margin: auto; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  .project-dialog[open] { display: flex; flex-direction: column; }
  .dialog-media-shell { min-height: 0; height: clamp(250px, 42dvh, 360px); flex: 0 0 clamp(250px, 42dvh, 360px); }
  .dialog-media-shell.media-landscape { height: clamp(240px, calc((100vw - 20px) * 0.5625 + 58px), 330px); flex-basis: clamp(240px, calc((100vw - 20px) * 0.5625 + 58px), 330px); }
  .dialog-media-shell.media-portrait { height: clamp(420px, 62dvh, 560px); flex-basis: clamp(420px, 62dvh, 560px); }
  .dialog-media { inset: 0 0 58px; }
  .dialog-media img, .dialog-media video { object-position: center center; }
  .dialog-copy { flex: 0 0 auto; padding: 34px 22px 28px; overflow: visible; }
  .dialog-copy h2 { font-size: clamp(1.85rem, 9vw, 2.4rem); }
  .dialog-details { margin-top: 26px; }
  .media-nav { width: 38px; height: 38px; font-size: 1.5rem; }
  .media-prev { left: 8px; }
  .media-next { right: 8px; }
  .dialog-close { top: 12px; right: 12px; }
}

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